Example #1
0
 public static function getDocument($params)
 {
     $instance = MemoryManager::getInstance();
     $plist = $instance->get('playList');
     $filepath = $plist[$params];
     $info = utf8_pathinfo($filepath);
     //TODO: maybe fsi has better things than pathinfo
     if (strtolower($info['extension']) == 'odt' || strtolower($info['extension']) == 'doc' || strtolower($info['extension']) == 'xls' || strtolower($info['extension']) == 'ods') {
         $myConverter = new Converter();
         $path = $myConverter->Convert($filepath, 'HTML (StarWriter)');
         $md5 = utf8_basename($path);
         if (!$path || !file_exists($path)) {
             return array($filepath, 'Unable to convert office file, maybe this system does not have office support installed?');
         }
         //TODO: we are having problems with FSI and hidden folders
         $data = file_get_contents($path);
         $data = str_replace('<IMG SRC="', '<IMG SRC="index.php/externMsg/' . ProcManager::getInstance()->getCurrentProcess()->getChecknum() . '/viewTempImg/', $data);
         return array($filepath, $data);
     }
     $myFile = FSI::getFile($filepath);
     $data = $myFile->getContents();
     return array($filepath, $data);
 }
Example #2
0
 /**
  * @return string The name of the file
  */
 public function getName()
 {
     if ($this->isRoot()) {
         return '/';
     }
     $pathInfo = utf8_pathinfo($this->getAbsolutePath());
     return $pathInfo['basename'];
 }
Example #3
0
 /**
  * @return string The name of the file
  */
 public function getName()
 {
     if ($this->getPathFromRoot() == '/') {
         return '/';
     }
     $pathInfo = utf8_pathinfo($this->path);
     return $pathInfo['basename'];
 }