From bfd3d26b83e6d6eb55280ce782bd9aa54e7e746e Mon Sep 17 00:00:00 2001 From: chris-hall-hu-cheng Date: Wed, 18 Jun 2014 12:07:37 +0000 Subject: [PATCH 1/3] Initialise the data object to prevent warnings. --- mcp.widgets.php | 1 + 1 file changed, 1 insertion(+) diff --git a/mcp.widgets.php b/mcp.widgets.php index 7021b92..45de220 100644 --- a/mcp.widgets.php +++ b/mcp.widgets.php @@ -41,6 +41,7 @@ function __construct() $this->EE->javascript->output('WIDGET_URL = "'.html_entity_decode(WIDGET_URL).'";'); $this->EE->javascript->compile(); + $this->data = new StdClass; $this->data->base = WIDGET_URL; $this->EE->load->library('widget'); From 9ee5b4c19d0fda3b3e5bcf51a0f49f960042e8ae Mon Sep 17 00:00:00 2001 From: chris-hall-hu-cheng Date: Tue, 26 Aug 2014 19:59:25 +0000 Subject: [PATCH 2/3] Replace the set_variable call no longer available in version >= 2.8. --- mcp.widgets.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcp.widgets.php b/mcp.widgets.php index 45de220..c31a5a0 100644 --- a/mcp.widgets.php +++ b/mcp.widgets.php @@ -66,7 +66,7 @@ public function index() $this->EE->cp->load_package_js('widgets'); // Show the current page to be WIDGET - $this->EE->cp->set_variable('cp_page_title', lang('widgets_module_name')); + $this->EE->view->cp_page_title = lang('widgets_module_name'); // Firstly, install any uninstalled widgets $uninstalled_widgets = $this->EE->widget->list_uninstalled_widgets(); From 5b0d9e5904251e8d322c2c7fc3e9984bfb697eb9 Mon Sep 17 00:00:00 2001 From: Chris Hall Date: Thu, 21 May 2015 15:17:32 +0000 Subject: [PATCH 3/3] Update the rest of the set_variable calls for edit, copy etc. --- mcp.widgets.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mcp.widgets.php b/mcp.widgets.php index c31a5a0..ee02cfe 100644 --- a/mcp.widgets.php +++ b/mcp.widgets.php @@ -66,7 +66,7 @@ public function index() $this->EE->cp->load_package_js('widgets'); // Show the current page to be WIDGET - $this->EE->view->cp_page_title = lang('widgets_module_name'); + $this->EE->view->cp_page_title = lang('widgets_module_name'); // Firstly, install any uninstalled widgets $uninstalled_widgets = $this->EE->widget->list_uninstalled_widgets(); @@ -125,7 +125,7 @@ public function update_order() public function add_instance() { $this->EE->cp->set_breadcrumb(WIDGET_URL, lang('widgets_module_name')); - $this->EE->cp->set_variable('cp_page_title', lang('widgets_add_instance')); + $this->EE->view->cp_page_title = lang('widgets_add_instance'); $this->EE->input->post('cancel') and $this->EE->functions->redirect(WIDGET_URL); @@ -188,7 +188,7 @@ public function add_instance() public function edit_instance() { $this->EE->cp->set_breadcrumb(WIDGET_URL, lang('widgets_module_name')); - $this->EE->cp->set_variable('cp_page_title', lang('widgets_edit_instance')); + $this->EE->view->cp_page_title = lang('widgets_edit_instance'); // Capture posted back data $title = $this->EE->input->post('title'); @@ -250,7 +250,7 @@ public function edit_instance() public function copy_instance() { $this->EE->cp->set_breadcrumb(WIDGET_URL, lang('widgets_module_name')); - $this->EE->cp->set_variable('cp_page_title', lang('widgets_copy_instance')); + $this->EE->view->cp_page_title = lang('widgets_copy_instance'); // Get instance ID $instance_id = $this->EE->input->get_post('instance_id'); @@ -285,7 +285,7 @@ public function copy_instance() public function delete_instance() { $this->EE->cp->set_breadcrumb(WIDGET_URL, lang('widgets_module_name')); - $this->EE->cp->set_variable('cp_page_title', lang('widgets_delete_instance')); + $this->EE->view->cp_page_title = lang('widgets_delete_instance'); $id = $this->EE->input->get_post('instance_id'); @@ -333,7 +333,7 @@ public function delete_instance() public function delete_area() { $this->EE->cp->set_breadcrumb(WIDGET_URL, lang('widgets_module_name')); - $this->EE->cp->set_variable('cp_page_title', lang('widgets_delete_area')); + $this->EE->view->cp_page_title = lang('widgets_delete_area'); $id = $this->EE->input->get_post('area_id'); @@ -392,7 +392,7 @@ public function details() // WTF you talkin 'bout? $widget or $this->EE->functions->redirect(WIDGET_URL); - $this->EE->cp->set_variable('cp_page_title', $widget->title); + $this->EE->view->cp_page_title = lang('widgets_module_name'); $this->data->widget =& $widget;