Author: tkoomzaaskz
Date: 2010-09-12 12:45:42 +0200 (Sun, 12 Sep 2010)
New Revision: 30886

Added:
   plugins/tdCorePlugin/trunk/modules/tdSubpage/templates/showSuccess.php
Modified:
   plugins/tdCorePlugin/trunk/README
   plugins/tdCorePlugin/trunk/config/routing.yml
   plugins/tdCorePlugin/trunk/config/tdCorePluginConfiguration.class.php
   plugins/tdCorePlugin/trunk/lib/model/doctrine/PlugintdSubpage.class.php
   plugins/tdCorePlugin/trunk/modules/tdSubpage/actions/actions.class.php
   plugins/tdCorePlugin/trunk/modules/tdSubpage/templates/_ajax_activate.php
   plugins/tdCorePlugin/trunk/modules/tdSubpage/templates/_ajax_deactivate.php
Log:
[td][core] preparing for new major release, 0.2.1

Modified: plugins/tdCorePlugin/trunk/README
===================================================================
--- plugins/tdCorePlugin/trunk/README   2010-09-12 06:30:05 UTC (rev 30885)
+++ plugins/tdCorePlugin/trunk/README   2010-09-12 10:45:42 UTC (rev 30886)
@@ -1,13 +1,26 @@
-tdCorePlugin
-============
+## table of contents
 
