Changeset 3930
- Timestamp:
- 05/04/07 16:38:48 (6 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfOpenOfficePlugin/config/ooffice-unix.sh
r3891 r3930 19 19 20 20 echo ${XVFBRUN} -a ${SOFFICE} -norestore -invisible -headless -nologo "macro:///Standard.Convert.ConvertTo(\"$3\",\"$4\",\"$5\")" 21 ${XVFBRUN} -a ${SOFFICE} -norestore -invisible -headless -nologo "macro:///Standard.Convert.ConvertTo(\"$3\",\"$4\",\"$5\")" 21 #${XVFBRUN} -a ${SOFFICE} -norestore -invisible -headless -nologo "macro:///Standard.Convert.ConvertTo(\"$3\",\"$4\",\"$5\")" 22 ${SOFFICE} -display :0.0 -norestore -invisible -headless -nologo "macro:///Standard.Convert.ConvertTo(\"$3\",\"$4\",\"$5\")" 22 23 23 24 fi plugins/sfOpenOfficePlugin/data/transformations/odt.xsl
r3895 r3930 23 23 </xsl:template> 24 24 25 26 <!-- Table rows with code are replaced by code -->27 25 <xsl:template match="table:table-row[table:table-cell[text:p[starts-with(., '<?php') and substring(., string-length(.)-1, 2)='?>']]]"> 28 26 <xsl:call-template name="code"><xsl:with-param name="node" select="table:table-cell/text:p" /></xsl:call-template> 29 27 </xsl:template> 30 31 28 32 29 … … 56 53 57 54 55 <!-- BEGIN Writer Objects --> 56 <xsl:template match="draw:frame[starts-with(@draw:name, '$') and draw:object]"> 57 <?php if(<xsl:value-of select="@draw:name" /> instanceof sfOOObject): ?> 58 <xsl:copy> 59 <xsl:attribute name="draw:name"><?php echo <xsl:value-of select="@draw:name" />->getName(); ?></xsl:attribute> 60 <xsl:attribute name="svg:width"><?php echo <xsl:value-of select="@draw:name" />->getWidth('<xsl:value-of select="@svg:width"/>'); ?></xsl:attribute> 61 <xsl:attribute name="svg:height"><?php echo <xsl:value-of select="@draw:name" />->getHeight('<xsl:value-of select="@svg:height"/>'); ?></xsl:attribute> 62 <xsl:apply-templates select="@*" mode="dynamic" /> 63 <xsl:apply-templates select="draw:object" mode="dynamic"/> 64 </xsl:copy> 65 <?php else: ?> 66 <xsl:copy> 67 <xsl:apply-templates select="@*|node()" /> 68 </xsl:copy> 69 <?php endif; ?> 70 </xsl:template> 71 72 <xsl:template match="draw:object" mode="dynamic"> 73 <xsl:copy> 74 <xsl:attribute name="xlink:href"><?php echo <xsl:value-of select="../@draw:name" />->copyTo($sf_ooffice_out_dir); ?></xsl:attribute> 75 <xsl:apply-templates select="@*[not(name()='xlink:href')]|node()"/> 76 </xsl:copy> 77 </xsl:template> 78 79 <!-- END Writer Objects --> 80 81 <xsl:template name="code"> 82 <xsl:param name="node" /> 83 <xsl:if test="starts-with($node, '<?php') and substring($node, string-length($node)-1, 2)='?>'"> 84 <?php <xsl:value-of select="substring($node, 6, string-length($node)-7)" disable-output-escaping="yes"/> ?> 85 </xsl:if> 86 </xsl:template> 87 58 88 </xsl:stylesheet> plugins/sfOpenOfficePlugin/lib/sfOOImage.class.php
r3891 r3930 1 1 <?php 2 3 4 class sfOOImage 5 { 2 class sfOOImage { 6 3 7 4 protected $name; 8 5 protected $path; 9 6 protected $options; 10 11 public function sfOOImage($name, $path, $options=array()) 12 { 7 8 public function sfOOImage($name, $path, $options = array ()) { 13 9 $this->name = $name; 14 10 $this->path = $path; 15 11 $this->options = $options; 16 12 } 17 18 public function getName() 19 { 13 14 public function getName() { 20 15 return $this->name; 21 16 } 22 17 23 public function copyTo($destination) 24 { 18 public function copyTo($destination) { 25 19 // check if Pictures directory exists in the destination 26 if (!is_dir($destination.'Pictures')) {27 mkdir($destination .'Pictures');20 if (!is_dir($destination . 'Pictures')) { 21 mkdir($destination . 'Pictures'); 28 22 } 29 23 30 24 $out = 'Pictures' . DIRECTORY_SEPARATOR . basename($this->path); 31 @ copy($this->path, $destination . $out);25 @ copy($this->path, $destination . $out); 32 26 33 27 // return xlink:href … … 35 29 } 36 30 37 public function getWidth($default) 38 { 39 if(isset($this->options['width'])) { 31 public function getWidth($default) { 32 if (isset ($this->options['width'])) { 40 33 return $this->options['width']; 41 } 42 else { 34 } else { 43 35 return $default; 44 36 } 45 37 } 46 38 47 public function getHeight($default) 48 { 49 if(isset($this->options['height'])) { 39 public function getHeight($default) { 40 if (isset ($this->options['height'])) { 50 41 return $this->options['height']; 51 } 52 else { 42 } else { 53 43 return $default; 54 44 }