Development

Changeset 3930

You must first sign up to be able to contribute.

Changeset 3930

Show
Ignore:
Timestamp:
05/04/07 16:38:48 (6 years ago)
Author:
promag
Message:

Added OLE support

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfOpenOfficePlugin/config/ooffice-unix.sh

    r3891 r3930  
    1919   
    2020  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\")" 
    2223 
    2324fi 
  • plugins/sfOpenOfficePlugin/data/transformations/odt.xsl

    r3895 r3930  
    2323</xsl:template> 
    2424 
    25  
    26 <!-- Table rows with code are replaced by code --> 
    2725<xsl:template match="table:table-row[table:table-cell[text:p[starts-with(., '&lt;?php') and substring(., string-length(.)-1, 2)='?&gt;']]]"> 
    2826  <xsl:call-template name="code"><xsl:with-param name="node" select="table:table-cell/text:p" /></xsl:call-template> 
    2927</xsl:template> 
    30  
    3128 
    3229 
     
    5653 
    5754 
     55<!-- BEGIN Writer  Objects --> 
     56<xsl:template match="draw:frame[starts-with(@draw:name, '$') and draw:object]"> 
     57  &lt;?php if(<xsl:value-of select="@draw:name" /> instanceof sfOOObject): ?&gt; 
     58  <xsl:copy> 
     59    <xsl:attribute name="draw:name">&lt;?php echo <xsl:value-of select="@draw:name" />-&gt;getName(); ?&gt;</xsl:attribute> 
     60    <xsl:attribute name="svg:width">&lt;?php echo <xsl:value-of select="@draw:name" />-&gt;getWidth('<xsl:value-of select="@svg:width"/>'); ?&gt;</xsl:attribute> 
     61    <xsl:attribute name="svg:height">&lt;?php echo <xsl:value-of select="@draw:name" />-&gt;getHeight('<xsl:value-of select="@svg:height"/>'); ?&gt;</xsl:attribute> 
     62    <xsl:apply-templates select="@*" mode="dynamic" /> 
     63    <xsl:apply-templates select="draw:object" mode="dynamic"/> 
     64  </xsl:copy> 
     65  &lt;?php else: ?&gt; 
     66  <xsl:copy> 
     67    <xsl:apply-templates select="@*|node()" /> 
     68  </xsl:copy> 
     69  &lt;?php endif; ?&gt; 
     70</xsl:template> 
     71 
     72<xsl:template match="draw:object" mode="dynamic"> 
     73  <xsl:copy> 
     74    <xsl:attribute name="xlink:href">&lt;?php echo <xsl:value-of select="../@draw:name" />-&gt;copyTo($sf_ooffice_out_dir); ?&gt;</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, '&lt;?php') and substring($node, string-length($node)-1, 2)='?&gt;'"> 
     84    &lt;?php <xsl:value-of select="substring($node, 6, string-length($node)-7)" disable-output-escaping="yes"/> ?&gt; 
     85  </xsl:if> 
     86</xsl:template> 
     87 
    5888</xsl:stylesheet> 
  • plugins/sfOpenOfficePlugin/lib/sfOOImage.class.php

    r3891 r3930  
    11<?php 
    2  
    3  
    4 class sfOOImage 
    5 
     2class sfOOImage { 
    63 
    74  protected $name; 
    85  protected $path; 
    96  protected $options; 
    10    
    11   public function sfOOImage($name, $path, $options=array()) 
    12   { 
     7 
     8  public function sfOOImage($name, $path, $options = array ()) { 
    139    $this->name = $name; 
    1410    $this->path = $path; 
    1511    $this->options = $options; 
    1612  } 
    17    
    18   public function getName() 
    19   { 
     13 
     14  public function getName() { 
    2015    return $this->name; 
    2116  } 
    2217 
    23   public function copyTo($destination) 
    24   { 
     18  public function copyTo($destination) { 
    2519    // 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'); 
    2822    } 
    2923 
    3024    $out = 'Pictures' . DIRECTORY_SEPARATOR . basename($this->path); 
    31     @copy($this->path, $destination . $out); 
     25    @ copy($this->path, $destination . $out); 
    3226 
    3327    // return xlink:href 
     
    3529  } 
    3630 
    37   public function getWidth($default) 
    38   { 
    39     if(isset($this->options['width'])) { 
     31  public function getWidth($default) { 
     32    if (isset ($this->options['width'])) { 
    4033      return $this->options['width']; 
    41     } 
    42     else { 
     34    } else { 
    4335      return $default; 
    4436    } 
    4537  } 
    4638 
    47   public function getHeight($default) 
    48   { 
    49     if(isset($this->options['height'])) { 
     39  public function getHeight($default) { 
     40    if (isset ($this->options['height'])) { 
    5041      return $this->options['height']; 
    51     } 
    52     else { 
     42    } else { 
    5343      return $default; 
    5444    }