Skip to content
Browse files

добавил админку для сайта - backend

  • Loading branch information...
1 parent 68e7a25 commit c6d7b53d354ecc4f73b416236fcff7f90bfc0756 @FladeX committed Jan 5, 2012
View
5 apps/backend/config/app.yml
@@ -0,0 +1,5 @@
+# You can find more information about this file on the symfony website:
+# http://www.symfony-project.org/reference/1_4/en/11-App
+
+# default values
+#all:
View
8 apps/backend/config/backendConfiguration.class.php
@@ -0,0 +1,8 @@
+<?php
+
+class backendConfiguration extends sfApplicationConfiguration
+{
+ public function configure()
+ {
+ }
+}
View
7 apps/backend/config/cache.yml
@@ -0,0 +1,7 @@
+# You can find more information about this file on the symfony website:
+# http://www.symfony-project.org/reference/1_4/en/09-Cache
+
+default:
+ enabled: false
+ with_layout: false
+ lifetime: 86400
View
42 apps/backend/config/factories.yml
@@ -0,0 +1,42 @@
+# You can find more information about this file on the symfony website:
+# http://www.symfony-project.org/reference/1_4/en/05-Factories
+
+prod:
+ logger:
+ class: sfNoLogger
+ param:
+ level: err
+ loggers: ~
+
+test:
+ storage:
+ class: sfSessionTestStorage
+ param:
+ session_path: %SF_TEST_CACHE_DIR%/sessions
+
+ response:
+ class: sfWebResponse
+ param:
+ send_http_headers: false
+
+ mailer:
+ param:
+ delivery_strategy: none
+
+dev:
+ mailer:
+ param:
+ delivery_strategy: none
+
+all:
+ routing:
+ class: sfPatternRouting
+ param:
+ generate_shortest_url: true
+ extra_parameters_as_query_string: true
+
+ view_cache_manager:
+ class: sfViewCacheManager
+ param:
+ cache_key_use_vary_headers: true
+ cache_key_use_host_name: true
View
10 apps/backend/config/filters.yml
@@ -0,0 +1,10 @@
+# You can find more information about this file on the symfony website:
+# http://www.symfony-project.org/reference/1_4/en/12-Filters
+
+rendering: ~
+security: ~
+
+# insert your own filters here
+
+cache: ~
+execution: ~
View
25 apps/backend/config/routing.yml
@@ -0,0 +1,25 @@
+projects:
+ class: sfDoctrineRouteCollection
+ options:
+ model: projects
+ module: projects
+ prefix_path: /projects
+ column: id
+ with_wildcard_routes: true
+
+# You can find more information about this file on the symfony website:
+# http://www.symfony-project.org/reference/1_4/en/10-Routing
+
+# default rules
+homepage:
+ url: /
+ param: { module: projects, action: index }
+
+# generic rules
+# please, remove them by adding more specific rules
+default_index:
+ url: /:module
+ param: { action: index }
+
+default:
+ url: /:module/:action/*
View
5 apps/backend/config/security.yml
@@ -0,0 +1,5 @@
+# You can find more information about this file on the symfony website:
+# http://www.symfony-project.org/reference/1_4/en/08-Security
+
+default:
+ is_secure: false
View
35 apps/backend/config/settings.yml
@@ -0,0 +1,35 @@
+# You can find more information about this file on the symfony website:
+# http://www.symfony-project.org/reference/1_4/en/04-Settings
+
+prod:
+ .settings:
+ no_script_name: false
+ logging_enabled: false
+
+dev:
+ .settings:
+ error_reporting: <?php echo (E_ALL | E_STRICT)."\n" ?>
+ web_debug: true
+ cache: false
+ no_script_name: false
+ etag: false
+
+test:
+ .settings:
+ error_reporting: <?php echo ((E_ALL | E_STRICT) ^ E_NOTICE)."\n" ?>
+ cache: false
+ web_debug: false
+ no_script_name: false
+ etag: false
+
+all:
+ .settings:
+ # Form security secret (CSRF protection)
+ csrf_secret: 26193c53dc5e0b09e8c7fbe6a9d12c64ec5f7c22
+
+ # Output escaping settings
+ escaping_strategy: true
+ escaping_method: ESC_SPECIALCHARS
+
+ # Enable the database manager
+ use_database: true
View
20 apps/backend/config/view.yml
@@ -0,0 +1,20 @@
+# You can find more information about this file on the symfony website:
+# http://www.symfony-project.org/reference/1_4/en/13-View
+
+default:
+ http_metas:
+ content-type: text/html
+
+ metas:
+ #title: symfony project
+ #description: symfony project
+ #keywords: symfony, project
+ #language: en
+ #robots: index, follow
+
+ stylesheets: [main.css]
+
+ javascripts: []
+
+ has_layout: true
+ layout: layout
View
5 apps/backend/lib/myUser.class.php
@@ -0,0 +1,5 @@
+<?php
+
+class myUser extends sfBasicSecurityUser
+{
+}
View
16 apps/backend/modules/projects/actions/actions.class.php
@@ -0,0 +1,16 @@
+<?php
+
+require_once dirname(__FILE__).'/../lib/projectsGeneratorConfiguration.class.php';
+require_once dirname(__FILE__).'/../lib/projectsGeneratorHelper.class.php';
+
+/**
+ * projects actions.
+ *
+ * @package posting
+ * @subpackage projects
+ * @author Your name here
+ * @version SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
+ */
+class projectsActions extends autoProjectsActions
+{
+}
View
25 apps/backend/modules/projects/config/generator.yml
@@ -0,0 +1,25 @@
+generator:
+ class: sfDoctrineGenerator
+ param:
+ model_class: projects
+ theme: admin
+ non_verbose_templates: true
+ with_show: false
+ singular: ~
+ plural: ~
+ route_prefix: projects
+ with_doctrine_route: true
+ actions_base_class: sfActions
+
+ config:
+ actions: ~
+ fields: ~
+ list:
+ title: Список проектов
+ filter: ~
+ form:
+ class: BackendprojectsForm
+ edit:
+ title: Редактирование проекта &laquo;%%title%%&raquo;
+ new:
+ title: Добавление нового проекта
View
13 apps/backend/modules/projects/lib/projectsGeneratorConfiguration.class.php
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * projects module configuration.
+ *
+ * @package posting
+ * @subpackage projects
+ * @author Your name here
+ * @version SVN: $Id: configuration.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
+ */
+class projectsGeneratorConfiguration extends BaseProjectsGeneratorConfiguration
+{
+}
View
13 apps/backend/modules/projects/lib/projectsGeneratorHelper.class.php
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * projects module helper.
+ *
+ * @package posting
+ * @subpackage projects
+ * @author Your name here
+ * @version SVN: $Id: helper.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
+ */
+class projectsGeneratorHelper extends BaseProjectsGeneratorHelper
+{
+}
View
14 apps/backend/templates/layout.php
@@ -0,0 +1,14 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <?php include_http_metas() ?>
+ <?php include_metas() ?>
+ <?php include_title() ?>
+ <link rel="shortcut icon" href="/favicon.ico" />
+ <?php include_stylesheets() ?>
+ <?php include_javascripts() ?>
+ </head>
+ <body>
+ <?php echo $sf_content ?>
+ </body>
+</html>
View
6 config/app.yml
@@ -0,0 +1,6 @@
+# You can find more information about this file on the symfony website:
+# http://www.symfony-project.org/reference/1_4/en/11-App
+
+# default values
+all:
+ projects_per_page: 5
View
35 lib/form/doctrine/BackendprojectsForm.class.php
@@ -0,0 +1,35 @@
+<?php
+
+/**
+ * projects form.
+ *
+ * @package posting
+ * @subpackage form
+ * @author Max Istlyaev
+ * @version SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
+ */
+class BackendprojectsForm extends projectsForm
+{
+ public function configure()
+ {
+ parent::configure();
+ }
+
+ protected function setFields()
+ {
+ $this->useFields(array('author_id', 'title', 'text', 'price', 'status', 'views_users', 'views_guests', 'expired_at', 'created_at', 'updated_at'));
+
+ $this->widgetSchema->setHelp('title', 'например, &laquo;Наполнение автомобильного форума&raquo;');
+ $this->widgetSchema->setHelp('text', 'подробное описание проекта для исполнителей');
+ $this->widgetSchema->setHelp('price', 'предполагаемый бюджет');
+ $this->widgetSchema->setHelp('status', 'статус проекта');
+
+ $this->widgetSchema->setLabels(array(
+ 'title' => 'Название проекта',
+ 'text' => 'Описание проекта',
+ 'price' => 'Бюджет',
+ 'status' => 'Статус',
+ ));
+
+ }
+}
View
5 lib/form/doctrine/projectsForm.class.php
@@ -12,6 +12,11 @@ class projectsForm extends BaseprojectsForm
{
public function configure()
{
+ $this->setFields();
+ }
+
+ protected function setFields()
+ {
$this->useFields(array('title', 'text', 'price'));
$this->widgetSchema->setHelp('title', 'например, &laquo;Наполнение автомобильного форума&raquo;');
View
19 test/functional/backend/projectsActionsTest.php
@@ -0,0 +1,19 @@
+<?php
+
+include(dirname(__FILE__).'/../../bootstrap/functional.php');
+
+$browser = new sfTestFunctional(new sfBrowser());
+
+$browser->
+ get('/projects/index')->
+
+ with('request')->begin()->
+ isParameter('module', 'projects')->
+ isParameter('action', 'index')->
+ end()->
+
+ with('response')->begin()->
+ isStatusCode(200)->
+ checkElement('body', '!/This is a temporary page/')->
+ end()
+;
View
7 web/backend.php
@@ -0,0 +1,7 @@
+<?php
+
+
+require_once(dirname(__FILE__).'/../config/ProjectConfiguration.class.php');
+
+$configuration = ProjectConfiguration::getApplicationConfiguration('backend', 'prod', true);
+sfContext::createInstance($configuration)->dispatch();
View
13 web/backend_dev.php
@@ -0,0 +1,13 @@
+<?php
+
+// this check prevents access to debug front controllers that are deployed by accident to production servers.
+// feel free to remove this, extend it or make something more sophisticated.
+if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1')))
+{
+ die('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
+}
+
+require_once(dirname(__FILE__).'/../config/ProjectConfiguration.class.php');
+
+$configuration = ProjectConfiguration::getApplicationConfiguration('backend', 'dev', true);
+sfContext::createInstance($configuration)->dispatch();
View
1 web/sfDoctrinePlugin

0 comments on commit c6d7b53

Please sign in to comment.
Something went wrong with that request. Please try again.