Author: KRavEN Date: 2010-05-13 14:27:14 +0200 (Thu, 13 May 2010) New Revision: 29435
Added: plugins/ExtjsGeneratorPlugin/trunk/README Modified: plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/configuration.php plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/createAction.php plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/deleteAction.php plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/editAction.php plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/filterAction.php plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/formpanelAction.php plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/newAction.php plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/paginationAction.php plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/updateAction.php Log: Incorporated recent changes to sfPropel15Plugin admin15 generator. Added README. Added: plugins/ExtjsGeneratorPlugin/trunk/README =================================================================== --- plugins/ExtjsGeneratorPlugin/trunk/README (rev 0) +++ plugins/ExtjsGeneratorPlugin/trunk/README 2010-05-13 12:27:14 UTC (rev 29435) @@ -0,0 +1,47 @@ +ExtjsGeneratorPlugin +==================== +Symfony 1.3/1.4 admin generator that requires sfPropel15Plugin and sfExtjs3Plugin. The entire administration frontend has been converted to use the ExtJS javascript framework. + +Installation +------------ + +Move into your project directory and issue the following commands: + + > svn export http://svn.symfony-project.com/plugins/ExtjsGeneratorPlugin/trunk/ ./plugins/ExtjsGeneratorPlugin + > svn export http://svn.symfony-project.com/plugins/sfExtjs3Plugin/trunk/ ./plugins/sfExtjs3Plugin + > svn export http://svn.symfony-project.com/plugins/sfPropel15Plugin/trunk ./plugins/sfPropel15Plugin + > + > mkdir ./plugins/sfExtjs3Plugin/web + > cd ./plugins/sfExtjs3Plugin/web + > wget http://extjs.cachefly.net/ext-3.2.1.zip + > unzip ext-3.2.1.zip + > rm ext-3.2.1.zip + > ln -s ext-3.2.1 extjs + > cd ../../../web/ + > ln -s ../plugins/sfExtjs3Plugin/web sfExtjs3Plugin + > ln -s ../plugins/ExtjsGeneratorPlugin/web ExtjsGeneratorPlugin + > ln -s ../plugins/sfPropel15Plugin/web sfPropel15Plugin + +Disable the core Propel plugin and enable the `sfPropel15Plugin`, `sfExtjs3Plugin`, and `ExtjsGeneratorPlugin`: + + [php] + class ProjectConfiguration extends sfProjectConfiguration + { + public function setup() + { + $this->enablePlugins('sfPropel15Plugin'); + $this->enablePlugins('sfExtjs3Plugin'); + $this->enablePlugins('ExtjsGeneratorPlugin'); + } + } + +Change the path of the symfony behaviors in the `config/propel.ini` file of your project: + + [ini] + propel.behavior.symfony.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorSymfony + propel.behavior.symfony_i18n.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorI18n + propel.behavior.symfony_i18n_translation.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorI18nTranslation + propel.behavior.symfony_behaviors.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorSymfonyBehaviors + propel.behavior.symfony_timestampable.class = plugins.sfPropel15Plugin.lib.behavior.SfPropelBehaviorTimestampable + +The new options for the `admin15` generator theme are fully documented, and illustrated by real life examples, in the [`doc/admin_generator.txt`](http://trac.symfony-project.org/browser/plugins/sfPropel15Plugin/trunk/doc/admin_generator.txt) file in this plugin source code. \ No newline at end of file Modified: plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/configuration.php =================================================================== --- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/configuration.php 2010-05-13 12:00:05 UTC (rev 29434) +++ plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/configuration.php 2010-05-13 12:27:14 UTC (rev 29435) @@ -71,7 +71,7 @@ <?php unset($this->config['list']['with']) ?> } - public function getQueryPartials() + public function getQueryMethods() { return <?php echo $this->asPhp(isset($this->config['list']['query_methods']) ? $this->config['list']['query_methods'] : array()) ?>; <?php unset($this->config['list']['query_methods']) ?> Modified: plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/createAction.php =================================================================== --- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/createAction.php 2010-05-13 12:00:05 UTC (rev 29434) +++ plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/createAction.php 2010-05-13 12:27:14 UTC (rev 29435) @@ -1,6 +1,7 @@ public function executeCreate(sfWebRequest $request) { $this->form = $this->configuration->getForm(); +<?php echo $this->getFormCustomization('new') ?> $this-><?php echo $this->getSingularName() ?> = $this->form->getObject(); $this->processForm($request, $this->form); Modified: plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/deleteAction.php =================================================================== --- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/deleteAction.php 2010-05-13 12:00:05 UTC (rev 29434) +++ plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/deleteAction.php 2010-05-13 12:27:14 UTC (rev 29435) @@ -2,9 +2,9 @@ { $request->checkCSRFProtection(); - $this->dispatcher->notify(new sfEvent($this, 'admin.delete_object', array('object' => $this->getRoute()->getObject($this->configuration->getQueryPartials())))); + $this->dispatcher->notify(new sfEvent($this, 'admin.delete_object', array('object' => $this->getRoute()->getObject($this->configuration->getQueryMethods())))); - $this->getRoute()->getObject($this->configuration->getQueryPartials())->delete(); + $this->getRoute()->getObject($this->configuration->getQueryMethods())->delete(); $this->getUser()->setFlash('notice', 'The item was deleted successfully.'); } Modified: plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/editAction.php =================================================================== --- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/editAction.php 2010-05-13 12:00:05 UTC (rev 29434) +++ plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/editAction.php 2010-05-13 12:27:14 UTC (rev 29435) @@ -1,5 +1,6 @@ public function executeEdit(sfWebRequest $request) { - $this-><?php echo $this->getSingularName() ?> = $this->getRoute()->getObject($this->configuration->getQueryPartials()); + $this-><?php echo $this->getSingularName() ?> = $this->getRoute()->getObject($this->configuration->getQueryMethods()); $this->form = $this->configuration->getForm($this-><?php echo $this->getSingularName() ?>); +<?php echo $this->getFormCustomization('edit') ?> } Modified: plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/filterAction.php =================================================================== --- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/filterAction.php 2010-05-13 12:00:05 UTC (rev 29434) +++ plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/filterAction.php 2010-05-13 12:27:14 UTC (rev 29435) @@ -8,6 +8,7 @@ } $this->filters = $this->configuration->getFilterForm($this->getFilters()); +<?php echo $this->getFormCustomization('filter', 'filters') ?> $this->filters->bind($request->getParameter($this->filters->getName())); if ($this->filters->isValid()) Modified: plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/formpanelAction.php =================================================================== --- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/formpanelAction.php 2010-05-13 12:00:05 UTC (rev 29434) +++ plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/formpanelAction.php 2010-05-13 12:27:14 UTC (rev 29435) @@ -1,6 +1,6 @@ public function executeFormpanel(sfWebRequest $request) { - //$this-><?php echo $this->getSingularName() ?> = $this->getRoute()->getObject($this->configuration->getQueryPartials()); + //$this-><?php echo $this->getSingularName() ?> = $this->getRoute()->getObject($this->configuration->getQueryMethods()); $this->form = $this->configuration->getForm(); sfConfig::set('sf_escaping_strategy', false); } Modified: plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/newAction.php =================================================================== --- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/newAction.php 2010-05-13 12:00:05 UTC (rev 29434) +++ plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/newAction.php 2010-05-13 12:27:14 UTC (rev 29435) @@ -2,4 +2,5 @@ { $this->form = $this->configuration->getForm(); $this-><?php echo $this->getSingularName() ?> = $this->form->getObject(); +<?php echo $this->getFormCustomization('new') ?> } Modified: plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/paginationAction.php =================================================================== --- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/paginationAction.php 2010-05-13 12:00:05 UTC (rev 29434) +++ plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/paginationAction.php 2010-05-13 12:27:14 UTC (rev 29435) @@ -23,31 +23,7 @@ if (null === $this->filters) { $this->filters = $this->configuration->getFilterForm($this->getFilters()); - foreach ($this->configuration->getFieldsFilter() as $key => $field) - { - if (isset($field['widget'])) - { - $widget = $field['widget']; - $options = (isset($widget['options'])) ? $widget['options'] : array(); - $attributes = (isset($widget['attributes'])) ? $widget['attributes'] : array(); - if (isset($widget['class'])) - { - $class = $widget['class']; - $this->filters->setWidget($key, new $class($options, $attributes)); - } - else - { - foreach ($options as $name => $value) - { - $this->filters->getWidget($key)->setOption($name, $value); - } - foreach ($attributes as $name => $value) - { - $this->filters->getWidget($key)->setAttribute($name, $value); - } - } - } - } +<?php echo $this->getFormCustomization('filter', 'filters') ?> } $query = $this->filters->buildCriteria($this->getFilters()); @@ -59,7 +35,7 @@ $query->joinWith($with); } - foreach ($this->configuration->getQueryPartials() as $method) { + foreach ($this->configuration->getQueryMethods() as $method) { $query->$method(); } Modified: plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/updateAction.php =================================================================== --- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/updateAction.php 2010-05-13 12:00:05 UTC (rev 29434) +++ plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/updateAction.php 2010-05-13 12:27:14 UTC (rev 29435) @@ -1,7 +1,8 @@ public function executeUpdate(sfWebRequest $request) { - $this-><?php echo $this->getSingularName() ?> = $this->getRoute()->getObject($this->configuration->getQueryPartials()); + $this-><?php echo $this->getSingularName() ?> = $this->getRoute()->getObject($this->configuration->getQueryMethods()); $this->form = $this->configuration->getForm($this-><?php echo $this->getSingularName() ?>); +<?php echo $this->getFormCustomization('edit') ?> $this->processForm($request, $this->form); -- 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.
