From 324875f768b6b1189aad3bc25f9a3d2e8db6d83f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1sztor=20G=C3=A1bor?= Date: Mon, 28 Mar 2016 15:47:29 +0200 Subject: [PATCH] Clean up --- modules/backend/ServiceProvider.php | 2 - modules/backend/traits/CollapsableWidget.php | 9 +--- .../backend/traits/InspectableContainer.php | 1 - modules/backend/traits/SearchableWidget.php | 4 -- modules/backend/traits/SelectableWidget.php | 5 --- modules/backend/traits/WidgetMaker.php | 1 - modules/cms/widgets/ComponentList.php | 45 +------------------ .../widgets/componentlist/partials/_items.htm | 2 +- 8 files changed, 5 insertions(+), 64 deletions(-) diff --git a/modules/backend/ServiceProvider.php b/modules/backend/ServiceProvider.php index 0651565d5..9451f075d 100644 --- a/modules/backend/ServiceProvider.php +++ b/modules/backend/ServiceProvider.php @@ -1,8 +1,6 @@ putSession('groups', $statuses); } - protected function getGroupStatus($group) + protected function getGroupStatus($group, $default = true) { $statuses = $this->getGroupStatuses(); if (array_key_exists($group, $statuses)) { return $statuses[$group]; } - return true; + return $default; } } diff --git a/modules/backend/traits/InspectableContainer.php b/modules/backend/traits/InspectableContainer.php index a3b5f5c70..62ddb6295 100644 --- a/modules/backend/traits/InspectableContainer.php +++ b/modules/backend/traits/InspectableContainer.php @@ -1,7 +1,6 @@ updateList(); } - public function onGroupStatusUpdate() - { - $this->setGroupStatus(Input::get('group'), Input::get('status')); - } - /* * Methods for th internal use */ @@ -262,37 +254,4 @@ class ComponentList extends WidgetBase return false; } - - protected function getGroupStatuses() - { - if ($this->groupStatusCache !== false) { - return $this->groupStatusCache; - } - - $groups = $this->getSession('groups'); - if (!is_array($groups)) { - return $this->groupStatusCache = []; - } - - return $this->groupStatusCache = $groups; - } - - protected function setGroupStatus($group, $status) - { - $statuses = $this->getGroupStatuses(); - $statuses[$group] = $status; - $this->groupStatusCache = $statuses; - - $this->putSession('groups', $statuses); - } - - protected function getGroupStatus($group) - { - $statuses = $this->getGroupStatuses(); - if (array_key_exists($group, $statuses)) { - return $statuses[$group]; - } - - return false; - } } diff --git a/modules/cms/widgets/componentlist/partials/_items.htm b/modules/cms/widgets/componentlist/partials/_items.htm index a182623a7..003e79f28 100644 --- a/modules/cms/widgets/componentlist/partials/_items.htm +++ b/modules/cms/widgets/componentlist/partials/_items.htm @@ -1,7 +1,7 @@