Skip to content

Commit

Permalink
Fix doxygen
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Apr 28, 2017
1 parent 9c2ce02 commit 05fe0d7
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 25 deletions.
30 changes: 19 additions & 11 deletions htdocs/includes/odtphp/Segment.php
@@ -1,14 +1,16 @@
<?php
require 'SegmentIterator.php';
class SegmentException extends Exception
{}
{
}

/**
* Class for handling templating segments with odt files
* You need PHP 5.2 at least
* You need Zip Extension or PclZip library
*
* @copyright GPL License 2008 - Julien Pauli - Cyril PIERRE de GEYER - Anaska (http://www.anaska.com)
* @copyright GPL License 2012 - Stephen Larroque - lrq3000@gmail.com
* @copyright 2008 - Julien Pauli - Cyril PIERRE de GEYER - Anaska (http://www.anaska.com)
* @copyright 2012 - Stephen Larroque - lrq3000@gmail.com
* @license http://www.gnu.org/copyleft/gpl.html GPL License
* @version 1.4.5 (last update 2013-04-07)
*/
Expand All @@ -22,11 +24,13 @@ class Segment implements IteratorAggregate, Countable
protected $images = array();
protected $odf;
protected $file;

/**
* Constructor
*
* @param string $name name of the segment to construct
* @param string $xml XML tree of the segment
* @param string $name name of the segment to construct
* @param string $xml XML tree of the segment
* @param string $odf odf
*/
public function __construct($name, $xml, $odf)
{
Expand Down Expand Up @@ -152,10 +156,11 @@ public function merge()

return $this->xmlParsed;
}

/**
* Analyse the XML code in order to find children
*
* @param string $xml
* @param string $xml Xml
* @return Segment
*/
protected function _analyseChildren($xml)
Expand All @@ -172,11 +177,14 @@ protected function _analyseChildren($xml)
}
return $this;
}

/**
* Assign a template variable to replace
*
* @param string $key
* @param string $value
* @param string $key Key
* @param string $value Value
* @param string $encode Encode
* @param string $charset Charset
* @throws SegmentException
* @return Segment
*/
Expand Down Expand Up @@ -230,7 +238,7 @@ public function setImage($key, $value)
/**
* Shortcut to retrieve a child
*
* @param string $prop
* @param string $prop Prop
* @return Segment
* @throws SegmentException
*/
Expand All @@ -245,8 +253,8 @@ public function __get($prop)
/**
* Proxy for setVars
*
* @param string $meth
* @param array $args
* @param string $meth Meth
* @param array $args Args
* @return Segment
*/
public function __call($meth, $args)
Expand Down
37 changes: 23 additions & 14 deletions htdocs/includes/odtphp/odf.php
@@ -1,16 +1,20 @@
<?php

require 'Segment.php';

class OdfException extends Exception
{}
{
}

/**
* Templating class for odt file
* You need PHP 5.2 at least
* You need Zip Extension or PclZip library
*
* @copyright GPL License 2008 - Julien Pauli - Cyril PIERRE de GEYER - Anaska (http://www.anaska.com)
* @copyright GPL License 2010-2015 - Laurent Destailleur - eldy@users.sourceforge.net
* @copyright GPL License 2010 - Vikas Mahajan - http://vikasmahajan.wordpress.com
* @copyright GPL License 2012 - Stephen Larroque - lrq3000@gmail.com
* @copyright 2008 - Julien Pauli - Cyril PIERRE de GEYER - Anaska (http://www.anaska.com)
* @copyright 2010-2015 - Laurent Destailleur - eldy@users.sourceforge.net
* @copyright 2010 - Vikas Mahajan - http://vikasmahajan.wordpress.com
* @copyright 2012 - Stephen Larroque - lrq3000@gmail.com
* @license http://www.gnu.org/copyleft/gpl.html GPL License
* @version 1.5.0
*/
Expand Down Expand Up @@ -43,7 +47,8 @@ class Odf
/**
* Class constructor
*
* @param string $filename the name of the odt file
* @param string $filename The name of the odt file
* @param string $config Array of config data
* @throws OdfException
*/
public function __construct($filename, $config = array())
Expand Down Expand Up @@ -116,9 +121,10 @@ public function __construct($filename, $config = array())
/**
* Assing a template variable
*
* @param string $key name of the variable within the template
* @param string $value replacement value
* @param bool $encode if true, special XML characters are encoded
* @param string $key Name of the variable within the template
* @param string $value Replacement value
* @param bool $encode If true, special XML characters are encoded
* @param string $charset Charset
* @throws OdfException
* @return odf
*/
Expand All @@ -129,7 +135,7 @@ public function setVars($key, $value, $encode = true, $charset = 'ISO-8859')
// <text:span text:style-name="T13">{</text:span><text:span text:style-name="T12">aaa</text:span><text:span text:style-name="T13">}</text:span>
// instead of {aaa} so we should enhance this function.
//print $key.'-'.$value.'-'.strpos($this->contentXml, $this->config['DELIMITER_LEFT'] . $key . $this->config['DELIMITER_RIGHT']).'<br>';
if (strpos($this->contentXml, $tag) === false && strpos($this->stylesXml , $tag) === false) {
if (strpos($this->contentXml, $tag) === false && strpos($this->stylesXml, $tag) === false) {
//if (strpos($this->contentXml, '">'. $key . '</text;span>') === false) {
throw new OdfException("var $key not found in the document");
//}
Expand Down Expand Up @@ -577,6 +583,7 @@ public function exportAsAttachedPDF($name="")
}
else
{
dol_syslog(get_class($this).'::exportAsAttachedPDF is used but the constant MAIN_DOL_SCRIPTS_ROOT with path to script directory was not defined.', LOG_WARNING);
$command = '../../scripts/odt2pdf/odt2pdf.sh '.escapeshellcmd($name).' '.(is_numeric($conf->global->MAIN_ODT_AS_PDF)?'jodconverter':$conf->global->MAIN_ODT_AS_PDF);
}

Expand Down Expand Up @@ -642,7 +649,8 @@ public function exportAsAttachedPDF($name="")
/**
* Returns a variable of configuration
*
* @return string The requested variable of configuration
* @param string $configKey Config key
* @return string The requested variable of configuration
*/
public function getConfig($configKey)
{
Expand Down Expand Up @@ -678,7 +686,8 @@ public function __destruct()

/**
* Empty the temporary working directory recursively
* @param $dir the temporary working directory
*
* @param string $dir The temporary working directory
* @return void
*/
private function _rrmdir($dir)
Expand All @@ -701,8 +710,8 @@ private function _rrmdir($dir)
/**
* return the value present on odt in [valuename][/valuename]
*
* @param string $value name balise in the template
* @return string the value inside the balise
* @param string $valuename Balise in the template
* @return string The value inside the balise
*/
public function getvalue($valuename)
{
Expand Down

0 comments on commit 05fe0d7

Please sign in to comment.