From 152026d4d146999aea145a53f0dc6fe74cbb57c6 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Thu, 31 Dec 2020 13:43:18 +0200 Subject: [PATCH] Addes more support for array values in the filter area. --- README.md | 4 ++-- admin/README.txt | 4 ++-- admin/models/external_sources.php | 12 ++++++++---- admin/models/help_documents.php | 12 ++++++++---- admin/models/local_listings.php | 12 ++++++++---- admin/models/preachers.php | 12 ++++++++---- admin/models/series_list.php | 12 ++++++++---- admin/models/sermons.php | 12 ++++++++---- admin/models/statistics.php | 12 ++++++++---- sermondistributor.xml | 2 +- site/views/api/view.html.php | 2 -- site/views/categories/view.html.php | 2 -- site/views/category/view.html.php | 2 -- site/views/preacher/view.html.php | 2 -- site/views/preachers/view.html.php | 2 -- site/views/series/view.html.php | 2 -- site/views/serieslist/view.html.php | 2 -- site/views/sermon/view.html.php | 2 -- 18 files changed, 61 insertions(+), 49 deletions(-) diff --git a/README.md b/README.md index e419cbe0..8e795fa4 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ The best way to see all your options is to install this component on you Joomla + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Sermon Distributor](https://www.vdm.io/) + *First Build*: 22nd October, 2015 -+ *Last Build*: 3rd December, 2020 ++ *Last Build*: 4th December, 2020 + *Version*: 2.0.x + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html @@ -36,7 +36,7 @@ due to [Automated Component Builder](https://www.vdm.io/joomla-component-builder > (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, > never making one mistake or taking any coffee break.) -+ *Line count*: **72786** ++ *Line count*: **72798** + *File count*: **459** + *Folder count*: **93** diff --git a/admin/README.txt b/admin/README.txt index e419cbe0..8e795fa4 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -23,7 +23,7 @@ The best way to see all your options is to install this component on you Joomla + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Sermon Distributor](https://www.vdm.io/) + *First Build*: 22nd October, 2015 -+ *Last Build*: 3rd December, 2020 ++ *Last Build*: 4th December, 2020 + *Version*: 2.0.x + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html @@ -36,7 +36,7 @@ due to [Automated Component Builder](https://www.vdm.io/joomla-component-builder > (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, > never making one mistake or taking any coffee break.) -+ *Line count*: **72786** ++ *Line count*: **72798** + *File count*: **459** + *Folder count*: **93** diff --git a/admin/models/external_sources.php b/admin/models/external_sources.php index 9c472644..98718171 100644 --- a/admin/models/external_sources.php +++ b/admin/models/external_sources.php @@ -73,8 +73,15 @@ class SermondistributorModelExternal_sources extends JModelList $this->context .= '.' . $layout; } + // Check if the form was submitted + $formSubmited = $app->input->post->get('form_submited'); + $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); - $this->setState('filter.access', $access); + if ($formSubmited) + { + $access = $app->input->post->get('access'); + $this->setState('filter.access', $access); + } $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); $this->setState('filter.published', $published); @@ -91,9 +98,6 @@ class SermondistributorModelExternal_sources extends JModelList $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); $this->setState('filter.search', $search); - // Check if the form was submitted - $formSubmited = $app->input->post->get('form_submited'); - $externalsources = $this->getUserStateFromRequest($this->context . '.filter.externalsources', 'filter_externalsources'); if ($formSubmited) { diff --git a/admin/models/help_documents.php b/admin/models/help_documents.php index e27d3860..476b0bbc 100644 --- a/admin/models/help_documents.php +++ b/admin/models/help_documents.php @@ -75,8 +75,15 @@ class SermondistributorModelHelp_documents extends JModelList $this->context .= '.' . $layout; } + // Check if the form was submitted + $formSubmited = $app->input->post->get('form_submited'); + $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); - $this->setState('filter.access', $access); + if ($formSubmited) + { + $access = $app->input->post->get('access'); + $this->setState('filter.access', $access); + } $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); $this->setState('filter.published', $published); @@ -93,9 +100,6 @@ class SermondistributorModelHelp_documents extends JModelList $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); $this->setState('filter.search', $search); - // Check if the form was submitted - $formSubmited = $app->input->post->get('form_submited'); - $type = $this->getUserStateFromRequest($this->context . '.filter.type', 'filter_type'); if ($formSubmited) { diff --git a/admin/models/local_listings.php b/admin/models/local_listings.php index b9fe578e..4aa6a303 100644 --- a/admin/models/local_listings.php +++ b/admin/models/local_listings.php @@ -74,8 +74,15 @@ class SermondistributorModelLocal_listings extends JModelList $this->context .= '.' . $layout; } + // Check if the form was submitted + $formSubmited = $app->input->post->get('form_submited'); + $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); - $this->setState('filter.access', $access); + if ($formSubmited) + { + $access = $app->input->post->get('access'); + $this->setState('filter.access', $access); + } $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); $this->setState('filter.published', $published); @@ -92,9 +99,6 @@ class SermondistributorModelLocal_listings extends JModelList $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); $this->setState('filter.search', $search); - // Check if the form was submitted - $formSubmited = $app->input->post->get('form_submited'); - $build = $this->getUserStateFromRequest($this->context . '.filter.build', 'filter_build'); if ($formSubmited) { diff --git a/admin/models/preachers.php b/admin/models/preachers.php index 7c2c9623..b8f70e31 100644 --- a/admin/models/preachers.php +++ b/admin/models/preachers.php @@ -72,8 +72,15 @@ class SermondistributorModelPreachers extends JModelList $this->context .= '.' . $layout; } + // Check if the form was submitted + $formSubmited = $app->input->post->get('form_submited'); + $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); - $this->setState('filter.access', $access); + if ($formSubmited) + { + $access = $app->input->post->get('access'); + $this->setState('filter.access', $access); + } $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); $this->setState('filter.published', $published); @@ -90,9 +97,6 @@ class SermondistributorModelPreachers extends JModelList $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); $this->setState('filter.search', $search); - // Check if the form was submitted - $formSubmited = $app->input->post->get('form_submited'); - $name = $this->getUserStateFromRequest($this->context . '.filter.name', 'filter_name'); if ($formSubmited) { diff --git a/admin/models/series_list.php b/admin/models/series_list.php index db492778..f3c43b50 100644 --- a/admin/models/series_list.php +++ b/admin/models/series_list.php @@ -71,8 +71,15 @@ class SermondistributorModelSeries_list extends JModelList $this->context .= '.' . $layout; } + // Check if the form was submitted + $formSubmited = $app->input->post->get('form_submited'); + $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); - $this->setState('filter.access', $access); + if ($formSubmited) + { + $access = $app->input->post->get('access'); + $this->setState('filter.access', $access); + } $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); $this->setState('filter.published', $published); @@ -89,9 +96,6 @@ class SermondistributorModelSeries_list extends JModelList $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); $this->setState('filter.search', $search); - // Check if the form was submitted - $formSubmited = $app->input->post->get('form_submited'); - $name = $this->getUserStateFromRequest($this->context . '.filter.name', 'filter_name'); if ($formSubmited) { diff --git a/admin/models/sermons.php b/admin/models/sermons.php index b09bc844..90da29bd 100644 --- a/admin/models/sermons.php +++ b/admin/models/sermons.php @@ -79,8 +79,15 @@ class SermondistributorModelSermons extends JModelList $this->context .= '.' . $layout; } + // Check if the form was submitted + $formSubmited = $app->input->post->get('form_submited'); + $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); - $this->setState('filter.access', $access); + if ($formSubmited) + { + $access = $app->input->post->get('access'); + $this->setState('filter.access', $access); + } $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); $this->setState('filter.published', $published); @@ -97,9 +104,6 @@ class SermondistributorModelSermons extends JModelList $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); $this->setState('filter.search', $search); - // Check if the form was submitted - $formSubmited = $app->input->post->get('form_submited'); - $preacher = $this->getUserStateFromRequest($this->context . '.filter.preacher', 'filter_preacher'); if ($formSubmited) { diff --git a/admin/models/statistics.php b/admin/models/statistics.php index a45f6fc7..c8d9f43c 100644 --- a/admin/models/statistics.php +++ b/admin/models/statistics.php @@ -75,8 +75,15 @@ class SermondistributorModelStatistics extends JModelList $this->context .= '.' . $layout; } + // Check if the form was submitted + $formSubmited = $app->input->post->get('form_submited'); + $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); - $this->setState('filter.access', $access); + if ($formSubmited) + { + $access = $app->input->post->get('access'); + $this->setState('filter.access', $access); + } $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); $this->setState('filter.published', $published); @@ -93,9 +100,6 @@ class SermondistributorModelStatistics extends JModelList $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); $this->setState('filter.search', $search); - // Check if the form was submitted - $formSubmited = $app->input->post->get('form_submited'); - $sermon = $this->getUserStateFromRequest($this->context . '.filter.sermon', 'filter_sermon'); if ($formSubmited) { diff --git a/sermondistributor.xml b/sermondistributor.xml index 5809447b..3557733f 100644 --- a/sermondistributor.xml +++ b/sermondistributor.xml @@ -1,7 +1,7 @@ COM_SERMONDISTRIBUTOR - 3rd December, 2020 + 4th December, 2020 Llewellyn van der Merwe joomla@vdm.io https://www.vdm.io/ diff --git a/site/views/api/view.html.php b/site/views/api/view.html.php index ef38bcc5..01e852db 100644 --- a/site/views/api/view.html.php +++ b/site/views/api/view.html.php @@ -121,8 +121,6 @@ class SermondistributorViewApi extends JViewLegacy */ protected function addToolBar() { - // adding the joomla toolbar to the front - JLoader::register('JToolbarHelper', JPATH_ADMINISTRATOR.'/includes/toolbar.php'); // set help url for this view if found $help_url = SermondistributorHelper::getHelpUrl('api'); diff --git a/site/views/categories/view.html.php b/site/views/categories/view.html.php index 6c4d2a9b..c52c1a90 100644 --- a/site/views/categories/view.html.php +++ b/site/views/categories/view.html.php @@ -212,8 +212,6 @@ class SermondistributorViewCategories extends JViewLegacy */ protected function addToolBar() { - // adding the joomla toolbar to the front - JLoader::register('JToolbarHelper', JPATH_ADMINISTRATOR.'/includes/toolbar.php'); // set help url for this view if found $help_url = SermondistributorHelper::getHelpUrl('categories'); diff --git a/site/views/category/view.html.php b/site/views/category/view.html.php index b91b9111..1a07a34c 100644 --- a/site/views/category/view.html.php +++ b/site/views/category/view.html.php @@ -303,8 +303,6 @@ class SermondistributorViewCategory extends JViewLegacy */ protected function addToolBar() { - // adding the joomla toolbar to the front - JLoader::register('JToolbarHelper', JPATH_ADMINISTRATOR.'/includes/toolbar.php'); // set help url for this view if found $help_url = SermondistributorHelper::getHelpUrl('category'); diff --git a/site/views/preacher/view.html.php b/site/views/preacher/view.html.php index 505ca268..f728caa5 100644 --- a/site/views/preacher/view.html.php +++ b/site/views/preacher/view.html.php @@ -299,8 +299,6 @@ class SermondistributorViewPreacher extends JViewLegacy */ protected function addToolBar() { - // adding the joomla toolbar to the front - JLoader::register('JToolbarHelper', JPATH_ADMINISTRATOR.'/includes/toolbar.php'); // set help url for this view if found $help_url = SermondistributorHelper::getHelpUrl('preacher'); diff --git a/site/views/preachers/view.html.php b/site/views/preachers/view.html.php index 0a8eb6d1..865c4c96 100644 --- a/site/views/preachers/view.html.php +++ b/site/views/preachers/view.html.php @@ -227,8 +227,6 @@ class SermondistributorViewPreachers extends JViewLegacy */ protected function addToolBar() { - // adding the joomla toolbar to the front - JLoader::register('JToolbarHelper', JPATH_ADMINISTRATOR.'/includes/toolbar.php'); // set help url for this view if found $help_url = SermondistributorHelper::getHelpUrl('preachers'); diff --git a/site/views/series/view.html.php b/site/views/series/view.html.php index 1b483cf6..92267ff6 100644 --- a/site/views/series/view.html.php +++ b/site/views/series/view.html.php @@ -298,8 +298,6 @@ class SermondistributorViewSeries extends JViewLegacy */ protected function addToolBar() { - // adding the joomla toolbar to the front - JLoader::register('JToolbarHelper', JPATH_ADMINISTRATOR.'/includes/toolbar.php'); // set help url for this view if found $help_url = SermondistributorHelper::getHelpUrl('series'); diff --git a/site/views/serieslist/view.html.php b/site/views/serieslist/view.html.php index 0a7043e6..75ba8234 100644 --- a/site/views/serieslist/view.html.php +++ b/site/views/serieslist/view.html.php @@ -227,8 +227,6 @@ class SermondistributorViewSerieslist extends JViewLegacy */ protected function addToolBar() { - // adding the joomla toolbar to the front - JLoader::register('JToolbarHelper', JPATH_ADMINISTRATOR.'/includes/toolbar.php'); // set help url for this view if found $help_url = SermondistributorHelper::getHelpUrl('serieslist'); diff --git a/site/views/sermon/view.html.php b/site/views/sermon/view.html.php index 191d059a..861440f1 100644 --- a/site/views/sermon/view.html.php +++ b/site/views/sermon/view.html.php @@ -278,8 +278,6 @@ class SermondistributorViewSermon extends JViewLegacy */ protected function addToolBar() { - // adding the joomla toolbar to the front - JLoader::register('JToolbarHelper', JPATH_ADMINISTRATOR.'/includes/toolbar.php'); // set help url for this view if found $help_url = SermondistributorHelper::getHelpUrl('sermon');