Changeset 4578 for trunk/core/modulecontroller.core.php
- Timestamp:
- 08/15/10 18:45:12 (22 months ago)
- File:
-
- 1 edited
-
trunk/core/modulecontroller.core.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/modulecontroller.core.php
r4568 r4578 24 24 * 25 25 * @license GNU/GPL v2 or (at your option) any later version, see "/doc/LICENSE". 26 *27 26 * @author Jens-André Koch <vain@clansuite.com> 28 27 * @copyright Jens-André Koch (2005 - onwards) 29 *30 28 * @link http://www.clansuite.com 31 * @link http://gna.org/projects/clansuite32 29 * 33 30 * @version SVN: $Id$ … … 38 35 { 39 36 die('Clansuite not loaded. Direct Access forbidden.'); 40 }41 42 /**43 * Interface for all modules44 *45 * Force classes implementing the interface to define this (must have) methods!46 *47 * @category Clansuite48 * @package Core49 * @subpackage Module50 */51 interface Clansuite_Module_Interface52 {53 # always needed is the main initializeModule() method54 function initializeModule(Clansuite_HttpRequest $request, Clansuite_HttpResponse $response);55 37 } 56 38 … … 89 71 90 72 /** 73 * @var object The Http_Request Object 74 */ 75 public $request = null; 76 77 /** 91 78 * @var array The Module Configuration Array 92 79 */ 93 80 public $moduleconfig = null; 81 82 public function __construct(Clansuite_HttpRequest $request, Clansuite_HttpResponse $response) 83 { 84 $this->request = $request; 85 $this->response = $response; 86 } 94 87 95 88 /** … … 109 102 if($modulename === null) 110 103 { 111 $modulename = Clansuite_ Dispatcher::getModuleName();104 $modulename = Clansuite_HttpRequest::getRoute()->getModuleName(); 112 105 } 113 106 … … 282 275 { 283 276 # check if the requesttype is xmlhttprequest (ajax) is incomming, then we will return data in json format 284 if(self::getHttpRequest()->is xhr() === true)277 if(self::getHttpRequest()->isAjax() === true) 285 278 { 286 279 $this->setRenderEngine('json'); … … 361 354 private function constructTemplateName() 362 355 { 363 $template = Clansuite_ Dispatcher::getActionName() . '.tpl';356 $template = Clansuite_TargetRoute::getActionName() . '.tpl'; 364 357 $this->setTemplate($template); 365 358 } … … 419 412 } 420 413 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); 429 431 } 430 432 … … 494 496 $referer = self::getHttpRequest()->getReferer(); 495 497 496 if(empty($referer) == false)498 if(empty($referer) === false) 497 499 { 498 500 $this->redirect($referer); … … 500 502 else 501 503 { 502 $this->redirect( WWW_ROOT . Clansuite_ Module_Controller_Resolver::getModuleName() );504 $this->redirect( WWW_ROOT . Clansuite_HttpRequest::getRoute()->getModuleName() ); 503 505 } 504 506 } … … 557 559 public function getHttpRequest() 558 560 { 559 return self::getInjector()->instantiate('Clansuite_HttpRequest');561 return $this->request; 560 562 } 561 563 … … 567 569 public function getHttpResponse() 568 570 { 569 return self::getInjector()->instantiate('Clansuite_HttpResponse');571 return $this->response; 570 572 } 571 573 }
Note: See TracChangeset
for help on using the changeset viewer.
