From 6243f540a18b8a54818f23f30c0b6d3e1f612aad Mon Sep 17 00:00:00 2001 From: Brian Hawkins Date: Fri, 23 Aug 2013 15:46:29 -0600 Subject: [PATCH] Added custome js and css to the widget edit page --- app/Controller/DbviewsController.php | 3 +++ app/View/Dbviews/edit.ctp | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/app/Controller/DbviewsController.php b/app/Controller/DbviewsController.php index 0255036..bc5fc97 100644 --- a/app/Controller/DbviewsController.php +++ b/app/Controller/DbviewsController.php @@ -47,6 +47,9 @@ function edit($id = null) { $dashboard_id = $this->request->data['Dbview']['dashboard_id']; $dashboards = $this->Dbview->Dashboard->find('list'); $this->set(compact('dashboards', 'dashboard_id')); + + $dashboard = $this->Dashboard->read(null, $dashboard_id); + $this->set('dashboard', $dashboard); } function update($id = null) { diff --git a/app/View/Dbviews/edit.ctp b/app/View/Dbviews/edit.ctp index abed75d..76d082c 100755 --- a/app/View/Dbviews/edit.ctp +++ b/app/View/Dbviews/edit.ctp @@ -1,3 +1,10 @@ +Html->scriptBlock($dashboard['Dashboard']['javascript'], array('inline' => false, 'safe' => false)); +if ($dashboard['Dashboard']['css'] != null) { + //If css is null tag() will only print out the start tag + $this->Blocks->append('css', $this->Html->tag('style', $dashboard['Dashboard']['css'], array('type' => 'text/css'))); +} +?>