Changeset 10288
- Timestamp:
- 07/15/08 00:48:31 (4 months ago)
- Files:
-
- plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/__edit_ajax_form_inner.php (modified) (8 diffs)
- plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_edit_ajax_form.php (modified) (5 diffs)
- plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_gridpanel_js.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/__edit_ajax_form_inner.php
r10256 r10288 1 1 <?php 2 // TAKES $form _config and sets $form_config['items'] and $form_config['buttons'] recursively (per (tab)page)2 // TAKES $formpanel->config_array and sets $formpanel->config_array['items'] and $formpanel->config_array['buttons'] recursively (per (tab)page) 3 3 // REQUIRES $edit_key (for current edit.display (or edit.page.pagename.display, etc) 4 4 … … 49 49 [?php if ($sf_user->hasCredential(<?php echo str_replace("\n", ' ', var_export($credentials, true)) ?>)): ?] 50 50 <?php endif; ?> 51 $form _config['items'][] = <?php var_export($this->getColumnAjaxEditDefinition($column, $groupedColumns, $edit_key)) ?>;51 $formpanel->config_array['items'][] = <?php var_export($this->getColumnAjaxEditDefinition($column, $groupedColumns, $edit_key)) ?>; 52 52 <?php if ($credentials): ?> 53 53 [?php endif; ?] … … 90 90 <?php endif; ?> 91 91 <?php endforeach; ?> 92 $form _config['items'][] = $fieldset;92 $formpanel->config_array['items'][] = $fieldset; 93 93 <?php endforeach; ?> 94 94 <?php if (count($pages) > 0): ?> 95 $form_config_org[] = $form _config;95 $form_config_org[] = $formpanel->config_array; 96 96 $tabpages_config_items = array(); 97 97 <?php foreach($pages as $pageName => $page): ?> … … 125 125 ?> 126 126 127 $form _config= array();127 $formpanel->config_array = array(); 128 128 // TODO: this brakes recursion of tab-pages in tab-pages at the moment (it includes itself over and over again... 129 129 include('_tabpage_<?php echo $edit_key_name ?>.php'); … … 137 137 // 'height' => 323, 138 138 139 'items' => $form _config['items']139 'items' => $formpanel->config_array['items'] 140 140 ); 141 141 142 if (isset($form _config['buttons']) && ($form_config['buttons']!=array()))142 if (isset($formpanel->config_array['buttons']) && ($formpanel->config_array['buttons']!=array())) 143 143 { 144 $tab_page_form['buttons'] = $form _config['buttons'];144 $tab_page_form['buttons'] = $formpanel->config_array['buttons']; 145 145 } 146 146 … … 148 148 <?php endforeach ?> 149 149 //restore $form_connfig after iterations 150 $form _config= array_pop($form_config_org);150 $formpanel->config_array = array_pop($form_config_org); 151 151 152 152 $tabpages_config = $sfExtjs2Plugin->asAnonymousClass(array( … … 168 168 169 169 // add tab-pages to formpanel 170 $form _config['items'][] = $tabpages_config;170 $formpanel->config_array['items'][] = $tabpages_config; 171 171 172 172 <?php endif ?> … … 187 187 188 188 if (count($editActions) > 0): ?> 189 $form _config['buttons'] = array();189 $formpanel->config_array['buttons'] = array(); 190 190 <?php foreach ($editActions as $actionName => $params): ?> 191 191 //TODO: add credential check 192 $form _config['buttons'][] = <?php var_export($this->getEditAjaxActionToButton($actionName, $params, $edit_ns, true)) ?>;192 $formpanel->config_array['buttons'][] = <?php var_export($this->getEditAjaxActionToButton($actionName, $params, $edit_ns, true)) ?>; 193 193 <?php endforeach ?> 194 194 <?php endif ?> plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_edit_ajax_form.php
r10256 r10288 15 15 sfLoader::loadHelpers('Extjs'); 16 16 17 $formpanel = new stdClass(); 18 $formpanel->attributes = array(); 19 20 //TODO: rewrite with include partial, without ob_start 17 21 ob_start(); 18 22 require('_edit_ajax_reader.php'); 19 $ sfExtjs2_<?php echo $formName ?>_reader = trim(ob_get_clean());23 $formpanel->reader = trim(ob_get_clean()); 20 24 21 25 22 26 <?php $objectName = $this->getParameterValue('object_name', $this->getModuleName()) ?> 23 27 24 $form _config= array(28 $formpanel->config_array = array( 25 29 'xtype' => 'form', 26 30 // 'baseCls => 'x-plain', … … 47 51 'defaultType' => 'textfield', 48 52 49 'reader' => $ sfExtjs2_<?php echo $formName ?>_reader,53 'reader' => $formpanel->reader, 50 54 51 55 'baseParams' => array( … … 55 59 'method' => 'post', 56 60 57 <?php if (($width = $this->getParameterValue('edit. width', 400)) != 'fill'): ?>61 <?php if (($width = $this->getParameterValue('edit.params.width', 400)) != 'fill'): ?> 58 62 'width' => <?php echo $width ?>, 59 63 <?php endif; ?> 60 64 61 65 ); 62 66 <?php 67 $user_params = $this->getParameterValue('edit.params', array()); 68 if (is_array($user_params)): 69 ?> 70 $formpanel->config_array = array_merge($formpanel->config_array, <?php var_export($user_params) ?>); 71 <?php endif; ?> 72 <?php 73 74 75 $methods = $this->getParameterValue('formpanel.method'); 76 if (isset($methods['partials'])): 77 if (!is_array($methods['partials'])) 78 { 79 $methods['partials'] = array($methods['partials']); 80 } 81 ?> 82 // generator method partials 83 <?php 84 foreach($methods['partials'] as $method): 85 ?> 86 include_partial('<?php echo substr($method,1) ?>', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'formpanel' => $formpanel)); 87 <?php 88 $this->createPartialFile($method,'<?php // @object $sfExtjs2Plugin and @object $formpanel provided ?>'); 89 endforeach; 90 endif; 91 92 93 ?> 63 94 <?php 64 95 // add fields, fieldsets, tab-pages and buttons … … 72 103 'source' => " 73 104 // combine <?php echo $formName ?>Config with arguments 74 Ext.app.sx.<?php echo $formName ?>.superclass.constructor.call(this, Ext.apply(".$sfExtjs2Plugin->asAnonymousClass($form _config).", c));105 Ext.app.sx.<?php echo $formName ?>.superclass.constructor.call(this, Ext.apply(".$sfExtjs2Plugin->asAnonymousClass($formpanel->config_array).", c)); 75 106 76 107 this.modulename = '<?php echo $this->getModuleName() ?>'; … … 316 347 '<?php echo $formName ?>', 317 348 'Ext.FormPanel', 318 array ( 319 'constructor' => $sfExtjs2_<?php echo $formName ?>_constructor, 320 'initComponent' => $sfExtjs2_<?php echo $formName ?>_initComponent, 321 322 'getModulename' => $sfExtjs2_<?php echo $formName ?>_getModulename, 323 'getPanelType' => $sfExtjs2_<?php echo $formName ?>_getPanelType, 324 325 'getKey' => $sfExtjs2_<?php echo $formName ?>_getKey, 326 'setKey' => $sfExtjs2_<?php echo $formName ?>_setKey, 327 328 'isNew' => $sfExtjs2_<?php echo $formName ?>_isNew, 329 'updateButtonsVisibility' => $sfExtjs2_<?php echo $formName ?>_updateButtonsVisibility, 330 331 'loadItem' => $sfExtjs2_<?php echo $formName ?>_loadItem, 332 'onLoadSuccess' => $sfExtjs2_<?php echo $formName ?>_onLoadSuccess, 333 334 'doSubmit' => $sfExtjs2_<?php echo $formName ?>_doSubmit, 335 'onSubmitSuccess' => $sfExtjs2_<?php echo $formName ?>_onSubmitSuccess, 336 'onSubmitFailure' => $sfExtjs2_<?php echo $formName ?>_onSubmitFailure, 337 338 'deleteItem' => $sfExtjs2_<?php echo $formName ?>_deleteItem, 339 340 'showError' => $sfExtjs2_<?php echo $formName ?>_showError, 349 array_merge( 350 array ( 351 'constructor' => $sfExtjs2_<?php echo $formName ?>_constructor, 352 'initComponent' => $sfExtjs2_<?php echo $formName ?>_initComponent, 353 354 'getModulename' => $sfExtjs2_<?php echo $formName ?>_getModulename, 355 'getPanelType' => $sfExtjs2_<?php echo $formName ?>_getPanelType, 356 357 'getKey' => $sfExtjs2_<?php echo $formName ?>_getKey, 358 'setKey' => $sfExtjs2_<?php echo $formName ?>_setKey, 359 360 'isNew' => $sfExtjs2_<?php echo $formName ?>_isNew, 361 'updateButtonsVisibility' => $sfExtjs2_<?php echo $formName ?>_updateButtonsVisibility, 362 363 'loadItem' => $sfExtjs2_<?php echo $formName ?>_loadItem, 364 'onLoadSuccess' => $sfExtjs2_<?php echo $formName ?>_onLoadSuccess, 365 366 'doSubmit' => $sfExtjs2_<?php echo $formName ?>_doSubmit, 367 'onSubmitSuccess' => $sfExtjs2_<?php echo $formName ?>_onSubmitSuccess, 368 'onSubmitFailure' => $sfExtjs2_<?php echo $formName ?>_onSubmitFailure, 369 370 'deleteItem' => $sfExtjs2_<?php echo $formName ?>_deleteItem, 371 372 'showError' => $sfExtjs2_<?php echo $formName ?>_showError, 373 ), 374 $formpanel->attributes // TODO: all methods above should be placed in $formpanel as done with the gridpanel 341 375 ) 342 376 ); plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_gridpanel_js.php
r10129 r10288 46 46 $gridpanel->config_array['autoExpandColumn'] = '<?php echo $this->getParameterValue('list.auto_expand_column') ?>'; 47 47 <?php endif; ?> 48 <? 48 <?php 49 49 $user_params = $this->getParameterValue('list.params', array()); 50 50