Development

Changeset 2789

You must first sign up to be able to contribute.

Changeset 2789

Show
Ignore:
Timestamp:
11/22/06 21:06:59 (2 years ago)
Author:
chtito
Message:

put the admin generator templates in svn:external and merged changes in actions.class.php

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfDoctrine/data/generator/sfDoctrineAdmin/default/template

    • Property svn:externals set to
      templates http://svn.symfony-project.com/trunk/data/generator/sfPropelAdmin/default/template/templates
  • plugins/sfDoctrine/data/generator/sfDoctrineAdmin/default/template/actions/actions.class.php

    r2767 r2789  
    7474      { 
    7575        return $this->redirect('<?php echo $this->getModuleName() ?>/edit?<?php echo $this->getPrimaryKeyUrlParams('this->') ?>); 
    76 <?php //' ?> 
    7776      } 
    7877    } 
    7978    else 
    8079    { 
    81       // add javascripts 
    82       $this->getResponse()->addJavascript(sfConfig::get('sf_prototype_web_dir').'/js/prototype'); 
    83       $this->getResponse()->addJavascript(sfConfig::get('sf_admin_web_dir').'/js/collapse'); 
    84       $this->getResponse()->addJavascript(sfConfig::get('sf_admin_web_dir').'/js/double_list'); 
     80      $this->addJavascriptsForEdit(); 
     81 
     82      $this->labels = $this->getLabels(); 
    8583    } 
    8684  } 
     
    125123    $this-><?php echo $this->getSingularName() ?> = $this->get<?php echo $this->getClassName() ?>OrCreate(); 
    126124    $this->update<?php echo $this->getClassName() ?>FromRequest(); 
     125 
     126    $this->addJavascriptsForEdit(); 
     127 
     128    $this->labels = $this->getLabels(); 
    127129 
    128130    return sfView::SUCCESS; 
     
    397399    } 
    398400  } 
     401 
     402  protected function addJavascriptsForEdit() 
     403  { 
     404    $this->getResponse()->addJavascript(sfConfig::get('sf_prototype_web_dir').'/js/prototype'); 
     405    $this->getResponse()->addJavascript(sfConfig::get('sf_admin_web_dir').'/js/collapse'); 
     406    $this->getResponse()->addJavascript(sfConfig::get('sf_admin_web_dir').'/js/double_list'); 
     407  } 
     408 
     409  protected function getLabels() 
     410  { 
     411    return array( 
     412<?php foreach ($this->getColumnCategories('edit.display') as $category): ?> 
     413<?php foreach ($this->getColumns('edit.display', $category) as $name => $column): ?> 
     414      '<?php echo $this->getSingularName() ?>{<?php echo $column->getName() ?>}' => '<?php $label_name = str_replace("'", "\\'", $this->getParameterValue('edit.fields.'.$column->getName().'.name')); echo $label_name ?><?php if ($label_name): ?>:<?php endif ?>', 
     415<?php endforeach; ?> 
     416<?php endforeach; ?> 
     417    ); 
     418  } 
    399419}