Пример #1
0
     $currDir = Text::htmlAllSpaces($currentDir);
     require CHORA_TEMPLATES . '/directory/dir.inc';
 }
 /* Display all of the files in this directory */
 foreach ($fileList as $currFile) {
     if ($conf['hide_restricted'] && Chora::isRestricted($currFile->queryName())) {
         continue;
     }
     $dirrow = ++$dirrow % 2;
     $lg = $currFile->queryLastLog();
     if (is_a($lg, 'PEAR_Error')) {
         continue;
     }
     $realname = $currFile->queryName();
     $mimeType = MIME_Magic::filenameToMIME($realname);
     $icon = MIME_Viewer::getIcon($mimeType);
     $aid = $lg->queryAuthor();
     $author = Chora::showAuthorName($aid);
     $head = $currFile->queryHead();
     $date = $lg->queryDate();
     $log = $lg->queryLog();
     $attic = $currFile->isAtticFile();
     $fileName = $where . ($attic ? DIRECTORY_SEPARATOR . 'Attic' : '') . DIRECTORY_SEPARATOR . $realname;
     $name = Text::htmlAllSpaces($realname);
     $url = Chora::url('cvs', $fileName);
     $readableDate = VC_File::readableTime($date);
     if ($log) {
         $shortLog = str_replace("\n", ' ', trim(substr($log, 0, $conf['options']['shortLogLength'] - 1)));
         if (strlen($log) > 80) {
             $shortLog .= "...";
         }
Пример #2
0
 /**
  * Pretty-print the checked out copy, using the
  * Horde::Mime::Viewer package.
  *
  * @param string $mime_type File extension of the checked out file
  * @param resource fp File pointer to the head of the checked out copy
  * @return object The MIME_Viewer object which can be rendered or
  *                false on failure
  */
 function &pretty($mime_type, $fp)
 {
     $lns = '';
     while ($ln = fread($fp, 8192)) {
         $lns .= $ln;
     }
     $mime =& new MIME_Part($mime_type, $lns);
     return MIME_Viewer::factory($mime);
 }