Changeset 8909
- Timestamp:
- 05/11/08 17:06:38 (2 months ago)
- Files:
-
- plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/__list_ajax_action.php (modified) (1 diff)
- plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_columnmodel_js.php (modified) (2 diffs)
- plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_datastore_js.php (modified) (3 diffs)
- plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_toolbar_paging_js.php (modified) (2 diffs)
- plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_toolbar_top_js.php (modified) (3 diffs)
- plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_related_ajax_renderer.php (modified) (4 diffs)
- plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/listAjaxGridPanelJsSuccess.pjs (modified) (5 diffs)
- plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/listJsSuccess.pjs (modified) (1 diff)
- plugins/sfExtjsThemePlugin/lib/sfExtjsPropelAdminGenerator.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/__list_ajax_action.php
r8380 r8909 7 7 8 8 ?> 9 <?php echo $this->addCredentialCondition($this->getAjaxButtonToToolbarAction ($actionName, $params, false), $params) ?>9 <?php echo $this->addCredentialCondition($this->getAjaxButtonToToolbarActionOBSOLETE($actionName, $params, false), $params) ?> plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_columnmodel_js.php
r8834 r8909 105 105 // constructor 106 106 $sfExtjs2_<?php echo $cmName ?>_constructor = " 107 // todocombine <?php echo $cmName ?>Config with arguments108 Ext.app.sx.<?php echo $cmName ?>.superclass.constructor. apply(this, [<?php echo $cmName ?>Config]);107 // combine <?php echo $cmName ?>Config with arguments 108 Ext.app.sx.<?php echo $cmName ?>.superclass.constructor.call(this, Ext.apply(<?php echo $cmName ?>Config, c)); 109 109 "; 110 110 … … 123 123 'Ext.grid.ColumnModel', 124 124 array ( 125 'constructor' => $sfExtjs2Plugin->asMethod($sfExtjs2_<?php echo $cmName ?>_constructor), 125 'constructor' => $sfExtjs2Plugin->asMethod(array( 126 'parameters' => 'c', 127 'source' => $sfExtjs2_<?php echo $cmName ?>_constructor 128 )), 126 129 'initComponent' => $sfExtjs2Plugin->asMethod($sfExtjs2_<?php echo $cmName ?>_initComponent), 127 130 ) plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_datastore_js.php
r8849 r8909 81 81 82 82 ?> 83 84 83 var <?php echo $storeName ?>Config = <?php echo $config ?>; 84 85 85 86 86 [?php … … 88 88 // constructor 89 89 $sfExtjs2_<?php echo $storeName ?>_constructor = " 90 Ext.app.sx.<?php echo $storeName ?>.superclass.constructor.apply(this, arguments); 90 // combine <?php echo $storeName ?>Config with arguments 91 Ext.app.sx.<?php echo $storeName ?>.superclass.constructor.call(this, Ext.apply(<?php echo $storeName ?>Config, c)); 91 92 "; 92 93 93 94 // initComponent 94 95 $sfExtjs2_<?php echo $storeName ?>_initComponent = " 95 //apply extra config96 Ext.apply(this, this.initialConfig, <?php echo $storeName ?>Config);97 96 //call parent 98 97 Ext.app.sx.<?php echo $storeName ?>.superclass.initComponent.apply(this, arguments); … … 106 105 'Ext.data.<?php echo $store ?>', 107 106 array ( 108 'constructor' => $sfExtjs2Plugin->asMethod($sfExtjs2_<?php echo $storeName ?>_constructor), 107 'constructor' => $sfExtjs2Plugin->asMethod(array( 108 'parameters' => 'c', 109 'source' => $sfExtjs2_<?php echo $storeName ?>_constructor 110 )), 109 111 'initComponent' => $sfExtjs2Plugin->asMethod($sfExtjs2_<?php echo $storeName ?>_initComponent), 110 112 ) plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_toolbar_paging_js.php
r8866 r8909 35 35 // constructor 36 36 $sfExtjs2_<?php echo $toolbarName ?>_constructor = " 37 Ext.app.sx.<?php echo $toolbarName ?>.superclass.constructor.apply(this, arguments); 37 // combine <?php echo $toolbarName ?>Config with arguments 38 Ext.app.sx.<?php echo $toolbarName ?>.superclass.constructor.call(this, Ext.apply(<?php echo $toolbarName ?>Config, c)); 38 39 "; 39 40 40 41 // initComponent 41 42 $sfExtjs2_<?php echo $toolbarName ?>_initComponent = " 42 //apply extra config43 Ext.apply(this, this.initialConfig, <?php echo $toolbarName ?>Config);44 43 //call parent 45 44 Ext.app.sx.<?php echo $toolbarName ?>.superclass.initComponent.apply(this, arguments); … … 54 53 'Ext.PagingToolbar', 55 54 array ( 56 'constructor' => $sfExtjs2Plugin->asMethod($sfExtjs2_<?php echo $toolbarName ?>_constructor), 55 'constructor' => $sfExtjs2Plugin->asMethod(array( 56 'parameters' => 'c', 57 'source' => $sfExtjs2_<?php echo $toolbarName ?>_constructor 58 )), 57 59 'initComponent' => $sfExtjs2Plugin->asMethod($sfExtjs2_<?php echo $toolbarName ?>_initComponent), 58 60 ) plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_toolbar_top_js.php
r8898 r8909 35 35 36 36 <?php foreach ((array) $listActions as $actionName => $params): ?> 37 <?php echo $this->addCredentialCondition("\$config['attributes']['items'][] = \$sfExtjs2Plugin->asAnonymousClass(array(".$this->getAjaxButtonToToolbarAction 2($actionName, $params, false)."));\n\n", $params) ?>37 <?php echo $this->addCredentialCondition("\$config['attributes']['items'][] = \$sfExtjs2Plugin->asAnonymousClass(array(".$this->getAjaxButtonToToolbarAction($actionName, $params, false)."));\n\n", $params) ?> 38 38 <?php endforeach ?> 39 39 … … 42 42 // constructor 43 43 $sfExtjs2_<?php echo $toolbarName ?>_constructor = " 44 Ext.app.sx.<?php echo $toolbarName ?>.superclass.constructor.apply(this, arguments); 44 // combine <?php echo $toolbarName ?>Config with arguments 45 Ext.app.sx.<?php echo $toolbarName ?>.superclass.constructor.call(this, Ext.apply(<?php echo $toolbarName ?>Config, c)); 45 46 "; 46 47 47 48 // initComponent 48 49 $sfExtjs2_<?php echo $toolbarName ?>_initComponent = " 49 //apply extra config50 Ext.apply(this, this.initialConfig, <?php echo $toolbarName ?>Config);51 50 //call parent 52 51 Ext.app.sx.<?php echo $toolbarName ?>.superclass.initComponent.apply(this, arguments); … … 61 60 'Ext.Toolbar', 62 61 array ( 63 'constructor' => $sfExtjs2Plugin->asMethod($sfExtjs2_<?php echo $toolbarName ?>_constructor), 62 'constructor' => $sfExtjs2Plugin->asMethod(array( 63 'parameters' => 'c', 64 'source' => $sfExtjs2_<?php echo $toolbarName ?>_constructor 65 )), 64 66 'initComponent' => $sfExtjs2Plugin->asMethod($sfExtjs2_<?php echo $toolbarName ?>_initComponent), 65 67 ) plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_related_ajax_renderer.php
r8407 r8909 50 50 [?php if ($sf_user->hasCredential(<?php echo $credentials ?>)): ?] 51 51 <?php endif; ?> 52 53 function render<?php echo $camelizedKey ?>Field(value, params, record, attr) { 52 function render<?php echo $camelizedKey ?>Field(value, params, record, rowIndex, i, ds) { 54 53 if (value) { 55 54 <?php … … 65 64 result = <?php echo $storeName ?>.getById(value).get('<?php echo $displayField ?>'); 66 65 // if not in foreign datastore, test if it is preloaded (this can be out-dated therefor do it after checking datastore) 67 } else if ((index = ds _list.find('<?php echo str_replace('/', $tableDelimiter, $relatedTableFKs) ?>', value)) != -1) {66 } else if ((index = ds.find('<?php echo str_replace('/', $tableDelimiter, $relatedTableFKs) ?>', value)) != -1) { 68 67 // foreign-ID not known in foreign-store yet, add preloaded data from the main-store 69 <?php echo $camelizedKey?>AddPreloadedFromIndex(index, value );68 <?php echo $camelizedKey?>AddPreloadedFromIndex(index, value, ds); 70 69 71 result = ds _list.getAt(index).get('<?php echo str_replace('/', $tableDelimiter, $column->key) ?>');70 result = ds.getAt(index).get('<?php echo str_replace('/', $tableDelimiter, $column->key) ?>'); 72 71 } else { 73 72 //TODO if value still not found the foreign-data-store should get it from the server! (but I don't think this will be necesarry occur) … … 86 85 87 86 // Define related renderer-helpers to show preloaded data; prevent loading all related data stores 88 function <?php echo $camelizedKey ?>AddPreloadedFromIndex(index, value ) {87 function <?php echo $camelizedKey ?>AddPreloadedFromIndex(index, value, ds) { 89 88 <?php 90 89 $hs2 = array(); … … 137 136 [?php if ($sf_user->hasCredential(<?php echo $credentials ?>)): ?] 138 137 <?php endif; ?> 139 record_data['<?php echo $this->getRelatedFieldName($column2); ?>'] = ds _list.getAt(index).get('<?php echo str_replace('/', $tableDelimiter, $relatedTableFKs).$tableDelimiter.$column2->getName() ?>');138 record_data['<?php echo $this->getRelatedFieldName($column2); ?>'] = ds.getAt(index).get('<?php echo str_replace('/', $tableDelimiter, $relatedTableFKs).$tableDelimiter.$column2->getName() ?>'); 140 139 <?php if ($credentials): ?> 141 140 [?php endif; ?] plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/listAjaxGridPanelJsSuccess.pjs
r8864 r8909 24 24 ?] 25 25 26 //TODO: check related-stores and renderers for improvements... imported directly from old-style (hence missing the _js suffix) 27 [?php include_partial('related_ajax_stores') ?] 28 26 29 [?php include_partial('list_ajax_renderer') ?] 27 30 [?php include_partial('related_ajax_renderer') ?] … … 48 51 'autoHeight' => true, 49 52 'autoScroll' => true, //TODO: need some work 53 54 'autoLoadStore' => true, 50 55 51 56 'selModel' => $sfExtjs2Plugin->RowSelectionModel(array( … … 76 81 // constructor 77 82 $sfExtjs2_<?php echo $panelName ?>_constructor = " 78 Ext.app.sx.<?php echo $panelName ?>.superclass.constructor.apply(this, arguments); 83 // combine <?php echo $panelName ?>Config with arguments 84 Ext.app.sx.<?php echo $panelName ?>.superclass.constructor.call(this, Ext.apply(<?php echo $panelName ?>Config, c)); 79 85 "; 80 86 81 87 // initComponent 82 88 $sfExtjs2_<?php echo $panelName ?>_initComponent = " 83 //apply extra config84 Ext.apply(this, this.initialConfig, <?php echo $panelName ?>Config);85 89 //call parent 86 90 Ext.app.sx.<?php echo $panelName ?>.superclass.initComponent.apply(this, arguments); … … 88 92 // this.addEvents( //TODO 89 93 // ); 94 95 if (this.autoLoadStore){ 96 this.store.load.defer(10, this.store, [ 97 typeof this.autoLoadStore == 'object' ? this.autoLoadStore : undefined 98 ]); 99 }; 90 100 91 101 "; … … 105 115 'Ext.grid.EditorGridPanel', 106 116 array ( 107 'constructor' => $sfExtjs2Plugin->asMethod($sfExtjs2_<?php echo $panelName ?>_constructor), 117 'constructor' => $sfExtjs2Plugin->asMethod(array( 118 'parameters' => 'c', 119 'source' => $sfExtjs2_<?php echo $panelName ?>_constructor 120 )), 108 121 'initComponent' => $sfExtjs2Plugin->asMethod($sfExtjs2_<?php echo $panelName ?>_initComponent), 109 122 'initEvents' => $sfExtjs2Plugin->asMethod($sfExtjs2_<?php echo $panelName ?>_initEvents), plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/listJsSuccess.pjs
r7873 r8909 1 1 [?php /* * Created on 2-sep-2007 * * by Leon van der Ree */ ?] 2 2 <?php 3 //this file is OBSOLETE 3 4 $included=true; 4 5 include('_list_ajax_layout.php'); plugins/sfExtjsThemePlugin/lib/sfExtjsPropelAdminGenerator.php
r8898 r8909 18 18 * @return string javascript code 19 19 */ 20 function getAjaxButtonToToolbarAction ($actionName, $params, $pk_link = false)20 function getAjaxButtonToToolbarActionOBSOLETE($actionName, $params, $pk_link = false) 21 21 { 22 22 // get the controller, used for URL creation … … 207 207 * @return string javascript code 208 208 */ 209 function getAjaxButtonToToolbarAction 2($actionName, $params, $pk_link = false)209 function getAjaxButtonToToolbarAction($actionName, $params, $pk_link = false) 210 210 { 211 211 // get the controller, used for URL creation