Changeset 265
- Timestamp:
- 02/14/07 18:03:38 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/websites/xml/stubXMLPagePostInterceptor.php
r264 r265 40 40 */ 41 41 protected $response; 42 /** 43 * list of callbacks 44 * 45 * @var array 46 */ 47 protected $callbacks = array(); 42 48 43 49 /** … … 50 56 stubXMLXIncludeStreamWrapper::setCachePath(stubConfig::getCachePath()); 51 57 $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']); 53 61 $xslProcessor->importXSLStylesheet(DOMDocument::load(stubFactory::getResourceURI('xsl/masterXInclude.xsl'))); 54 62 stubXMLXIncludeStreamWrapper::setXSLProcessor($xslProcessor); … … 82 90 // first we create the xsl with the master.xsl 83 91 $xslProcessor = new stubXSLProcessor(); 84 $xslProcessor->registerCallback('image', new stubXSLImageDimensions(new stubDomXMLStreamWriter()));92 $xslProcessor->registerCallback('image', $this->callbacks['image']); 85 93 $xslProcessor->importXSLStylesheet(DOMDocument::load(stubFactory::getResourceURI('xsl/master.xsl'))); 86 94 if ($this->request->hasValue('page') == true) { trunk/src/main/php/net/stubbles/xml/xsl/util/stubXSLImageDimensions.php
r193 r265 34 34 */ 35 35 protected $xmlStreamWriter; 36 /** 37 * path to images 38 * 39 * @var string 40 */ 41 protected $path = null; 36 42 37 43 /** … … 43 49 { 44 50 $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; 45 61 } 46 62 … … 59 75 } else { 60 76 $imageFileName = $imageFile; 77 } 78 79 if (null !== $this->path) { 80 $imageFileName = $this->path . '/' . $imageFileName; 61 81 } 62 82
