Changeset 814

Show
Ignore:
Timestamp:
08/14/07 16:27:48 (1 year ago)
Author:
mikey
Message:

bugfixes, move patError handling into template abstraction class

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/websites/memphis/stubMemphisProcessor.php

    r813 r814  
    112112        } 
    113113         
    114         $result = $this->template->getParsedTemplate('frame'); 
    115         if (patErrorManager::isError($result) == true) { 
    116             $result = $result->getMessage(); 
    117         } 
    118          
    119         $this->response->write($result); 
     114        $this->response->write($this->template->getParsedTemplate('frame')); 
    120115    } 
    121116 
     
    130125    protected function processElement(stubPageElement $element, stubRequest $request, array $context) 
    131126    { 
    132         if ($element->isAvailable($request, $this->session, $this->response, $context) == false) { 
     127        if ($element->isAvailable($request, $this->session, $this->response, $context) === false) { 
    133128            return ''; 
    134129        } 
     
    172167    { 
    173168        $this->template->addGlobalVar('UCUO_FRAME', $this->getFrameId($page)); 
    174         $this->template->addGlobalVar('SHOP_TITLE', $page->getProperty('title')); 
     169        $this->template->addGlobalVar('PAGE_TITLE', $page->getProperty('title')); 
    175170        $this->template->addGlobalVar('PAGE_NAME', $this->getPageName('memphis')); 
    176171        $this->template->addGlobalVar('VARIANT', $this->session->getValue('net.stubbles.websites.variantmanager.variant', '')); 
  • trunk/src/main/php/net/stubbles/websites/memphis/stubMemphisTemplate.php

    r813 r814  
    9393     * @return  mixed 
    9494     * @throws  stubIllegalAccessException 
     95     * @throws  stubException 
    9596     */ 
    9697    public function __call($method, $arguments) 
    9798    { 
    9899        if (method_exists($this->template, $method) == true) { 
    99             return call_user_func_array(array($this->template, $method), $arguments); 
     100            $return = call_user_func_array(array($this->template, $method), $arguments); 
     101            if (patErrorManager::isError($return) == true) { 
     102                throw new stubException($return->getMessage()); 
     103            } 
     104             
     105            return $return; 
    100106        } 
    101107         
    102         throw new stubIllegalAccessException('Method patTemplate::' . $method . ' does not exist.'); 
     108        $backtrace = debug_backtrace(); 
     109        throw new stubIllegalAccessException('Method patTemplate::' . $method . ' called in ' . $backtrace[2]['class'] . '::' . $backtrace[2]['function'] . '() on line ' . $backtrace[2]['line'] . ' does not exist.'); 
    103110    } 
    104111}