Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Simple backend (admin section)

  • Loading branch information...
commit 6253233777b25df6436f7fb0446ffb72b8e6cedc 1 parent 9eed6aa
@rauchg authored
Showing with 591 additions and 1 deletion.
  1. +2 −0  apps/backend/config/app.yml
  2. +8 −0 apps/backend/config/backendConfiguration.class.php
  3. +4 −0 apps/backend/config/cache.yml
  4. +132 −0 apps/backend/config/factories.yml
  5. +8 −0 apps/backend/config/filters.yml
  6. +29 −0 apps/backend/config/routing.yml
  7. +3 −0  apps/backend/config/security.yml
  8. +97 −0 apps/backend/config/settings.yml
  9. +17 −0 apps/backend/config/view.yml
  10. +5 −0 apps/backend/lib/myUser.class.php
  11. +23 −0 apps/backend/modules/auth/actions/actions.class.php
  12. +1 −0  apps/backend/modules/auth/templates/loginSuccess.php
  13. +16 −0 apps/backend/modules/author/actions/actions.class.php
  14. +22 −0 apps/backend/modules/author/config/generator.yml
  15. +13 −0 apps/backend/modules/author/lib/authorGeneratorConfiguration.class.php
  16. +13 −0 apps/backend/modules/author/lib/authorGeneratorHelper.class.php
  17. +21 −0 apps/backend/modules/dashboard/actions/actions.class.php
  18. +1 −0  apps/backend/modules/dashboard/templates/indexSuccess.php
  19. +16 −0 apps/backend/modules/plugin/actions/actions.class.php
  20. +22 −0 apps/backend/modules/plugin/config/generator.yml
  21. +13 −0 apps/backend/modules/plugin/lib/pluginGeneratorConfiguration.class.php
  22. +13 −0 apps/backend/modules/plugin/lib/pluginGeneratorHelper.class.php
  23. +20 −0 apps/backend/templates/layout.php
  24. +1 −1  apps/frontend/modules/user/templates/loginSuccess.php
  25. 0  {apps/frontend/lib → lib/filter}/twitterFilter.class.php
  26. 0  {apps/frontend → }/lib/form/LoginForm.class.php
  27. +4 −0 lib/model/Author.php
  28. +4 −0 lib/model/PluginTag.php
  29. +19 −0 test/functional/backend/authActionsTest.php
  30. +19 −0 test/functional/backend/authorActionsTest.php
  31. +19 −0 test/functional/backend/dashboardActionsTest.php
  32. +19 −0 test/functional/backend/pluginActionsTest.php
  33. +7 −0 web/backend.php
