Development

Changeset 1457

You must first sign up to be able to contribute.

Changeset 1457

Show
Ignore:
Timestamp:
06/16/06 15:21:10 (2 years ago)
Author:
fabien
Message:

fixes Themes don't allow new templates (fixes #616)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/generator/sfGenerator.class.php

    r1415 r1457  
    5656    { 
    5757      // eval template file 
    58       $template_template = $template_dir.'/templates/'.$template.'.php'
     58      $template_template = $template_dir.'/templates/'.$template
    5959      if (!is_readable($template_template)) 
    6060      { 
    61         $template_template = $default_template_dir.'/templates/'.$template.'.php'
     61        $template_template = $default_template_dir.'/templates/'.$template
    6262        if (!is_readable($template_template)) 
    6363        { 
     
    6969 
    7070      // save actions class 
    71       $this->getGeneratorManager()->getCache()->set($template.'.php', $generatedModuleName.DIRECTORY_SEPARATOR.'templates', $retval); 
     71      $this->getGeneratorManager()->getCache()->set($template, $generatedModuleName.DIRECTORY_SEPARATOR.'templates', $retval); 
    7272    } 
    7373  } 
  • trunk/lib/generator/sfPropelAdminGenerator.class.php

    r1415 r1457  
    7272    // theme exists? 
    7373    $theme = isset($this->params['theme']) ? $this->params['theme'] : 'default'; 
    74     if (!is_dir(sfConfig::get('sf_symfony_data_dir').'/generator/sfPropelAdmin/'.$theme.'/template')) 
     74    $themeDir = sfConfig::get('sf_symfony_data_dir').'/generator/sfPropelAdmin/'.$theme.'/template'; 
     75    if (!is_dir($themeDir)) 
    7576    { 
    7677      $error = 'The theme "%s" does not exist.'; 
     
    8081 
    8182    $this->setTheme($theme); 
    82     $templateFiles = array( 
    83       'listSuccess', 'editSuccess', '_filters',  
    84       '_list_th_'.$this->getParameterValue('list.layout', 'tabular'), '_list_td_'.$this->getParameterValue('list.layout', 'tabular'), 
    85       '_list_th_tabular', 
    86       '_list_header', '_edit_header', '_list_footer', '_edit_footer', 
    87       '_list_td_actions', '_list_actions', '_edit_actions', 
    88     ); 
     83 
     84    $templateFiles = sfFinder::type('file')->name('*.php')->relative()->in($themeDir.'/templates'); 
    8985    $this->generatePhpFiles($this->generatedModuleName, $templateFiles); 
    9086 
  • trunk/lib/generator/sfPropelCrudGenerator.class.php

    r1415 r1457  
    8383 
    8484    $this->setTheme($theme); 
    85     $this->generatePhpFiles($this->generatedModuleName, array('listSuccess', 'editSuccess', 'showSuccess')); 
     85    $this->generatePhpFiles($this->generatedModuleName, array('listSuccess.php', 'editSuccess.php', 'showSuccess.php')); 
    8686 
    8787    // require generated action class