Changeset 6005


Ignore:
Timestamp:
02/05/12 16:39:25 (4 months ago)
Author:
vain
Message:
  • serveral changes, so that setting a template manually via setTemplate() works again
  • main methods get|setTemplate are now inside the view_mapper
  • calls at the controller/modulecontroller level are proxied there
  • Clansuite_View_Mapper is now an object inside the Renderer_Base class
Location:
trunk/core
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/modulecontroller.core.php

    r6002 r6005  
    302302     * Get view returns the render engine 
    303303     * 
    304      * @param string $renderEngineName Sets the render engine, like smarty, phptal. 
     304     * @param string $renderEngineName Name of the render engine, like smarty, phptal. 
    305305     * @return Returns the View Object (Rendering Engine) 
    306306     */ 
     
    314314 
    315315        # if already set, get the rendering engine from the view variable 
    316         if (isset($this->view) === true) 
     316        if(isset($this->view) === true) 
    317317        { 
    318318            return $this->view; 
     
    411411    public function display($templates = null) 
    412412    { 
    413         $view_mapper = new Clansuite_View_Mapper; 
     413        # get the view 
     414        $this->view = $this->getView(); 
     415 
     416        # get the view mapper 
     417        $view_mapper = $this->view->getViewMapper(); 
    414418 
    415419        # set layout and content template by parameter array 
     
    432436        # get the templatename 
    433437        $template = $view_mapper->getTemplateName(); 
    434  
    435         # get the view 
    436         $this->view = $this->getView(); 
    437438 
    438439        # Debug display of Layout Template and Content Template 
  • trunk/core/renderer/renderer.base.php

    r6003 r6005  
    5353 
    5454    /** 
    55      * @var Object Holds instance of the Theme Object 
     55     * @var object Holds instance of the Theme Object 
    5656     */ 
    5757    public $theme = null; 
     
    6363 
    6464    /** 
    65      * @var string The "content" template 
    66      */ 
    67     public $template = null; 
    68  
    69     /** 
    7065     * @var string Variable for the RenderMode (available: WRAPPED) 
    7166     */ 
     
    8378 
    8479    /** 
     80     * @var object Clansuite_View_Mapper 
     81     */ 
     82    public $view_mapper = null; 
     83 
     84    /** 
    8585     * Construct Renderer 
    8686     * 
     
    8989    public function __construct(Clansuite_Config $config) 
    9090    { 
    91         $this->config   = $config; 
     91        $this->config = $config; 
     92        $this->view_mapper = new Clansuite_View_Mapper(); 
    9293    } 
    9394 
     
    164165    abstract public function clearCache(); 
    165166 
    166     /** 
    167      * Set the template name 
     167    public function getViewMapper() 
     168    { 
     169        return $this->view_mapper; 
     170    } 
     171 
     172    public function setViewMapper(Clansuite_View_Mapper $view_mapper) 
     173    { 
     174        $this->view_mapper = $view_mapper; 
     175    } 
     176 
     177    /** 
     178     * Set the template name. 
     179     * 
     180     * Proxies to Clansuite_View_Mapper::setTemplate() 
    168181     * 
    169182     * @param string $template Name of the Template (full path) 
     
    171184    public function setTemplate($template) 
    172185    { 
    173         $this->template = $template; 
     186        $this->getViewMapper()->setTemplate($template); 
    174187    } 
    175188 
    176189    /** 
    177190     * Get the template name 
     191     * 
     192     * Proxies to Clansuite_View_Mapper::getTemplate() 
     193     * 
     194     * @return string $template Name of the Template (full path) 
    178195     */ 
    179196    public function getTemplate() 
    180197    { 
    181         return $this->template; 
     198        return $this->getViewMapper()->getTemplate(); 
    182199    } 
    183200 
  • trunk/core/renderer/templatemapper.php

    r6002 r6005  
    109109 
    110110    /** 
     111     * Get the template name 
     112     * 
     113     * Proxies to Clansuite_View_Mapper::getTemplate() 
     114     * 
     115     * @return string $template Name of the Template (full path) 
     116     */ 
     117    public function getTemplate() 
     118    { 
     119        return $this->template; 
     120    } 
     121 
     122    /** 
    111123     * Returns the Template Path 
    112124     * 
Note: See TracChangeset for help on using the changeset viewer.