diff --git a/config/siteMap.inc b/config/siteMap.inc index c4b1d7c..ff403af 100644 --- a/config/siteMap.inc +++ b/config/siteMap.inc @@ -34,10 +34,10 @@ $default->siteMap = new SiteMap(false); $default->siteMap->addPage("login", "/login.php", "General", None, ""); // dashboard -$default->siteMap->addPage("ajaxdashboard", "/dashboard2.php", "General", Guest, "ajaxdashboard"); +$default->siteMap->addPage("dashboard", "/dashboard.php", "General", Guest, "dashboard"); // old dashboard -$default->siteMap->addPage("dashboard", "/dashboard.php", "General", Guest, "dashboard"); +$default->siteMap->addPage("olddashboard", "/olddashboard.php", "General", Guest, "olddashboard"); // dashboard news //pages for manage documents section diff --git a/dashboard.php b/dashboard.php index 579df2d..2cf2803 100644 --- a/dashboard.php +++ b/dashboard.php @@ -83,9 +83,32 @@ class DashboardDispatcher extends KTStandardDispatcher { $i %= 2; } + // javascript + // yahoo + $this->oPage->requireJSResource('thirdpartyjs/yui/yahoo/yahoo.js'); + $this->oPage->requireJSResource('thirdpartyjs/yui/event/event.js'); + $this->oPage->requireJSResource('thirdpartyjs/yui/dom/dom.js'); + $this->oPage->requireJSResource('thirdpartyjs/yui/dragdrop/dragdrop.js'); + $this->oPage->requireJSResource('resources/js/DDList.js'); + + + // dashboard + $sDashboardState = $this->oUser->getDashboardState(); + $sDSJS = "var savedState = "; + if($sDashboardState == null) { + $sDSJS .= "false"; + $sDashboardState = false; + } else { + $sDSJS .= $sDashboardState; + } + $sDSJS .= ';'; + $this->oPage->requireJSStandalone($sDSJS); + $this->oPage->requireJSResource('resources/js/dashboard.js'); + + // render $oTemplating =& KTTemplating::getSingleton(); - $oTemplate = $oTemplating->loadTemplate("kt3/olddashboard"); + $oTemplate = $oTemplating->loadTemplate("kt3/dashboard"); $aTemplateData = array( "context" => $this, "dashlets_left" => $aDashletsLeft, @@ -94,6 +117,12 @@ class DashboardDispatcher extends KTStandardDispatcher { return $oTemplate->render($aTemplateData); } + // return some kind of ID for each dashlet + // currently uses the class name + function _getDashletId($oDashlet) { + return get_class($oDashlet); + } + // disable a dashlet. // FIXME this very slightly violates the separation of concerns, but its not that flagrant. function do_disableDashlet() { @@ -117,6 +146,13 @@ class DashboardDispatcher extends KTStandardDispatcher { $this->commitTransaction(); $this->successRedirectToMain('Dashlet disabled.'); } + + + function json_saveDashboardState() { + $sState = KTUtil::arrayGet($_REQUEST, 'state', array('error'=>true)); + $this->oUser->setDashboardState($sState); + return array('success' => true); + } } $oDispatcher = new DashboardDispatcher(); diff --git a/lib/templating/kt3template.inc.php b/lib/templating/kt3template.inc.php index fd43a5b..c57921a 100644 --- a/lib/templating/kt3template.inc.php +++ b/lib/templating/kt3template.inc.php @@ -134,8 +134,8 @@ class KTPage { function initMenu() { // FIXME: we lost the getDefaultAction stuff - do we care? // note that key == action. this is _important_, since we crossmatch the breadcrumbs against this for "active" - $this->menu = array("ajaxdashboard" => $this->_actionHelper(array("name" => _kt("Dashboard"), "action" => "ajaxdashboard", "active" => 0)), - "dashboard" => $this->_actionHelper(array("name" => _kt("Old Dashboard"), "action" => "dashboard", "active" => 0)), + $this->menu = array("dashboard" => $this->_actionHelper(array("name" => _kt("Dashboard"), "action" => "dashboard", "active" => 0)), + "olddashboard" => $this->_actionHelper(array("name" => _kt("Old Dashboard"), "action" => "olddashboard", "active" => 0)), "browse" => $this->_actionHelper(array("name" => _kt("Browse Documents"), "action" => "browse", "active" => 0)), "administration" => $this->_actionHelper(array("name" => _kt("DMS Administration"), "action" => "administration", "active" => 0)),); } diff --git a/dashboard2.php b/olddashboard.php index 5618831..104d0c6 100644 --- a/dashboard2.php +++ b/olddashboard.php @@ -1,7 +1,7 @@ , Jam Warehouse (Pty) Ltd, South Africa */ @@ -52,7 +52,7 @@ class DashboardDispatcher extends KTStandardDispatcher { function DashboardDispatcher() { $this->aBreadcrumbs = array( - array('action' => 'ajaxdashboard', 'name' => _kt('Dashboard')), + array('action' => 'olddashboard', 'name' => _kt('Dashboard')), ); return parent::KTStandardDispatcher(); } @@ -83,32 +83,9 @@ class DashboardDispatcher extends KTStandardDispatcher { $i %= 2; } - // javascript - // yahoo - $this->oPage->requireJSResource('thirdpartyjs/yui/yahoo/yahoo.js'); - $this->oPage->requireJSResource('thirdpartyjs/yui/event/event.js'); - $this->oPage->requireJSResource('thirdpartyjs/yui/dom/dom.js'); - $this->oPage->requireJSResource('thirdpartyjs/yui/dragdrop/dragdrop.js'); - $this->oPage->requireJSResource('resources/js/DDList.js'); - - - // dashboard - $sDashboardState = $this->oUser->getDashboardState(); - $sDSJS = "var savedState = "; - if($sDashboardState == null) { - $sDSJS .= "false"; - $sDashboardState = false; - } else { - $sDSJS .= $sDashboardState; - } - $sDSJS .= ';'; - $this->oPage->requireJSStandalone($sDSJS); - $this->oPage->requireJSResource('resources/js/dashboard.js'); - - // render $oTemplating =& KTTemplating::getSingleton(); - $oTemplate = $oTemplating->loadTemplate("kt3/dashboard"); + $oTemplate = $oTemplating->loadTemplate("kt3/olddashboard"); $aTemplateData = array( "context" => $this, "dashlets_left" => $aDashletsLeft, @@ -117,12 +94,6 @@ class DashboardDispatcher extends KTStandardDispatcher { return $oTemplate->render($aTemplateData); } - // return some kind of ID for each dashlet - // currently uses the class name - function _getDashletId($oDashlet) { - return get_class($oDashlet); - } - // disable a dashlet. // FIXME this very slightly violates the separation of concerns, but its not that flagrant. function do_disableDashlet() { @@ -146,13 +117,6 @@ class DashboardDispatcher extends KTStandardDispatcher { $this->commitTransaction(); $this->successRedirectToMain('Dashlet disabled.'); } - - - function json_saveDashboardState() { - $sState = KTUtil::arrayGet($_REQUEST, 'state', array('error'=>true)); - $this->oUser->setDashboardState($sState); - return array('success' => true); - } } $oDispatcher = new DashboardDispatcher();