theme = $theme; $this->params = $params; $this->imgpath = '../views/'.$theme.'/images/'; $this->extraheader = ''; } function htmlStartPage($title="", $bodyClass="") { /* {{{ */ echo "\n"; echo "\n\n"; echo "\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; if($this->extraheader) echo $this->extraheader; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo "".(strlen($this->params['sitename'])>0 ? $this->params['sitename'] : "SeedDMS").(strlen($title)>0 ? ": " : "").htmlspecialchars($title)."\n"; echo "\n"; echo "0 ? " class=\"".$bodyClass."\"" : "").">\n"; } /* }}} */ function htmlAddHeader($head) { /* {{{ */ $this->extraheader .= $head; } /* }}} */ function htmlEndPage() { /* {{{ */ $this->footNote(); echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo "\n\n"; } /* }}} */ function footNote() { /* {{{ */ echo '
'."\n"; echo '
'."\n"; echo '
'."\n"; if ($this->params['printdisclaimer']){ echo "
".getMLText("disclaimer")."
"; } if (isset($this->params['footnote']) && strlen((string)$this->params['footnote'])>0) { echo "
".(string)$this->params['footnote']."
"; } echo "
\n"; echo "
\n"; echo "
\n"; return; } /* }}} */ function contentStart() { /* {{{ */ echo "
\n"; echo "
\n"; } /* }}} */ function contentEnd() { /* {{{ */ echo "
\n"; echo "
\n"; } /* }}} */ function globalBanner() { /* {{{ */ echo "
\n"; echo "
\n"; echo " \n"; echo "
\n"; /* echo "
\n"; echo "
\n"; echo "
\n"; echo "
". (strlen($this->param['sitename'])>0 ? $this->params['sitename'] : "SeedDMS"). "
\n"; echo "
 
\n". "
\n"; return; */ } /* }}} */ function globalNavigation($folder=null) { /* {{{ */ echo "
\n"; echo "
\n"; echo "
\n"; echo "
\n"; echo " params['rootfolderid']."\">".(strlen($this->params['sitename'])>0 ? $this->params['sitename'] : "SeedDMS")."\n"; if(isset($this->params['user']) && $this->params['user']) { echo "
\n"; echo " \n"; echo " \n"; echo "
"; if ($folder!=null && is_object($folder) && !strcasecmp(get_class($folder), "SeedDMS_Core_Folder")) { echo " getID()."\" />"; } echo " "; echo " "; echo " "; echo " "; echo " "; if($this->params['enablefullsearch']) { echo " "; } // echo " "; echo "
\n"; echo "
\n"; } echo "
\n"; echo "
\n"; echo "
\n"; return; } /* }}} */ function getFolderPathHTML($folder, $tagAll=false, $document=null) { /* {{{ */ $path = $folder->getPath(); $txtpath = ""; for ($i = 0; $i < count($path); $i++) { $txtpath .= "
  • "; if ($i +1 < count($path)) { $txtpath .= "getID()."&showtree=".showtree()."\" rel=\"folder_".$path[$i]->getID()."\" ondragover=\"allowDrop(event)\" ondrop=\"onDrop(event)\">". htmlspecialchars($path[$i]->getName()).""; } else { $txtpath .= ($tagAll ? "getID()."&showtree=".showtree()."\">". htmlspecialchars($path[$i]->getName())."" : htmlspecialchars($path[$i]->getName())); } $txtpath .= " /
  • "; } if($document) $txtpath .= "
  • getId()."\">".htmlspecialchars($document->getName())."
  • "; return ''; } /* }}} */ function pageNavigation($pageTitle, $pageType=null, $extra=null) { /* {{{ */ if ($pageType!=null && strcasecmp($pageType, "noNav")) { if($pageType == "view_folder" || $pageType == "view_document") echo $pageTitle."\n"; echo "
    \n"; echo "
    \n"; switch ($pageType) { case "view_folder": $this->folderNavigationBar($extra); break; case "view_document": $this->documentNavigationBar(); break; case "my_documents": echo "".$pageTitle.""; //echo $pageTitle."\n"; $this->myDocumentsNavigationBar(); break; case "my_account": echo "".$pageTitle.""; //echo $pageTitle."\n"; $this->accountNavigationBar(); break; case "admin_tools": echo "".$pageTitle.""; //echo $pageTitle."\n"; $this->adminToolsNavigationBar(); break; case "calendar"; echo "".$pageTitle.""; //echo $pageTitle."\n"; $this->calendarNavigationBar($extra); break; } echo "
    \n"; echo "
    \n"; } else { echo "".$pageTitle."\n"; } return; } /* }}} */ private function folderNavigationBar($folder) { /* {{{ */ if (!is_object($folder) || strcasecmp(get_class($folder), "SeedDMS_Core_Folder")) { echo "\n"; return; } $accessMode = $folder->getAccessMode($this->params['user']); $folderID = $folder->getID(); echo "\n"; return; } /* }}} */ private function documentNavigationBar() { /* {{{ */ global $document; $accessMode = $document->getAccessMode($this->params['user']); $docid=".php?documentid=" . $document->getID(); echo "\n"; return; } /* }}} */ private function accountNavigationBar() { /* {{{ */ echo "\n"; return; } /* }}} */ private function myDocumentsNavigationBar() { /* {{{ */ echo "\n"; return; } /* }}} */ private function adminToolsNavigationBar() { /* {{{ */ echo " \n"; echo " \n"; if($this->params['enablefullsearch']) { echo " \n"; } echo " \n"; echo " \n"; echo "\n"; return; } /* }}} */ private function calendarNavigationBar($d){ /* {{{ */ $ds="&day=".$d[0]."&month=".$d[1]."&year=".$d[2]; echo "\n"; return; } /* }}} */ function pageList($pageNumber, $totalPages, $baseURI, $params) { /* {{{ */ if (!is_numeric($pageNumber) || !is_numeric($totalPages) || $totalPages<2) { return; } // Construct the basic URI based on the $_GET array. One could use a // regular expression to strip out the pg (page number) variable to // achieve the same effect. This seems to be less haphazard though... $resultsURI = $baseURI; $first=true; foreach ($params as $key=>$value) { // Don't include the page number in the basic URI. This is added in // during the list display loop. if (!strcasecmp($key, "pg")) { continue; } if (is_array($value)) { foreach ($value as $subvalue) { $resultsURI .= ($first ? "?" : "&").$key."%5B%5D=".$subvalue; $first = false; } } else { $resultsURI .= ($first ? "?" : "&").$key."=".$value; } $first = false; } echo "
    "; echo ""; echo "
    "; return; } /* }}} */ function contentContainer($content) { /* {{{ */ echo "
    \n"; echo $content; echo "
    \n"; return; } /* }}} */ function contentContainerStart($type='info') { /* {{{ */ //echo "
    \n"; echo "
    \n"; return; } /* }}} */ function contentContainerEnd() { /* {{{ */ echo "
    \n"; return; } /* }}} */ function contentHeading($heading, $noescape=false) { /* {{{ */ if($noescape) echo "".$heading."\n"; else echo "".htmlspecialchars($heading)."\n"; return; } /* }}} */ function contentSubHeading($heading, $first=false) { /* {{{ */ // echo "
    ".htmlspecialchars($heading)."
    \n"; echo "
    ".$heading."
    "; return; } /* }}} */ function getMimeIcon($fileType) { /* {{{ */ // for extension use LOWER CASE only $icons = array(); $icons["txt"] = "txt.png"; $icons["text"] = "txt.png"; $icons["doc"] = "word.png"; $icons["dot"] = "word.png"; $icons["docx"] = "word.png"; $icons["dotx"] = "word.png"; $icons["rtf"] = "document.png"; $icons["xls"] = "excel.png"; $icons["xlt"] = "excel.png"; $icons["xlsx"] = "excel.png"; $icons["xltx"] = "excel.png"; $icons["ppt"] = "powerpoint.png"; $icons["pot"] = "powerpoint.png"; $icons["pptx"] = "powerpoint.png"; $icons["potx"] = "powerpoint.png"; $icons["exe"] = "binary.png"; $icons["html"] = "html.png"; $icons["htm"] = "html.png"; $icons["gif"] = "image.png"; $icons["jpg"] = "image.png"; $icons["jpeg"] = "image.png"; $icons["bmp"] = "image.png"; $icons["png"] = "image.png"; $icons["tif"] = "image.png"; $icons["tiff"] = "image.png"; $icons["log"] = "log.png"; $icons["midi"] = "midi.png"; $icons["pdf"] = "pdf.png"; $icons["wav"] = "sound.png"; $icons["mp3"] = "sound.png"; $icons["c"] = "source_c.png"; $icons["cpp"] = "source_cpp.png"; $icons["h"] = "source_h.png"; $icons["java"] = "source_java.png"; $icons["py"] = "source_py.png"; $icons["tar"] = "tar.png"; $icons["gz"] = "gz.png"; $icons["7z"] = "gz.png"; $icons["bz"] = "gz.png"; $icons["bz2"] = "gz.png"; $icons["tgz"] = "gz.png"; $icons["zip"] = "gz.png"; $icons["mpg"] = "video.png"; $icons["avi"] = "video.png"; $icons["tex"] = "tex.png"; $icons["ods"] = "ooo_spreadsheet.png"; $icons["ots"] = "ooo_spreadsheet.png"; $icons["sxc"] = "ooo_spreadsheet.png"; $icons["stc"] = "ooo_spreadsheet.png"; $icons["odt"] = "ooo_textdocument.png"; $icons["ott"] = "ooo_textdocument.png"; $icons["sxw"] = "ooo_textdocument.png"; $icons["stw"] = "ooo_textdocument.png"; $icons["odp"] = "ooo_presentation.png"; $icons["otp"] = "ooo_presentation.png"; $icons["sxi"] = "ooo_presentation.png"; $icons["sti"] = "ooo_presentation.png"; $icons["odg"] = "ooo_drawing.png"; $icons["otg"] = "ooo_drawing.png"; $icons["sxd"] = "ooo_drawing.png"; $icons["std"] = "ooo_drawing.png"; $icons["odf"] = "ooo_formula.png"; $icons["sxm"] = "ooo_formula.png"; $icons["smf"] = "ooo_formula.png"; $icons["mml"] = "ooo_formula.png"; $icons["default"] = "default.png"; $ext = strtolower(substr($fileType, 1)); if (isset($icons[$ext])) { return $this->imgpath.$icons[$ext]; } else { return $this->imgpath.$icons["default"]; } } /* }}} */ function printDateChooser($defDate = -1, $varName) { /* {{{ */ if ($defDate == -1) $defDate = mktime(); $day = date("d", $defDate); $month = date("m", $defDate); $year = date("Y", $defDate); print " \n"; print " \n"; print ""; } /* }}} */ function printSequenceChooser($objArr, $keepID = -1) { /* {{{ */ if (count($objArr) > 0) { $max = $objArr[count($objArr)-1]->getSequence() + 1; $min = $objArr[0]->getSequence() - 1; } else { $max = 1.0; } print ""; } /* }}} */ function printDocumentChooser($formName) { /* {{{ */ ?> "; print "
    \n"; print ""; // print ""; print "params['rootfolderid']."\" role=\"button\" class=\"btn\" data-toggle=\"modal\">".getMLText("document")."…\n"; print "
    \n"; ?> getID() : "") ."\">"; print "
    \n"; print "getName()) : "") ."\" placeholder=\"".getMLText('type_to_search')."\" autocomplete=\"off\" />"; // print ""; print "".getMLText("folder")."…\n"; print "
    \n"; ?> getId(); $names[] = htmlspecialchars($cat->getName()); } } print ""; print "
    \n"; print ""; print ""; print "".getMLText("category")."…\n"; print "
    \n"; ?>
    getValueSetAsArray()) { echo ""; } else { echo "getId()."]\" value=\"".htmlspecialchars($objvalue)."\" />"; } } /* }}} */ function printDropFolderChooser($formName, $dropfolderfile="") { /* {{{ */ ?> \n"; print ""; print ""; print "".getMLText("choose_target_file")."…\n"; print "
    \n"; ?> imgpath.$img) ) { return $this->imgpath.$img; } return "../out/images/$img"; } /* }}} */ function printImgPath($img) { /* {{{ */ print $this->getImgPath($img); } /* }}} */ function infoMsg($msg) { /* {{{ */ echo "
    \n"; echo $msg; echo "
    \n"; } /* }}} */ function warningMsg($msg) { /* {{{ */ echo "
    \n"; echo $msg; echo "
    \n"; } /* }}} */ function errorMsg($msg) { /* {{{ */ echo "
    \n"; echo $msg; echo "
    \n"; } /* }}} */ function exitError($pagetitle,$error) { /* {{{ */ $this->htmlStartPage($pagetitle); $this->globalNavigation(); $this->contentStart(); print "
    "; print "

    Error!

    "; print htmlspecialchars($error); print "
    "; print "
    "; $this->htmlEndPage(); add_log_line(" UI::exitError error=".$error." pagetitle=".$pagetitle); exit; } /* }}} */ // navigation flag is used for items links (navigation or selection) function printFoldersTree($accessMode, $exclude, $folderID, $currentFolderID=-1, $navigation=false) { /* {{{ */ if ($this->params['expandfoldertree']==2){ // folder completely open $is_open=true; }else if ($this->params['expandfoldertree']==1 && $folderID==$this->params['rootfolderid'] ){ $is_open=true; }else{ // open the tree until the current folder $is_open=false; if ($currentFolderID!=-1){ $currentFolder=$this->params['dms']->getFolder($currentFolderID); if (is_object($currentFolder)){ $parent=$currentFolder->getParent(); while (is_object($parent)){ if ($parent->getID()==$folderID){ $is_open=true; break; } $parent=$parent->getParent(); } } } } $folder = $this->params['dms']->getFolder($folderID); if (!is_object($folder)) return; $subFolders = $folder->getSubFolders(); $subFolders = SeedDMS_Core_DMS::filterAccess($subFolders, $this->params['user'], M_READ); if ($folderID == $this->params['rootfolderid']) print "