Commit 510ef9523cfecb3209f68d0ec32cc81bef6772b7

Authored by Bryn Divey
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
config/siteMap.inc
@@ -34,10 +34,10 @@ $default->siteMap = new SiteMap(false); @@ -34,10 +34,10 @@ $default->siteMap = new SiteMap(false);
34 $default->siteMap->addPage("login", "/login.php", "General", None, ""); 34 $default->siteMap->addPage("login", "/login.php", "General", None, "");
35 35
36 // dashboard 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 // old dashboard 39 // old dashboard
40 -$default->siteMap->addPage("dashboard", "/dashboard.php", "General", Guest, "dashboard"); 40 +$default->siteMap->addPage("olddashboard", "/olddashboard.php", "General", Guest, "olddashboard");
41 // dashboard news 41 // dashboard news
42 42
43 //pages for manage documents section 43 //pages for manage documents section
dashboard.php
@@ -83,9 +83,32 @@ class DashboardDispatcher extends KTStandardDispatcher { @@ -83,9 +83,32 @@ class DashboardDispatcher extends KTStandardDispatcher {
83 $i %= 2; 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 $oTemplating =& KTTemplating::getSingleton(); 110 $oTemplating =& KTTemplating::getSingleton();
88 - $oTemplate = $oTemplating->loadTemplate("kt3/olddashboard"); 111 + $oTemplate = $oTemplating->loadTemplate("kt3/dashboard");
89 $aTemplateData = array( 112 $aTemplateData = array(
90 "context" => $this, 113 "context" => $this,
91 "dashlets_left" => $aDashletsLeft, 114 "dashlets_left" => $aDashletsLeft,
@@ -94,6 +117,12 @@ class DashboardDispatcher extends KTStandardDispatcher { @@ -94,6 +117,12 @@ class DashboardDispatcher extends KTStandardDispatcher {
94 return $oTemplate->render($aTemplateData); 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 // disable a dashlet. 126 // disable a dashlet.
98 // FIXME this very slightly violates the separation of concerns, but its not that flagrant. 127 // FIXME this very slightly violates the separation of concerns, but its not that flagrant.
99 function do_disableDashlet() { 128 function do_disableDashlet() {
@@ -117,6 +146,13 @@ class DashboardDispatcher extends KTStandardDispatcher { @@ -117,6 +146,13 @@ class DashboardDispatcher extends KTStandardDispatcher {
117 $this->commitTransaction(); 146 $this->commitTransaction();
118 $this->successRedirectToMain('Dashlet disabled.'); 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 $oDispatcher = new DashboardDispatcher(); 158 $oDispatcher = new DashboardDispatcher();
lib/templating/kt3template.inc.php
@@ -134,8 +134,8 @@ class KTPage { @@ -134,8 +134,8 @@ class KTPage {
134 function initMenu() { 134 function initMenu() {
135 // FIXME: we lost the getDefaultAction stuff - do we care? 135 // FIXME: we lost the getDefaultAction stuff - do we care?
136 // note that key == action. this is _important_, since we crossmatch the breadcrumbs against this for "active" 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 "browse" => $this->_actionHelper(array("name" => _kt("Browse Documents"), "action" => "browse", "active" => 0)), 139 "browse" => $this->_actionHelper(array("name" => _kt("Browse Documents"), "action" => "browse", "active" => 0)),
140 "administration" => $this->_actionHelper(array("name" => _kt("DMS Administration"), "action" => "administration", "active" => 0)),); 140 "administration" => $this->_actionHelper(array("name" => _kt("DMS Administration"), "action" => "administration", "active" => 0)),);
141 } 141 }
dashboard2.php renamed to olddashboard.php
1 <?php 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 * Main dashboard page -- This page is presented to the user after login. 6 * Main dashboard page -- This page is presented to the user after login.
7 * It contains a high level overview of the users subscriptions, checked out 7 * It contains a high level overview of the users subscriptions, checked out
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
27 * All Rights Reserved. 27 * All Rights Reserved.
28 * 28 *
29 * 29 *
30 - * @version $Revision: 5758 $ 30 + * @version $Revision: 6039 $
31 * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa 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,7 +52,7 @@ class DashboardDispatcher extends KTStandardDispatcher {
52 52
53 function DashboardDispatcher() { 53 function DashboardDispatcher() {
54 $this->aBreadcrumbs = array( 54 $this->aBreadcrumbs = array(
55 - array('action' => 'ajaxdashboard', 'name' => _kt('Dashboard')), 55 + array('action' => 'olddashboard', 'name' => _kt('Dashboard')),
56 ); 56 );
57 return parent::KTStandardDispatcher(); 57 return parent::KTStandardDispatcher();
58 } 58 }
@@ -83,32 +83,9 @@ class DashboardDispatcher extends KTStandardDispatcher { @@ -83,32 +83,9 @@ class DashboardDispatcher extends KTStandardDispatcher {
83 $i %= 2; 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 $oTemplating =& KTTemplating::getSingleton(); 87 $oTemplating =& KTTemplating::getSingleton();
111 - $oTemplate = $oTemplating->loadTemplate("kt3/dashboard"); 88 + $oTemplate = $oTemplating->loadTemplate("kt3/olddashboard");
112 $aTemplateData = array( 89 $aTemplateData = array(
113 "context" => $this, 90 "context" => $this,
114 "dashlets_left" => $aDashletsLeft, 91 "dashlets_left" => $aDashletsLeft,
@@ -117,12 +94,6 @@ class DashboardDispatcher extends KTStandardDispatcher { @@ -117,12 +94,6 @@ class DashboardDispatcher extends KTStandardDispatcher {
117 return $oTemplate->render($aTemplateData); 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 // disable a dashlet. 97 // disable a dashlet.
127 // FIXME this very slightly violates the separation of concerns, but its not that flagrant. 98 // FIXME this very slightly violates the separation of concerns, but its not that flagrant.
128 function do_disableDashlet() { 99 function do_disableDashlet() {
@@ -146,13 +117,6 @@ class DashboardDispatcher extends KTStandardDispatcher { @@ -146,13 +117,6 @@ class DashboardDispatcher extends KTStandardDispatcher {
146 $this->commitTransaction(); 117 $this->commitTransaction();
147 $this->successRedirectToMain('Dashlet disabled.'); 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 $oDispatcher = new DashboardDispatcher(); 122 $oDispatcher = new DashboardDispatcher();