_rootDir . "themes/"; $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; } $theme = $settings->_theme; function printHTMLHead($title) { global $theme; $GLOBALS['phpgw_info']['flags'] = array( 'currentapp' => 'mydms', 'noheader' => True, 'nonavbar' => True ); include_once('../../header.inc.php'); if(!@is_object($GLOBALS['phpgw']->js)) { $GLOBALS['phpgw']->js =& CreateObject('phpgwapi.javascript'); } $GLOBALS['phpgw']->js->validate_file('dhtmlxtree','js/dhtmlXCommon'); $GLOBALS['phpgw']->js->validate_file('dhtmlxtree','js/dhtmlXTree'); $GLOBALS['phpgw']->js->validate_file('jscode','mydms','mydms'); $GLOBALS['phpgw']->common->phpgw_header(); echo parse_navbar(); if ( is_file("../themes/$theme/styles.css") ) $stylesheet="../themes/$theme/styles.css"; else $stylesheet="../themes/default/styles.css"; if ( is_file("../themes/$theme/HTMLHead.html" ) ) include("../themes/$theme/HTMLHead.html"); else include("../themes/default/HTMLHead.html"); } function printHTMLFoot() { global $theme; $GLOBALS['phpgw']->common->phpgw_footer(); if ( is_file("../themes/$theme/HTMLFoot.html" ) ) { include("../themes/$theme/HTMLFoot.html"); } else { include("../themes/default/HTMLFoot.html"); } } function printStartBox($header) { global $theme; if ( is_file("../themes/$theme/StartBox.html" ) ) { include("../themes/$theme/StartBox.html"); } else { include("../themes/default/StartBox.html"); } } function printNextBox($header) { global $theme; if ( is_file("../themes/$theme/NextBox.html" ) ) { include("../themes/$theme/NextBox.html"); } else { include("../themes/default/NextBox.html"); } } function printEndBox() { global $theme; if ( is_file("../themes/$theme/EndBox.html" ) ) { include("../themes/$theme/EndBox.html"); } else { include("../themes/default/EndBox.html"); } } function printCenterStart() { print "
"; } function printCenterEnd() { print "
"; } function printGoBack() { print "

".getMLText("back").""; } function printGoto($targets) { print "

".getMLText("goto").": "; for ($i = 0; $i < count($targets); $i++) { print "".$targets[$i][0].""; if ($i+1 < count($targets)) print " | "; } } function printTitleBar($folder) { return; global $user, $settings, $theme; $options=array(); $options[getMLText("content")]=$settings->_httpRoot . "out/out.ViewFolder.php?folderid=" . $folder->getID(); $options[getMLText("search")]=$settings->_httpRoot . "out/out.SearchForm.php?folderid=" . $folder->getID(); if ($user->getID() != $settings->_guestID) //$options[getMLText("my_account")]=$settings->_httpRoot . "out/out.EditUserData.php"; if ($user->isAdmin()) { $options[getMLText("admin_tools")] = $settings->_httpRoot . "out/out.AdminTools.php"; // $options[getMLText("user_management")]=$settings->_httpRoot . "out/out.UsrMgr.php"; // $options[getMLText("group_management")]=$settings->_httpRoot . "out/out.GroupMgr.php"; } else $options[getMLText("user_list")]=$settings->_httpRoot . "out/out.UserList.php"; //$options[getMLText("logout")]=$settings->_httpRoot . "op/op.Logout.php"; $title=getMLText("logged_in_as")." ".$user->getFullName(); $menu = buildMenu( $options, "titlebar" ); if ( is_file("../themes/$theme/TitleBar.html" ) ) { include("../themes/$theme/TitleBar.html"); } else { include("../themes/default/TitleBar.html"); } } function printFolderTree($path, $level = 0, $activeObj, $isFolder) { GLOBAL $user; #$folder = $path[$level]; #$subFolders = $folder->getSubFolders(); #$subFolders = filterAccess($subFolders, $user, M_READ); $allSubFolders = array(); foreach($path as $folderObject) { $allSubFolders['_id'.$folderObject->getID()] = $folderObject; $subFoldersL1 = $folderObject->getSubFolders(); foreach((array)$subFoldersL1 as $subFolderL1Object) { $allSubFolders['_id'.$subFolderL1Object->getID()] = $subFolderL1Object; $subFoldersL2 = $subFolderL1Object->getSubFolders(); foreach((array)$subFoldersL2 as $subFolderL2Object) { $allSubFolders['_id'.$subFolderL2Object->getID()] = $subFolderL2Object; } } } $uimydms =& CreateObject('mydms.uimydms'); print $uimydms->folderChooser($allSubFolders, $activeObj); return; } function printFolderPageStart($folder) { global $theme; $uimydms =& CreateObject('mydms.uimydms'); $title1 = getMLText("foldertree"); $title2 = " ". getMLText("selected_folder") . ": " . $folder->getName(); $path = $folder->getPathNew(); $txtpath = ''; if($path!=''){ foreach($path as $folderObject) { if(!empty($txtpath)) $txtpath .= " / "; $txtpath .= "getID()."\">". $folderObject->getName().""; } } $txtpath = getMLText("folder_path") . ": " . $txtpath; if ( is_file("../themes/$theme/FolderPageStart.html" ) ) { include("../themes/$theme/FolderPageStart.html"); } else { include("../themes/default/FolderPageStart.html"); } } function printFolderPageEnd($folder) { GLOBAL $user, $theme; $title = getMLText("edit_folder"); $options=array(); $accessMode = $folder->getAccessMode($user); if ($accessMode >= M_READWRITE) { $options[getMLText("add_subfolder")] = "out.AddSubFolder.php?folderid=" . $folder->getID(); $options[getMLText("add_document")] = "out.AddDocument.php?folderid=" . $folder->getID(); $options[getMLText("edit_folder_props")] = "out.EditFolder.php?folderid=" . $folder->getID(); $options[getMLText("edit_folder_notify")] = "out.FolderNotify.php?folderid=" . $folder->getID(); $options[getMLText("move_folder")] = "out.MoveFolder.php?folderid=" . $folder->getID(); } if ($accessMode == M_ALL) { $options[getMLText("rm_folder")] = "out.RemoveFolder.php?folderid=" . $folder->getID(); $options[getMLText("edit_folder_access")] = "out.FolderAccess.php?folderid=" . $folder->getID(); } $menu=buildMenu( $options, "editfolder" ); if ( is_file("../themes/$theme/FolderPageEnd.html" ) ) { include("../themes/$theme/FolderPageEnd.html"); } else { include("../themes/default/FolderPageEnd.html"); } } function printPageHeader($header) { print "

".$header."

\n"; } function printDocumentPageStart($document) { global $theme; $uimydms =& CreateObject('mydms.uimydms'); $folder = $document->getFolder(); $title1 = getMLText("foldertree"); $title2 = " ". getMLText("selected_document") . ": " . $document->getName(); $path = $folder->getPathNew(); $txtpath = ''; foreach($path as $folderObject) { if(!empty($txtpath)) $txtpath .= " / "; $txtpath .= "getID()."\">". $folderObject->getName().""; } $txtpath = getMLText("folder_path") . ": " . $txtpath; if ( is_file("../themes/$theme/DocumentPageStart.html" ) ) { include("../themes/$theme/DocumentPageStart.html"); } else { include("../themes/default/DocumentPageStart.html"); } } function printDocumentPageEnd($document) { GLOBAL $user, $theme; $docid=".php?documentid=" . $document->getID(); $title = getMLText("edit_document"); $options=array(); $accessMode = $document->getAccessMode($user); if ($accessMode >= M_READWRITE) { if (!$document->isLocked()) { $options[getMLText("update_document")] = "out.UpdateDocument" . $docid; $options[getMLText("lock_document")] = "../op/op.LockDocument" . $docid; $options[getMLText("edit_document_props")] = "out.EditDocument" . $docid; $options[getMLText("expires")] = "out.SetExpires" . $docid; $options[getMLText("edit_document_notify")] = "out.DocumentNotify" . $docid; $options[getMLText("move_document")] = "out.MoveDocument" . $docid; } else { $lockingUser = $document->getLockingUser(); if (($lockingUser->getID() == $user->getID()) || ($document->getAccessMode($user) == M_ALL)) { $options[getMLText("update_document")] = "out.UpdateDocument" . $docid; $options[getMLText("unlock_document")] = "../op/op.UnlockDocument" . $docid; $options[getMLText("edit_document_props")]= "out.EditDocument" . $docid; $options[getMLText("expires")] = "out.SetExpires" . $docid; $options[getMLText("edit_document_notify")]= "out.DocumentNotify" . $docid; $options[getMLText("move_document")] = "out.MoveDocument" . $docid; } } } if ($accessMode == M_ALL) { $options[getMLText("rm_document")] = "out.RemoveDocument" . $docid; $options[getMLText("edit_document_access")] = "out.DocumentAccess" . $docid; } $menu=buildMenu( $options, "editfolder" ); if ( is_file("../themes/$theme/DocumentPageEnd.html" ) ) { include("../themes/$theme/DocumentPageEnd.html"); } else { include("../themes/default/DocumentPageEnd.html"); } } 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; $linkData = array ( 'menuaction' => 'mydms.uimydms.folderChooser', 'form' => $formName, 'mode' => $accessMode, 'exlcude' => $exclude, 'folderid' => $settings->_rootFolderID ); $link = $GLOBALS['phpgw']->link('/index.php',$linkData); ?> getID() : "") ."\">"; print "getName() : "") ."\">"; print "  "; } /* ---------------------------------------- ICONS --------------------------------------------- */ $icons = array(); $icons["txt"] = "txt.png"; $icons["doc"] = "word.png"; $icons["rtf"] = "document.png"; $icons["xls"] = "excel.png"; $icons["ppt"] = "powerpoint.png"; $icons["exe"] = "binary.png"; $icons["html"] = "html.png"; $icons["htm"] = "html.png"; $icons["gif"] = "image.png"; $icons["jpg"] = "image.png"; $icons["bmp"] = "image.png"; $icons["png"] = "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["zip"] = "gz.png"; $icons["mpg"] = "video.png"; $icons["avi"] = "video.png"; $icons["tex"] = "tex.png"; $icons["default"] = "default.png"; function getImgPath($img) { global $theme; if ( is_file("../themes/$theme/images/$img") ) { return "../themes/$theme/images/$img"; } return "../out/images/$img"; } function printImgPath($img) { print getImgPath($img); } function buildMenu( $options , $class="titlebar" ) { $sep = ""; $menu = ""; reset($options); while ( list($desc,$url) = each($options) ) { $menu.=$sep; $menu.="$desc\n"; $sep=" | \n"; } return $menu; } function getMimeIcon($fileType) { GLOBAL $icons; $ext = substr($fileType, 1); if (isset($icons[$ext])) return $icons[$ext]; else return $icons["default"]; } ?>