From 20def177ef0c594fef80d8bb03f4900671875656 Mon Sep 17 00:00:00 2001 From: Kevin Crider Date: Wed, 18 Sep 2013 12:14:15 -0400 Subject: [PATCH] Added ability to reorder monitors on the dashboard --- web/app/Controller/MonitorsController.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/web/app/Controller/MonitorsController.php b/web/app/Controller/MonitorsController.php index 2ad56c779..17bc2ed9f 100644 --- a/web/app/Controller/MonitorsController.php +++ b/web/app/Controller/MonitorsController.php @@ -1,11 +1,11 @@ array('Jquery')); public function index() { $zmBandwidth = $this->Cookie->read('zmBandwidth'); $this->set('width', Configure::read('ZM_WEB_LIST_THUMB_WIDTH')); - $monitoroptions = array( 'fields' => array('Name', 'Id', 'Function', 'Enabled'), 'recursive' => -1); + $monitoroptions = array('fields' => array('Name', 'Id', 'Function', 'Enabled', 'Sequence'), 'order' => 'Sequence ASC', 'recursive' => -1); $this->set('monitors', $this->Monitor->find('all', $monitoroptions)); $monitors = $this->Monitor->find('all', array('recursive' => -1, 'fields' => array('Id', 'StreamReplayBuffer'))); foreach ($monitors as $monitor => $mon) { @@ -172,7 +172,16 @@ } } } + public function reorder() { + $this->log(print_r($this->data['Monitor'],true)); + foreach ($this->data['Monitor'] as $key => $value) { + $this->log($value); + $this->Monitor->id = $value; + $this->Monitor->saveField('Sequence', $key + 1); + } + exit(); + } } -?> +?> \ No newline at end of file