From e54874c3ff388fa211e614a1fad987acff909edc Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 3 Jan 2023 14:07:38 +0100 Subject: [PATCH] some more documentation --- inc/inc.ClassConversionMgr.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/inc/inc.ClassConversionMgr.php b/inc/inc.ClassConversionMgr.php index 278d2e510..8e98a44df 100644 --- a/inc/inc.ClassConversionMgr.php +++ b/inc/inc.ClassConversionMgr.php @@ -72,18 +72,25 @@ class SeedDMS_ConversionMgr { * @param string $file name of file to convert * @param string $from mimetype of input file * @param string $to mimetype of output file + * @param string $target name of target file. If none is given the + * content of the converted document will be returned. + * @param array $params additional parameter needed for the conversion, + * e.g. the width of an image * * @return boolean true on success, other false */ - public function convert($file, $from, $to, $target=null, $params=array()) { + public function convert($file, $from, $to, $target=null, $params=array()) { /* {{{ */ if(isset($this->services[$from][$to])) { $services = $this->services[$from][$to]; for(end($services); key($services)!==null; prev($services)) { $service = current($services); $text = $service->convert($file, $target, $params); - if($text !== false) + if($text === false) + return false; + if($text) return $text; } } - } + return true; + } /* }}} */ }