Changeset 302

Show
Ignore:
Timestamp:
02/28/07 16:47:04 (2 years ago)
Author:
mikey
Message:

some optimizations

Files:

Legend:

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

    r294 r302  
    3232     */ 
    3333    protected $response; 
    34     /** 
    35      * list of callbacks 
    36      * 
    37      * @var  array 
    38      */ 
    39     protected $callbacks = array(); 
    4034     
    4135    /** 
     
    4741        stubXMLXIncludeStreamWrapper::setIncludePath(stubConfig::getConfigPath() . '/xml/pages/txt'); 
    4842        stubXMLXIncludeStreamWrapper::setCachePath(stubConfig::getCachePath()); 
    49         $xslProcessor = new stubXSLProcessor(); 
    50         $this->callbacks['image'] = new stubXSLImageDimensions(stubXMLStreamWriterFactory::createAsAvailable()); 
    51         $this->callbacks['image']->setPath(getcwd()); 
    52         $xslProcessor->registerCallback('image', $this->callbacks['image']); 
    53         $xslProcessor->importXSLStylesheet(DOMDocument::load(stubFactory::getResourceURI('xsl/masterXInclude.xsl'))); 
    54         stubXMLXIncludeStreamWrapper::setXSLProcessor($xslProcessor); 
    5543    } 
    5644 
     
    7260        // first we create the xsl with the master.xsl 
    7361        $xslProcessor = new stubXSLProcessor(); 
    74         $xslProcessor->registerCallback('image', $this->callbacks['image']); 
     62        $image = new stubXSLImageDimensions(stubXMLStreamWriterFactory::createAsAvailable()); 
     63        $image->setPath(getcwd()); 
     64        $xslProcessor->registerCallback('image', $image); 
    7565        $xslProcessor->importXSLStylesheet(DOMDocument::load(stubFactory::getResourceURI('xsl/master.xsl'))); 
    76          
    7766        $page = $this->response->getPage(); 
    7867        $xslProcessor->setParameter('', 'page', $page->getProperty('name')); 
     68        // use same xsl processor for the xincludes 
     69        stubXMLXIncludeStreamWrapper::setXSLProcessor($xslProcessor); 
     70         
    7971        if ($page->hasProperty('skin') == true) { 
    8072            $skin = $page->getProperty('skin');