Development

Changeset 12508 for plugins/sfExtjsThemePlugin

You must first sign up to be able to contribute.

Show
Ignore:
Timestamp:
10/31/08 21:09:52 (5 years ago)
Author:
KRavEN
Message:

Moved columnmodel config to the generator
Moved store config to the generator
Moved gridpanel config to the generator
Moved custom methods and variable generation for all classes to the generator

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfExtjsThemePlugin/branches/Extjs2DBFGeneratorThemePlugin/data/generator/DbFinderAdmin/extjs2/template/actions/actions.class.php

    r12497 r12508  
    438438  { 
    439439<?php 
    440   foreach ($this->DbFinderAdminGenerator->getUniqueDisplayColumns() as $column): 
     440  foreach ($this->DbFinderAdminGenerator->getUniqueListDisplayColumns() as $column): 
    441441    $type = $this->DbFinderAdminGenerator->getFieldType($column); 
    442442    $name = str_replace('::','.',sfInflector::camelize($column->getName())); 
  • plugins/sfExtjsThemePlugin/branches/Extjs2DBFGeneratorThemePlugin/data/generator/DbFinderAdmin/extjs2/template/templates/_list_columnmodel_js.php

    r12379 r12508  
    11<?php 
    22  $moduleName = ucfirst(sfInflector::camelize($this->getModuleName())); 
    3   $cmName = "List".$moduleName.'ColumnModel'; 
    4   $rendererName = "List".$moduleName.'Renderers'; 
     3  $cmConfig = $this->DbFinderAdminGenerator->getColumnModelConfig(); 
     4  $cmName = "List".$moduleName."ColumnModel"; 
     5  $cm_xtype = strtolower($cmName); 
    56?> 
    67[?php 
     
    910$columnmodel->attributes = array(); 
    1011 
    11 // cmConfig Var 
    12 include_partial('list_columnmodel_variable_cmConfig_js', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'columnmodel' => $columnmodel)); 
     12$columnmodel->config_array = <?php echo preg_replace("/'(get_partial\([^\)]*\))',/", '\1,', var_export($cmConfig['col_items'], true)) ?>; 
     13 
     14$columnmodel->plugins = <?php var_export($cmConfig['plugins']) ?>; 
     15 
     16/* handle user credentials */ 
     17<?php echo implode("\n", $cmConfig['cred_arr']) ?> 
     18 
     19<?php 
     20  $user_params = $this->getParameterValue('columnmodel.params', array()); 
     21  if (is_array($user_params)): 
     22?> 
     23$columnmodel->config_array = array_merge($columnmodel->config_array, <?php var_export($user_params) ?>); 
     24<?php endif; ?> 
    1325 
    1426// constructor 
     
    1729// initComponent 
    1830include_partial('list_columnmodel_method_initComponent_js', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'columnmodel' => $columnmodel)); 
    19  
    20 <?php 
    21 $methods =  $this->getParameterValue('columnmodel.method'); 
    22 if(isset($methods['partials'])): 
    23 if (!is_array($methods['partials'])) 
    24 
    25   $methods['partials'] = array($methods['partials']); 
    26 
    27 ?> 
    28 // generator method partials 
    29 <?php 
    30   foreach($methods['partials'] as $method): 
    31 ?> 
    32 include_partial('<?php echo substr($method,1) ?>', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'columnmodel' => $columnmodel)); 
    33 <?php 
    34     $this->DbFinderAdminGenerator->createPartialFile($method,'<?php // @object $sfExtjs2Plugin and @object $columnmodel provided ?>'); 
    35   endforeach; 
    36 endif; 
    37  
    38 $variables =  $this->getParameterValue('columnmodel.variable'); 
    39 if (isset($variables['partials'])): 
    40 if (!is_array($variables['partials'])) 
    41 
    42   $variables['partials'] = array($variables['partials']); 
    43 
    44 ?> 
    45 // generator variable partials 
    46 <?php 
    47   foreach($variables['partials'] as $variable): 
    48 ?> 
    49 include_partial('<?php echo substr($variable,1) ?>', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'columnmodel' => $columnmodel)); 
    50 <?php 
    51   $this->DbFinderAdminGenerator->createPartialFile($variable,'<?php // @object $sfExtjs2Plugin and @object $columnmodel provided ?>'); 
    52   endforeach; 
    53 endif; 
    54 ?> 
    55  
     31<?php echo $this->DbFinderAdminGenerator->getCustomPartials('columnmodel','method'); ?> 
     32<?php echo $this->DbFinderAdminGenerator->getCustomPartials('columnmodel','variable'); ?> 
    5633$sfExtjs2Plugin->beginClass( 
    5734  'Ext.app.sx', 
    5835  '<?php echo $cmName ?>', 
    59   'Ext.app.sx.<?php echo $rendererName ?>', 
     36  'Ext.app.sx.<?php echo "List".$moduleName."Renderers" ?>', 
    6037  $columnmodel->attributes 
    6138); 
     39 
    6240$sfExtjs2Plugin->endClass(); 
    63  
    6441?] 
     42// register xtype 
     43Ext.reg('<?php echo $cm_xtype ?>', Ext.app.sx.<?php echo $cmName ?>); 
  • plugins/sfExtjsThemePlugin/branches/Extjs2DBFGeneratorThemePlugin/data/generator/DbFinderAdmin/extjs2/template/templates/_list_columnmodel_method_constructor_js.php

    r12379 r12508  
    22  $moduleName = ucfirst(sfInflector::camelize($this->getModuleName())); 
    33  $cmName = "List".$moduleName."ColumnModel"; 
    4  
    54?> 
    65 
  • plugins/sfExtjsThemePlugin/branches/Extjs2DBFGeneratorThemePlugin/data/generator/DbFinderAdmin/extjs2/template/templates/_list_filterpanel_js.php

    r12392 r12508  
    22  $moduleName = ucfirst(sfInflector::camelize($this->getModuleName())); 
    33  $panelName = "List".$moduleName."FilterPanel"; 
    4   $panelName_xtype = "list".$this->getModuleName()."filterpanel"
     4  $panelName_xtype = strtolower($panelName)
    55  $limit = $this->getParameterValue('list.max_per_page', sfConfig::get('app_extjs2_dbfgen_theme_plugin_list_max_per_page', 20)); 
    66 
     
    108108// initEvents 
    109109include_partial('list_filterpanel_method_initEvents_js', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'filterpanel' => $filterpanel)); 
    110  
    111  
    112 <?php 
    113 $methods =  $this->getParameterValue('filterpanel.method'); 
    114 if(isset($methods['partials'])): 
    115 if (!is_array($methods['partials'])) 
    116 
    117   $methods['partials'] = array($methods['partials']); 
    118 
    119 ?> 
    120 // generator method partials 
    121 <?php 
    122   foreach($methods['partials'] as $method): 
    123 ?> 
    124 include_partial('<?php echo substr($method,1) ?>', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'filterpanel' => $filterpanel)); 
    125 <?php 
    126     $this->DbFinderAdminGenerator->createPartialFile($method,'<?php // @object $sfExtjs2Plugin and @object $filterpanel provided ?>'); 
    127   endforeach; 
    128 endif; 
    129  
    130 $variables =  $this->getParameterValue('filterpanel.variable'); 
    131 if (isset($variables['partials'])): 
    132 if (!is_array($variables['partials'])) 
    133 
    134   $variables['partials'] = array($variables['partials']); 
    135 
    136 ?> 
    137 // generator variable partials 
    138 <?php 
    139   foreach($variables['partials'] as $variable): 
    140 ?> 
    141 include_partial('<?php echo substr($variable,1) ?>', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'filterpanel' => $filterpanel)); 
    142 <?php 
    143     $this->DbFinderAdminGenerator->createPartialFile($variable,'<?php // @object $sfExtjs2Plugin and @object $filterpanel provided ?>'); 
    144   endforeach; 
    145 endif; 
    146 ?> 
    147  
     110<?php echo $this->DbFinderAdminGenerator->getCustomPartials('filterpanel','method'); ?> 
     111<?php echo $this->DbFinderAdminGenerator->getCustomPartials('filterpanel','variable'); ?> 
    148112// create the Ext.app.sx.<?php echo $panelName ?> class 
    149113$sfExtjs2Plugin->beginClass( 
  • plugins/sfExtjsThemePlugin/branches/Extjs2DBFGeneratorThemePlugin/data/generator/DbFinderAdmin/extjs2/template/templates/_list_gridpanel_js.php

    r12392 r12508  
    22  $moduleName = ucfirst(sfInflector::camelize($this->getModuleName())); 
    33  $panelName = "List".$moduleName."GridPanel"; 
    4   $panelName_xtype = "list".$this->getModuleName()."gridpanel"; 
    5  
    6   $group_field = $this->getParameterValue('list.grouping.field', null); 
    7  
    8   if($this->getParameterValue('list.grouping.text_tpl',false)) $grid_view['groupTextTpl'] = $this->getParameterValue('list.grouping.text_tpl'); 
    9  
    10   $listDisplay = $this->getParameterValue('list.display', null); 
    11  
    12   $expander =  $this->getParameterValue('list.expand_columns'); 
    13  
     4  $panelName_xtype = strtolower($panelName); 
     5  $group_field = $this->getParameterValue('list.grouping.field', false); 
     6  $objectName = $this->getParameterValue('object_name', $this->getModuleName()); 
    147  $limit = $this->getParameterValue('list.max_per_page', sfConfig::get('app_extjs2_dbfgen_theme_plugin_list_max_per_page', 20)); 
    15   $pluginArr = false; 
    16  
    17   if($this->getParameterValue('list.plugins')) 
    18   { 
    19     $pluginArr = (!is_array($this->getParameterValue('list.plugins'))) ? array($this->getParameterValue('list.plugins')) : $this->getParameterValue('list.plugins'); 
    20   } 
    21  
    22   if (isset($expander['renderer_partial'])) 
    23   { 
    24     $pluginArr[] = 'this.rowExpander'; 
    25   } 
    26  
    27   if (isset($listDisplay)) 
    28   { 
    29     foreach($this->getParameterValue('list.display') as $col) 
    30     { 
    31       if($this->getParameterValue('list.fields.'.$col.'.plugin')) $pluginArr[] = 'this.cm.'.$col.'_'.$this->getParameterValue('list.fields.'.$col.'.plugin'); 
    32       if($col == '^rowactions') $pluginArr[] = 'this.cm.'.strtolower($moduleName).'_rowactions'; 
    33     } 
    34   } 
    35  
     8  $gridConfig = $this->DbFinderAdminGenerator->getGridPanelConfig(); 
    369?> 
    3710[?php 
     
    4114/* gridPanel Configuration */ 
    4215 
    43 <?php $objectName = $this->getParameterValue('object_name', $this->getModuleName()) ?> 
    44  
    4516$sfExtjs2_gridpanel_view = 'new Ext.grid.<?php echo (($group_field)?'Grouping':'Grid') ?>View()'; 
    4617 
    47 <?php if (isset($expander['renderer_partial'])): ?> 
     18<?php if (!empty($gridConfig['expander_partial'])): ?> 
    4819// initialise the row expander plugin 
    4920$gridpanel->rowExpander = 'this.getRowExpander();'; 
     21 
    5022<?php endif; ?> 
    5123$gridpanel->column_model = 'new Ext.app.sx.<?php echo 'List'.$moduleName.'ColumnModel' ?>()'; 
     
    5931  'autoScroll'          => true,  //needed to set a height on the toolbar so the scroll doesnt mess up when adding buttons to an empty bar 
    6032  'autoLoadStore'       => true, 
    61   'selModel'            => $sfExtjs2Plugin->RowSelectionModel(array( 
    62                             'singleSelect' => <?php echo $this->getParameterValue('list.single_select', true) ? 'true' : 'false' ?> // this should probably also be defined application wide 
    63                            )), 
    64   'clicksToEdit'        => <?php var_export(sfConfig::get('app_extjs2_dbfgen_theme_plugin_list_clicksToEdit', 1)) ?>, 
    65   'trackMouseOver'      => <?php var_export(sfConfig::get('app_extjs2_dbfgen_theme_plugin_list_trackMouseOver', false)) ?>, //this will cause the firefox permission denied errors if true 
    66   'loadMask'            => <?php var_export(sfConfig::get('app_extjs2_dbfgen_theme_plugin_list_loadMask', false)) ?>, 
    67   'stripeRows'          => <?php var_export(sfConfig::get('app_extjs2_dbfgen_theme_plugin_list_stripeRows', true)) ?>, 
     33  'clicksToEdit'        => 1, 
     34  'trackMouseOver'      => false, //this will cause the firefox permission denied errors if true 
     35  'loadMask'            => false, 
     36  'stripeRows'          => true, 
    6837  'viewConfig'          => $sfExtjs2Plugin->asAnonymousClass(array('forceFit'=>true)), 
    6938); 
     
    7140<?php if (sfConfig::get('app_extjs2_dbfgen_theme_plugin_list_tabbed')): ?> 
    7241$gridpanel->config_array['header'] = false; 
     42 
    7343<?php endif; ?> 
     44// get plugins from generator 
     45<?php if(is_array($gridConfig['plugin_arr'])): ?> 
     46$gridpanel->config_array['plugins'] = <?php echo var_export($gridConfig['plugin_arr']); ?>; 
    7447 
    75 // get plugins from generator 
    76 <?php if(is_array($pluginArr)): ?> 
    77 $gridpanel->config_array['plugins'] = <?php echo var_export($pluginArr); ?>; 
    7848<?php endif; ?> 
     49<?php if (is_array($gridConfig['user_params'])):?> 
    7950 
    80 <?php 
    81   $user_params = $this->getParameterValue('gridpanel.params', array()); 
    82  
    83   if (isset($user_params['bbar'])) unset($user_params['bbar']); 
    84   if (isset($user_params['tbar'])) unset($user_params['tbar']); 
    85  
    86   if (is_array($user_params)): 
    87 ?> 
    88 $gridpanel->config_array = array_merge($gridpanel->config_array, <?php var_export($user_params) ?>); 
     51$gridpanel->config_array = array_merge($gridpanel->config_array, <?php var_export($gridConfig['user_params']) ?>); 
    8952<?php endif; ?> 
    90  
    9153/* gridPanel methods and variables */ 
    9254 
     
    10870// updateDB 
    10971include_partial('list_gridpanel_method_updateDB_js', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'gridpanel' => $gridpanel)); 
     72<?php echo $this->DbFinderAdminGenerator->getCustomPartials('gridpanel','method'); ?> 
     73<?php echo $this->DbFinderAdminGenerator->getCustomPartials('gridpanel','variable'); ?> 
     74<?php echo $gridConfig['expander_partial'] ?> 
    11075 
    11176// setFilter 
     
    139104} 
    140105 
    141 <?php 
    142 $methods =  $this->getParameterValue('gridpanel.method'); 
    143 if (isset($methods['partials'])): 
    144 if (!is_array($methods['partials'])) 
    145 { 
    146   $methods['partials'] = array($methods['partials']); 
    147 } 
    148 ?> 
    149 // generator method partials 
    150 <?php 
    151   foreach($methods['partials'] as $method): 
    152 ?> 
    153 include_partial('<?php echo substr($method,1) ?>', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'gridpanel' => $gridpanel)); 
    154 <?php 
    155     $this->DbFinderAdminGenerator->createPartialFile($method,'<?php // @object $sfExtjs2Plugin and @object $gridpanel provided ?>'); 
    156   endforeach; 
    157 endif; 
    158  
    159 if (isset($expander['renderer_partial'])): 
    160 if (!is_array($expander['renderer_partial'])) 
    161 { 
    162   $expander['renderer_partial'] = array($expander['renderer_partial']); 
    163 } 
    164 if (isset($expander['fields'])) 
    165 { 
    166   if (!is_array($expander['fields'])) 
    167   { 
    168     $expander['fields'] = array($expander['fields']); 
    169   } 
    170   $template = ''; 
    171   foreach($expander['fields'] as $field) 
    172   { 
    173     $template .= "<tr><td><p>{".str_replace('/','-',$field)."}</p></td></tr>"; 
    174   } 
    175 } 
    176 ?> 
    177 // generator expand columns renderer partial 
    178 <?php 
    179   foreach($expander['renderer_partial'] as $expanderRenderer): 
    180     $this->DbFinderAdminGenerator->createPartialFile($expanderRenderer,'<?php // @object $sfExtjs2Plugin and @object $gridpanel provided 
    181   $configArr["source"] = " 
    182   if(typeof this.rowExpander ==\'undefined\') 
    183   { 
    184     this.rowExpander = Ext.ComponentMgr.create({ 
    185       xtype: \'rowexpander\', 
    186       tpl : new Ext.Template( 
    187         \'<table width=\"100%\">'.$template.'</table>\' 
    188       ) 
    189     }); 
    190   } 
    191   return this.rowExpander"; 
    192   $gridpanel->attributes["getRowExpander"] = $sfExtjs2Plugin->asMethod($configArr); 
    193 ?>'); 
    194 ?> 
    195 include_partial('<?php echo substr($expanderRenderer,1) ?>', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'gridpanel' => $gridpanel)); 
    196 <?php 
    197  
    198   endforeach; 
    199 endif; 
    200  
    201 $variables =  $this->getParameterValue('gridpanel.variable'); 
    202 if (isset($variables['partials'])): 
    203 if (!is_array($variables['partials'])) 
    204 { 
    205   $variables['partials'] = array($variables['partials']); 
    206 } 
    207 ?> 
    208 // generator variable partials 
    209 <?php 
    210   foreach($variables['partials'] as $variable): 
    211 ?> 
    212 include_partial('<?php echo substr($variable,1) ?>', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'gridpanel' => $gridpanel)); 
    213 <?php 
    214   $this->DbFinderAdminGenerator->createPartialFile($variable,'<?php // @object $sfExtjs2Plugin and @object $gridpanel provided ?>'); 
    215   endforeach; 
    216 endif; 
    217 ?> 
    218  
    219106// create the Ext.app.sx.<?php echo $panelName ?> class 
    220107$sfExtjs2Plugin->beginClass( 
  • plugins/sfExtjsThemePlugin/branches/Extjs2DBFGeneratorThemePlugin/data/generator/DbFinderAdmin/extjs2/template/templates/_list_renderer_js.php

    r12421 r12508  
    1414$renderer->attributes = array(); 
    1515 
    16   // initComponent 
    17   $renderer->attributes['initComponent'] = $sfExtjs2Plugin->asMethod(" 
    18     //call parent 
    19     Ext.app.sx.<?php echo $rendererName ?>.superclass.initComponent.apply(this, arguments); 
    20   "); 
     16// initComponent 
     17$renderer->attributes['initComponent'] = $sfExtjs2Plugin->asMethod(" 
     18  //call parent 
     19  Ext.app.sx.<?php echo $rendererName ?>.superclass.initComponent.apply(this, arguments); 
     20"); 
    2121 
    22   // renderLink 
    23   $renderer->attributes['renderLink'] = $sfExtjs2Plugin->asMethod(array( 
    24     'parameters' => 'value, params, record, rowIndex, colIndex, store', 
    25     'source' => " 
    26       if (record) return String.format('<u><b><a class=\'gridlink\' sf_ns:modulename=\'<?php echo $this->DbFinderAdminGenerator->getPrimaryKeyAdminColumn()->getTableName() ?>\' sf_ns:key=\'{1}\' href=\'<?php echo $this->controller->genUrl($this->getModuleName().'/edit?'.$pkn.'=') ?>/{1}\'>{0}</a></b></u>', 
    27         value, 
    28         record.data['<?php echo $pkn ?>'] 
    29       ); 
    30    
    31   )); 
     22// renderLink 
     23$renderer->attributes['renderLink'] = $sfExtjs2Plugin->asMethod(array( 
     24  'parameters' => 'value, params, record, rowIndex, colIndex, store', 
     25  'source' => " 
     26    if (record) return String.format('<u><b><a class=\'gridlink\' sf_ns:modulename=\'<?php echo $this->DbFinderAdminGenerator->getPrimaryKeyAdminColumn()->getTableName() ?>\' sf_ns:key=\'{1}\' href=\'<?php echo $this->controller->genUrl($this->getModuleName().'/edit?'.$pkn.'=') ?>/{1}\'>{0}</a></b></u>', 
     27      value, 
     28      record.data['<?php echo $pkn ?>'] 
     29    ); 
     30 
     31)); 
    3232 
    33   // a column with a weight 
    34   $renderer->attributes['renderWeight'] = $sfExtjs2Plugin->asMethod(array( 
    35     'parameters' => 'v', 
    36     'source' => " 
    37       if (!v) return ''; 
     33// a column with a weight 
     34$renderer->attributes['renderWeight'] = $sfExtjs2Plugin->asMethod(array( 
     35  'parameters' => 'v', 
     36  'source' => " 
     37    if (!v) return ''; 
    3838 
    39       v = String(v); var ps = v.split('.'); 
    40       var whole = ps[0]; 
    41       var r = /(\d+)(\d{3})/; 
    42       while (r.test(whole)) { 
    43         whole = whole.replace(r, '$1' +',' + '$2'); 
    44      
    45       v = whole; 
     39    v = String(v); var ps = v.split('.'); 
     40    var whole = ps[0]; 
     41    var r = /(\d+)(\d{3})/; 
     42    while (r.test(whole)) { 
     43      whole = whole.replace(r, '$1' +',' + '$2'); 
     44   
     45    v = whole; 
    4646 
    47       return String.format('{0} kg', v); 
    48    
    49   )); 
     47    return String.format('{0} kg', v); 
     48 
     49)); 
    5050 
    51   // formatDate 
    52   $renderer->attributes['formatDate'] = $sfExtjs2Plugin->asMethod(array( 
    53     'parameters' => 'v', 
    54     'source' => "return Ext.util.Format.date(v, '<?php echo sfConfig::get('app_extjs2_dbfgen_theme_plugin_format_date', 'm/d/Y') ?>')" 
    55   )); 
     51// formatDate 
     52$renderer->attributes['formatDate'] = $sfExtjs2Plugin->asMethod(array( 
     53  'parameters' => 'v', 
     54  'source' => "return Ext.util.Format.date(v, '<?php echo sfConfig::get('app_extjs2_dbfgen_theme_plugin_format_date', 'm/d/Y') ?>')" 
     55)); 
    5656 
    57   $renderer->attributes['formatLongstring'] = $sfExtjs2Plugin->asMethod(array( 
    58     'parameters' => 'v, metaData', 
    59     'source' => " 
    60       metaData.css = 'x-grid3-cell-wrap'; 
    61       v = Ext.util.Format.stripTags(v); 
    62       return Ext.util.Format.ellipsis(v, 255); 
    63    
    64   )); 
     57$renderer->attributes['formatLongstring'] = $sfExtjs2Plugin->asMethod(array( 
     58  'parameters' => 'v, metaData', 
     59  'source' => " 
     60    metaData.css = 'x-grid3-cell-wrap'; 
     61    v = Ext.util.Format.stripTags(v); 
     62    return Ext.util.Format.ellipsis(v, 255); 
     63 
     64)); 
    6565 
    66   $renderer->attributes['formatNumber'] = $sfExtjs2Plugin->asMethod(array( 
    67     'parameters' => 'v', 
    68     'source' => " 
    69       var vString = v.toString(); 
    70       if (vString.indexOf('.') != -1) 
    71      
    72         v.toFixed(2); 
    73      
    74       return v; 
    75    
    76   )); 
     66$renderer->attributes['formatNumber'] = $sfExtjs2Plugin->asMethod(array( 
     67  'parameters' => 'v', 
     68  'source' => " 
     69    var vString = v.toString(); 
     70    if (vString.indexOf('.') != -1) 
     71   
     72      v.toFixed(2); 
     73   
     74    return v; 
     75 
     76)); 
    7777 
    78   $renderer->attributes['formatBoolean'] = $sfExtjs2Plugin->asMethod(array( 
    79     'parameters' => 'v', 
    80     'source' => "return v ? 'Yes' : 'No';" 
    81   )); 
     78$renderer->attributes['formatBoolean'] = $sfExtjs2Plugin->asMethod(array( 
     79  'parameters' => 'v', 
     80  'source' => "return v ? 'Yes' : 'No';" 
     81)); 
    8282 
    83   $renderer->attributes['formatReadonly'] = $sfExtjs2Plugin->asMethod(array( 
    84     'parameters' => 'v', 
    85     'source' => "return String.format('<i>{0}</i>', v);" 
    86   )); 
     83$renderer->attributes['formatReadonly'] = $sfExtjs2Plugin->asMethod(array( 
     84  'parameters' => 'v', 
     85  'source' => "return String.format('<i>{0}</i>', v);" 
     86)); 
     87<?php echo $this->DbFinderAdminGenerator->getCustomPartials('renderer','method'); ?> 
     88<?php echo $this->DbFinderAdminGenerator->getCustomPartials('renderer','variable'); ?> 
     89// app.sx from Symfony eXtended (instead of ux: user eXtention) 
     90$sfExtjs2Plugin->beginClass( 
     91  'Ext.app.sx', 
     92  '<?php echo $rendererName ?>', 
     93  'Ext.grid.ColumnModel', 
     94  $renderer->attributes 
     95); 
    8796 
    88  
    89 <?php 
    90 $methods =  $this->getParameterValue('renderers.method'); 
    91 if (isset($methods['partials'])): 
    92 if (!is_array($methods['partials'])) 
    93 
    94   $methods['partials'] = array($methods['partials']); 
    95 
    96 ?> 
    97 // generator method partials 
    98 <?php 
    99   foreach($methods['partials'] as $method): 
    100 ?> 
    101 include_partial('<?php echo substr($method,1) ?>', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'renderer' => $renderer)); 
    102 <?php 
    103     $this->createPartialFile($method,'<?php // @object $sfExtjs2Plugin and @object $renderer provided 
    104   $configArr["parameters"] = "value, metadata, record, rowIndex, colIndex, store"; 
    105   $configArr["source"] = "Ext.Msg.alert(\'Error\',\'New renderer partial defined in generator.yml!<br><br>Copy the template file from cache \"_'.$method.'.php\" to your application/modules/'.strtolower($this->getModuleName()).'/templates folder and alter it\');"; 
    106   $renderer->attributes["'.$method.'"] = $sfExtjs2Plugin->asMethod($configArr); 
    107 ?>'); 
    108   endforeach; 
    109 endif; 
    110  
    111 $variables =  $this->getParameterValue('renderers.variable'); 
    112 if (isset($variables['partials'])): 
    113 if (!is_array($variables['partials'])) 
    114 
    115   $variables['partials'] = array($variables['partials']); 
    116 
    117 ?> 
    118 // generator variable partials 
    119 <?php 
    120   foreach($variables['partials'] as $variable): 
    121 ?> 
    122 include_partial('<?php echo substr($variable,1) ?>', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'renderer' => $renderer)); 
    123 <?php 
    124   $this->DbFinderAdminGenerator->createPartialFile($variable,'<?php // @object $sfExtjs2Plugin and @object $renderer provided ?>'); 
    125   endforeach; 
    126 endif; 
    127 ?> 
    128  
    129  
    130   // app.sx from Symfony eXtended (instead of ux: user eXtention) 
    131   $sfExtjs2Plugin->beginClass( 
    132     'Ext.app.sx', 
    133     '<?php echo $rendererName ?>', 
    134     'Ext.grid.ColumnModel', 
    135     $renderer->attributes 
    136   ); 
    137  
    138   $sfExtjs2Plugin->endClass(); 
     97$sfExtjs2Plugin->endClass(); 
    13998?] 
  • plugins/sfExtjsThemePlugin/branches/Extjs2DBFGeneratorThemePlugin/data/generator/DbFinderAdmin/extjs2/template/templates/_list_rowactions_js.php

    r12417 r12508  
    22  $moduleName = ucfirst(sfInflector::camelize($this->getModuleName())); 
    33  $rowactionsName = "List".$moduleName."RowActions"; 
    4   $rowactionsName_xtype = "list".$this->getModuleName()."rowactions"
     4  $rowactionsName_xtype = strtolower($rowactionsName)
    55?> 
    66[?php 
     
    1616// initComponent 
    1717include_partial('list_rowactions_method_initComponent_js', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'rowactions' => $rowactions)); 
    18  
     18<?php echo $this->DbFinderAdminGenerator->getCustomPartials('rowactions','method'); ?> 
     19<?php echo $this->DbFinderAdminGenerator->getCustomPartials('rowactions','variable'); ?> 
    1920<?php 
    20 $methods =  $this->getParameterValue('rowactions.method'); 
    21 if(isset($methods['partials'])): 
    22 if (!is_array($methods['partials'])) 
    23 { 
    24   $methods['partials'] = array($methods['partials']); 
    25 } 
    26 ?> 
    27 // generator method partials 
    28 <?php 
    29   foreach($methods['partials'] as $method): 
    30 ?> 
    31 include_partial('<?php echo substr($method,1) ?>', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'rowactions' => $rowactions)); 
    32 <?php 
    33     $this->createPartialFile($method,'<?php // @object $sfExtjs2Plugin and @object $rowactions provided ?>'); 
    34   endforeach; 
    35 endif; 
    36  
    37 $variables =  $this->getParameterValue('rowactions.variable'); 
    38 if (isset($variables['partials'])): 
    39 if (!is_array($variables['partials'])) 
    40 { 
    41   $variables['partials'] = array($variables['partials']); 
    42 } 
    43 ?> 
    44 // generator variable partials 
    45 <?php 
    46   foreach($variables['partials'] as $variable): 
    47 ?> 
    48 include_partial('<?php echo substr($variable,1) ?>', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'rowactions' => $rowactions)); 
    49 <?php 
    50   $this->createPartialFile($variable,'<?php // @object $sfExtjs2Plugin and @object $rowactions provided ?>'); 
    51   endforeach; 
    52 endif; 
    53  
    5421$listActions = $this->getParameterValue('list.rowactions'); 
    5522?> 
  • plugins/sfExtjsThemePlugin/branches/Extjs2DBFGeneratorThemePlugin/data/generator/DbFinderAdmin/extjs2/template/templates/_list_store_js.php

    r12502 r12508  
    1010 
    1111  $panelName = "List".$moduleName.$store; 
    12   $panelName_xtype = "list".$this->getModuleName().$store
     12  $panelName_xtype = strtolower($panelName)
    1313 
    1414  $storeConfig = $this->DbFinderAdminGenerator->getDataStoreConfig(); 
     
    5050// initEvents 
    5151include_partial('list_store_method_initEvents_js', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'store' => $store, 'panelName' => $panelName)); 
    52  
    53 <?php 
    54 $methods =  $this->getParameterValue('datastore.method'); 
    55 if(isset($methods['partials'])): 
    56 if (!is_array($methods['partials'])) 
    57 
    58   $methods['partials'] = array($methods['partials']); 
    59 
    60 ?> 
    61 // generator method partials 
    62 <?php 
    63   foreach($methods['partials'] as $method): 
    64 ?> 
    65 include_partial('<?php echo substr($method,1) ?>', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'store' => $store)); 
    66 <?php 
    67     $this->DbFinderAdminGenerator->createPartialFile($method,'<?php // @object $sfExtjs2Plugin and @object $store provided ?>'); 
    68   endforeach; 
    69 endif; 
    70  
    71 $variables =  $this->getParameterValue('datastore.variable'); 
    72 if (isset($variables['partials'])): 
    73 if (!is_array($variables['partials'])) 
    74 
    75   $variables['partials'] = array($variables['partials']); 
    76 
    77 ?> 
    78 // generator variable partials 
    79 <?php 
    80   foreach($variables['partials'] as $variable): 
    81 ?> 
    82 include_partial('<?php echo substr($variable,1) ?>', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'store' => $store)); 
    83 <?php 
    84     $this->DbFinderAdminGenerator->createPartialFile($variable,'<?php // @object $sfExtjs2Plugin and @object $store provided ?>'); 
    85   endforeach; 
    86 endif; 
    87 ?> 
    88  
     52<?php echo $this->DbFinderAdminGenerator->getCustomPartials('store','method'); ?> 
     53<?php echo $this->DbFinderAdminGenerator->getCustomPartials('store','variable'); ?> 
    8954// create the Ext.app.sx.<?php echo $panelName ?> class 
    9055$sfExtjs2Plugin->beginClass( 
  • plugins/sfExtjsThemePlugin/branches/Extjs2DBFGeneratorThemePlugin/data/generator/DbFinderAdmin/extjs2/template/templates/_list_tabpanel_js.php

    r12379 r12508  
    22  $moduleName = ucfirst(sfInflector::camelize($this->getModuleName())); 
    33  $panelName = "List".$moduleName."TabPanel"; 
    4   $panelName_xtype = "list".$this->getModuleName()."tabpanel"
     4  $panelName_xtype = strtolower($panelName)
    55?> 
    66[?php 
     
    4040// initEvents 
    4141include_partial('list_tabpanel_method_initEvents_js', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'tabpanel' => $tabpanel)); 
    42  
    43 <?php 
    44 $methods =  $this->getParameterValue('tabpanel.method'); 
    45 if(isset($methods['partials'])): 
    46 if (!is_array($methods['partials'])) 
    47 
    48   $methods['partials'] = array($methods['partials']); 
    49 
    50 ?> 
    51 // generator method partials 
    52 <?php 
    53   foreach($methods['partials'] as $method): 
    54 ?> 
    55 include_partial('<?php echo substr($method,1) ?>', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'tabpanel' => $tabpanel)); 
    56 <?php 
    57     $this->DbFinderAdminGenerator->createPartialFile($method,'<?php // @object $sfExtjs2Plugin and @object $tabpanel provided ?>'); 
    58   endforeach; 
    59 endif; 
    60  
    61 $variables =  $this->getParameterValue('tabpanel.variable'); 
    62 if (isset($variables['partials'])): 
    63 if (!is_array($variables['partials'])) 
    64 
    65   $variables['partials'] = array($variables['partials']); 
    66 
    67 ?> 
    68 // generator variable partials 
    69 <?php 
    70   foreach($variables['partials'] as $variable): 
    71 ?> 
    72 include_partial('<?php echo substr($variable,1) ?>', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'tabpanel' => $tabpanel)); 
    73 <?php 
    74     $this->DbFinderAdminGenerator->createPartialFile($variable,'<?php // @object $sfExtjs2Plugin and @object $tabpanel provided ?>'); 
    75   endforeach; 
    76 endif; 
    77 ?> 
    78  
     42<?php echo $this->DbFinderAdminGenerator->getCustomPartials('tabpanel','method'); ?> 
     43<?php echo $this->DbFinderAdminGenerator->getCustomPartials('tabpanel','variable'); ?> 
    7944// create the Ext.app.sx.<?php echo $panelName ?> class 
    8045$sfExtjs2Plugin->beginClass( 
  • plugins/sfExtjsThemePlugin/branches/Extjs2DBFGeneratorThemePlugin/data/generator/DbFinderAdmin/extjs2/template/templates/_list_toolbar_paging_js.php

    r12392 r12508  
    22  $moduleName = ucfirst(sfInflector::camelize($this->getModuleName())); 
    33  $toolbarName = "List".$moduleName."ToolbarPaging"; 
    4   $toolbarName_xtype = "list".$this->getModuleName()."pagingtoolbar"
     4  $toolbarName_xtype = strtolower($toolbarName)
    55  $limit = $this->getParameterValue('list.max_per_page', sfConfig::get('app_extjs2_dbfgen_theme_plugin_list_max_per_page', 20)); 
    66?> 
     
    2929// initComponent 
    3030include_partial('list_toolbar_paging_method_initComponent_js', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'toolbar_paging' => $toolbar_paging)); 
    31  
    32 <?php 
    33 $methods =  $this->getParameterValue('toolbar_paging.method'); 
    34 if(isset($methods['partials'])): 
    35 if (!is_array($methods['partials'])) 
    36 
    37   $methods['partials'] = array($methods['partials']); 
    38 
    39 ?> 
    40 // generator method partials 
    41 <?php 
    42   foreach($methods['partials'] as $method): 
    43 ?> 
    44 include_partial('<?php echo substr($method,1) ?>', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'toolbar_paging' => $toolbar_paging)); 
    45 <?php 
    46     $this->DbFinderAdminGenerator->createPartialFile($method,'<?php // @object $sfExtjs2Plugin and @object $toolbar_paging provided ?>'); 
    47   endforeach; 
    48 endif; 
    49  
    50 $variables =  $this->getParameterValue('toolbar_paging.variable'); 
    51 if (isset($variables['partials'])): 
    52 if (!is_array($variables['partials'])) 
    53 
    54   $variables['partials'] = array($variables['partials']); 
    55 
    56 ?> 
    57 // generator variable partials 
    58 <?php 
    59   foreach($variables['partials'] as $variable): 
    60 ?> 
    61 include_partial('<?php echo substr($variable,1) ?>', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'toolbar_paging' => $toolbar_paging)); 
    62 <?php 
    63   $this->DbFinderAdminGenerator->createPartialFile($variable,'<?php // @object $sfExtjs2Plugin and @object $toolbar_paging provided ?>'); 
    64   endforeach; 
    65 endif;?> 
    66  
     31<?php echo $this->DbFinderAdminGenerator->getCustomPartials('toolbar_paging','method'); ?> 
     32<?php echo $this->DbFinderAdminGenerator->getCustomPartials('toolbar_paging','variable'); ?> 
    6733// app.sx from Symfony eXtended (instead of ux: user eXtention) 
    6834$sfExtjs2Plugin->beginClass( 
     
    7238  $toolbar_paging->attributes 
    7339); 
     40 
    7441$sfExtjs2Plugin->endClass(); 
    7542?] 
  • plugins/sfExtjsThemePlugin/branches/Extjs2DBFGeneratorThemePlugin/data/generator/DbFinderAdmin/extjs2/template/templates/_list_toolbar_top_js.php

    r12386 r12508  
    22  $moduleName = ucfirst(sfInflector::camelize($this->getModuleName())); 
    33  $toolbarName = "List".$moduleName."ToolbarTop"; 
    4   $toolbarName_xtype = "list".$this->getModuleName()."toptoolbar"
     4  $toolbarName_xtype = strtolower($toolbarName)
    55?> 
    66[?php 
     
    2222// initComponent 
    2323include_partial('list_toolbar_top_method_initComponent_js', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'toolbar_top' => $toolbar_top)); 
    24  
     24<?php echo $this->DbFinderAdminGenerator->getCustomPartials('toolbar_top','method'); ?> 
     25<?php echo $this->DbFinderAdminGenerator->getCustomPartials('toolbar_top','variable'); ?> 
    2526<?php 
    26 $methods =  $this->getParameterValue('toolbar_top.method'); 
    27 if(isset($methods['partials'])): 
    28 if (!is_array($methods['partials'])) 
    29 { 
    30   $methods['partials'] = array($methods['partials']); 
    31 } 
    32 ?> 
    33 // generator method partials 
    34 <?php 
    35   foreach($methods['partials'] as $method): 
    36 ?> 
    37 include_partial('<?php echo substr($method,1) ?>', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'toolbar_top' => $toolbar_top)); 
    38 <?php 
    39     $this->createPartialFile($method,'<?php // @object $sfExtjs2Plugin and @object $toolbar_top provided ?>'); 
    40   endforeach; 
    41 endif; 
    42  
    43 $variables =  $this->getParameterValue('toolbar_top.variable'); 
    44 if (isset($variables['partials'])): 
    45 if (!is_array($variables['partials'])) 
    46 { 
    47   $variables['partials'] = array($variables['partials']); 
    48 } 
    49 ?> 
    50 // generator variable partials 
    51 <?php 
    52   foreach($variables['partials'] as $variable): 
    53 ?> 
    54 include_partial('<?php echo substr($variable,1) ?>', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'toolbar_top' => $toolbar_top)); 
    55 <?php 
    56   $this->createPartialFile($variable,'<?php // @object $sfExtjs2Plugin and @object $toolbar_top provided ?>'); 
    57   endforeach; 
    58 endif; 
    59  
    6027$listActions = $this->getParameterValue('list.actions'); 
    6128?> 
     
    8047  $toolbar_top->attributes 
    8148); 
     49 
    8250$sfExtjs2Plugin->endClass(); 
    8351?] 
  • plugins/sfExtjsThemePlugin/branches/Extjs2DBFGeneratorThemePlugin/lib/Extjs2DbFinderAdminGenerator.class.php

    r12502 r12508  
    55    $listDisplayColumns = null, 
    66    $uniqueListDisplayColumns = null, 
    7     $displayColumnsConfig = null; 
     7    $listDisplayColumnsConfig = null, 
     8    $editDisplayColumns = null, 
     9    $uniqueEditDisplayColumns = null, 
     10    $editDisplayColumnsConfig = null; 
    811 
    912    /** 
     
    5356    $this->generator->DbFinderAdminGenerator = $this; 
    5457    return $this->generator->generate($params); 
     58  } 
     59 
     60  public function getCustomPartials($objName,$type='method') 
     61  { 
     62    $partialStr =''; 
     63    $customs =  $this->getParameterValue("$objName.$type"); 
     64    if(isset($customs['partials'])) 
     65    { 
     66      if (!is_array($customs['partials'])) 
     67      { 
     68        $customs['partials'] = array($customs['partials']); 
     69      } 
     70 
     71      $partialStr .= "\n// generator $type partials\n"; 
     72 
     73      foreach($customs['partials'] as $custom) 
     74      { 
     75        $partialStr .= "include_partial('".substr($custom,1)."', array('sfExtjs2Plugin' => \$sfExtjs2Plugin, '$objName' => \$$objName));\n"; 
     76        $this->createPartialFile($custom,'<?php // @object $sfExtjs2Plugin and @object $'.$objName.' provided ?>'); 
     77      } 
     78    } 
     79    return $partialStr; 
    5580  } 
    5681 
     
    108133    $group_field = $this->getParameterValue('list.grouping.field', null); 
    109134 
    110     $displayColumnsConfig = $this->getDisplayColumnsConfig(); 
     135    $displayColumnsConfig = $this->getListDisplayColumnsConfig(); 
    111136    $groupedColumns = $this->getListDisplayColumns(); 
    112137 
     
    150175  } 
    151176 
     177  public function getColumnModelConfig() 
     178  { 
     179    $plugins = false; 
     180    $cmItems = array(); 
     181    $credArr = array(); 
     182    $i=0; 
     183    foreach ($this->sortColumns($this->getListColumns($this->getListDisplayColumns())) as $column) 
     184    { 
     185      //don't create column config for invisible columns 
     186      if (($column->isInvisible())) 
     187      { 
     188        continue; 
     189      } 
     190 
     191      //captures the ^expander in the list.display and sets the rowexpander at that position 
     192      //new syntax is ^expander, need to obsolete plain * 
     193      if ($column->key == '*'||$column->key == '^expander') 
     194      { 
     195        $cmItems[] = "{xtype: 'rowexpander'}"; 
     196        $i++; 
     197        continue; 
     198      } 
     199 
     200      //handle credentials for displaying the column 
     201      $listcreds = $this->getParameterValue('list.fields.'.$column->key.'.credentials'); 
     202      if ($listcreds) 
     203      { 
     204        $listcreds = str_replace("\n", ' ', var_export($listcreds, true)); 
     205        //if the user doesn't have the right permissions remove the columnconfig 
     206        $credArr[] = 'if(!$sf_user->hasCredential('.$listcreds.')) unset($columnmodel->config_array['.$i.']);'; 
     207      } 
     208 
     209      $columnDefinition = $this->getColumnAjaxListDefinition($column, $this->getListDisplayColumns()); 
     210 
     211      //captures the ^rowactions in the list.display and sets the rowexpander at that position 
     212      if ($column->key == '^rowactions') 
     213      { 
     214        //handle credentials for displaying the rowaction column 
     215        $listRowactions = $this->getParameterValue('list.rowactions'); 
     216        foreach ((array) $listRowactions as $actionName => $params) 
     217        { 
     218          $actioncreds = (isset($params['credentials']))?$params['credentials']:false; 
     219          if ($actioncreds) 
     220          { 
     221            $actioncreds = str_replace("\n", ' ', var_export($actioncreds, true)); 
     222            //if the user doesn't have the right permissions remove the button config 
     223            $credArr[] = 'if(!$sf_user->hasCredential('.$actioncreds.')) unset($columnmodel->config_array['.$i.']);'; 
     224          } 
     225        } 
     226 
     227        $pluginArrName = strtolower($this->getModuleName()).'_rowactions'; 
     228        //here are the defaults if nothing is set in the fields config 
     229        $plugins[$pluginArrName] = array('xtype' => 'list'.strtolower($this->getModuleName()).'rowactions', 'header' => '&nbsp;'); 
     230        //merge in the fields config if it's there 
     231        if($this->getParameterValue('fields.'.$column->key,false)||$this->getParameterValue('list.fields.'.$column->key,false)){ 
     232          $plugins[$pluginArrName] = array_merge($plugins[$pluginArrName], $columnDefinition); 
     233        } 
     234        //set the column item to our generated plugin 
     235        $cmItems[] = 'this.'.$pluginArrName; 
     236        $i++; 
     237        continue; 
     238      } 
     239 
     240      //handle edit credentials for plugin columns 
     241      if($this->getParameterValue('list.fields.'.$column->key.'.plugin')) 
     242      { 
     243        $pluginArrName = $column->key.'_'.$this->getParameterValue('list.fields.'.$column->key.'.plugin'); 
     244        //setup the data for generating the new plugin instance 
     245        $plugins[$pluginArrName] = $columnDefinition; 
     246        if ($editcreds = $this->getParameterValue('edit.fields.'.$column->key.'.credentials')) 
     247        { 
     248          $editcreds = str_replace("\n", ' ', var_export($editcreds, true)); 
     249          //pass our credentials down to the generated partial 
     250          $credArr[] = "if(!\$sf_user->hasCredential($editcreds)&& is_array(\$columnmodel->plugins['$pluginArrName'])) \$columnmodel->plugins['$pluginArrName']['editable'] = false;"; 
     251        } 
     252        //set the column item to our generated plugin 
     253        $cmItems[] = 'this.'.$pluginArrName; 
     254        $i++; 
     255        continue; 
     256      } 
     257 
     258      //handle edit credentials for non-plugin columns 
     259      if ($editcreds = $this->getParameterValue('edit.fields.'.$column->key.'.credentials')) 
     260      { 
     261        $editcreds = str_replace("\n", ' ', var_export($editcreds, true)); 
     262        //unset the editor if the user doesn't have the right credentials 
     263        $credArr[] = "if(!\$sf_user->hasCredential($editcreds)&& is_array(\$columnmodel->config_array['$i'])&& isset(\$columnmodel->config_array['$i']['editor'])) unset(\$columnmodel->config_array['$i']['editor']);"; 
     264      } 
     265 
     266      $cmItems[] = $columnDefinition; 
     267 
     268      $i++; 
     269    } 
     270    return array('plugins'=>$plugins, 'cred_arr' =>$credArr, 'col_items'=>$cmItems); 
     271  } 
     272 
     273  public function getToolbarTopConfig() 
     274  { 
     275 
     276  } 
     277 
     278  public function getFilterPanelConfig() 
     279  { 
     280 
     281  } 
     282 
     283  public function getGridPanelConfig() 
     284  { 
     285    if($this->getParameterValue('list.grouping.text_tpl',false)) 
     286    { 
     287      $grid_view['groupTextTpl'] = $this->getParameterValue('list.grouping.text_tpl'); 
     288    } 
     289 
     290    $pluginArr = false; 
     291    $listPlugins = $this->getParameterValue('list.plugins',false); 
     292    if($listPlugins) 
     293    { 
     294      $pluginArr = (!is_array($listPlugins)) ? array($listPlugins) : $listPlugins; 
     295    } 
     296 
     297    $listDisplay = $this->getParameterValue('list.display', false); 
     298    if ($listDisplay) 
     299    { 
     300      foreach($listDisplay as $col) 
     301      { 
     302        if($this->getParameterValue('list.fields.'.$col.'.plugin')) 
     303        { 
     304          $pluginArr[] = 'this.cm.'.$col.'_'.$this->getParameterValue('list.fields.'.$col.'.plugin'); 
     305        } 
     306        if($col == '^rowactions') 
     307        { 
     308          $pluginArr[] = 'this.cm.'.strtolower($this->getModuleName()).'_rowactions'; 
     309        } 
     310      } 
     311    } 
     312 
     313    $expander =  $this->getParameterValue('list.expand_columns'); 
     314    $expanderPartial = ''; 
     315    if (isset($expander['renderer_partial'])) 
     316    { 
     317      $pluginArr[] = 'this.rowExpander'; 
     318 
     319      if (!is_array($expander['renderer_partial'])) 
     320      { 
     321        $expander['renderer_partial'] = array($expander['renderer_partial']); 
     322      } 
     323 
     324      if (isset($expander['fields'])) 
     325      { 
     326        if (!is_array($expander['fields'])) 
     327        { 
     328          $expander['fields'] = array($expander['fields']); 
     329        } 
     330        $template = ''; 
     331        foreach($expander['fields'] as $field) 
     332        { 
     333          $template .= "<tr><td><p>{".str_replace('/','-',$field)."}</p></td></tr>"; 
     334        } 
     335      } 
     336 
     337      $expanderPartial .= "\n// generator expand columns renderer partial\n"; 
     338      foreach($expander['renderer_partial'] as $expanderRenderer) 
     339      { 
     340        $this->createPartialFile($expanderRenderer,'<?php // @object $sfExtjs2Plugin and @object $gridpanel provided 
     341    $configArr["source"] = " 
     342    if(typeof this.rowExpander ==\'undefined\') 
     343    { 
     344      this.rowExpander = Ext.ComponentMgr.create({ 
     345        xtype: \'rowexpander\', 
     346        tpl : new Ext.Template( 
     347          \'<table width=\"100%\">'.$template.'</table>\' 
     348        ) 
     349      }); 
     350    } 
     351    return this.rowExpander"; 
     352    $gridpanel->attributes["getRowExpander"] = $sfExtjs2Plugin->asMethod($configArr); 
     353  ?>'); 
     354 
     355        $expanderPartial .= "include_partial('<?php echo substr($expanderRenderer,1) ?>', array('sfExtjs2Plugin' => $sfExtjs2Plugin, 'gridpanel' => $gridpanel));\n"; 
     356      } 
     357    } 
     358 
     359    $user_params = $this->getParameterValue('gridpanel.params', array()); 
     360    if (isset($user_params['bbar'])) unset($user_params['bbar']); 
     361    if (isset($user_params['tbar'])) unset($user_params['tbar']); 
     362 
     363    return array('expander_partial'=>$expanderPartial,'user_params'=>$user_params,'plugin_arr'=>$pluginArr); 
     364  } 
     365 
     366  public function getRowActionsConfig() 
     367  { 
     368 
     369  } 
     370 
    152371  public function getListDisplayColumns() 
    153372  { 
    154     if(!$this->displayListColumns) 
    155     { 
    156       $this->displayColumns = $this->getColumnsGrouped('list.display'); 
    157     } 
    158     return $this->displayColumns; 
     373    if(!$this->listDisplayColumns) 
     374    { 
     375      $this->listDisplayColumns = $this->getColumnsGrouped('list.display'); 
     376    } 
     377    return $this->listDisplayColumns; 
    159378  } 
    160379 
     
    166385    } 
    167386    return $this->uniqueListDisplayColumns; 
     387  } 
     388 
     389  public function getEditDisplayColumns() 
     390  { 
     391    if(!$this->editDisplayColumns) 
     392    { 
     393      $this->editDisplayColumns = $this->getColumnsGrouped('list.display'); 
     394    } 
     395    return $this->editDisplayColumns; 
     396  } 
     397 
     398  public function getUniqueEditDisplayColumns() 
     399  { 
     400    if(!$this->uniqueEditDisplayColumns) 
     401    { 
     402      $this->uniqueEditDisplayColumns = $this->getListUniqueColumns($this->getEditDisplayColumns(), true); 
     403    } 
     404    return $this->uniqueEditDisplayColumns; 
    168405  } 
    169406 
    170407  /** 
    171408   * Configures the display columns config used in several modules 
    172    * @param 
     409   * 
    173410   * @return array($listDisplay, $credArr) 
    174411   * 
    175412   */ 
    176   public function getDisplayColumnsConfig() 
    177   { 
    178     if(!$this->displayColumnsConfig) 
     413  public function getListDisplayColumnsConfig() 
     414  { 
     415    if(!$this->listDisplayColumnsConfig) 
    179416    { 
    180417      $i=0; 
    181       $this->displayColumnsConfig['credArr'] = array(); 
    182       $this->displayColumnsConfig['listDisplay'] = array(); 
    183       foreach ($this->getUniqueDisplayColumns() as $column) 
     418      $this->listDisplayColumnsConfig['credArr'] = array(); 
     419      $this->listDisplayColumnsConfig['listDisplay'] = array(); 
     420      foreach ($this->getUniqueListDisplayColumns() as $column) 
    184421      { 
    185422        if ($column->isPlugin()) continue;  //plugin placeholder columns not in json-data 
     
    192429        if ($credentials){ 
    193430          $credentials = str_replace("\n", ' ', var_export($credentials, true)); 
    194           $this->displayColumnsConfig['credArr'][] = 'if(!$sf_user->hasCredential('.$credentials.')) unset($reader["fields"]['.$i.']);'; 
    195         } 
    196  
    197         $this->displayColumnsConfig['listDisplay'][] = array( 
     431          $this->listDisplayColumnsConfig['credArr'][] = 'if(!$sf_user->hasCredential('.$credentials.')) unset($reader["fields"]['.$i.']);'; 
     432        } 
     433 
     434        $this->listDisplayColumnsConfig['listDisplay'][] = array( 
    198435         'name' => $fieldName, 
    199436         'type' => $this->getFieldTypeForReader($column) 
     
    202439      } 
    203440    } 
    204     return $this->displayColumnsConfig; 
     441    return $this->listDisplayColumnsConfig; 
    205442  } 
    206443 
     
    250487 
    251488  } 
     489 
    252490  /** 
    253491   * Returns javascript code for an action button in the toolbar new (config)style (with sfExtjs2Plugin usage). 
     
    675913        } 
    676914 
    677         // add grouping.field if set 
    678 //        if ($groupColumnName = $this->getParameterValue('list.grouping.field', null)) 
    679 //        { 
    680 //          $columnNames[] = $groupColumnName; 
    681 //        } 
    682  
    683         // you don't have to add 'list.grouping.display' to the arguments of this method, it is taken into account automatically if you provide 'list.display' 
    684 //        if (!in_array('list.grouping.display', $for)) 
    685 //        { 
    686 // 
    687 //          if ($groupColumnDisplay = $this->getParameterValue('list.grouping.display', null)) 
    688 //          { 
    689 //            $for[] = 'list.grouping.display'; 
    690 //          } 
    691 //        } 
     915        if ($this->hasGroupFieldNotInDisplay()) 
     916        { 
     917          $for[] = 'list.grouping.field'; 
     918        } 
     919 
    692920      } 
    693921      // check if you want to display edit, add pages automatically 
     
    9601188        } 
    9611189      } 
    962 //      else 
    963 //      { 
    964 //        $group_field = sfInflector::underscore($this->getClassName()).$this->generator->tableDelimiter.$group_field; 
    965 //      } 
    966     } 
    967  
     1190    } 
    9681191    return $group_field; 
    969   } 
    970  
    971   //obsolete 
    972   public function hasGroupField() 
    973   { 
    974     $group_field = $this->getParameterValue('list.grouping.field', null); 
    975  
    976     return $group_field ? true : false; 
    9771192  } 
    9781193 
     
    16801895  } 
    16811896 
    1682  
    16831897  /** This method overwrites the original method so it can handle foreign-field by providing a peerName 
    16841898   */