Commit 510ef9523cfecb3209f68d0ec32cc81bef6772b7
1 parent
0011c74a
Move dashboards around
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@6110 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
4 changed files
with
45 additions
and
45 deletions
config/siteMap.inc
| ... | ... | @@ -34,10 +34,10 @@ $default->siteMap = new SiteMap(false); |
| 34 | 34 | $default->siteMap->addPage("login", "/login.php", "General", None, ""); |
| 35 | 35 | |
| 36 | 36 | // dashboard |
| 37 | -$default->siteMap->addPage("ajaxdashboard", "/dashboard2.php", "General", Guest, "ajaxdashboard"); | |
| 37 | +$default->siteMap->addPage("dashboard", "/dashboard.php", "General", Guest, "dashboard"); | |
| 38 | 38 | |
| 39 | 39 | // old dashboard |
| 40 | -$default->siteMap->addPage("dashboard", "/dashboard.php", "General", Guest, "dashboard"); | |
| 40 | +$default->siteMap->addPage("olddashboard", "/olddashboard.php", "General", Guest, "olddashboard"); | |
| 41 | 41 | // dashboard news |
| 42 | 42 | |
| 43 | 43 | //pages for manage documents section | ... | ... |
dashboard.php
| ... | ... | @@ -83,9 +83,32 @@ class DashboardDispatcher extends KTStandardDispatcher { |
| 83 | 83 | $i %= 2; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | + // javascript | |
| 87 | + // yahoo | |
| 88 | + $this->oPage->requireJSResource('thirdpartyjs/yui/yahoo/yahoo.js'); | |
| 89 | + $this->oPage->requireJSResource('thirdpartyjs/yui/event/event.js'); | |
| 90 | + $this->oPage->requireJSResource('thirdpartyjs/yui/dom/dom.js'); | |
| 91 | + $this->oPage->requireJSResource('thirdpartyjs/yui/dragdrop/dragdrop.js'); | |
| 92 | + $this->oPage->requireJSResource('resources/js/DDList.js'); | |
| 93 | + | |
| 94 | + | |
| 95 | + // dashboard | |
| 96 | + $sDashboardState = $this->oUser->getDashboardState(); | |
| 97 | + $sDSJS = "var savedState = "; | |
| 98 | + if($sDashboardState == null) { | |
| 99 | + $sDSJS .= "false"; | |
| 100 | + $sDashboardState = false; | |
| 101 | + } else { | |
| 102 | + $sDSJS .= $sDashboardState; | |
| 103 | + } | |
| 104 | + $sDSJS .= ';'; | |
| 105 | + $this->oPage->requireJSStandalone($sDSJS); | |
| 106 | + $this->oPage->requireJSResource('resources/js/dashboard.js'); | |
| 86 | 107 | |
| 108 | + | |
| 109 | + // render | |
| 87 | 110 | $oTemplating =& KTTemplating::getSingleton(); |
| 88 | - $oTemplate = $oTemplating->loadTemplate("kt3/olddashboard"); | |
| 111 | + $oTemplate = $oTemplating->loadTemplate("kt3/dashboard"); | |
| 89 | 112 | $aTemplateData = array( |
| 90 | 113 | "context" => $this, |
| 91 | 114 | "dashlets_left" => $aDashletsLeft, |
| ... | ... | @@ -94,6 +117,12 @@ class DashboardDispatcher extends KTStandardDispatcher { |
| 94 | 117 | return $oTemplate->render($aTemplateData); |
| 95 | 118 | } |
| 96 | 119 | |
| 120 | + // return some kind of ID for each dashlet | |
| 121 | + // currently uses the class name | |
| 122 | + function _getDashletId($oDashlet) { | |
| 123 | + return get_class($oDashlet); | |
| 124 | + } | |
| 125 | + | |
| 97 | 126 | // disable a dashlet. |
| 98 | 127 | // FIXME this very slightly violates the separation of concerns, but its not that flagrant. |
| 99 | 128 | function do_disableDashlet() { |
| ... | ... | @@ -117,6 +146,13 @@ class DashboardDispatcher extends KTStandardDispatcher { |
| 117 | 146 | $this->commitTransaction(); |
| 118 | 147 | $this->successRedirectToMain('Dashlet disabled.'); |
| 119 | 148 | } |
| 149 | + | |
| 150 | + | |
| 151 | + function json_saveDashboardState() { | |
| 152 | + $sState = KTUtil::arrayGet($_REQUEST, 'state', array('error'=>true)); | |
| 153 | + $this->oUser->setDashboardState($sState); | |
| 154 | + return array('success' => true); | |
| 155 | + } | |
| 120 | 156 | } |
| 121 | 157 | |
| 122 | 158 | $oDispatcher = new DashboardDispatcher(); | ... | ... |
lib/templating/kt3template.inc.php
| ... | ... | @@ -134,8 +134,8 @@ class KTPage { |
| 134 | 134 | function initMenu() { |
| 135 | 135 | // FIXME: we lost the getDefaultAction stuff - do we care? |
| 136 | 136 | // note that key == action. this is _important_, since we crossmatch the breadcrumbs against this for "active" |
| 137 | - $this->menu = array("ajaxdashboard" => $this->_actionHelper(array("name" => _kt("Dashboard"), "action" => "ajaxdashboard", "active" => 0)), | |
| 138 | - "dashboard" => $this->_actionHelper(array("name" => _kt("Old Dashboard"), "action" => "dashboard", "active" => 0)), | |
| 137 | + $this->menu = array("dashboard" => $this->_actionHelper(array("name" => _kt("Dashboard"), "action" => "dashboard", "active" => 0)), | |
| 138 | + "olddashboard" => $this->_actionHelper(array("name" => _kt("Old Dashboard"), "action" => "olddashboard", "active" => 0)), | |
| 139 | 139 | "browse" => $this->_actionHelper(array("name" => _kt("Browse Documents"), "action" => "browse", "active" => 0)), |
| 140 | 140 | "administration" => $this->_actionHelper(array("name" => _kt("DMS Administration"), "action" => "administration", "active" => 0)),); |
| 141 | 141 | } | ... | ... |
dashboard2.php renamed to olddashboard.php
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** |
| 4 | - * $Id: dashboard.php 5758 2006-07-27 10:17:43Z bshuttle $ | |
| 4 | + * $Id: dashboard.php 6039 2006-11-03 10:01:51Z bryndivey $ | |
| 5 | 5 | * |
| 6 | 6 | * Main dashboard page -- This page is presented to the user after login. |
| 7 | 7 | * It contains a high level overview of the users subscriptions, checked out |
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 | * All Rights Reserved. |
| 28 | 28 | * |
| 29 | 29 | * |
| 30 | - * @version $Revision: 5758 $ | |
| 30 | + * @version $Revision: 6039 $ | |
| 31 | 31 | * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa |
| 32 | 32 | */ |
| 33 | 33 | |
| ... | ... | @@ -52,7 +52,7 @@ class DashboardDispatcher extends KTStandardDispatcher { |
| 52 | 52 | |
| 53 | 53 | function DashboardDispatcher() { |
| 54 | 54 | $this->aBreadcrumbs = array( |
| 55 | - array('action' => 'ajaxdashboard', 'name' => _kt('Dashboard')), | |
| 55 | + array('action' => 'olddashboard', 'name' => _kt('Dashboard')), | |
| 56 | 56 | ); |
| 57 | 57 | return parent::KTStandardDispatcher(); |
| 58 | 58 | } |
| ... | ... | @@ -83,32 +83,9 @@ class DashboardDispatcher extends KTStandardDispatcher { |
| 83 | 83 | $i %= 2; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - // javascript | |
| 87 | - // yahoo | |
| 88 | - $this->oPage->requireJSResource('thirdpartyjs/yui/yahoo/yahoo.js'); | |
| 89 | - $this->oPage->requireJSResource('thirdpartyjs/yui/event/event.js'); | |
| 90 | - $this->oPage->requireJSResource('thirdpartyjs/yui/dom/dom.js'); | |
| 91 | - $this->oPage->requireJSResource('thirdpartyjs/yui/dragdrop/dragdrop.js'); | |
| 92 | - $this->oPage->requireJSResource('resources/js/DDList.js'); | |
| 93 | - | |
| 94 | - | |
| 95 | - // dashboard | |
| 96 | - $sDashboardState = $this->oUser->getDashboardState(); | |
| 97 | - $sDSJS = "var savedState = "; | |
| 98 | - if($sDashboardState == null) { | |
| 99 | - $sDSJS .= "false"; | |
| 100 | - $sDashboardState = false; | |
| 101 | - } else { | |
| 102 | - $sDSJS .= $sDashboardState; | |
| 103 | - } | |
| 104 | - $sDSJS .= ';'; | |
| 105 | - $this->oPage->requireJSStandalone($sDSJS); | |
| 106 | - $this->oPage->requireJSResource('resources/js/dashboard.js'); | |
| 107 | 86 | |
| 108 | - | |
| 109 | - // render | |
| 110 | 87 | $oTemplating =& KTTemplating::getSingleton(); |
| 111 | - $oTemplate = $oTemplating->loadTemplate("kt3/dashboard"); | |
| 88 | + $oTemplate = $oTemplating->loadTemplate("kt3/olddashboard"); | |
| 112 | 89 | $aTemplateData = array( |
| 113 | 90 | "context" => $this, |
| 114 | 91 | "dashlets_left" => $aDashletsLeft, |
| ... | ... | @@ -117,12 +94,6 @@ class DashboardDispatcher extends KTStandardDispatcher { |
| 117 | 94 | return $oTemplate->render($aTemplateData); |
| 118 | 95 | } |
| 119 | 96 | |
| 120 | - // return some kind of ID for each dashlet | |
| 121 | - // currently uses the class name | |
| 122 | - function _getDashletId($oDashlet) { | |
| 123 | - return get_class($oDashlet); | |
| 124 | - } | |
| 125 | - | |
| 126 | 97 | // disable a dashlet. |
| 127 | 98 | // FIXME this very slightly violates the separation of concerns, but its not that flagrant. |
| 128 | 99 | function do_disableDashlet() { |
| ... | ... | @@ -146,13 +117,6 @@ class DashboardDispatcher extends KTStandardDispatcher { |
| 146 | 117 | $this->commitTransaction(); |
| 147 | 118 | $this->successRedirectToMain('Dashlet disabled.'); |
| 148 | 119 | } |
| 149 | - | |
| 150 | - | |
| 151 | - function json_saveDashboardState() { | |
| 152 | - $sState = KTUtil::arrayGet($_REQUEST, 'state', array('error'=>true)); | |
| 153 | - $this->oUser->setDashboardState($sState); | |
| 154 | - return array('success' => true); | |
| 155 | - } | |
| 156 | 120 | } |
| 157 | 121 | |
| 158 | 122 | $oDispatcher = new DashboardDispatcher(); | ... | ... |