theme = $theme; } static function __getStyles() { /* {{{ */ global $settings; $themes = array(); $path = $settings->_rootDir . "styles/"; $handle = opendir($path); while ($entry = readdir($handle) ) { if ($entry == ".." || $entry == ".") continue; else if (is_dir($path . $entry)) array_push($themes, $entry); } closedir($handle); return $themes; } /* }}} */ function htmlStartPage($title="", $bodyClass="") { /* {{{ */ global $theme, $settings; if(file_exists("../themes/".$theme."/HTMLHead.html")) { include("../themes/".$theme."/HTMLHead.html"); } else { echo "\n"; echo "\n\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "".(strlen($settings->_siteName)>0 ? $settings->_siteName : "SeedDMS").(strlen($title)>0 ? ": " : "").htmlspecialchars($title)."\n"; echo "\n"; echo "0 ? " class=\"".$bodyClass."\"" : "").">\n"; } } /* }}} */ function htmlEndPage() { /* {{{ */ global $theme; UI::footNote(); if(file_exists("../themes/".$theme."/HTMLFoot.html")) { include("../themes/".$theme."/HTMLFoot.html"); } else { echo "\n\n"; } } /* }}} */ function footNote() { /* {{{ */ global $settings; echo "
\n"; echo '
'."\n"; echo '
'."\n"; echo '
'."\n"; if ($settings->_printDisclaimer){ echo "
".getMLText("disclaimer")."
"; } if (isset($settings->_footNote) && strlen((string)$settings->_footNote)>0) { echo "
".(string)$settings->_footNote."
"; } echo "
\n"; echo "
\n"; echo "
\n"; echo "
\n"; return; } /* }}} */ function contentStart() { /* {{{ */ echo "
\n"; echo "
\n"; } /* }}} */ function contentEnd() { /* {{{ */ echo "
\n"; echo "
\n"; } /* }}} */ function globalBanner() { /* {{{ */ global $settings; echo "
\n"; echo "
\n"; echo " \n"; echo "
\n"; echo "
\n"; return; } /* }}} */ function __globalNavigation($folder=null) { /* {{{ */ global $settings, $user; echo "
\n"; echo "
\n"; echo "\n"; echo "
\n"; echo "
". (strlen($settings->_siteName)>0 ? $settings->_siteName : "SeedDMS"). "
\n"; echo "\n"; echo "
".getMLText("signed_in_as")." ".htmlspecialchars($user->getFullName()). " (".getMLText("sign_out").").
\n"; echo "
 
\n". "
\n"; return; } /* }}} */ function __pageNavigation($pageTitle, $pageType=null, $extra=null) { /* {{{ */ global $settings, $user; echo "
\n"; // This spacer span is an awful hack, but it is the only way I know to // get the spacer to match the mainheading content's size. echo "".($settings->_titleDisplayHack ? $pageTitle : "")."\n"; echo "
".$pageTitle."
\n"; echo "
\n
\n"; if ($pageType!=null && strcasecmp($pageType, "noNav")) { echo "
\n"; switch ($pageType) { case "view_folder": UI::folderNavigationBar($extra); break; case "view_document": UI::documentNavigationBar(); break; case "my_documents": UI::myDocumentsNavigationBar(); break; case "my_account": UI::accountNavigationBar(); break; case "admin_tools": UI::adminToolsNavigationBar(); break; case "calendar"; UI::calendarNavigationBar($extra); break; } echo "
\n
\n"; } return; } /* }}} */ function __folderNavigationBar($folder) { /* {{{ */ global $user, $settings, $theme; if (!is_object($folder) || strcasecmp(get_class($folder), "SeedDMS_Core_Folder")) { echo "\n"; return; } $accessMode = $folder->getAccessMode($user); $folderID = $folder->getID(); echo "\n"; return; } /* }}} */ function __documentNavigationBar() { /* {{{ */ global $user, $settings, $document; $accessMode = $document->getAccessMode($user); $docid=".php?documentid=" . $document->getID(); echo "\n"; return; } /* }}} */ function __accountNavigationBar() { /* {{{ */ global $settings,$user; echo "\n"; return; } /* }}} */ function __myDocumentsNavigationBar() { /* {{{ */ echo "\n"; return; } /* }}} */ function __adminToolsNavigationBar() { /* {{{ */ global $settings; echo "\n"; return; } /* }}} */ function __calendarNavigationBar($d){ /* {{{ */ global $settings,$user; $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 getMLText("results_page").": "; for ($i = 1; $i <= $totalPages; $i++) { if ($i == $pageNumber) echo "".$i." "; else echo "".$i.""." "; } if ($totalPages>1) { echo "".getMLText("all_pages").""." "; } echo "
"; return; } /* }}} */ function __contentContainer($content) { /* {{{ */ echo "
\n"; echo "
\n"; echo "
\n"; echo $content; echo "
\n
\n
\n"; return; } /* }}} */ function contentContainerStart($class="") { /* {{{ */ 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 "
".$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["rar"] = "gz.png"; $icons["mpg"] = "video.png"; $icons["avi"] = "video.png"; $icons["tex"] = "tex.png"; $icons["ods"] = "x-office-spreadsheet.png"; $icons["ots"] = "x-office-spreadsheet.png"; $icons["sxc"] = "x-office-spreadsheet.png"; $icons["stc"] = "x-office-spreadsheet.png"; $icons["odt"] = "x-office-document.png"; $icons["ott"] = "x-office-document.png"; $icons["sxw"] = "x-office-document.png"; $icons["stw"] = "x-office-document.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 $icons[$ext]; } else { return $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) { /* {{{ */ global $settings; ?> "; print ""; print "  "; } /* }}} */ function __printFolderChooser($formName, $accessMode, $exclude = -1, $default = false) { /* {{{ */ global $settings; ?> getID() : "") ."\">"; print "getName()) : "") ."\">"; print "  "; } /* }}} */ function __printCategoryChooser($formName, $categories=array()) { /* {{{ */ global $settings; ?> getId(); $names[] = htmlspecialchars($cat->getName()); } } print ""; print ""; print "  \"\""; print "  "; } /* }}} */ function __printAttributeEditField($attrdef, $objvalue, $fieldname='attributes') { /* {{{ */ if($valueset = $attrdef->getValueSetAsArray()) { echo ""; } else { echo "getId()."]\" value=\"".htmlspecialchars($objvalue)."\" />"; } } /* }}} */ function __getImgPath($img) { /* {{{ */ global $theme; if ( is_file("../styles/$theme/images/$img") ) { return "../styles/$theme/images/$img"; } else if ( is_file("../styles/$theme/img/$img") ) { return "../styles/$theme/img/$img"; } return "../out/images/$img"; } /* }}} */ function __printImgPath($img) { /* {{{ */ print UI::getImgPath($img); } /* }}} */ function errorMsg($msg) { /* {{{ */ echo "
\n"; echo $msg; echo "
\n"; } /* }}} */ static function exitError($pagetitle,$error) { /* {{{ */ UI::htmlStartPage($pagetitle); UI::globalNavigation(); print "
"; print htmlspecialchars($error); print "
"; UI::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) { /* {{{ */ global $dms, $user, $form, $settings; if ($settings->_expandFolderTree==2){ // folder completely open $is_open=true; }else if ($settings->_expandFolderTree==1 && $folderID==$settings->_rootFolderID ){ $is_open=true; }else{ // open the tree until the current folder $is_open=false; if ($currentFolderID!=-1){ $currentFolder=$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 = $dms->getFolder($folderID); if (!is_object($folder)) return; $subFolders = $folder->getSubFolders(); $subFolders = SeedDMS_Core_DMS::filterAccess($subFolders, $user, M_READ); if ($folderID == $settings->_rootFolderID) print "