diff --git a/dashboard.php b/dashboard.php index abd3f1b..54ffb9f 100644 --- a/dashboard.php +++ b/dashboard.php @@ -17,15 +17,12 @@ // main library routines and defaults require_once("./config/dmsDefaults.php"); -require_once("$default->owl_fs_root/lib/owl.lib.php"); -require_once("$default->owl_fs_root/config/html.php"); -require_once("$default->owl_fs_root/lib/control.inc"); -require_once("$default->owl_fs_root/lib/Session.inc"); require_once("$default->owl_fs_root/lib/SiteMap.inc"); require_once("$default->owl_fs_root/lib/visualpatterns/PatternMainPage.inc"); require_once("$default->owl_fs_root/lib/visualpatterns/PatternImage.inc"); require_once("$default->owl_fs_root/lib/visualpatterns/PatternTableLinks.inc"); require_once("$default->owl_fs_root/lib/visualpatterns/PatternTableSqlQuery.inc"); +require_once("$default->owl_fs_root/lib/visualpatterns/PatternCustom.inc"); // ------------------------------- // page start @@ -36,23 +33,116 @@ if (checkSession()) { // check if this page is authorised, ie. has come from control.php if ($_SESSION["authorised"]) { // create a page - + // logo $img = new PatternImage("$default->owl_root_url/locale/$default->owl_lang/graphics/$default->logo"); + $img->setImgSize(238, 178); // build the top menu of links - $aTopMenuLinks = array(0=>generateControllerUrl("logout"), 1=>generateControllerUrl("scratchPad")); - $aTopMenuText = array(0=>"logout", 1=>"scratchPad"); - $oPatternTableLinks = new PatternTableLinks($aTopMenuLinks, $aTopMenuText, 3, 1); + // TODO: this is a function of the sitemap + // get list of sections + $aTopMenuLinks = array(generateControllerUrl("dashboard"), generateControllerUrl("browse"), generateControllerUrl("subscriptions"), + generateControllerUrl("search"), generateControllerUrl("administration"), generateControllerUrl("preferences"), generateControllerUrl("help")); + $aTopMenuText = array("Dashboard", "Browse Documents", "Subscriptions", "Advanced Search", "Administration", "Preferences", "Help", "Logout"); + $aTopMenuImages = array("$default->owl_graphics_url/dashboard.jpg", "$default->owl_graphics_url/browse.jpg", + "$default->owl_graphics_url/subscriptions.jpg", "$default->owl_graphics_url/search.jpg", + "$default->owl_graphics_url/administration.jpg", "$default->owl_graphics_url/preferences.jpg", + "$default->owl_graphics_url/help.jpg", "$default->owl_graphics_url/logout.jpg"); + $oPatternTableLinks = new PatternTableLinks($aTopMenuLinks, null, 1, 8, 2, $aTopMenuImages); + + + // build the central dashboard - /* - $aCentralPageColumns = array(0=>"name",1=>"parent",2=>"security"); - $aColumnTypes = array(0=>1,1=>2,2=>1); - $oTableSqlQuery = & new PatternTableSqlQuery("Folders", $aCentralPageColumns, $aColumnTypes); - ($HTTP_GET_VARS["fStartIndex"]) ? $oTableSqlQuery->setStartIndex($HTTP_GET_VARS["fStartIndex"]) : $oTableSqlQuery->setStartIndex(0); - $oTableSqlQuery->setLinkType(1); - */ + //- pending documents (document approval) + //- checked out documents + //- subscriptions + $sHtml = " + + + + + +
+ + + + + + + + + "; + /* + $aPendingDocumentList = getPendingDocuments($_SESSION["userID"]); + for ($i = 0; $i < count($aPendingDocumentList); $i++) { + $sHtml = $sHtml . ""; + } + */ + $sHtml = $sHtml . " +
+ Pending Documents +
+ Title + + Status + + Days +
" . $aPendingDocumentList[$i] . "
+
+ + + + + + + + "; + /* + $aCheckedOutDocumentList = getCheckedOutDocuments($_SESSION["userID"]); + for ($i = 0; $i < count($aCheckedOutDocumentList); $i++) { + $sHtml = $sHtml . ""; + } + */ + $sHtml = $sHtml . " +
+ Checked Out Documents +
+ Title + + Days +
" . $aCheckedOutDocumentList[$i] . "
+
+ + + + + + + + + "; + /* + $aSubscriptionList = getSubscriptionAlerts($_SESSION["userID"]); + for ($i = 0; $i < count($aSubscriptionList); $i++) { + $sHtml = $sHtml . ""; + } + */ + $sHtml = $sHtml . " +
+ Subscriptions Alerts +
+ Title + + Status + + Days +
" . $aSubscriptionList[$i] . "
+
"; + + + $oContent = new PatternCustom(); + $oContent->setHtml($html); /* get a page */ $tmp = new PatternMainPage(); @@ -60,7 +150,7 @@ if (checkSession()) { /* put the page together */ $tmp->setNorthWestPayload($img); $tmp->setNorthPayload($oPatternTableLinks); - //$tmp->setCentralPayload($oTableSqlQuery); + $tmp->setCentralPayload($oContent); $tmp->setFormAction("dashboard.php"); $tmp->render(); @@ -69,10 +159,6 @@ if (checkSession()) { print "you do not have access to view this page! please go away, and come back when you do.
"; echo generateLink("logout") . "logout"; } -} else { - // no session, should have been redirected - echo "no session
"; - print_r($_SESSION); } ?>