From bee36c05c85f47e30b7a28118d54b43e802abf78 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Wed, 12 Jun 2019 22:59:35 +0200 Subject: [PATCH] Updated with JCB v2.9.20 --- README.md | 8 ++--- admin/README.txt | 8 ++--- admin/models/forms/external_source.xml | 1 - admin/views/external_source/tmpl/edit.php | 1 - admin/views/external_sources/view.html.php | 30 ++++++++++++++-- admin/views/help_document/tmpl/edit.php | 1 - admin/views/help_documents/view.html.php | 40 +++++++++++++++++++--- admin/views/local_listing/tmpl/edit.php | 1 - admin/views/local_listings/view.html.php | 20 +++++++++-- admin/views/preacher/tmpl/edit.php | 1 - admin/views/series/tmpl/edit.php | 1 - admin/views/sermon/tmpl/edit.php | 1 - admin/views/sermons/view.html.php | 40 +++++++++++++++++++--- admin/views/statistic/tmpl/edit.php | 1 - admin/views/statistics/view.html.php | 30 ++++++++++++++-- sermondistributor.xml | 2 +- site/controllers/download.php | 5 +++ site/helpers/category.php | 2 +- 18 files changed, 159 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index cb6bcab3..bfc1acc9 100644 --- a/README.md +++ b/README.md @@ -23,20 +23,20 @@ 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*: 23rd April, 2019 ++ *Last Build*: 12th June, 2019 + *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 ## Build Time :hourglass: -**186 Hours** or **23 Eight Hour Days** (actual time the author saved - +**187 Hours** or **23 Eight Hour Days** (actual time the author saved - 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*: **66821** ++ *Line count*: **66946** + *File count*: **445** + *Folder count*: **93** @@ -48,7 +48,7 @@ due to [Automated Component Builder](https://www.vdm.io/joomla-component-builder > **mapping @19hours** = codingtime / 10; > **office @31hours** = codingtime / 6;) -**309 Hours** or **39 Eight Hour Days** +**310 Hours** or **39 Eight Hour Days** (a total of the realistic time frame for this project) > (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, diff --git a/admin/README.txt b/admin/README.txt index cb6bcab3..bfc1acc9 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -23,20 +23,20 @@ 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*: 23rd April, 2019 ++ *Last Build*: 12th June, 2019 + *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 ## Build Time :hourglass: -**186 Hours** or **23 Eight Hour Days** (actual time the author saved - +**187 Hours** or **23 Eight Hour Days** (actual time the author saved - 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*: **66821** ++ *Line count*: **66946** + *File count*: **445** + *Folder count*: **93** @@ -48,7 +48,7 @@ due to [Automated Component Builder](https://www.vdm.io/joomla-component-builder > **mapping @19hours** = codingtime / 10; > **office @31hours** = codingtime / 6;) -**309 Hours** or **39 Eight Hour Days** +**310 Hours** or **39 Eight Hour Days** (a total of the realistic time frame for this project) > (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, diff --git a/admin/models/forms/external_source.xml b/admin/models/forms/external_source.xml index fcae6bf7..62cd1cdb 100644 --- a/admin/models/forms/external_source.xml +++ b/admin/models/forms/external_source.xml @@ -244,7 +244,6 @@ maxlength="150" description="COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_TFOLDER_DESCRIPTION" class="text_area span12" - required="false" filter="PATH" message="COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_TFOLDER_MESSAGE" hint="COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_TFOLDER_HINT" diff --git a/admin/views/external_source/tmpl/edit.php b/admin/views/external_source/tmpl/edit.php index eac7610d..b7d790f6 100644 --- a/admin/views/external_source/tmpl/edit.php +++ b/admin/views/external_source/tmpl/edit.php @@ -130,7 +130,6 @@ $componentParams = $this->params; // will be removed just use $this->params inst -
diff --git a/admin/views/external_sources/view.html.php b/admin/views/external_sources/view.html.php index 3629f4e7..fae4f3fd 100644 --- a/admin/views/external_sources/view.html.php +++ b/admin/views/external_sources/view.html.php @@ -201,7 +201,15 @@ class SermondistributorViewExternal_sources extends JViewLegacy // Set Externalsources Selection $this->externalsourcesOptions = $this->getTheExternalsourcesSelections(); - if ($this->externalsourcesOptions) + // We do some sanitation for Externalsources filter + if (SermondistributorHelper::checkArray($this->externalsourcesOptions) && + isset($this->externalsourcesOptions[0]->value) && + !SermondistributorHelper::checkString($this->externalsourcesOptions[0]->value)) + { + unset($this->externalsourcesOptions[0]); + } + // Only load Externalsources filter if it has values + if (SermondistributorHelper::checkArray($this->externalsourcesOptions)) { // Externalsources Filter JHtmlSidebar::addFilter( @@ -223,7 +231,15 @@ class SermondistributorViewExternal_sources extends JViewLegacy // Set Update Method Selection $this->update_methodOptions = $this->getTheUpdate_methodSelections(); - if ($this->update_methodOptions) + // We do some sanitation for Update Method filter + if (SermondistributorHelper::checkArray($this->update_methodOptions) && + isset($this->update_methodOptions[0]->value) && + !SermondistributorHelper::checkString($this->update_methodOptions[0]->value)) + { + unset($this->update_methodOptions[0]); + } + // Only load Update Method filter if it has values + if (SermondistributorHelper::checkArray($this->update_methodOptions)) { // Update Method Filter JHtmlSidebar::addFilter( @@ -245,7 +261,15 @@ class SermondistributorViewExternal_sources extends JViewLegacy // Set Build Selection $this->buildOptions = $this->getTheBuildSelections(); - if ($this->buildOptions) + // We do some sanitation for Build filter + if (SermondistributorHelper::checkArray($this->buildOptions) && + isset($this->buildOptions[0]->value) && + !SermondistributorHelper::checkString($this->buildOptions[0]->value)) + { + unset($this->buildOptions[0]); + } + // Only load Build filter if it has values + if (SermondistributorHelper::checkArray($this->buildOptions)) { // Build Filter JHtmlSidebar::addFilter( diff --git a/admin/views/help_document/tmpl/edit.php b/admin/views/help_document/tmpl/edit.php index 5294f9ef..a940b24f 100644 --- a/admin/views/help_document/tmpl/edit.php +++ b/admin/views/help_document/tmpl/edit.php @@ -120,7 +120,6 @@ $componentParams = $this->params; // will be removed just use $this->params inst -
diff --git a/admin/views/help_documents/view.html.php b/admin/views/help_documents/view.html.php index ed38ce93..1c47790b 100644 --- a/admin/views/help_documents/view.html.php +++ b/admin/views/help_documents/view.html.php @@ -201,7 +201,15 @@ class SermondistributorViewHelp_documents extends JViewLegacy // Set Type Selection $this->typeOptions = $this->getTheTypeSelections(); - if ($this->typeOptions) + // We do some sanitation for Type filter + if (SermondistributorHelper::checkArray($this->typeOptions) && + isset($this->typeOptions[0]->value) && + !SermondistributorHelper::checkString($this->typeOptions[0]->value)) + { + unset($this->typeOptions[0]); + } + // Only load Type filter if it has values + if (SermondistributorHelper::checkArray($this->typeOptions)) { // Type Filter JHtmlSidebar::addFilter( @@ -223,7 +231,15 @@ class SermondistributorViewHelp_documents extends JViewLegacy // Set Location Selection $this->locationOptions = $this->getTheLocationSelections(); - if ($this->locationOptions) + // We do some sanitation for Location filter + if (SermondistributorHelper::checkArray($this->locationOptions) && + isset($this->locationOptions[0]->value) && + !SermondistributorHelper::checkString($this->locationOptions[0]->value)) + { + unset($this->locationOptions[0]); + } + // Only load Location filter if it has values + if (SermondistributorHelper::checkArray($this->locationOptions)) { // Location Filter JHtmlSidebar::addFilter( @@ -245,7 +261,15 @@ class SermondistributorViewHelp_documents extends JViewLegacy // Set Admin View Selection $this->admin_viewOptions = JFormHelper::loadFieldType('Adminviewfolderlist')->options; - if ($this->admin_viewOptions) + // We do some sanitation for Admin View filter + if (SermondistributorHelper::checkArray($this->admin_viewOptions) && + isset($this->admin_viewOptions[0]->value) && + !SermondistributorHelper::checkString($this->admin_viewOptions[0]->value)) + { + unset($this->admin_viewOptions[0]); + } + // Only load Admin View filter if it has values + if (SermondistributorHelper::checkArray($this->admin_viewOptions)) { // Admin View Filter JHtmlSidebar::addFilter( @@ -267,7 +291,15 @@ class SermondistributorViewHelp_documents extends JViewLegacy // Set Site View Selection $this->site_viewOptions = JFormHelper::loadFieldType('Siteviewfolderlist')->options; - if ($this->site_viewOptions) + // We do some sanitation for Site View filter + if (SermondistributorHelper::checkArray($this->site_viewOptions) && + isset($this->site_viewOptions[0]->value) && + !SermondistributorHelper::checkString($this->site_viewOptions[0]->value)) + { + unset($this->site_viewOptions[0]); + } + // Only load Site View filter if it has values + if (SermondistributorHelper::checkArray($this->site_viewOptions)) { // Site View Filter JHtmlSidebar::addFilter( diff --git a/admin/views/local_listing/tmpl/edit.php b/admin/views/local_listing/tmpl/edit.php index 498811d5..8981483d 100644 --- a/admin/views/local_listing/tmpl/edit.php +++ b/admin/views/local_listing/tmpl/edit.php @@ -120,7 +120,6 @@ $componentParams = $this->params; // will be removed just use $this->params inst - diff --git a/admin/views/local_listings/view.html.php b/admin/views/local_listings/view.html.php index d9bb57ea..50f405f9 100644 --- a/admin/views/local_listings/view.html.php +++ b/admin/views/local_listings/view.html.php @@ -201,7 +201,15 @@ class SermondistributorViewLocal_listings extends JViewLegacy // Set Build Selection $this->buildOptions = $this->getTheBuildSelections(); - if ($this->buildOptions) + // We do some sanitation for Build filter + if (SermondistributorHelper::checkArray($this->buildOptions) && + isset($this->buildOptions[0]->value) && + !SermondistributorHelper::checkString($this->buildOptions[0]->value)) + { + unset($this->buildOptions[0]); + } + // Only load Build filter if it has values + if (SermondistributorHelper::checkArray($this->buildOptions)) { // Build Filter JHtmlSidebar::addFilter( @@ -223,7 +231,15 @@ class SermondistributorViewLocal_listings extends JViewLegacy // Set External Source Description Selection $this->external_sourceDescriptionOptions = JFormHelper::loadFieldType('Externalsource')->options; - if ($this->external_sourceDescriptionOptions) + // We do some sanitation for External Source Description filter + if (SermondistributorHelper::checkArray($this->external_sourceDescriptionOptions) && + isset($this->external_sourceDescriptionOptions[0]->value) && + !SermondistributorHelper::checkString($this->external_sourceDescriptionOptions[0]->value)) + { + unset($this->external_sourceDescriptionOptions[0]); + } + // Only load External Source Description filter if it has values + if (SermondistributorHelper::checkArray($this->external_sourceDescriptionOptions)) { // External Source Description Filter JHtmlSidebar::addFilter( diff --git a/admin/views/preacher/tmpl/edit.php b/admin/views/preacher/tmpl/edit.php index 16774416..8aa0e819 100644 --- a/admin/views/preacher/tmpl/edit.php +++ b/admin/views/preacher/tmpl/edit.php @@ -132,7 +132,6 @@ $componentParams = $this->params; // will be removed just use $this->params inst - diff --git a/admin/views/series/tmpl/edit.php b/admin/views/series/tmpl/edit.php index 8efb86bc..317d4207 100644 --- a/admin/views/series/tmpl/edit.php +++ b/admin/views/series/tmpl/edit.php @@ -132,7 +132,6 @@ $componentParams = $this->params; // will be removed just use $this->params inst - diff --git a/admin/views/sermon/tmpl/edit.php b/admin/views/sermon/tmpl/edit.php index 1df25896..c791cf82 100644 --- a/admin/views/sermon/tmpl/edit.php +++ b/admin/views/sermon/tmpl/edit.php @@ -142,7 +142,6 @@ $componentParams = $this->params; // will be removed just use $this->params inst -
diff --git a/admin/views/sermons/view.html.php b/admin/views/sermons/view.html.php index fc77fec3..1b998d46 100644 --- a/admin/views/sermons/view.html.php +++ b/admin/views/sermons/view.html.php @@ -218,7 +218,15 @@ class SermondistributorViewSermons extends JViewLegacy // Set Preacher Name Selection $this->preacherNameOptions = JFormHelper::loadFieldType('Preachers')->options; - if ($this->preacherNameOptions) + // We do some sanitation for Preacher Name filter + if (SermondistributorHelper::checkArray($this->preacherNameOptions) && + isset($this->preacherNameOptions[0]->value) && + !SermondistributorHelper::checkString($this->preacherNameOptions[0]->value)) + { + unset($this->preacherNameOptions[0]); + } + // Only load Preacher Name filter if it has values + if (SermondistributorHelper::checkArray($this->preacherNameOptions)) { // Preacher Name Filter JHtmlSidebar::addFilter( @@ -240,7 +248,15 @@ class SermondistributorViewSermons extends JViewLegacy // Set Series Name Selection $this->seriesNameOptions = JFormHelper::loadFieldType('Series')->options; - if ($this->seriesNameOptions) + // We do some sanitation for Series Name filter + if (SermondistributorHelper::checkArray($this->seriesNameOptions) && + isset($this->seriesNameOptions[0]->value) && + !SermondistributorHelper::checkString($this->seriesNameOptions[0]->value)) + { + unset($this->seriesNameOptions[0]); + } + // Only load Series Name filter if it has values + if (SermondistributorHelper::checkArray($this->seriesNameOptions)) { // Series Name Filter JHtmlSidebar::addFilter( @@ -262,7 +278,15 @@ class SermondistributorViewSermons extends JViewLegacy // Set Link Type Selection $this->link_typeOptions = $this->getTheLink_typeSelections(); - if ($this->link_typeOptions) + // We do some sanitation for Link Type filter + if (SermondistributorHelper::checkArray($this->link_typeOptions) && + isset($this->link_typeOptions[0]->value) && + !SermondistributorHelper::checkString($this->link_typeOptions[0]->value)) + { + unset($this->link_typeOptions[0]); + } + // Only load Link Type filter if it has values + if (SermondistributorHelper::checkArray($this->link_typeOptions)) { // Link Type Filter JHtmlSidebar::addFilter( @@ -284,7 +308,15 @@ class SermondistributorViewSermons extends JViewLegacy // Set Source Selection $this->sourceOptions = $this->getTheSourceSelections(); - if ($this->sourceOptions) + // We do some sanitation for Source filter + if (SermondistributorHelper::checkArray($this->sourceOptions) && + isset($this->sourceOptions[0]->value) && + !SermondistributorHelper::checkString($this->sourceOptions[0]->value)) + { + unset($this->sourceOptions[0]); + } + // Only load Source filter if it has values + if (SermondistributorHelper::checkArray($this->sourceOptions)) { // Source Filter JHtmlSidebar::addFilter( diff --git a/admin/views/statistic/tmpl/edit.php b/admin/views/statistic/tmpl/edit.php index 108299de..9960cc32 100644 --- a/admin/views/statistic/tmpl/edit.php +++ b/admin/views/statistic/tmpl/edit.php @@ -93,7 +93,6 @@ $componentParams = $this->params; // will be removed just use $this->params inst - diff --git a/admin/views/statistics/view.html.php b/admin/views/statistics/view.html.php index e5e2edc0..4cdb61bd 100644 --- a/admin/views/statistics/view.html.php +++ b/admin/views/statistics/view.html.php @@ -201,7 +201,15 @@ class SermondistributorViewStatistics extends JViewLegacy // Set Sermon Name Selection $this->sermonNameOptions = JFormHelper::loadFieldType('Sermon')->options; - if ($this->sermonNameOptions) + // We do some sanitation for Sermon Name filter + if (SermondistributorHelper::checkArray($this->sermonNameOptions) && + isset($this->sermonNameOptions[0]->value) && + !SermondistributorHelper::checkString($this->sermonNameOptions[0]->value)) + { + unset($this->sermonNameOptions[0]); + } + // Only load Sermon Name filter if it has values + if (SermondistributorHelper::checkArray($this->sermonNameOptions)) { // Sermon Name Filter JHtmlSidebar::addFilter( @@ -223,7 +231,15 @@ class SermondistributorViewStatistics extends JViewLegacy // Set Preacher Name Selection $this->preacherNameOptions = JFormHelper::loadFieldType('Preachers')->options; - if ($this->preacherNameOptions) + // We do some sanitation for Preacher Name filter + if (SermondistributorHelper::checkArray($this->preacherNameOptions) && + isset($this->preacherNameOptions[0]->value) && + !SermondistributorHelper::checkString($this->preacherNameOptions[0]->value)) + { + unset($this->preacherNameOptions[0]); + } + // Only load Preacher Name filter if it has values + if (SermondistributorHelper::checkArray($this->preacherNameOptions)) { // Preacher Name Filter JHtmlSidebar::addFilter( @@ -245,7 +261,15 @@ class SermondistributorViewStatistics extends JViewLegacy // Set Series Name Selection $this->seriesNameOptions = JFormHelper::loadFieldType('Series')->options; - if ($this->seriesNameOptions) + // We do some sanitation for Series Name filter + if (SermondistributorHelper::checkArray($this->seriesNameOptions) && + isset($this->seriesNameOptions[0]->value) && + !SermondistributorHelper::checkString($this->seriesNameOptions[0]->value)) + { + unset($this->seriesNameOptions[0]); + } + // Only load Series Name filter if it has values + if (SermondistributorHelper::checkArray($this->seriesNameOptions)) { // Series Name Filter JHtmlSidebar::addFilter( diff --git a/sermondistributor.xml b/sermondistributor.xml index 45a242ef..c871d7e4 100644 --- a/sermondistributor.xml +++ b/sermondistributor.xml @@ -1,7 +1,7 @@ COM_SERMONDISTRIBUTOR - 23rd April, 2019 + 12th June, 2019 Llewellyn van der Merwe joomla@vdm.io https://www.vdm.io/ diff --git a/site/controllers/download.php b/site/controllers/download.php index 3d7e9e8b..6716e45e 100644 --- a/site/controllers/download.php +++ b/site/controllers/download.php @@ -62,6 +62,11 @@ class SermondistributorControllerDownload extends JControllerLegacy // we must first count this download if (SermondistributorHelper::countDownload($keys,$filename)) { + $model = SermondistributorHelper::getModel('preachers', JPATH_COMPONENT_ADMINISTRATOR); + if (($result = $model->getSomeStuff($filename)) !== false) + { + // on success do some thing more (code here) + } // get Site name $config = JFactory::getConfig(); $vendor = $config->get('sitename'); diff --git a/site/helpers/category.php b/site/helpers/category.php index 6b060036..2668dcb4 100644 --- a/site/helpers/category.php +++ b/site/helpers/category.php @@ -30,7 +30,7 @@ defined('_JEXEC') or die('Restricted access'); */ //Insure this view category file is loaded. -$classname = 'sermondistributorSermonsCategories'; +$classname = 'SermondistributorSermonsCategories'; if (!class_exists($classname)) { $path = JPATH_SITE . '/components/com_sermondistributor/helpers/categorysermons.php';