View
2  apps/backend/config/app.yml
@@ -0,0 +1,2 @@
+# default values
+#all:
View
8 apps/backend/config/backendConfiguration.class.php
@@ -0,0 +1,8 @@
+<?php
+
+class backendConfiguration extends sfApplicationConfiguration
+{
+ public function configure()
+ {
+ }
+}
View
4 apps/backend/config/cache.yml
@@ -0,0 +1,4 @@
+default:
+ enabled: off
+ with_layout: false
+ lifetime: 86400
View
132 apps/backend/config/factories.yml
@@ -0,0 +1,132 @@
+prod:
+ logger:
+ class: sfNoLogger
+ param:
+ level: err
+ loggers: ~
+
+cli:
+ controller:
+ class: sfConsoleController
+ request:
+ class: sfConsoleRequest
+ response:
+ class: sfConsoleResponse
+
+test:
+ storage:
+ class: sfSessionTestStorage
+ param:
+ session_path: %SF_TEST_CACHE_DIR%/sessions
+
+ response:
+ class: sfWebResponse
+ param:
+ send_http_headers: false
+
+all:
+ routing:
+ class: sfPatternRouting
+ param:
+ generate_shortest_url: true
+ extra_parameters_as_query_string: true
+
+#all:
+# controller:
+# class: sfFrontWebController
+#
+# request:
+# class: sfWebRequest
+# param:
+# logging: %SF_LOGGING_ENABLED%
+# path_info_array: SERVER
+# path_info_key: PATH_INFO
+# relative_url_root: ~
+# formats:
+# txt: text/plain
+# js: [application/javascript, application/x-javascript, text/javascript]
+# css: text/css
+# json: [application/json, application/x-json]
+# xml: [text/xml, application/xml, application/x-xml]
+# rdf: application/rdf+xml
+# atom: application/atom+xml
+#
+# response:
+# class: sfWebResponse
+# param:
+# logging: %SF_LOGGING_ENABLED%
+# charset: %SF_CHARSET%
+# send_http_headers: true
+#
+# user:
+# class: myUser
+# param:
+# timeout: 1800
+# logging: %SF_LOGGING_ENABLED%
+# use_flash: true
+# default_culture: %SF_DEFAULT_CULTURE%
+#
+ storage:
+ class: sfSessionStorage
+ param:
+ session_name: mooforge
+#
+# view_cache:
+# class: sfFileCache
+# param:
+# automatic_cleaning_factor: 0
+# cache_dir: %SF_TEMPLATE_CACHE_DIR%
+# lifetime: 86400
+# prefix: %SF_APP_DIR%/template
+#
+# i18n:
+# class: sfI18N
+# param:
+# source: XLIFF
+# debug: off
+# untranslated_prefix: "[T]"
+# untranslated_suffix: "[/T]"
+# cache:
+# class: sfFileCache
+# param:
+# automatic_cleaning_factor: 0
+# cache_dir: %SF_I18N_CACHE_DIR%
+# lifetime: 31556926
+# prefix: %SF_APP_DIR%/i18n
+#
+# routing:
+# class: sfPatternRouting
+# param:
+# load_configuration: true
+# suffix: ''
+# default_module: default
+# default_action: index
+# debug: %SF_DEBUG%
+# logging: %SF_LOGGING_ENABLED%
+# generate_shortest_url: false
+# extra_parameters_as_query_string: false
+# cache:
+# class: sfFileCache
+# param:
+# automatic_cleaning_factor: 0
+# cache_dir: %SF_CONFIG_CACHE_DIR%/routing
+# lifetime: 31556926
+# prefix: %SF_APP_DIR%/routing
+#
+# logger:
+# class: sfAggregateLogger
+# param:
+# level: debug
+# loggers:
+# sf_web_debug:
+# class: sfWebDebugLogger
+# param:
+# level: debug
+# condition: %SF_WEB_DEBUG%
+# xdebug_logging: true
+# web_debug_class: sfWebDebug
+# sf_file_debug:
+# class: sfFileLogger
+# param:
+# level: debug
+# file: %SF_LOG_DIR%/%SF_APP%_%SF_ENVIRONMENT%.log
View
8 apps/backend/config/filters.yml
@@ -0,0 +1,8 @@
+rendering: ~
+security: ~
+
+# insert your own filters here
+
+cache: ~
+common: ~
+execution: ~
View
29 apps/backend/config/routing.yml
@@ -0,0 +1,29 @@
+plugin:
+ class: sfPropelRouteCollection
+ options:
+ model: Plugin
+ module: plugin
+ prefix_path: plugin
+ column: id
+ with_wildcard_routes: true
+
+author:
+ class: sfPropelRouteCollection
+ options:
+ model: Author
+ module: author
+ prefix_path: author
+ column: id
+ with_wildcard_routes: true
+
+# default rules
+homepage:
+ url: /
+ param: { module: dashboard, action: index }
+
+default_index:
+ url: /:module
+ param: { action: index }
+
+default:
+ url: /:module/:action/*
View
3  apps/backend/config/security.yml
@@ -0,0 +1,3 @@
+all:
+ is_secure: on
+ credentials: admin
View
97 apps/backend/config/settings.yml
@@ -0,0 +1,97 @@
+prod:
+ .settings:
+ no_script_name: off
+ logging_enabled: off
+
+dev:
+ .settings:
+ error_reporting: <?php echo (E_ALL | E_STRICT)."\n" ?>
+ web_debug: on
+ cache: off
+ no_script_name: off
+ etag: off
+
+test:
+ .settings:
+ error_reporting: <?php echo ((E_ALL | E_STRICT) ^ E_NOTICE)."\n" ?>
+ cache: off
+ web_debug: off
+ no_script_name: off
+ etag: off
+
+all:
+ .settings:
+ # Form security secret (CSRF protection)
+ csrf_secret: false # Unique secret to enable CSRF protection or false to disable
+
+ # Output escaping settings
+ escaping_strategy: false # Determines how variables are made available to templates. Accepted values: on, off.
+ escaping_method: ESC_SPECIALCHARS # Function or helper used for escaping. Accepted values: ESC_RAW, ESC_ENTITIES, ESC_JS, ESC_JS_NO_ENTITIES, and ESC_SPECIALCHARS.
+
+ # Cache settings
+ lazy_cache_key: on # Delays creation of a cache key until after checking whether an action or partial is cacheable
+
+all:
+ .actions:
+# error_404_module: default # To be called when a 404 error is raised
+# error_404_action: error404 # Or when the requested URL doesn't match any route
+#
+ login_module: auth # To be called when a non-authenticated user
+ login_action: login # Tries to access a secure page
+#
+ secure_module: auth # To be called when a user doesn't have
+ secure_action: login # The credentials required for an action
+#
+# module_disabled_module: default # To be called when a user requests
+# module_disabled_action: disabled # A module disabled in the module.yml
+#
+# .settings:
+# # Optional features. Deactivating unused features boots performance a bit.
+# use_database: on # Enable database manager. Set to off if you don't use a database.
+# i18n: off # Enable interface translation. Set to off if your application should not be translated.
+# check_symfony_version: off # Enable check of symfony version for every request. Set to on to have symfony clear the cache automatically when the framework is upgraded. Set to off if you always clear the cache after an upgrade.
+# compressed: off # Enable PHP response compression. Set to on to compress the outgoing HTML via the PHP handler.
+# check_lock: off # Enable the application lock system triggered by the clear-cache and disable tasks. Set to on to have all requests to disabled applications redirected to the $sf_symfony_lib_dir/exception/data/unavailable.php page.
+#
+# # Routing settings
+# no_script_name: off # Enable the front controller name in generated URLs
+#
+# # Validation settings, used for error generation by the Validation helper
+# validation_error_prefix: ' &darr;&nbsp;'
+# validation_error_suffix: ' &nbsp;&darr;'
+# validation_error_class: form_error
+# validation_error_id_prefix: error_for_
+#
+# # Cache settings
+# cache: off # Enable the template cache
+# etag: on # Enable etag handling
+# lazy_cache_key: off # Delays creation of a cache key until after checking whether an action or partial is cacheable (defaults to false for backward compatibility)
+#
+# # Logging and debugging settings
+# web_debug: off # Enable the web debug toolbar
+# error_reporting: <?php echo (E_PARSE | E_COMPILE_ERROR | E_ERROR | E_CORE_ERROR | E_USER_ERROR)."\n" ?> # Determines which events are logged.
+#
+# # Assets paths
+# rich_text_js_dir: js/tiny_mce
+# admin_web_dir: /sf/sf_admin
+# web_debug_web_dir: /sf/sf_web_debug
+# calendar_web_dir: /sf/calendar
+#
+# # Helpers included in all templates by default
+# standard_helpers: [Partial, Cache, Form]
+#
+# # Activated modules from plugins or from the symfony core
+# enabled_modules: [default]
+#
+# # Charset used for the response
+# charset: utf-8
+#
+# # Miscellaneous
+# strip_comments: on # Remove comments in core framework classes as defined in the core_compile.yml
+# max_forwards: 5
+#
+# # Logging
+# logging_enabled: on
+#
+# # i18n
+# default_culture: en # Default user culture
View
17 apps/backend/config/view.yml
@@ -0,0 +1,17 @@
+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: on
+ layout: layout
View
5 apps/backend/lib/myUser.class.php
@@ -0,0 +1,5 @@
+<?php
+
+class myUser extends sfBasicSecurityUser
+{
+}
View
23 apps/backend/modules/auth/actions/actions.class.php
@@ -0,0 +1,23 @@
+<?php
+
+/**
+ * auth actions.
+ *
+ * @package mooforge
+ * @subpackage auth
+ * @author Guillermo Rauch
+ * @version SVN: $Id: actions.class.php 12479 2008-10-31 10:54:40Z fabien $
+ */
+class authActions extends sfActions
+{
+
+ /**
+ * Login action
+ *
+ * @author Guillermo Rauch
+ **/
+ public function executeLogin(sfWebRequest $request)
+ {
+ }
+
+}
View
1  apps/backend/modules/auth/templates/loginSuccess.php
@@ -0,0 +1 @@
+<p>You have to be logged in and have administrative rights to access this page.</p>
View
16 apps/backend/modules/author/actions/actions.class.php
@@ -0,0 +1,16 @@
+<?php
+
+require_once dirname(__FILE__).'/../lib/authorGeneratorConfiguration.class.php';
+require_once dirname(__FILE__).'/../lib/authorGeneratorHelper.class.php';
+
+/**
+ * author actions.
+ *
+ * @package mooforge
+ * @subpackage author
+ * @author Guillermo Rauch
+ * @version SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $
+ */
+class authorActions extends autoAuthorActions
+{
+}
View
22 apps/backend/modules/author/config/generator.yml
@@ -0,0 +1,22 @@
+generator:
+ class: sfPropelGenerator
+ param:
+ model_class: Author
+ theme: admin
+ non_verbose_templates: true
+ with_show: false
+ singular: ~
+ plural: ~
+ route_prefix: author
+ with_propel_route: 1
+
+ config:
+ actions: ~
+ fields: ~
+ list:
+ display: [id,username,email,location,homepageurl,plugins_count]
+
+ filter: ~
+ form: ~
+ edit: ~
+ new: ~
View
13 apps/backend/modules/author/lib/authorGeneratorConfiguration.class.php
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * author module configuration.
+ *
+ * @package mooforge
+ * @subpackage author
+ * @author Guillermo Rauch
+ * @version SVN: $Id: configuration.php 12474 2008-10-31 10:41:27Z fabien $
+ */
+class authorGeneratorConfiguration extends BaseAuthorGeneratorConfiguration
+{
+}
View
13 apps/backend/modules/author/lib/authorGeneratorHelper.class.php
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * author module helper.
+ *
+ * @package mooforge
+ * @subpackage author
+ * @author Guillermo Rauch
+ * @version SVN: $Id: helper.php 12474 2008-10-31 10:41:27Z fabien $
+ */
+class authorGeneratorHelper extends BaseAuthorGeneratorHelper
+{
+}
View
21 apps/backend/modules/dashboard/actions/actions.class.php
@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * dashboard actions.
+ *
+ * @package mooforge
+ * @subpackage dashboard
+ * @author Guillermo Rauch
+ * @version SVN: $Id: actions.class.php 12479 2008-10-31 10:54:40Z fabien $
+ */
+class dashboardActions extends sfActions
+{
+ /**
+ * Executes index action
+ *
+ * @param sfRequest $request A request object
+ */
+ public function executeIndex(sfWebRequest $request)
+ {
+ }
+}
View
1  apps/backend/modules/dashboard/templates/indexSuccess.php
@@ -0,0 +1 @@
+<p>Welcome to the admin panel!</p>
View
16 apps/backend/modules/plugin/actions/actions.class.php
@@ -0,0 +1,16 @@
+<?php
+
+require_once dirname(__FILE__).'/../lib/pluginGeneratorConfiguration.class.php';
+require_once dirname(__FILE__).'/../lib/pluginGeneratorHelper.class.php';
+
+/**
+ * plugin actions.
+ *
+ * @package mooforge
+ * @subpackage plugin
+ * @author Guillermo Rauch
+ * @version SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $
+ */
+class pluginActions extends autoPluginActions
+{
+}
View
22 apps/backend/modules/plugin/config/generator.yml
@@ -0,0 +1,22 @@
+generator:
+ class: sfPropelGenerator
+ param:
+ model_class: Plugin
+ theme: admin
+ non_verbose_templates: true
+ with_show: false
+ singular: ~
+ plural: ~
+ route_prefix: plugin
+ with_propel_route: 1
+
+ config:
+ actions: ~
+ fields: ~
+ list:
+ display: [id,title,description_clean]
+
+ filter: ~
+ form: ~
+ edit: ~
+ new: ~
View
13 apps/backend/modules/plugin/lib/pluginGeneratorConfiguration.class.php
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * plugin module configuration.
+ *
+ * @package mooforge
+ * @subpackage plugin
+ * @author Guillermo Rauch
+ * @version SVN: $Id: configuration.php 12474 2008-10-31 10:41:27Z fabien $
+ */
+class pluginGeneratorConfiguration extends BasePluginGeneratorConfiguration
+{
+}
View
13 apps/backend/modules/plugin/lib/pluginGeneratorHelper.class.php
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * plugin module helper.
+ *
+ * @package mooforge
+ * @subpackage plugin
+ * @author Guillermo Rauch
+ * @version SVN: $Id: helper.php 12474 2008-10-31 10:41:27Z fabien $
+ */
+class pluginGeneratorHelper extends BasePluginGeneratorHelper
+{
+}
View
20 apps/backend/templates/layout.php
@@ -0,0 +1,20 @@
+<!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" />
+ </head>
+ <body>
+ <?php if ($sf_user->isAuthenticated()): ?>
+ <ul id="nav">
+ <li><?php echo link_to('Dashboard', 'dashboard/index') ?></li>
+ <li><?php echo link_to('Authors', 'author/index') ?></li>
+ <li><?php echo link_to('Plugins', 'plugin/index') ?></li>
+ </ul>
+ <?php endif ?>
+
+ <?php echo $sf_content ?>
+ </body>
+</html>
View
2  apps/frontend/modules/user/templates/loginSuccess.php
@@ -27,7 +27,7 @@
<hr class="clear" />
<div class="input_submit">
- <input type="submit" name="twitter_details_submit" value="Submit" id="twitter_details_submit" />
+ <input type="submit" name="login_submit" value="Submit" id="login_submit" />
</div>
<?php echo $form->renderHiddenFields() ?>
View
0  apps/frontend/lib/twitterFilter.class.php → lib/filter/twitterFilter.class.php
File renamed without changes
View
0  apps/frontend/lib/form/LoginForm.class.php → lib/form/LoginForm.class.php
File renamed without changes
View
4 lib/model/Author.php
@@ -2,6 +2,10 @@
class Author extends BaseAuthor
{
+
+ public function __toString(){
+ return $this->getUsername();
+ }
public function save(PropelPDO $con = null){
// unconfirm email upon change
View
4 lib/model/PluginTag.php
@@ -3,6 +3,10 @@
class PluginTag extends BasePluginTag
{
+ public function __toString(){
+ return $this->getName();
+ }
+
public function getName($strict = false){
if ($strict && is_numeric($this->name)) return floatval($this->name);
return $this->name;
View
19 test/functional/backend/authActionsTest.php
@@ -0,0 +1,19 @@
+<?php
+
+include(dirname(__FILE__).'/../../bootstrap/functional.php');
+
+$browser = new sfTestFunctional(new sfBrowser());
+
+$browser->
+ get('/auth/index')->
+
+ with('request')->begin()->
+ isParameter('module', 'auth')->
+ isParameter('action', 'index')->
+ end()->
+
+ with('response')->begin()->
+ isStatusCode(200)->
+ checkElement('body', '!/This is a temporary page/')->
+ end()
+;
View
19 test/functional/backend/authorActionsTest.php
@@ -0,0 +1,19 @@
+<?php
+
+include(dirname(__FILE__).'/../../bootstrap/functional.php');
+
+$browser = new sfTestFunctional(new sfBrowser());
+
+$browser->
+ get('/author/index')->
+
+ with('request')->begin()->
+ isParameter('module', 'author')->
+ isParameter('action', 'index')->
+ end()->
+
+ with('response')->begin()->
+ isStatusCode(200)->
+ checkElement('body', '!/This is a temporary page/')->
+ end()
+;
View
19 test/functional/backend/dashboardActionsTest.php
@@ -0,0 +1,19 @@
+<?php
+
+include(dirname(__FILE__).'/../../bootstrap/functional.php');
+
+$browser = new sfTestFunctional(new sfBrowser());
+
+$browser->
+ get('/dashboard/index')->
+
+ with('request')->begin()->
+ isParameter('module', 'dashboard')->
+ isParameter('action', 'index')->
+ end()->
+
+ with('response')->begin()->
+ isStatusCode(200)->
+ checkElement('body', '!/This is a temporary page/')->
+ end()
+;
View
19 test/functional/backend/pluginActionsTest.php
@@ -0,0 +1,19 @@
+<?php
+
+include(dirname(__FILE__).'/../../bootstrap/functional.php');
+
+$browser = new sfTestFunctional(new sfBrowser());
+
+$browser->
+ get('/plugin/index')->
+
+ with('request')->begin()->
+ isParameter('module', 'plugin')->
+ 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', false);
+sfContext::createInstance($configuration)->dispatch();
Please sign in to comment.
Something went wrong with that request. Please try again.