Development

Changeset 10129

You must first sign up to be able to contribute.

Changeset 10129

Show
Ignore:
Timestamp:
07/05/08 01:02:25 (5 months ago)
Author:
Leon.van.der.Ree
Message:

implemented object_name at several places which can replace module name in text/titles if defined in generator
changed some defaults regarding titles and header-on/off

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/actions/actions.class.php

    r10117 r10129  
    384384<?php endforeach; ?> 
    385385<?php endforeach; ?> 
    386 <?php if(! ($deleteNotification = $this->getParameterValue('edit.delete_notification'))) $deleteNotification = 'The '.$this->getModuleName().' has been deleted' ?> 
     386<?php $objectName = $this->getParameterValue('object_name', $this->getModuleName()) ?> 
     387<?php if(! ($deleteNotification = $this->getParameterValue('edit.delete_notification'))) $deleteNotification = 'The '.$objectName.' has been deleted' ?> 
    387388    $this->setFlash('notice', '<?php echo $deleteNotification ?>'); 
    388389 
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_edit_ajax_form.php

    r9963 r10129  
    2020 
    2121 
     22<?php $objectName = $this->getParameterValue('object_name', $this->getModuleName()) ?> 
     23 
    2224$form_config = array( 
    23 //  'region'              => 'center', 
    2425  'xtype'               => 'form', 
    2526//  'baseCls              => 'x-plain', 
     27 
     28  'title'               => <?php echo $this->getI18NString('edit.newtitle', 'New '.$objectName, false) ?>, 
    2629 
    2730//  'width'               => 400, 
     
    5861); 
    5962 
    60 //set primary key 
    61 $form_config['items'] = array( 
    62 //obsolete, use params 
    63 //  $sfExtjs2Plugin->asAnonymousClass(array( 
    64 //    'xtype'     => 'hidden', 
    65 //    'name'      => '<?php $pkn ?>' 
    66 //  )) 
    67 ); 
    68  
    69  
    7063<?php 
    7164  // add fields, fieldsets, tab-pages and buttons 
     
    8073        // combine <?php echo $formName ?>Config with arguments 
    8174        Ext.app.sx.<?php echo $formName ?>.superclass.constructor.call(this, Ext.apply(".$sfExtjs2Plugin->asAnonymousClass($form_config).", c)); 
    82  
    83         this.title = '".<?php echo $this->getI18NString('edit.newtitle', 'Add new '.$this->getModuleName(), false) ?>."'; 
    8475 
    8576        this.modulename = '<?php echo $this->getModuleName() ?>'; 
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_json.php

    r9902 r10129  
     1<?php $objectName = $this->getParameterValue('object_name', $this->getModuleName()) ?> 
    12[?php use_helper('I18N', 'Date') ?] 
    23[?php sfLoader::loadHelpers('Extjs'); ?] 
     
    910[?php if ($for == 'edit'): ?] 
    1011, 
    11 title: "<?php echo $this->getI18NString('edit.title', 'Edit '.$this->getModuleName()) ?>" 
     12title: "<?php echo $this->getI18NString('edit.title', 'Edit '.$objectName) ?>" 
    1213[?php endif; ?] 
    1314} 
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_gridpanel_js.php

    r10003 r10129  
    1313/* gridPanel Configuration */ 
    1414 
     15<?php $objectName = $this->getParameterValue('object_name', $this->getModuleName()) ?> 
     16 
    1517$sfExtjs2_gridpanel_view = 'new Ext.grid.GridView({forceFit: true, autoFill: true <?php echo $grid_view_extras ?>})'; 
    1618 
    1719// default config 
    1820$gridpanel->config_array = array( 
     21  'title'               => <?php echo $this->getI18NString('list.title', $objectName.' overview', false) ?>, 
    1922  'ds'                  => $sfExtjs2Plugin->asVar('new Ext.app.sx.<?php echo 'List'.$moduleName.(($group_field)?'Grouping':'Store') ?>()'), 
    2023  'cm'                  => $sfExtjs2Plugin->asVar('new Ext.app.sx.<?php echo 'List'.$moduleName.'ColumnModel' ?>()'), 
     
    3134 
    3235<?php if (sfConfig::get('app_sf_extjs_theme_plugin_list_tabbed')): ?> 
    33 $gridpanel->config_array['title'] = <?php echo $this->getI18NString('list.title', $this->getModuleName().' list', false) ?>; //TODO remove 'Grid'
     36$gridpanel->config_array['header'] = false
    3437<?php endif; ?> 
    3538 
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_gridpanel_method_constructor_js.php

    r10049 r10129  
    1515    this.panelType = 'list'; 
    1616 
    17     if (typeof c.filter != 'undefined') { 
    18       var baseParams = {'filter': true} 
     17    if ((typeof c != 'undefined') && (typeof c.filter != 'undefined')) { 
     18      var baseParams = {'filter': true}; 
    1919      c.filter_key = (typeof c.filter_key != 'undefined') ? c.filter_key : -1; 
    2020      baseParams['filters['+c.filter+']'] = c.filter_key; 
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_layout_js.php

    r9963 r10129  
    3030 
    3131 
    32   var list<?php echo $moduleName ?>GridPanel = new Ext.app.sx.List<?php echo $moduleName ?>GridPanel ([?php echo $sfExtjs2Plugin->asAnonymousClass(array( 
    33     'title' => <?php echo $this->getI18NString('list.title', $this->getModuleName().' list', false) ?> 
    34   ))?]); 
     32<?php $objectName = $this->getParameterValue('object_name', $this->getModuleName()) ?> 
     33  var list<?php echo $moduleName ?>GridPanel = new Ext.app.sx.List<?php echo $moduleName ?>GridPanel(); 
    3534 
    3635//  list<?php echo $moduleName ?>GridPanel.on('actions', function() {alert('action: ')} ); 
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/editAjaxJsSuccess.pjs

    r10018 r10129  
    6464); 
    6565 
     66<?php $objectName = $this->getParameterValue('object_name', $this->getModuleName()) ?> 
    6667$config = $sfExtjs2Plugin->asAnonymousClass(array( 
    6768  'layout'              => 'border', 
     
    7172//  'height'          => 300, 
    7273 
    73   'title'               => <?php echo $this->getI18NString('edit.newtitle', 'Add '.$this->getModuleName(), false) ?>, 
    74   'header'              => false, 
     74  'title'               => <?php echo $this->getI18NString('edit.newtitle', 'Add '.$objectName, false) ?>, 
     75  'header'              => true, //TODO:  make this a config option 
    7576 
    7677  'defaults'            => array('border' => false), 
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/editAjaxSuccess.php

    r10114 r10129  
    6767<?php endif;?> 
    6868 
     69<?php $objectName = $this->getParameterValue('object_name', $this->getModuleName()) ?> 
    6970[?php 
    70   $config = "{"; 
    71   $config .= "title: '"; 
     71  $config = array(); 
    7272  if ($<?php echo $this->getSingularName() ?>->isNew()) 
    7373  { 
    74     $config .= <?php echo $this->getI18NString('edit.newtitle', 'Add new '.$this->getModuleName(), false); ?>; 
     74    $config['title'] = <?php echo $this->getI18NString('edit.newtitle', 'Add '.$objectName, false); ?>; 
    7575  } 
    7676  else 
    7777  { 
    78     $config .= <?php echo $this->getI18NString('edit.title', 'Edit '.$this->getModuleName(), false); ?>; 
     78    $config['title'] = <?php echo $this->getI18NString('edit.title', 'Edit '.$objectName, false); ?>; 
     79    $config['key'] = $<?php echo $this->getSingularName()?>->get<?php echo $pk->getPhpName() ?>(); 
    7980  } 
    80   $config .= "'"; 
     81  $config['header'] = true; // TODO, make config option 
    8182?] 
    82   [?php $config .= ", header: false " ?] 
    83 [?php if (!$<?php echo $this->getSingularName() ?>->isNew()): ?] 
    84   [?php $config .= ", key:".$<?php echo $this->getSingularName()?>->get<?php echo $pk->getPhpName() ?>(); ?] 
    85 [?php endif; ?] 
    86 [?php $config .= "}"; ?] 
    87     var editPanel = new Ext.app.sx.Edit<?php echo $moduleName ?>FormPanel([?php echo $config ?]); 
     83 
     84  var editPanel = new Ext.app.sx.Edit<?php echo $moduleName ?>FormPanel([?php echo $sfExtjs2Plugin->asAnonymousClass($config) ?]); 
    8885[?php if (!$<?php echo $this->getSingularName() ?>->isNew()): ?] 
    8986    editPanel.loadItem(); 
    9087[?php endif; ?] 
    9188 
     89    editPanel 
    9290    editPanel.on('saved', function(panel) {alert('saved: ' + panel.getKey() )} ); 
    9391    editPanel.on('deleted', function(panel) {alert('deleted: ' + panel.getKey() )} ); 
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/editSuccess.php

    r7032 r10129  
    88<div id="sf_admin_container"> 
    99 
    10 [?php if ($<?php echo $this->getSingularName() ?>->isNew()): ?]  
    11 <h1><?php echo $this->getI18NString('edit.newtitle', 'Add new '.$this->getModuleName()); ?></h1>   
    12 [?php else: ?]  
    13 <h1><?php echo $this->getI18NString('edit.title', 'Edit '.$this->getModuleName()); ?></h1>   
     10<?php $objectName = $this->getParameterValue('object_name', $this->getModuleName()) ?> 
     11[?php if ($<?php echo $this->getSingularName() ?>->isNew()): ?] 
     12<h1><?php echo $this->getI18NString('edit.newtitle', 'Add '.$objectName); ?></h1> 
     13[?php else: ?] 
     14<h1><?php echo $this->getI18NString('edit.title', 'Edit '.$objectName); ?></h1> 
    1415[?php endif; ?] 
    1516 
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/jsonSaveSuccess.php

    r8992 r10129  
    11[?php use_helper('I18N', 'Date') ?] 
    2  
    3 { success: true, message: "Your modifications have been saved", id: "[?php echo $id ?]", title: "<?php echo $this->getI18NString('edit.title', 'Edit '.$this->getModuleName())  ?>"  } 
     2<?php $objectName = $this->getParameterValue('object_name', $this->getModuleName()) ?> 
     3{ success: true, message: "Your modifications have been saved", id: "[?php echo $id ?]", title: "<?php echo $this->getI18NString('edit.title', 'Edit '.$objectName)  ?>"  } 
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/listAjaxSuccess.php

    r10114 r10129  
    6161  <div id="sf_admin_bar"> 
    6262<?php if ($this->getParameterValue('list.filters')): ?> 
    63   [?php //include_partial('filters', array('filters' => $filters)) // filters loaded at different place ?] 
     63  [?php //include_partial('filters', array('filters' => $filters)) // filters loaded at different place? ???? >LvanderRee please ask again at forum, don't know who said this, but filters aren't implemented yet, it needs to be reimplemted in its own panel, so it can be reused at any location you want ?] 
    6464<?php endif; ?> 
    6565  </div> 
     
    7070      <div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div> 
    7171      <div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc"> 
    72           <h3 style="margin-bottom:5px;"><?php echo $this->getI18NString('list.title', $this->getModuleName().' list') ?></h3> 
     72 
     73          <?php $objectName = $this->getParameterValue('object_name', $this->getModuleName()) ?> 
     74          <h3 style="margin-bottom:5px;"><?php echo $this->getI18NString('list.title', $objectName.' overview') ?></h3> 
    7375          <div id="ajax-border" style="border:1px solid transparent;"> 
    7476  <?php endif; ?> 
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/listSuccess.php

    r7185 r10129  
    55<div id="sf_admin_container"> 
    66 
    7 <h1><?php echo $this->getI18NString('list.title', $this->getModuleName().' list') ?></h1> 
     7<?php $objectName = $this->getParameterValue('object_name', $this->getModuleName()) ?> 
     8<h1><?php echo $this->getI18NString('list.title', $objectName.' overview') ?></h1> 
    89 
    910<div id="sf_admin_header">