Changeset 9583
- Timestamp:
- Dec 18, 2008, 1:57:53 AM (14 years ago)
- Location:
- OpenPNE3/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
OpenPNE3/trunk/lib/config/sfOpenPNEViewConfigHandler.class.php
r8567 r9583 91 91 $target .= ')'; 92 92 93 $data .= " \$this->setCustomize('$name', '{$template[0]}', '{$template[1]}', $category, $parts, $target);\n"; 93 $isComponent = 'false'; 94 if (!empty($customize['is_component'])) 95 { 96 $isComponent = 'true'; 97 } 98 99 $data .= " \$this->setCustomize('$name', '{$template[0]}', '{$template[1]}', $category, $parts, $target, $isComponent);\n"; 94 100 $data .= " if (sfConfig::get('sf_logging_enabled')) \$this->context->getEventDispatcher()->notify(new sfEvent(\$this, 'application.log', array(sprintf('Set customize \"%s\" (%s/%s)', '$name', '{$template[0]}', '{$template[1]}'))));\n"; 95 101 } -
OpenPNE3/trunk/lib/helper/PartsHelper.php
r9510 r9583 100 100 $lastActionStack = $context->getActionStack()->getLastEntry(); 101 101 102 103 102 $content = ''; 104 103 foreach ($customizes as $customize) { … … 107 106 $moduleName = $lastActionStack->getModuleName(); 108 107 } 109 $actionName = '_'.$customize[1]; 110 $view = new sfPartialView($context, $moduleName, $actionName, ''); 111 $view->setPartialVars($lastActionStack->getActionInstance()->getVarHolder()->getAll()); 112 if (_is_disabled_plugin_dir($view->getDirectory())) { 113 continue; 108 $actionName = $customize[1]; 109 $vars = $lastActionStack->getActionInstance()->getVarHolder()->getAll(); 110 111 if ($customize[2]) 112 { 113 $content .= get_component($moduleName, $actionName, $vars); 114 114 } 115 $content .= $view->render(); 115 else 116 { 117 $templateName = $moduleName.'/'.$actionName; 118 $content .= get_partial($templateName, $vars); 119 } 116 120 } 117 121 -
OpenPNE3/trunk/lib/view/sfOpenPNEView.class.php
r8567 r9583 25 25 public $customizeTemplates = array(); 26 26 27 protected $customizeComponents = array(); 28 27 29 /** 28 30 * Sets the customize. … … 34 36 * @param array $partsNames Parts names 35 37 * @param array $targetNames Target names 38 * @param bool $isComponent 36 39 */ 37 public function setCustomize($attributeName, $moduleName, $templateName, $categoryNames, $partsNames, $targetNames )40 public function setCustomize($attributeName, $moduleName, $templateName, $categoryNames, $partsNames, $targetNames, $isComponent = false) 38 41 { 39 42 if (empty($categoryNames)) … … 73 76 } 74 77 75 $this->customizeTemplates[$attributeName] = array($moduleName, $templateName );78 $this->customizeTemplates[$attributeName] = array($moduleName, $templateName, $isComponent); 76 79 } 77 80 -
OpenPNE3/trunk/test/unit/config/sfOpenPNEViewConfigHandlerTest.php
r8570 r9583 35 35 36 36 $content = <<<EOF 37 \$this->setCustomize('first', '', 'first', array(), array(), array() ); if (sfConfig::get('sf_logging_enabled')) \$this->context->getEventDispatcher()->notify(new sfEvent(\$this, 'application.log', array(sprintf('Set customize "%s" (%s/%s)', 'first', '', 'first'))));37 \$this->setCustomize('first', '', 'first', array(), array(), array(), false); if (sfConfig::get('sf_logging_enabled')) \$this->context->getEventDispatcher()->notify(new sfEvent(\$this, 'application.log', array(sprintf('Set customize "%s" (%s/%s)', 'first', '', 'first')))); 38 38 EOF; 39 39 $t->is(strip_cl($h->addCustomizes('myView')), strip_cl($content), 'addCustomizes() basic customize addition');
Note: See TracChangeset
for help on using the changeset viewer.