Commit 874695011a0ce91c62f65512313fe0378655ed25
1 parent
c28f0fb1
Some mods to dashboard, fixed bulk action no-having-the-template-in-source-control problem
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@6048 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
7 changed files
with
41 additions
and
11 deletions
config/siteMap.inc
| @@ -34,7 +34,7 @@ $default->siteMap = new SiteMap(false); | @@ -34,7 +34,7 @@ $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, "dashboard2"); | 37 | +$default->siteMap->addPage("ajaxdashboard", "/dashboard2.php", "General", Guest, "ajaxdashboard"); |
| 38 | 38 | ||
| 39 | // old dashboard | 39 | // old dashboard |
| 40 | $default->siteMap->addPage("dashboard", "/dashboard.php", "General", Guest, "dashboard"); | 40 | $default->siteMap->addPage("dashboard", "/dashboard.php", "General", Guest, "dashboard"); |
dashboard2.php
| @@ -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' => 'dashboard', 'name' => _kt('Dashboard')), | 55 | + array('action' => 'ajaxdashboard', 'name' => _kt('Dashboard')), |
| 56 | ); | 56 | ); |
| 57 | return parent::KTStandardDispatcher(); | 57 | return parent::KTStandardDispatcher(); |
| 58 | } | 58 | } |
plugins/ktcore/KTBulkActions.php
| @@ -72,7 +72,7 @@ class KTBulkDeleteAction extends KTBulkAction { | @@ -72,7 +72,7 @@ class KTBulkDeleteAction extends KTBulkAction { | ||
| 72 | $this->store_lists(); | 72 | $this->store_lists(); |
| 73 | $this->get_lists(); | 73 | $this->get_lists(); |
| 74 | $oTemplating =& KTTemplating::getSingleton(); | 74 | $oTemplating =& KTTemplating::getSingleton(); |
| 75 | - $oTemplate = $oTemplating->loadTemplate('ktcore/move_bulk_action_info'); | 75 | + $oTemplate = $oTemplating->loadTemplate('ktcore/bulk_action_info'); |
| 76 | return $oTemplate->render(array('context' => $this, | 76 | return $oTemplate->render(array('context' => $this, |
| 77 | 'form' => $this->form_collectinfo())); | 77 | 'form' => $this->form_collectinfo())); |
| 78 | } | 78 | } |
| @@ -194,7 +194,7 @@ class KTBulkMoveAction extends KTBulkAction { | @@ -194,7 +194,7 @@ class KTBulkMoveAction extends KTBulkAction { | ||
| 194 | $this->store_lists(); | 194 | $this->store_lists(); |
| 195 | $this->get_lists(); | 195 | $this->get_lists(); |
| 196 | $oTemplating =& KTTemplating::getSingleton(); | 196 | $oTemplating =& KTTemplating::getSingleton(); |
| 197 | - $oTemplate = $oTemplating->loadTemplate('ktcore/move_bulk_action_info'); | 197 | + $oTemplate = $oTemplating->loadTemplate('ktcore/bulk_action_info'); |
| 198 | return $oTemplate->render(array('context' => $this, | 198 | return $oTemplate->render(array('context' => $this, |
| 199 | 'form' => $this->form_collectinfo())); | 199 | 'form' => $this->form_collectinfo())); |
| 200 | } | 200 | } |
resources/css/kt-framing.css
resources/js/dashboard.js
| @@ -54,6 +54,8 @@ KTDashboard.CLOSED = 2; | @@ -54,6 +54,8 @@ KTDashboard.CLOSED = 2; | ||
| 54 | 54 | ||
| 55 | KTDashboard.prototype = { | 55 | KTDashboard.prototype = { |
| 56 | 'initialize' : function(dashboard) { | 56 | 'initialize' : function(dashboard) { |
| 57 | + this.element = dashboard; | ||
| 58 | + | ||
| 57 | var dashOpts = { | 59 | var dashOpts = { |
| 58 | 'tag':'div', | 60 | 'tag':'div', |
| 59 | 'dropOnEmpty':true, | 61 | 'dropOnEmpty':true, |
| @@ -62,8 +64,7 @@ KTDashboard.prototype = { | @@ -62,8 +64,7 @@ KTDashboard.prototype = { | ||
| 62 | 'only' : ['dashboard_block'], | 64 | 'only' : ['dashboard_block'], |
| 63 | 'handle' : 'dashboard_block_handle' | 65 | 'handle' : 'dashboard_block_handle' |
| 64 | }; | 66 | }; |
| 65 | - | ||
| 66 | - MochiKit.Sortable.Sortable.create(dashboard, dashOpts); | 67 | + MochiKit.Sortable.Sortable.create(this.element, dashOpts); |
| 67 | 68 | ||
| 68 | var self = this; | 69 | var self = this; |
| 69 | map(function(e) { | 70 | map(function(e) { |
| @@ -73,14 +74,10 @@ KTDashboard.prototype = { | @@ -73,14 +74,10 @@ KTDashboard.prototype = { | ||
| 73 | var d = new KTDashlet(); | 74 | var d = new KTDashlet(); |
| 74 | d.initialize(e, self); | 75 | d.initialize(e, self); |
| 75 | self.dashlets[e.id] = { 'object' : d, 'state' : KTDashboard.OPEN }; | 76 | self.dashlets[e.id] = { 'object' : d, 'state' : KTDashboard.OPEN }; |
| 76 | - }, getElementsByTagAndClassName('*', 'dashboard_block', dashboard)); | 77 | + }, getElementsByTagAndClassName('*', 'dashboard_block', this.element)); |
| 77 | 78 | ||
| 78 | this.addButton = $('add_dashlet'); | 79 | this.addButton = $('add_dashlet'); |
| 79 | connect(this.addButton, 'onclick', this, 'onclickAdd'); | 80 | connect(this.addButton, 'onclick', this, 'onclickAdd'); |
| 80 | - //hideElement(this.addButton); | ||
| 81 | - | ||
| 82 | - // alert(keys(this.dashlets)); | ||
| 83 | - // alert(values(this.dashlets)); | ||
| 84 | }, | 81 | }, |
| 85 | 82 | ||
| 86 | 'statusChange' : function(status) { | 83 | 'statusChange' : function(status) { |
| @@ -152,7 +149,28 @@ KTDashboard.prototype = { | @@ -152,7 +149,28 @@ KTDashboard.prototype = { | ||
| 152 | appendChildNodes(addDialog, closeLink); | 149 | appendChildNodes(addDialog, closeLink); |
| 153 | appendChildNodes(addDialogScreen, addDialog); | 150 | appendChildNodes(addDialogScreen, addDialog); |
| 154 | appendChildNodes(document.body, addDialogScreen); | 151 | appendChildNodes(document.body, addDialogScreen); |
| 152 | + }, | ||
| 153 | + | ||
| 154 | + 'serialize' : function() { | ||
| 155 | + var self = this; | ||
| 156 | + var cols = Set('left', 'right'); | ||
| 157 | + var ret = {}; | ||
| 158 | + | ||
| 159 | + for(var col in cols) { | ||
| 160 | + ret[col] = []; | ||
| 161 | + var container = $('dashboard-container-' + col); | ||
| 162 | + forEach(getElementsByTagAndClassName('*', 'dashboard_block', container), function(e) { | ||
| 163 | + if(e.id != '') { | ||
| 164 | + ret[col].push({'id':e.id, 'state':self.dashlets[e.id]['state']}); | ||
| 165 | + } | ||
| 166 | + }); | ||
| 167 | + } | ||
| 168 | + | ||
| 169 | + alert(ret); | ||
| 170 | + | ||
| 155 | } | 171 | } |
| 172 | + | ||
| 173 | + | ||
| 156 | } | 174 | } |
| 157 | 175 | ||
| 158 | 176 | ||
| @@ -167,6 +185,7 @@ addLoadEvent( | @@ -167,6 +185,7 @@ addLoadEvent( | ||
| 167 | } else { | 185 | } else { |
| 168 | var dashboard = new KTDashboard(); | 186 | var dashboard = new KTDashboard(); |
| 169 | dashboard.initialize($('content')); | 187 | dashboard.initialize($('content')); |
| 188 | + dashboard.serialize(); | ||
| 170 | } | 189 | } |
| 171 | }); | 190 | }); |
| 172 | 191 |
resources/js/kt-utility.js
templates/ktcore/bulk_action_info.smarty
0 → 100644