Ignore:
Timestamp:
08/15/10 18:45:12 (22 months ago)
Author:
vain
Message:
  • several changes to copyright, router, bootstrap, frontcontroller and various other files
File:
1 edited

Legend:

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

    r4568 r4578  
    2424    * 
    2525    * @license    GNU/GPL v2 or (at your option) any later version, see "/doc/LICENSE". 
    26     * 
    2726    * @author     Jens-André Koch <vain@clansuite.com> 
    2827    * @copyright  Jens-André Koch (2005 - onwards) 
    29     * 
    3028    * @link       http://www.clansuite.com 
    31     * @link       http://gna.org/projects/clansuite 
    3229    * 
    3330    * @version    SVN: $Id$ 
     
    3835{ 
    3936    die('Clansuite not loaded. Direct Access forbidden.'); 
    40 } 
    41  
    42 /** 
    43  * Interface for all modules 
    44  * 
    45  * Force classes implementing the interface to define this (must have) methods! 
    46  * 
    47  * @category    Clansuite 
    48  * @package     Core 
    49  * @subpackage  Module 
    50  */ 
    51 interface Clansuite_Module_Interface 
    52 { 
    53     # always needed is the main initializeModule() method 
    54     function initializeModule(Clansuite_HttpRequest $request, Clansuite_HttpResponse $response); 
    5537} 
    5638 
     
    8971 
    9072    /** 
     73     * @var object The Http_Request Object 
     74     */ 
     75    public $request = null; 
     76 
     77    /** 
    9178     * @var array The Module Configuration Array 
    9279     */ 
    9380    public $moduleconfig = null; 
     81 
     82    public function __construct(Clansuite_HttpRequest $request, Clansuite_HttpResponse $response) 
     83    { 
     84        $this->request = $request; 
     85        $this->response = $response; 
     86    } 
    9487 
    9588    /** 
     
    109102        if($modulename === null) 
    110103        { 
    111             $modulename = Clansuite_Dispatcher::getModuleName(); 
     104            $modulename = Clansuite_HttpRequest::getRoute()->getModuleName(); 
    112105        } 
    113106 
     
    282275    { 
    283276        # check if the requesttype is xmlhttprequest (ajax) is incomming, then we will return data in json format 
    284         if(self::getHttpRequest()->isxhr() === true) 
     277        if(self::getHttpRequest()->isAjax() === true) 
    285278        { 
    286279            $this->setRenderEngine('json'); 
     
    361354    private function constructTemplateName() 
    362355    { 
    363         $template = Clansuite_Dispatcher::getActionName() . '.tpl'; 
     356        $template = Clansuite_TargetRoute::getActionName() . '.tpl'; 
    364357        $this->setTemplate($template); 
    365358    } 
     
    419412        } 
    420413 
    421         $response = $this->getHttpResponse();         
    422  
    423         # Debug - Layout Template and Content Template 
    424         # Clansuite_Debug::firebug('Layout/Wrapper Template: ' . $view->getLayoutTemplate() . '<br />'); 
    425         # Clansuite_Debug::firebug('Template Name: ' .$this->getTemplateName() . '<br />'); 
    426  
    427         #  Set Content on the Response Object 
    428         $response->setContent($this->getView()->render($this->getTemplateName())); 
     414        # get the templatename 
     415        $templatename = $this->getTemplateName(); 
     416 
     417        # get the view 
     418        $this->view = $this->getView(); 
     419 
     420        # Debug display of Layout Template and Content Template 
     421        Clansuite_Debug::firebug('Layout/Wrapper Template: ' . $this->view->getLayoutTemplate() . '<br />'); 
     422        Clansuite_Debug::firebug('Template Name: ' . $templatename . '<br />'); 
     423 
     424        # render the content / template 
     425        $content = $this->view->render($templatename); 
     426 
     427        # push content to the response object 
     428        $this->response->setContent($content); 
     429 
     430        unset($content, $templatename); 
    429431    } 
    430432 
     
    494496        $referer = self::getHttpRequest()->getReferer(); 
    495497 
    496         if(empty($referer) == false) 
     498        if(empty($referer) === false) 
    497499        { 
    498500            $this->redirect($referer); 
     
    500502        else 
    501503        { 
    502             $this->redirect( WWW_ROOT . Clansuite_Module_Controller_Resolver::getModuleName() ); 
     504            $this->redirect( WWW_ROOT . Clansuite_HttpRequest::getRoute()->getModuleName() ); 
    503505        } 
    504506    } 
     
    557559    public function getHttpRequest() 
    558560    { 
    559         return self::getInjector()->instantiate('Clansuite_HttpRequest'); 
     561        return $this->request; 
    560562    } 
    561563 
     
    567569    public function getHttpResponse() 
    568570    { 
    569         return self::getInjector()->instantiate('Clansuite_HttpResponse'); 
     571        return $this->response; 
    570572    } 
    571573} 
Note: See TracChangeset for help on using the changeset viewer.