Changeset 6819
- Timestamp:
- 12/30/07 03:16:16 (1 year ago)
- Files:
-
- plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/__list_ajax_action.php (added)
- plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_edit_ajax_actions.php (modified) (1 diff)
- plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_edit_form_ajax_tabpages.php (modified) (2 diffs)
- plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_actions.php (modified) (1 diff)
- plugins/sfExtjsThemePlugin/lib/sfExtjsPropelAdminGenerator.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_edit_ajax_actions.php
r6586 r6819 28 28 // save template file 29 29 $template = '_'.$edit_name.'_ajax_actions.php'; 30 $generatedModuleName = 'auto'. $this->className;30 $generatedModuleName = 'auto'.ucfirst(strToLower($this->className)); 31 31 $this->getGeneratorManager()->getCache()->set($template, $generatedModuleName.DIRECTORY_SEPARATOR.'templates', $retval); 32 32 } plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_edit_form_ajax_tabpages.php
r6718 r6819 32 32 $content .= $innerContent; 33 33 $content .= '</div>'; 34 35 34 36 35 // replace [?php and ?] … … 44 43 // save template file 45 44 $template = '_'.$edit_name.'_form_ajax.php'; 46 $generatedModuleName = 'auto'. $this->className;45 $generatedModuleName = 'auto'.ucfirst(strToLower($this->className)); 47 46 $this->getGeneratorManager()->getCache()->set($template, $generatedModuleName.DIRECTORY_SEPARATOR.'templates', $retval); 48 47 49 48 ?> 50 49 include_partial('<?php echo $edit_name?>_form_ajax', array('<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>, 'labels' => $labels)); 51 <?php 52 endforeach; 53 ?> 50 <?php endforeach; ?> 54 51 ?] 55 52 </div> plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_actions.php
r6146 r6819 1 1 2 2 <?php $listActions = $this->getParameterValue('list.actions') ?> 3 <?php if (null !== $listActions): ?> 4 <?php foreach ((array) $listActions as $actionName => $params): ?> 5 <?php echo $this->addCredentialCondition($this->getAjaxButtonToToolbarAction($actionName, $params, false), $params) ?> 6 <?php endforeach; ?> 7 <?php else: ?> 8 <?php echo $this->getAjaxButtonToToolbarAction('_create', array('name' => 'Add new '.$this->getClassName()), false) ?> 9 <?php echo $this->getAjaxButtonToToolbarAction('_refresh', array(), false) ?> 10 <?php endif; ?> 3 <?php 4 if (null === $listActions) 5 { 6 $listActions = array( 7 '_create' => array(), 8 '_refresh' => array() 9 ); 10 } 11 ?> 12 13 <?php foreach ((array) $listActions as $actionName => $params): ?> 14 <?php 15 //get 'super' template 16 ob_start(); 17 require('__list_ajax_action.php'); 18 $content = ob_get_clean(); 19 20 // save template file, HACK: resolving the modulename might not always be correct but what symfony does is really dirty.... 21 $template = '_list_ajax_action_'.$actionName.'.php'; 22 $generatedModuleName = 'auto'.ucfirst(strToLower($this->className)); 23 $this->getGeneratorManager()->getCache()->set($template, $generatedModuleName.DIRECTORY_SEPARATOR.'templates', $content); 24 25 ?> 26 [?php include_partial('list_ajax_action_<?php echo $actionName?>'); ?] 27 <?php endforeach; ?> plugins/sfExtjsThemePlugin/lib/sfExtjsPropelAdminGenerator.php
r6720 r6819 35 35 $default_icon = sfConfig::get('sf_admin_web_dir').'/images/'.$actionName.'_icon.png'; 36 36 $default_action = $actionName; 37 $default_class = ' sf_admin_action_'.$actionName;37 $default_class = 'btn_'.$actionName; 38 38 $default_handler_function = "Ext.Msg.alert('Error','handler_function is not defined!');"; 39 39 … … 48 48 break; 49 49 case 'create': 50 $ name = isset($params['name']) ? $params['name'] : $default_name;51 $default_handler_function = "addTab('".$ name."', { url: '".$controller->genUrl($this->getModuleName().'/create')."', scripts: true, method: 'GET' }, 'create_".$this->getClassName()."')";50 $default_name = isset($params['name']) ? $params['name'] : 'Add new '.$this->getClassName(); 51 $default_handler_function = "addTab('".$default_name."', { url: '".$controller->genUrl($this->getModuleName().'/create')."', scripts: true, method: 'GET' }, 'create_".$this->getClassName()."')"; 52 52 break; 53 53 case 'refresh': … … 73 73 if (!isset($options['class'])) 74 74 { 75 if ($default_class) 75 if (isset($params['class'])) 76 { 77 $options['class'] = $params['class']; 78 } 79 elseif ($default_class) 76 80 { 77 81 $options['class'] = $default_class; … … 82 86 } 83 87 } 88 $actionClass = $options['class']; 84 89 85 90 $html = ''; … … 101 106 102 107 // little hack 108 //TODO: phpOptions is not used! 103 109 $phpOptions = preg_replace("/'confirm' => '(.+?)(?<!\\\)'/", '\'confirm\' => __(\'$1\')', $phpOptions); 104 110 … … 109 115 action: '".$action."', 110 116 idRequired: false, 111 cls: 'x-btn-text-icon btn_".$actionName."',117 cls: 'x-btn-text-icon ".$actionClass."', 112 118 disabled: false, 113 119 handler : function(){ ".$handler_function." }