Changeset 5992
- Timestamp:
- 02/02/12 19:39:34 (4 months ago)
- Location:
- trunk/core
- Files:
-
- 2 edited
-
modulecontroller.core.php (modified) (6 diffs)
-
renderer/templatemapper.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/modulecontroller.core.php
r5991 r5992 93 93 94 94 /** 95 * Returns the Doctrine Entity Manager 95 * Returns the Doctrine Entity Manager 96 96 * 97 97 * @return \Doctrine\ORM\EntityManager … … 200 200 201 201 $repos = $module_models_path . 'repositories' . DS . ucfirst($modulename) . 'Repository.php'; 202 202 203 203 if(is_file($repos) === true and class_exists('Entities\\' . ucfirst($modulename), false) === false) 204 204 { … … 372 372 373 373 /** 374 * Set the template name375 *376 * @param string $template Name of the Template with full Path377 */378 public function setTemplate($template)379 {380 #self::checkTemplateExtension($template);381 $this->template = $template;382 }383 384 /**385 374 * Sets the Render Mode 386 375 * … … 422 411 public function display($templates = null) 423 412 { 413 include ROOT_CORE . 'renderer/templatemapper.php'; 414 $view_mapper = new Clansuite_View_Mapper; 415 424 416 # set layout and content template by parameter array 425 417 if(is_array($templates) === true) … … 427 419 if(isset($templates['layout_template']) === true) 428 420 { 429 $ this->setLayoutTemplate($templates['layout_template']);421 $view_mapper->setLayoutTemplate($templates['layout_template']); 430 422 } 431 423 432 424 if(isset($templates['content_template']) === true) 433 425 { 434 $ this->setTemplate($templates['content_template']);426 $view_mapper->setTemplate($templates['content_template']); 435 427 } 436 428 } 437 429 438 430 # only the content template is set 439 if(is_string($templates)) { $ this->setTemplate($templates); }431 if(is_string($templates)) { $view_mapper->setTemplate($templates); } 440 432 441 433 # get the templatename 442 $templatename = $ this->getTemplateName();434 $templatename = $view_mapper->getTemplateName(); 443 435 444 436 # get the view … … 521 513 $route = Clansuite_HttpRequest::getRoute(); 522 514 523 # we use internal rewrite style here: /module/action 515 # we use internal rewrite style here: /module/action 524 516 $redirect_to = '/' . $route->getModuleName(); 525 517 $submodule = $route->getSubModuleName(); -
trunk/core/renderer/templatemapper.php
r5991 r5992 43 43 * Clansuite_View_Mapper is a "class action" to "template" mapper. 44 44 * This has nothing to do with rendering, but with template selection for the view. 45 * If no template was set manually in the action of a module (class), 46 * this class will help determining the template, 45 * If no template was set manually in the action of a module (class), 46 * this class will help determining the template, 47 47 * by mapping the requested class and action to a template. 48 48 */ 49 49 class Clansuite_View_Mapper 50 50 { 51 /** 52 * Template name. 53 * 54 * @var string 55 */ 56 public $template; 57 51 58 /** 52 59 * Ensures the template extension is correct. … … 82 89 # construct template name 83 90 $template = Clansuite_TargetRoute::getActionName() . '.tpl'; 84 91 85 92 $this->setTemplate($template); 86 93 } … … 88 95 return $this->template; 89 96 } 97 98 /** 99 * Set the template name 100 * 101 * @param string $template Name of the Template with full Path 102 */ 103 public function setTemplate($template) 104 { 105 #self::checkTemplateExtension($template); 106 $this->template = (string) $template; 107 } 90 108 } 91 109 ?>
Note: See TracChangeset
for help on using the changeset viewer.
