Changeset 29921
- Timestamp:
- 06/21/10 19:45:54 (3 years ago)
- Files:
-
- plugins/ExtjsGeneratorPlugin/trunk/TODO.txt (modified) (1 diff)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_bottomToolbar.js.php (modified) (2 diffs)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_columnModel.js.php (modified) (2 diffs)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_columnRenderers.js.php (modified) (5 diffs)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_datastore.js.php (modified) (2 diffs)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_editaction__cancel.js.php (modified) (1 diff)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_editaction__delete.js.php (modified) (1 diff)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_editaction__reload.js.php (modified) (1 diff)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_editaction__save.js.php (modified) (1 diff)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_editaction__savenew.js.php (modified) (1 diff)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_filterpanel.js.php (modified) (2 diffs)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_filterpanel_method_initEvents.js.php (modified) (2 diffs)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_formpanel.js.php (modified) (3 diffs)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_formpanel_method_close.js.php (modified) (1 diff)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_formpanel_method_doDelete.js.php (modified) (1 diff)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_formpanel_method_doLoad.js.php (modified) (1 diff)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_formpanel_method_doSubmit.js.php (modified) (1 diff)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_formpanel_method_initComponent.js.php (modified) (2 diffs)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_formpanel_method_initEvents.js.php (modified) (1 diff)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_formpanel_method_isNew.js.php (modified) (1 diff)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_formpanel_method_onLoadFailure.js.php (modified) (1 diff)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_formpanel_method_onLoadSuccess.js.php (modified) (1 diff)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_formpanel_method_onSubmitFailure.js.php (modified) (1 diff)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_formpanel_method_onSubmitSuccess.js.php (modified) (1 diff)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_formpanel_method_setKey.js.php (modified) (1 diff)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_formpanel_method_updateButtonsVisibility.js.php (modified) (1 diff)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_gridpanel.js.php (modified) (2 diffs)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_gridpanel_method_initComponent.js.php (modified) (2 diffs)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_gridpanel_method_initEvents.js.php (modified) (2 diffs)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_gridpanel_method_onEditLinkClick.js.php (modified) (2 diffs)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_gridpanel_method_resetFilter.js.php (modified) (1 diff)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_gridpanel_method_setFilter.js.php (modified) (1 diff)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_listaction__new.js.php (modified) (2 diffs)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_objectAction__delete.js.php (modified) (2 diffs)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_objectAction__edit.js.php (modified) (1 diff)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_objectActions.js.php (modified) (3 diffs)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_tabpanel.js.php (modified) (2 diffs)
- plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_topToolbar.js.php (modified) (3 diffs)
- plugins/ExtjsGeneratorPlugin/trunk/lib/generator/ExtjsGenerator.class.php (modified) (4 diffs)
- plugins/ExtjsGeneratorPlugin/trunk/lib/generator/ExtjsModelGeneratorConfiguration.class.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/ExtjsGeneratorPlugin/trunk/TODO.txt
r29879 r29921 28 28 ### generic 29 29 add time display for datetime fields to list, filter, and edit 30 use heredoc in ExtjsGenerator for getStandardPartials, createStandardConstructorPartial, createStandardInitComponentPartial, createStandardInitEventsPartial methods31 expand generated partials with examples32 30 add support for objects with multiple fields as primary key 33 31 plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_bottomToolbar.js.php
r29426 r29921 7 7 $className = '<?php echo $className ?>'; 8 8 $bottomToolbar = new stdClass(); 9 $bottomToolbar->attributes = array(); 9 $bottomToolbar->methods = array(); 10 $bottomToolbar->variables = array(); 10 11 11 12 /* bottomToolbar configuration */ … … 27 28 '<?php echo $className ?>', 28 29 'Ext.PagingToolbar', 29 $bottomToolbar->attributes 30 array_merge( 31 $bottomToolbar->methods, 32 $bottomToolbar->variables 33 ) 30 34 ); 31 35 plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_columnModel.js.php
r29610 r29921 7 7 $className = '<?php echo $className ?>'; 8 8 $columnModel = new stdClass(); 9 $columnModel->attributes = array(); 9 $columnModel->methods = array(); 10 $columnModel->variables = array(); 10 11 11 12 $columnModel->config_array = array( … … 35 36 '<?php echo $className ?>', 36 37 'Ext.app.sf.<?php echo $moduleName."ColumnRenderers" ?>', 37 $columnModel->attributes 38 array_merge( 39 $columnModel->methods, 40 $columnModel->variables 41 ) 38 42 ); 39 43 plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_columnRenderers.js.php
r29727 r29921 7 7 $className = '<?php echo $className ?>'; 8 8 $columnRenderers = new stdClass(); 9 $columnRenderers->attributes = array(); 9 $columnRenderers->methods = array(); 10 $columnRenderers->variables = array(); 10 11 11 12 // renderLink 12 $columnRenderers-> attributes['renderLink'] = $sfExtjs3Plugin->asMethod(array(13 $columnRenderers->methods['renderLink'] = $sfExtjs3Plugin->asMethod(array( 13 14 'parameters' => 'value, params, record, rowIndex, colIndex, store', 14 15 'source' => " … … 22 23 )); 23 24 24 $columnRenderers-> attributes['formatLongstring'] = $sfExtjs3Plugin->asMethod(array(25 $columnRenderers->methods['formatLongstring'] = $sfExtjs3Plugin->asMethod(array( 25 26 'parameters' => 'value, params, record, rowIndex, colIndex, store', 26 27 'source' => " … … 31 32 )); 32 33 33 $columnRenderers-> attributes['formatBoolean'] = $sfExtjs3Plugin->asMethod(array(34 $columnRenderers->methods['formatBoolean'] = $sfExtjs3Plugin->asMethod(array( 34 35 'parameters' => 'value, params, record, rowIndex, colIndex, store', 35 36 'source' => "return value ? 'Yes' : 'No';" … … 37 38 38 39 // formatDate 39 $ renderers->attributes['formatDate'] = $sfExtjs3Plugin->asMethod(array(40 $columnRenderers->methods['formatDate'] = $sfExtjs3Plugin->asMethod(array( 40 41 'parameters' => 'v', 41 42 'source' => "return Ext.util.Format.date(v, 'm/d/Y')" … … 50 51 '<?php echo $className ?>', 51 52 'Ext.grid.ColumnModel', 52 $columnRenderers->attributes 53 array_merge( 54 $columnRenderers->methods, 55 $columnRenderers->variables 56 ) 53 57 ); 54 58 plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_datastore.js.php
r29426 r29921 8 8 $className = '<?php echo $className ?>'; 9 9 $datastore = new stdClass(); 10 $datastore->attributes = array(); 10 $datastore->methods = array(); 11 $datastore->variables = array(); 11 12 12 13 /* store configuration */ … … 49 50 '<?php echo $className ?>', 50 51 'Ext.data.<?php echo $store ?>', 51 $datastore->attributes 52 array_merge( 53 $datastore->methods, 54 $datastore->variables 55 ) 52 56 ); 53 57 plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_editaction__cancel.js.php
r29426 r29921 1 [?php // @object $sfExtjs3Plugin and @object $formpanel provided2 $formpanel-> attributes["_cancel"] = $sfExtjs3Plugin->asMethod("1 [?php // @object $sfExtjs3Plugin string $className and @object $formpanel provided 2 $formpanel->methods["_cancel"] = $sfExtjs3Plugin->asMethod(" 3 3 this.fireEvent('close', this); 4 4 "); plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_editaction__delete.js.php
r29426 r29921 1 [?php // @object $sfExtjs3Plugin and @object $formpanel provided2 $formpanel-> attributes["_delete"] = $sfExtjs3Plugin->asMethod("this.doDelete();");1 [?php // @object $sfExtjs3Plugin string $className and @object $formpanel provided 2 $formpanel->methods["_delete"] = $sfExtjs3Plugin->asMethod("this.doDelete();"); 3 3 ?] plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_editaction__reload.js.php
r29426 r29921 1 [?php // @object $sfExtjs3Plugin and @object $formpanel provided2 $formpanel-> attributes["_reload"] = $sfExtjs3Plugin->asMethod("1 [?php // @object $sfExtjs3Plugin string $className and @object $formpanel provided 2 $formpanel->methods["_reload"] = $sfExtjs3Plugin->asMethod(" 3 3 if (!this.getForm().isDirty()) { 4 4 this.doLoad(); plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_editaction__save.js.php
r29426 r29921 1 [?php // @object $sfExtjs3Plugin and @object $formpanel provided2 $formpanel-> attributes["_save"] = $sfExtjs3Plugin->asMethod("this.doSubmit();");1 [?php // @object $sfExtjs3Plugin string $className and @object $formpanel provided 2 $formpanel->methods["_save"] = $sfExtjs3Plugin->asMethod("this.doSubmit();"); 3 3 ?] plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_editaction__savenew.js.php
r29426 r29921 1 [?php // @object $sfExtjs3Plugin and @object $formpanel provided2 $formpanel-> attributes["_savenew"] = $sfExtjs3Plugin->asMethod("this.doSubmit(true);");1 [?php // @object $sfExtjs3Plugin string $className and @object $formpanel provided 2 $formpanel->methods["_savenew"] = $sfExtjs3Plugin->asMethod("this.doSubmit(true);"); 3 3 ?] plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_filterpanel.js.php
r29879 r29921 7 7 $className = '<?php echo $className ?>'; 8 8 $filterpanel = new stdClass(); 9 $filterpanel->attributes = array(); 9 $filterpanel->methods = array(); 10 $filterpanel->variables = array(); 10 11 11 12 /* Filterpanel Configuration */ … … 77 78 '<?php echo $className ?>', 78 79 'Ext.FormPanel', 79 $filterpanel->attributes 80 array_merge( 81 $filterpanel->methods, 82 $filterpanel->variables 83 ) 80 84 ); 81 85 plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_filterpanel_method_initEvents.js.php
r29426 r29921 1 [?php 1 [?php // @object $sfExtjs3Plugin string $className and @object $filterpanel provided 2 2 // constructor 3 3 $configArr = array( … … 33 33 ); 34 34 35 $filterpanel-> attributes['initEvents'] = $sfExtjs3Plugin->asMethod($configArr);35 $filterpanel->methods['initEvents'] = $sfExtjs3Plugin->asMethod($configArr); 36 36 ?] plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_formpanel.js.php
r29879 r29921 7 7 $className = '<?php echo $className ?>'; 8 8 $formpanel = new stdClass(); 9 $formpanel->attributes = array(); 9 $formpanel->methods = array(); 10 $formpanel->variables = array(); 10 11 11 12 /* formpanel configuration */ … … 26 27 <?php foreach ($editActions as $name => $params): ?> 27 28 <?php if(! isset($params['handler_function']) && $name[0] != '_'): 28 $this->createPartialFile('_editaction_'.$name,'<?php 29 // @object $sfExtjs3Plugin and @object $formpanel provided 30 $configArr["source"] = "Ext.Msg.alert(\'Error\',\'handler_function is not defined!<br><br>Copy the template \"_editaction_'.$actionName.'.js.php\" from cache to your application/modules/'.strtolower($this->getModuleName()).'/templates folder and alter it or define the \"handler_function\" in your generator.yml file\');"; 31 $formpanel->attributes["'.$name.'"] = $sfExtjs3Plugin->asMethod($configArr); 32 ?>'); 29 $this->createPartialFile('_editaction_'.$name, <<<EOT 30 <?php 31 /* @object \$sfExtjs3Plugin string \$className and @object \$formpanel provided 32 *** Method example with no parameters 33 \$formpanel->methods['$name'] = \$sfExtjs3Plugin->asMethod(" 34 //method code 35 "); 36 37 *** Method example with parameters 38 \$configArr->['parameters'] = 'grid, record, action, row, col'; 39 \$configArr->['source'] = " 40 //method code 41 "); 42 \$formpanel->methods['$name'] = \$sfExtjs3Plugin->asMethod(\$configArr); 43 */ 44 \$configArr["source"] = " 45 Ext.Msg.alert(\'Error\',\'handler_function is not defined!<br><br>Copy the template \"_editaction_$actionName.js.php\" from cache to your application/modules/'.strtolower(\$this->getModuleName()).'/templates folder and alter it or define the \"handler_function\" in your generator.yml file\'); 46 "; 47 \$formpanel->methods['$name'] = \$sfExtjs3Plugin->asMethod(\$configArr); 48 ?> 49 EOT 50 51 ); 33 52 ?> 34 53 <?php endif; ?> … … 142 161 array_merge( 143 162 $formpanel->methods, 144 $formpanel-> attributes163 $formpanel->variables 145 164 ) 146 165 ); plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_formpanel_method_close.js.php
r29507 r29921 1 [?php 1 [?php // @object $sfExtjs3Plugin string $className and @object $formpanel provided 2 2 $formpanel->methods['close'] = $sfExtjs3Plugin->asMethod(" 3 3 this.gridPanel.getStore().reload(); plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_formpanel_method_doDelete.js.php
r29426 r29921 1 [?php 1 [?php // @object $sfExtjs3Plugin string $className and @object $formpanel provided 2 2 $form = new BaseForm(); 3 3 $csrf = ''; plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_formpanel_method_doLoad.js.php
r29426 r29921 1 [?php 1 [?php // @object $sfExtjs3Plugin @object $form string $className and @object $formpanel provided 2 2 // doLoad 3 3 $formpanel->methods['doLoad'] = $sfExtjs3Plugin->asMethod(" plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_formpanel_method_doSubmit.js.php
r29426 r29921 1 [?php 1 [?php // @object $sfExtjs3Plugin @object $form string $className and @object $formpanel provided 2 2 // doSubmit 3 3 $formpanel->methods['doSubmit'] = $sfExtjs3Plugin->asMethod(array( plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_formpanel_method_initComponent.js.php
r29426 r29921 1 [?php 1 [?php // @object $sfExtjs3Plugin string $className and @object $formpanel provided 2 2 // constructor 3 3 $configArr = array( … … 57 57 ); 58 58 59 $formpanel-> attributes['initComponent'] = $sfExtjs3Plugin->asMethod($configArr);59 $formpanel->methods['initComponent'] = $sfExtjs3Plugin->asMethod($configArr); 60 60 ?] plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_formpanel_method_initEvents.js.php
r29426 r29921 1 [?php 1 [?php // @object $sfExtjs3Plugin string $className and @object $formpanel provided 2 2 $formpanel->methods['initEvents'] = $sfExtjs3Plugin->asMethod(" 3 3 Ext.app.sf.$className.superclass.initEvents.apply(this); plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_formpanel_method_isNew.js.php
r29426 r29921 1 [?php 1 [?php // @object $sfExtjs3Plugin string $className and @object $formpanel provided 2 2 // isNew 3 3 $formpanel->methods['isNew'] = $sfExtjs3Plugin->asMethod(" plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_formpanel_method_onLoadFailure.js.php
r29426 r29921 1 [?php 1 [?php // @object $sfExtjs3Plugin string $className and @object $formpanel provided 2 2 // onLoadFailure 3 3 $formpanel->methods['onLoadFailure'] = $sfExtjs3Plugin->asMethod(array( plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_formpanel_method_onLoadSuccess.js.php
r29426 r29921 1 [?php 1 [?php // @object $sfExtjs3Plugin string $className and @object $formpanel provided 2 2 // onLoadSuccess 3 3 $formpanel->methods['onLoadSuccess'] = $sfExtjs3Plugin->asMethod(array( plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_formpanel_method_onSubmitFailure.js.php
r29426 r29921 1 [?php 1 [?php // @object $sfExtjs3Plugin string $className and @object $formpanel provided 2 2 // onSubmitFailure 3 3 $formpanel->methods['onSubmitFailure'] = $sfExtjs3Plugin->asMethod(array( plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_formpanel_method_onSubmitSuccess.js.php
r29426 r29921 1 [?php 1 [?php // @object $sfExtjs3Plugin string $className and @object $formpanel provided 2 2 // onSubmitSuccess 3 3 $formpanel->methods['onSubmitSuccess'] = $sfExtjs3Plugin->asMethod(array( plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_formpanel_method_setKey.js.php
r29426 r29921 1 [?php 1 [?php // @object $sfExtjs3Plugin string $className and @object $formpanel provided 2 2 // setKey 3 3 $formpanel->methods['setKey'] = $sfExtjs3Plugin->asMethod(array( plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_formpanel_method_updateButtonsVisibility.js.php
r29426 r29921 1 [?php 1 [?php // @object $sfExtjs3Plugin string $className and @object $formpanel provided 2 2 // updateButtonsVisibility 3 3 $formpanel->methods['updateButtonsVisibility'] = $sfExtjs3Plugin->asMethod(" plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_gridpanel.js.php
r29426 r29921 7 7 $className = '<?php echo $className ?>'; 8 8 $gridpanel = new stdClass(); 9 $gridpanel->attributes = array(); 9 $gridpanel->methods = array(); 10 $gridpanel->variables = array(); 10 11 $gridpanelPlugins = array(); 11 12 12 $gridpanel-> attributes['cm'] = $sfExtjs3Plugin->asVar("Ext.ComponentMgr.create({xtype:'<?php echo $this->getModuleName() ?>columnmodel'})");13 $gridpanel->variables['cm'] = $sfExtjs3Plugin->asVar("Ext.ComponentMgr.create({xtype:'<?php echo $this->getModuleName() ?>columnmodel'})"); 13 14 14 15 /* gridpanel Configuration */ … … 88 89 '<?php echo $className ?>', 89 90 'Ext.grid.EditorGridPanel', 90 $gridpanel->attributes 91 array_merge( 92 $gridpanel->methods, 93 $gridpanel->variables 94 ) 91 95 ); 92 96 $sfExtjs3Plugin->endClass(); plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_gridpanel_method_initComponent.js.php
r29426 r29921 14 14 */ 15 15 ?> 16 [?php 16 [?php // @object $sfExtjs3Plugin string $className and @object $gridpanel provided 17 17 // constructor 18 18 $configArr = array( … … 55 55 ); 56 56 57 $gridpanel-> attributes['initComponent'] = $sfExtjs3Plugin->asMethod($configArr);57 $gridpanel->methods['initComponent'] = $sfExtjs3Plugin->asMethod($configArr); 58 58 ?] plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_gridpanel_method_initEvents.js.php
r29426 r29921 1 [?php 1 [?php // @object $sfExtjs3Plugin string $className and @object $gridpanel provided 2 2 // constructor 3 3 $configArr = array( … … 24 24 "); 25 25 26 $gridpanel-> attributes['initEvents'] = $sfExtjs3Plugin->asMethod($configArr);26 $gridpanel->methods['initEvents'] = $sfExtjs3Plugin->asMethod($configArr); 27 27 ?] plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_gridpanel_method_onEditLinkClick.js.php
r29507 r29921 1 [?php 1 [?php // @object $sfExtjs3Plugin string $className and @object $gridpanel provided 2 2 // onLinkClick 3 3 $configArr = Array( … … 20 20 ); 21 21 22 $gridpanel-> attributes['onEditLinkClick'] = $sfExtjs3Plugin->asMethod($configArr);22 $gridpanel->methods['onEditLinkClick'] = $sfExtjs3Plugin->asMethod($configArr); 23 23 ?] plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_gridpanel_method_resetFilter.js.php
r29426 r29921 1 [?php 1 [?php // @object $sfExtjs3Plugin string $className and @object $gridpanel provided 2 2 // resetFilter 3 $gridpanel-> attributes['resetFilter'] = $sfExtjs3Plugin->asMethod("3 $gridpanel->methods['resetFilter'] = $sfExtjs3Plugin->asMethod(" 4 4 this.getStore().proxy.setMethod('POST'); 5 5 this.getStore().proxy.setUrl('".url_for('<?php echo $this->getUrlForAction('collection') ?>', array('action' => 'filter')).".json'); plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_gridpanel_method_setFilter.js.php
r29426 r29921 1 [?php 1 [?php // @object $sfExtjs3Plugin string $className and @object $gridpanel provided 2 2 // setFilter 3 $gridpanel-> attributes['setFilter'] = $sfExtjs3Plugin->asMethod(array(3 $gridpanel->methods['setFilter'] = $sfExtjs3Plugin->asMethod(array( 4 4 'parameters' => 'params', 5 5 'source' => " plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_listaction__new.js.php
r29552 r29921 1 [?php // @object $sfExtjs3Plugin and @object $topToolbar provided1 [?php // @object $sfExtjs3Plugin string $className and @object $topToolbar provided 2 2 $configArr["parameters"] = "button, event"; 3 3 $configArr["source"] = $configArr["source"] = " … … 10 10 <?php echo sfConfig::get('app_extjs_gen_plugin_module_tab_panel_name', 'Ext.app.sf.TabPanel') ?>.add(formpanel).show(); 11 11 "; 12 $topToolbar-> attributes["_new"] = $sfExtjs3Plugin->asMethod($configArr);12 $topToolbar->methods["_new"] = $sfExtjs3Plugin->asMethod($configArr); 13 13 ?] plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_objectAction__delete.js.php
r29426 r29921 7 7 } 8 8 9 $configArr[ "parameters"] = "grid, record, action, row, col";10 $configArr[ "source"] = $configArr["source"] = "9 $configArr['parameters'] = 'grid, record, action, row, col'; 10 $configArr['source'] = " 11 11 Ext.Msg.confirm('Confirm','Are you sure you want to delete this <?php echo $this->configuration->getObjectName() ?>?',function(btn,text){ 12 12 if(btn == 'yes') … … 37 37 }); 38 38 "; 39 $objectActions-> attributes["_delete"] = $sfExtjs3Plugin->asMethod($configArr);39 $objectActions->methods['_delete'] = $sfExtjs3Plugin->asMethod($configArr); 40 40 ?] plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_objectAction__edit.js.php
r29836 r29921 15 15 } 16 16 "; 17 $objectActions-> attributes["_edit"] = $sfExtjs3Plugin->asMethod($configArr);17 $objectActions->methods["_edit"] = $sfExtjs3Plugin->asMethod($configArr); 18 18 ?] plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_objectActions.js.php
r29426 r29921 7 7 $className = '<?php echo $className ?>'; 8 8 $objectActions = new stdClass(); 9 $objectActions->attributes = array(); 9 $objectActions->methods = array(); 10 $objectActions->variables = array(); 10 11 11 12 /* objectActions configuration */ … … 20 21 <?php foreach ($actions as $name => $params): ?> 21 22 <?php if(! isset($params['handler_function']) && $name[0] != '_'): 22 $this->createPartialFile('_list_rowaction_'.$name,'<?php // @object $sfExtjs3Plugin and @object $objectActions provided 23 $configArr["parameters"] = "grid, record, action, row, col"; 24 $configArr["source"] = "Ext.Msg.alert(\'Error\',\'callback is not defined!<br><br>Copy the template file from cache \"_list_action_'.$actionName.'.php\" to your application/modules/'.strtolower($this->getModuleName()).'/templates folder and alter it or define the \"callback\" in your generator.yml file\');"; 25 $objectActions->attributes["'.$name.'"] = $sfExtjs3Plugin->asMethod($configArr); 26 ?>'); 23 $this->createPartialFile('_objectAction_'.$name, <<<EOT 24 <?php 25 /* @object \$sfExtjs3Plugin string \$className and @object \$objectActions provided 26 *** Method example with no parameters 27 \$objectActions->methods['$name'] = \$sfExtjs3Plugin->asMethod(" 28 //method code 29 "); 30 31 *** Method example with parameters 32 \$configArr->['parameters'] = 'grid, record, action, row, col'; 33 \$configArr->['source'] = " 34 //method code 35 "); 36 \$objectActions->methods['$name'] = \$sfExtjs3Plugin->asMethod(\$configArr); 37 */ 38 \$configArr["source"] = " 39 Ext.Msg.alert(\'Error\',\'handler_function is not defined!<br><br>Copy the template \"_objectAction_$actionName.js.php\" from cache to your application/modules/'.strtolower(\$this->getModuleName()).'/templates folder and alter it or define the \"handler_function\" in your generator.yml file\'); 40 "; 41 \$objectActions->methods['$name'] = \$sfExtjs3Plugin->asMethod(\$configArr); 42 ?> 43 EOT 44 45 ); 27 46 ?> 28 47 <?php endif; ?> … … 42 61 '<?php echo $className ?>', 43 62 'Ext.ux.grid.RowActions', 44 $objectActions->attributes 63 array_merge( 64 $objectActions->methods, 65 $objectActions->variables 66 ) 45 67 ); 46 68 plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_tabpanel.js.php
r29426 r29921 7 7 $className = '<?php echo $className ?>'; 8 8 $tabpanel = new stdClass(); 9 $tabpanel->attributes = array(); 9 $tabpanel->methods = array(); 10 $tabpanel->variables = array(); 10 11 11 12 /* tabpanel configuration */ … … 24 25 '<?php echo $className ?>', 25 26 'Ext.TabPanel', 26 $tabpanel->attributes 27 array_merge( 28 $tabpanel->methods, 29 $tabpanel->variables 30 ) 27 31 ); 28 32 plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/template/templates/_topToolbar.js.php
r29426 r29921 7 7 $className = '<?php echo $className ?>'; 8 8 $topToolbar = new stdClass(); 9 $topToolbar->attributes = array(); 9 $topToolbar->methods = array(); 10 $topToolbar->variables = array(); 10 11 11 12 /* topToolbar configuration */ … … 117 118 <?php foreach ($listActions as $name => $params): ?> 118 119 <?php if(! isset($params['handler_function']) && $name[0] != '_'): 119 $this->createPartialFile('_listaction_'.$name,'<?php 120 // @object $sfExtjs3Plugin and @object $topToolbar provided 121 $configArr["source"] = "Ext.Msg.alert(\'Error\',\'handler_function is not defined!<br><br>Copy the template \"_listaction_'.$actionName.'.js.php\" from cache to your application/modules/'.strtolower($this->getModuleName()).'/templates folder and alter it or define the \"handler_function\" in your generator.yml file\');"; 122 $topToolbar->attributes["'.$name.'"] = $sfExtjs3Plugin->asMethod($configArr); 123 ?>'); 120 $this->createPartialFile('_listaction_'.$name, <<<EOT 121 <?php 122 /* @object \$sfExtjs3Plugin string \$className and @object \$topToolbar provided 123 *** Method example with no parameters 124 \$topToolbar->methods['$name'] = \$sfExtjs3Plugin->asMethod(" 125 //method code 126 "); 127 128 *** Method example with parameters 129 \$configArr->['parameters'] = 'grid, record, action, row, col'; 130 \$configArr->['source'] = " 131 //method code 132 "); 133 \$topToolbar->methods['$name'] = \$sfExtjs3Plugin->asMethod(\$configArr); 134 */ 135 \$configArr["source"] = " 136 Ext.Msg.alert(\'Error\',\'handler_function is not defined!<br><br>Copy the template \"_listaction_$actionName.js.php\" from cache to your application/modules/'.strtolower(\$this->getModuleName()).'/templates folder and alter it or define the \"handler_function\" in your generator.yml file\'); 137 "; 138 \$topToolbar->methods['$name'] = \$sfExtjs3Plugin->asMethod(\$configArr); 139 ?> 140 EOT 141 142 ); 124 143 ?> 125 144 <?php endif; ?> … … 139 158 '<?php echo $className ?>', 140 159 'Ext.Toolbar', 141 $topToolbar->attributes 160 array_merge( 161 $topToolbar->methods, 162 $topToolbar->variables 163 ) 142 164 ); 143 165 plugins/ExtjsGeneratorPlugin/trunk/lib/generator/ExtjsGenerator.class.php
r29879 r29921 133 133 else 134 134 { 135 $params = ExtjsGeneratorUtil::getColumnParams($column, $modelClass);135 $params = ExtjsGeneratorUtil::getColumnParams($column, sfInflector::camelize($modelClass)); 136 136 $getter = $params['getter']; 137 137 } … … 562 562 foreach($partials as $partial) 563 563 { 564 if($partial[0] == '_') $partial = substr($partial, 1); 564 565 $partialStr .= "include_partial('" . $partial . "', array('sfExtjs3Plugin' => \$sfExtjs3Plugin, '$objName' => \$$objName, 'className' => \$className));\n"; 565 $this->createPartialFile('_' . $partial, '<?php // @object $sfExtjs3Plugin, $className and @object $' . $objName . ' provided ?>'); 566 567 $partialContent = <<<EOF 568 <?php 569 // @object \$sfExtjs3Plugin string \$className and @object $$objName provided 570 /* 571 *** Method example with no parameters 572 \${$objName}->methods['MethodName'] = \$sfExtjs3Plugin->asMethod(" 573 //method code 574 "); 575 576 *** Method example with parameters 577 \$configArr->['parameters'] = 'grid, record, action, row, col'; 578 \$configArr->['source'] = " 579 //method code 580 "); 581 \${$objName}->methods['MethodName'] = \$sfExtjs3Plugin->asMethod(\$configArr); 582 583 *** Variable example 584 \${$objName}->variables['VariableName'] = \$sfExtjs3Plugin->asVar(" 585 //variable creation or string 586 "); 587 */ 588 ?> 589 EOF; 590 591 $this->createPartialFile('_' . $partial, $partialContent); 566 592 } 567 593 } … … 610 636 protected function createStandardConstructorPartial($objName) 611 637 { 612 return sprintf('<?php 638 return sprintf('<?php // @object \$sfExtjs3Plugin string \$className and @object %1$s provided 613 639 // constructor 614 640 $configArr["parameters"] = "c"; … … 619 645 // combine %1$s config with arguments 620 646 Ext.app.sf.$className.superclass.constructor.call(this, Ext.apply(this.%1$s_config, c));"; 621 $%1$s-> attributes["constructor"] = $sfExtjs3Plugin->asMethod($configArr);', $objName);647 $%1$s->methods["constructor"] = $sfExtjs3Plugin->asMethod($configArr);', $objName); 622 648 } 623 649 624 650 protected function createStandardInitComponentPartial($objName) 625 651 { 626 return sprintf('<?php 652 return sprintf('<?php // @object \$sfExtjs3Plugin string \$className and @object %1$s provided 627 653 // initComponent 628 654 $configArr["source"] = "Ext.app.sf.$className.superclass.initComponent.apply(this, arguments);"; 629 $%1$s-> attributes["initComponent"] = $sfExtjs3Plugin->asMethod($configArr);', $objName);655 $%1$s->methods["initComponent"] = $sfExtjs3Plugin->asMethod($configArr);', $objName); 630 656 } 631 657 632 658 protected function createStandardInitEventsPartial($objName) 633 659 { 634 return sprintf('<?php 660 return sprintf('<?php // @object \$sfExtjs3Plugin string \$className and @object %1$s provided 635 661 // initEvents 636 662 $configArr["source"] = "Ext.app.sf.$className.superclass.initEvents.apply(this);"; 637 $%1$s-> attributes["initEvents"] = $sfExtjs3Plugin->asMethod($configArr);', $objName);663 $%1$s->methods["initEvents"] = $sfExtjs3Plugin->asMethod($configArr);', $objName); 638 664 } 639 665 plugins/ExtjsGeneratorPlugin/trunk/lib/generator/ExtjsModelGeneratorConfiguration.class.php
r29743 r29921 16 16 { 17 17 $config = $this->getConfig(); 18 18 19 19 // inheritance rules: 20 20 // new|edit < form < default … … 22 22 // filter < default 23 23 $this->configuration = array( 24 'list' => array(25 'fields' => array(),26 'layout' => $this->getListLayout(),27 'title' => $this->getListTitle(),28 'actions' => $this->getListActions(),29 'object_actions' => $this->getListObjectActions(), 30 'params' => $this->getListParams(),31 ), 24 'list' => array( 25 'fields' => array(), 26 'layout' => $this->getListLayout(), 27 'title' => $this->getListTitle(), 28 'actions' => $this->getListActions(), 29 'object_actions' => $this->getListObjectActions(), 30 'params' => $this->getListParams() 31 ), 32 32 'filter' => array( 33 'fields' => array(),34 ), 35 'form' => array(36 'fields' => array(),37 ), 38 'new' => array(39 'fields' => array(),40 'title' => $this->getNewTitle(),41 'actions' => $this->getNewActions() ? $this->getNewActions() : $this->getFormActions() ,42 ), 43 'edit' => array(44 'fields' => array(),45 'title' => $this->getEditTitle(),46 'actions' => $this->getEditActions() ? $this->getEditActions() : $this->getFormActions() ,47 ), 48 'top_toolbar' => array(49 'config' => $this->getTopToolbarConfig(),50 'plugins' => $this->getTopToolbarPlugins(), 51 ' method' => $this->getTopToolbarPartials(),52 ), 53 'bottom_toolbar' => array(54 'config' => $this->getBottomToolbarConfig(),55 'plugins' => $this->getBottomToolbarPlugins(), 56 ' method' => $this->getBottomToolbarPartials(),57 ), 58 'datastore' => array(59 'config' => $this->getDatastoreConfig(),60 ' method' => $this->getDatastorePartials(),61 'grouping' => $this->getDatastoreGroupingConfig(),62 ), 63 'column_renderers' => array(64 ' method' => $this->getColumnRenderersPartials(),65 ), 66 'column_model' => array(67 'config' => $this->getColumnModelConfig(),68 ' method' => $this->getColumnModelPartials(),69 ), 70 'tabpanel' => array(71 'config' => $this->getTabpanelConfig(),72 'plugins' => $this->getTabpanelPlugins(), 73 ' method' => $this->getTabpanelPartials(),74 'active_tab' => $this->getTabpanelActiveTab() ,75 ), 76 'filterpanel' => array(77 'config' => $this->getFilterpanelConfig(),78 'plugins' => $this->getFilterpanelPlugins(), 79 ' method' => $this->getFilterpanelPartials(),80 ), 81 'gridpanel' => array(82 'config' => $this->getGridpanelConfig(),83 'plugins' => $this->getGridpanelPlugins(), 84 ' method' => $this->getGridpanelPartials(),85 ), 86 'formpanel' => array(87 'config' => $this->getFormpanelConfig(),88 'plugins' => $this->getFormpanelPlugins(), 89 ' method' => $this->getFormpanelPartials(),90 ), 91 'object_actions' => array(92 'method' => $this->getObjectActionsPartials(),33 'fields' => array() 34 ), 35 'form' => array( 36 'fields' => array() 37 ), 38 'new' => array( 39 'fields' => array(), 40 'title' => $this->getNewTitle(), 41 'actions' => $this->getNewActions() ? $this->getNewActions() : $this->getFormActions() 42 ), 43 'edit' => array( 44 'fields' => array(), 45 'title' => $this->getEditTitle(), 46 'actions' => $this->getEditActions() ? $this->getEditActions() : $this->getFormActions() 47 ), 48 'top_toolbar' => array( 49 'config' => $this->getTopToolbarConfig(), 50 'plugins' => $this->getTopToolbarPlugins(), 51 'partials' => $this->getTopToolbarPartials() 52 ), 53 'bottom_toolbar' => array( 54 'config' => $this->getBottomToolbarConfig(), 55 'plugins' => $this->getBottomToolbarPlugins(), 56 'partials' => $this->getBottomToolbarPartials() 57 ), 58 'datastore' => array( 59 'config' => $this->getDatastoreConfig(), 60 'partials' => $this->getDatastorePartials(), 61 'grouping' => $this->getDatastoreGroupingConfig() 62 ), 63 'column_renderers' => array( 64 'partials' => $this->getColumnRenderersPartials() 65 ), 66 'column_model' => array( 67 'config' => $this->getColumnModelConfig(), 68 'partials' => $this->getColumnModelPartials() 69 ), 70 'tabpanel' => array( 71 'config' => $this->getTabpanelConfig(), 72 'plugins' => $this->getTabpanelPlugins(), 73 'partials' => $this->getTabpanelPartials(), 74 'active_tab' => $this->getTabpanelActiveTab() 75 ), 76 'filterpanel' => array( 77 'config' => $this->getFilterpanelConfig(), 78 'plugins' => $this->getFilterpanelPlugins(), 79 'partials' => $this->getFilterpanelPartials() 80 ), 81 'gridpanel' => array( 82 'config' => $this->getGridpanelConfig(), 83 'plugins' => $this->getGridpanelPlugins(), 84 'partials' => $this->getGridpanelPartials() 85 ), 86 'formpanel' => array( 87 'config' => $this->getFormpanelConfig(), 88 'plugins' => $this->getFormpanelPlugins(), 89 'partials' => $this->getFormpanelPartials() 90 ), 91 'object_actions' => array( 92 'method' => $this->getObjectActionsPartials() 93 93 ), 94 94 );