Changeset 265

Show
Ignore:
Timestamp:
02/14/07 18:03:38 (2 years ago)
Author:
mikey
Message:

added possibility to set the path where the images can be found

Files:

Legend:

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

    r264 r265  
    4040     */ 
    4141    protected $response; 
     42    /** 
     43     * list of callbacks 
     44     * 
     45     * @var  array 
     46     */ 
     47    protected $callbacks = array(); 
    4248     
    4349    /** 
     
    5056        stubXMLXIncludeStreamWrapper::setCachePath(stubConfig::getCachePath()); 
    5157        $xslProcessor = new stubXSLProcessor(); 
    52         $xslProcessor->registerCallback('image', new stubXSLImageDimensions(new stubDomXMLStreamWriter())); 
     58        $this->callbacks['image'] = new stubXSLImageDimensions(new stubDomXMLStreamWriter()); 
     59        $this->callbacks['image']->setPath(getcwd()); 
     60        $xslProcessor->registerCallback('image', $this->callbacks['image']); 
    5361        $xslProcessor->importXSLStylesheet(DOMDocument::load(stubFactory::getResourceURI('xsl/masterXInclude.xsl'))); 
    5462        stubXMLXIncludeStreamWrapper::setXSLProcessor($xslProcessor); 
     
    8290        // first we create the xsl with the master.xsl 
    8391        $xslProcessor = new stubXSLProcessor(); 
    84         $xslProcessor->registerCallback('image', new stubXSLImageDimensions(new stubDomXMLStreamWriter())); 
     92        $xslProcessor->registerCallback('image', $this->callbacks['image']); 
    8593        $xslProcessor->importXSLStylesheet(DOMDocument::load(stubFactory::getResourceURI('xsl/master.xsl'))); 
    8694        if ($this->request->hasValue('page') == true) { 
  • trunk/src/main/php/net/stubbles/xml/xsl/util/stubXSLImageDimensions.php

    r193 r265  
    3434     */ 
    3535    protected $xmlStreamWriter; 
     36    /** 
     37     * path to images 
     38     * 
     39     * @var  string 
     40     */ 
     41    protected $path            = null; 
    3642     
    3743    /** 
     
    4349    { 
    4450        $this->xmlStreamWriter = $xmlStreamWriter; 
     51    } 
     52     
     53    /** 
     54     * sets the path to the images 
     55     * 
     56     * @param  string  $path 
     57     */ 
     58    public function setPath($path) 
     59    { 
     60        $this->path = $path; 
    4561    } 
    4662     
     
    5975        } else { 
    6076            $imageFileName = $imageFile; 
     77        } 
     78         
     79        if (null !== $this->path) { 
     80            $imageFileName = $this->path . '/' . $imageFileName; 
    6181        } 
    6282