+*   [tdCorePlugin](#tdCorePlugin)
+*   [Installation](#installation)
+*   [Usage](#usage)
+*   [Configuration](#configuration)
+*   [tdConfig](#tdConfig)
+*   [tdSubpage](#tdSubpage)
+*   [Breadcrumbs](#breadcrumbs)
+*   [AJAX backend interface](#ajax_backend_interface)
+*   [sfAdminDashPlugin compatibility](#sfAdminDashPlugin)
+*   [Random Data Generator](#random_data_generator)
+
+<a name="tdCorePlugin">tdCorePlugin</a>
+==========================================
+
 The `tdCorePlugin` is a symfony plugin that provides basic functionalities
 enabling TD CMF, such as common configuration or random data generation.
 
 This plugin is a part of __TD CMF__ and is based on __Doctrine ORM__.
 
-Installation
-============
+<a name="installation">Installation</a>
+=======================================
 
 Install the plugin via the subversion repository by executing the following
 command from the project root directory:
@@ -25,8 +38,8 @@
 
 One of the assets is nice CSS file cooperating with other __TD CMF__ plugins.
 
-Usage
-=====
+<a name="usage">Usage</a>
+=========================
 
   * This plugin is the main part of the __TD CMF__ and therefore it should be
     installed as the first one. Other td components will use functionalities
@@ -37,51 +50,41 @@
         [php]
         stylesheets:    [ /tdCorePlugin/css/td_admin.css ]
 
-Configuration
-=============
+<a name="configuration">Configuration</a>
+=========================================
 
   * _td_short_text_sign_count_ - character count of a short descrtiption of any
-    kind of object used among admin generators (used by tdGuestbookPlugin,
-    tdAudioPlugin, tdVideoPlugin and so on)
+    kind of object used among admin generators (used by tdSubpage,
+    tdGuestbookPlugin, tdAudioPlugin, tdVideoPlugin and so on)
 
-sfAdminDashPlugin compatibility
+<a name="tdConfig">tdConfig</a>
 ===============================
 
-The icons provided with the plugin may be used for sfAdminDashPlugin. To do so,
-you need to do the following:
+tdConfig is a model representing dynamic configuration options in your symfony
+project. It is provided with the tdConfig backend module enabing easy
+configuration options management. Just enable the module in your
+__backend/config/settings.yml__ file:
 
-  * modify the __sfAdminDashPlugin/config/app.yml__ file, set:
+    enabled_modules: [ ... , tdConfig ]
 
-        [php]
-        image_dir: /tdCorePlugin/images/icons/
+<a name="tdSubpage">tdSubpage</a>
+=================================
 
-  * and finally you may use the icons in the app.yml file:
+tdSubpage is a model representing subpages in your symfony project. Enables 
easy
+management of pages with dynamic content. Use it in your frontend application -
+in actions, components and layout templates:
 
-        [php]
-        categories:
-          Administration:
-            items:
-              Newsletter:
-                url: newsletter
-                image: newsletter.png
+    [php]
+    url_for('@tdSubpage_show?id=1&name=about')
 
-AJAX backend interface
-======================
+<a name="breadcrumbs">Breadcrumbs</a>
+=====================================
 
-Some of TD CMF plugins use AJAX actions to provide user-friendly interface
-(such as tdGuestbookPlugin). Enable the graphics module from tdCorePlugin to
-enable AJAX actions in other plugins to run correctly:
-
-    enabled_modules: [ ..., graphics ]
-
-Breadcrumbs
-===========
-
 This part is based on _isicsBreadcrumbsPlugin_. It includes a singleton 
managing
 breadcrumb items. Displaying breadcrumbs is done using a component. At first,
 enable the tdBreadcrumb module:
 
-    enabled_modules: [ ..., tdBreadcrumb ]
+    enabled_modules: [ ... , tdBreadcrumb ]
 
 Define the path in your templates:
 
@@ -125,9 +128,42 @@
       )) ?>
     </p>
 
-Random Data Generator
-=====================
+<a name="ajax_backend_interface">AJAX backend interface</a>
+===========================================================
 
+Some of TD CMF plugins use AJAX actions to provide user-friendly interface
+(such as tdGuestbookPlugin). Enable the graphics module from tdCorePlugin to
+enable AJAX actions in other plugins to run correctly:
+
+    enabled_modules: [ ... , graphics ]
+
+More about __TD CFM__ AJAX backend feature in my [symfony developer
+blog](http://symfony-world.blogspot.com/2010/05/ajaxsymfony-easy-user-friendly-example.html
 "Ajax/symfony easy & user friendly example")
+
+<a name="sfAdminDashPlugin">sfAdminDashPlugin compatibility</a>
+===============================================================
+
+The icons provided with the plugin may be used for sfAdminDashPlugin. To do so,
+you need to do the following:
+
+  * modify the __sfAdminDashPlugin/config/app.yml__ file, set:
+
+        [php]
+        image_dir: /tdCorePlugin/images/icons/
+
+  * and finally you may use the icons in the app.yml file:
+
+        [php]
+        categories:
+          Administration:
+            items:
+              Newsletter:
+                url: newsletter
+                image: newsletter.png
+
+<a name="random_data_generator">Random Data Generator</a>
+=========================================================
+
 There is a class in the plugin responsible for generating some random data used
 for the symfony fixtures. During development phase its essential to see how 
some
 mechanisms work when real data is available in the database. Writing the same

Modified: plugins/tdCorePlugin/trunk/config/routing.yml
===================================================================
--- plugins/tdCorePlugin/trunk/config/routing.yml       2010-09-12 06:30:05 UTC 
(rev 30885)
+++ plugins/tdCorePlugin/trunk/config/routing.yml       2010-09-12 10:45:42 UTC 
(rev 30886)
@@ -7,13 +7,17 @@
     column:               id
     with_wildcard_routes: true
 
-td_ajax_subpage_activate:
+tdSubpage_show:
+  url:   /subpage/:id/:name
+  param: { module: tdSubpage, action: show }
+
+tdSubpage_ajax_activate:
   url:   /td_ajax_subpage_activate/:id
   param: { module: tdSubpage, action: activate }
   requirements:
     id: \d+
 
-td_ajax_subpage_deactivate:
+tdSubpage_ajax_deactivate:
   url:   /td_ajax_subpage_deactivate/:id
   param: { module: tdSubpage, action: deactivate }
   requirements:

Modified: plugins/tdCorePlugin/trunk/config/tdCorePluginConfiguration.class.php
===================================================================
--- plugins/tdCorePlugin/trunk/config/tdCorePluginConfiguration.class.php       
2010-09-12 06:30:05 UTC (rev 30885)
+++ plugins/tdCorePlugin/trunk/config/tdCorePluginConfiguration.class.php       
2010-09-12 10:45:42 UTC (rev 30886)
@@ -17,7 +17,7 @@
   public function initialize()
   {
     // short description sign count
-    sfConfig::set('td_short_text_sign_count', 200);
+    sfConfig::set('td_short_text_sign_count', 500);
 
     $this->dispatcher->connect('template.filter_parameters', 
array('tdBreadcrumb', 'filterTemplateParameters'));
   }

Modified: 
plugins/tdCorePlugin/trunk/lib/model/doctrine/PlugintdSubpage.class.php
===================================================================
--- plugins/tdCorePlugin/trunk/lib/model/doctrine/PlugintdSubpage.class.php     
2010-09-12 06:30:05 UTC (rev 30885)
+++ plugins/tdCorePlugin/trunk/lib/model/doctrine/PlugintdSubpage.class.php     
2010-09-12 10:45:42 UTC (rev 30886)
@@ -29,7 +29,7 @@
    */
   public function getContentShort()
   {
-    return strip_tags(tdTools::getMbShortenedString($this->getContent(), 400));
+    return strip_tags(tdTools::getMbShortenedString($this->getContent(), 
sfConfig::get('td_short_text_sign_count')));
   }
 
   /**

Modified: plugins/tdCorePlugin/trunk/modules/tdSubpage/actions/actions.class.php
===================================================================
--- plugins/tdCorePlugin/trunk/modules/tdSubpage/actions/actions.class.php      
2010-09-12 06:30:05 UTC (rev 30885)
+++ plugins/tdCorePlugin/trunk/modules/tdSubpage/actions/actions.class.php      
2010-09-12 10:45:42 UTC (rev 30886)
@@ -13,6 +13,17 @@
  */
 class tdSubpageActions extends autoTdSubpageActions
 {
+ /**
+  * Shows a single tdSubpage which is given by the 'heading' parameter.
+  *
+  * @param sfRequest A request object
+  */
+  public function executeShow(sfWebRequest $request)
+  {
+    $this->setVar('td_subpage', 
tdSubpageTable::getSubpageByIdQuery($request->getParameter('id'))->fetchOne(), 
true);
+    $this->forward404If(!$this->td_subpage, 'Strona nie istnieje');
+  }
+
   /**
    * Activates a subpage from admin generator list using AJAX.
    *

Modified: 
plugins/tdCorePlugin/trunk/modules/tdSubpage/templates/_ajax_activate.php
===================================================================
--- plugins/tdCorePlugin/trunk/modules/tdSubpage/templates/_ajax_activate.php   
2010-09-12 06:30:05 UTC (rev 30885)
+++ plugins/tdCorePlugin/trunk/modules/tdSubpage/templates/_ajax_activate.php   
2010-09-12 10:45:42 UTC (rev 30886)
@@ -2,7 +2,7 @@
 <?php use_helper('jQuery'); ?>
   <?php echo jq_link_to_remote(__('Activate', array(), 'sf_admin'), array(
     'update'   => 'subpage_visible_action_'.$td_subpage->getId(),
-    'url'      => '@td_ajax_subpage_activate?id='.$td_subpage->getId(),
+    'url'      => '@tdSubpage_ajax_activate?id='.$td_subpage->getId(),
     'script' => true,
     'complete' => jq_remote_function( array(
       'update' => 'subpage_visible_column_'.$td_subpage->getId(),

Modified: 
plugins/tdCorePlugin/trunk/modules/tdSubpage/templates/_ajax_deactivate.php
===================================================================
--- plugins/tdCorePlugin/trunk/modules/tdSubpage/templates/_ajax_deactivate.php 
2010-09-12 06:30:05 UTC (rev 30885)
+++ plugins/tdCorePlugin/trunk/modules/tdSubpage/templates/_ajax_deactivate.php 
2010-09-12 10:45:42 UTC (rev 30886)
@@ -2,7 +2,7 @@
 <?php use_helper('jQuery'); ?>
   <?php echo jq_link_to_remote(__('Deactivate', array(), 'sf_admin'), array(
     'update'   => 'subpage_visible_action_'.$td_subpage->getId(),
-    'url'      => '@td_ajax_subpage_deactivate?id='.$td_subpage->getId(),
+    'url'      => '@tdSubpage_ajax_deactivate?id='.$td_subpage->getId(),
     'script' => true,
     'complete' => jq_remote_function( array(
       'update' => 'subpage_visible_column_'.$td_subpage->getId(),

Added: plugins/tdCorePlugin/trunk/modules/tdSubpage/templates/showSuccess.php
===================================================================
--- plugins/tdCorePlugin/trunk/modules/tdSubpage/templates/showSuccess.php      
                        (rev 0)
+++ plugins/tdCorePlugin/trunk/modules/tdSubpage/templates/showSuccess.php      
2010-09-12 10:45:42 UTC (rev 30886)
@@ -0,0 +1,3 @@
+<h1><?php echo $td_subpage['name'] ?></h1>
+
+<?php echo $td_subpage['content'] ?>

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to