diff --git a/README.md b/README.md index 8e795fa4..96aee6ce 100644 --- a/README.md +++ b/README.md @@ -23,24 +23,24 @@ 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*: 4th December, 2020 ++ *Last Build*: 31st 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 ## Build Time :hourglass: -**203 Hours** or **25 Eight Hour Days** (actual time the author saved - +**204 Hours** or **26 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*: **72798** -+ *File count*: **459** ++ *Line count*: **73050** ++ *File count*: **460** + *Folder count*: **93** -**134 Hours** or **17 Eight Hour Days** (the actual time the author spent) +**134 Hours** or **16 Eight Hour Days** (the actual time the author spent) > (with the following break down: > **debugging @51hours** = codingtime / 4; @@ -48,7 +48,7 @@ due to [Automated Component Builder](https://www.vdm.io/joomla-component-builder > **mapping @20hours** = codingtime / 10; > **office @34hours** = codingtime / 6;) -**337 Hours** or **42 Eight Hour Days** +**338 Hours** or **42 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 8e795fa4..96aee6ce 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -23,24 +23,24 @@ 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*: 4th December, 2020 ++ *Last Build*: 31st 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 ## Build Time :hourglass: -**203 Hours** or **25 Eight Hour Days** (actual time the author saved - +**204 Hours** or **26 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*: **72798** -+ *File count*: **459** ++ *Line count*: **73050** ++ *File count*: **460** + *Folder count*: **93** -**134 Hours** or **17 Eight Hour Days** (the actual time the author spent) +**134 Hours** or **16 Eight Hour Days** (the actual time the author spent) > (with the following break down: > **debugging @51hours** = codingtime / 4; @@ -48,7 +48,7 @@ due to [Automated Component Builder](https://www.vdm.io/joomla-component-builder > **mapping @20hours** = codingtime / 10; > **office @34hours** = codingtime / 6;) -**337 Hours** or **42 Eight Hour Days** +**338 Hours** or **42 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/helpers/sermondistributor.php b/admin/helpers/sermondistributor.php index 29ee8f68..79ee22a9 100644 --- a/admin/helpers/sermondistributor.php +++ b/admin/helpers/sermondistributor.php @@ -25,9 +25,9 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -use Joomla\CMS\Language\Language; -use Joomla\Registry\Registry; -use Joomla\String\StringHelper; +use Joomla\CMS\Language\Language; +use Joomla\Registry\Registry; +use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; use PhpOffice\PhpSpreadsheet\IOFactory; use PhpOffice\PhpSpreadsheet\Spreadsheet; diff --git a/admin/language/en-GB/en-GB.com_sermondistributor.ini b/admin/language/en-GB/en-GB.com_sermondistributor.ini index 078407dc..eefe566f 100644 --- a/admin/language/en-GB/en-GB.com_sermondistributor.ini +++ b/admin/language/en-GB/en-GB.com_sermondistributor.ini @@ -4,6 +4,7 @@ COM_SERMONDISTRIBUTOR_ADD_TOKEN_HERE="ADD TOKEN HERE!" COM_SERMONDISTRIBUTOR_ALL_IS_GOOD_PLEASE_CHECK_AGAIN_LATTER="All is good, please check again latter." COM_SERMONDISTRIBUTOR_ALWAYS_BETTER_TO_ADD_THE_FILES_TO_EXTERNAL_SOURCE_AND_LET_THE_SYSTEM_CREATE_THE_SERMON_FOR_YOU_PLEASE_READ_INSTRUCTIONS_BELOW_CAREFULLY="Always better to add the files to External Source and let the system create the sermon for you. Please read instructions below carefully." COM_SERMONDISTRIBUTOR_ARCHIVED="Archived" +COM_SERMONDISTRIBUTOR_ARE_YOU_SURE_YOU_WANT_TO_DELETE_CONFIRMING_WILL_PERMANENTLY_DELETE_THE_SELECTED_ITEMS="Are you sure you want to delete? Confirming will permanently delete the selected item(s)!" COM_SERMONDISTRIBUTOR_AUTHOR="Author" COM_SERMONDISTRIBUTOR_A_FEW_CLOSED_ISSUES_FROM_GITHUB_IS_LOADING="A few closed issues from Github is loading" COM_SERMONDISTRIBUTOR_A_FEW_OPEN_ISSUES_FROM_GITHUB_IS_LOADING="A few open issues from Github is loading" @@ -356,6 +357,8 @@ COM_SERMONDISTRIBUTOR_EDIT_CREATED_DATE_DESC="Allows users in this group to edit COM_SERMONDISTRIBUTOR_EDIT_S="Edit %s" COM_SERMONDISTRIBUTOR_EDIT_VERSIONS="Edit Version" COM_SERMONDISTRIBUTOR_EDIT_VERSIONS_DESC="Allows users in this group to edit versions." +COM_SERMONDISTRIBUTOR_EMPTY_TRASH="Empty trash" +COM_SERMONDISTRIBUTOR_EXIT_TRASH="Exit trash" COM_SERMONDISTRIBUTOR_EXPORT_DATA="Export Data" COM_SERMONDISTRIBUTOR_EXPORT_DATA_DESC="Allows users in this group to export data." COM_SERMONDISTRIBUTOR_EXPORT_FAILED="Export Failed" @@ -815,7 +818,6 @@ COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_MODIFIED_DATE_LABEL="Modified Date" COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_NEW="A New Help Document" COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_NOT_REQUIRED="Not Required" COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ORDERING_LABEL="Ordering" -COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_PERMISSION="Permissions" COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_PUBLISHING="Publishing" COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Help Document to customise the alias." COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_SELECT_AN_OPTION="Select an option" @@ -1592,6 +1594,7 @@ COM_SERMONDISTRIBUTOR_THE_WIKI_IS_LOADING="The wiki is loading" COM_SERMONDISTRIBUTOR_THIS_SOURCE_HAS_NO_LOCAL_LISTING_SET="This source has no local listing set." COM_SERMONDISTRIBUTOR_TOTAL_DOWNLOADS="total downloads" COM_SERMONDISTRIBUTOR_TRASHED="Trashed" +COM_SERMONDISTRIBUTOR_TRASHED_ITEMS="Trashed items" COM_SERMONDISTRIBUTOR_TYPE_EXTERNAL_SOURCE="External Source" COM_SERMONDISTRIBUTOR_TYPE_HELP_DOCUMENT="Help Document" COM_SERMONDISTRIBUTOR_TYPE_LOCAL_LISTING="Local Listing" @@ -1610,5 +1613,6 @@ COM_SERMONDISTRIBUTOR_VIEW_MORE_ISSUES_ON_GITHUB="View more issues on Github" COM_SERMONDISTRIBUTOR_VIEW_MORE_RELEASES_ON_GITHUB="View more releases on Github" COM_SERMONDISTRIBUTOR_VIEW_UPDATE_STATUS="View Update Status" COM_SERMONDISTRIBUTOR_WEBSITE="Website" +COM_SERMONDISTRIBUTOR_YOU_ARE_CURRENTLY_VIEWING_THE_TRASHED_ITEMS="You are currently viewing the trashed items." COM_SERMONDISTRIBUTOR_YOU_DO_NOT_HAVE_PERMISSION_TO_CLEAR_LOCAL_LISTING="You do not have permission to clear local listing." COM_SERMONDISTRIBUTOR_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_UPDATE_STATUS="You do not have permission to reset update status." \ No newline at end of file diff --git a/admin/layouts/external_source/publishing.php b/admin/layouts/external_source/publishing.php index 7299dace..57a71a8e 100644 --- a/admin/layouts/external_source/publishing.php +++ b/admin/layouts/external_source/publishing.php @@ -39,6 +39,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'title', 'created', 'created_by', 'modified', diff --git a/admin/layouts/local_listing/publishing.php b/admin/layouts/local_listing/publishing.php index 7299dace..57a71a8e 100644 --- a/admin/layouts/local_listing/publishing.php +++ b/admin/layouts/local_listing/publishing.php @@ -39,6 +39,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'title', 'created', 'created_by', 'modified', diff --git a/admin/layouts/preacher/publishing.php b/admin/layouts/preacher/publishing.php index a2ccdca5..c32aa560 100644 --- a/admin/layouts/preacher/publishing.php +++ b/admin/layouts/preacher/publishing.php @@ -39,6 +39,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'title', 'created', 'created_by', 'modified', diff --git a/admin/layouts/series/publishing.php b/admin/layouts/series/publishing.php index a2ccdca5..c32aa560 100644 --- a/admin/layouts/series/publishing.php +++ b/admin/layouts/series/publishing.php @@ -39,6 +39,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'title', 'created', 'created_by', 'modified', diff --git a/admin/layouts/sermon/publishing.php b/admin/layouts/sermon/publishing.php index a2ccdca5..c32aa560 100644 --- a/admin/layouts/sermon/publishing.php +++ b/admin/layouts/sermon/publishing.php @@ -39,6 +39,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'title', 'created', 'created_by', 'modified', diff --git a/admin/layouts/statistic/publishing.php b/admin/layouts/statistic/publishing.php index a2ccdca5..c32aa560 100644 --- a/admin/layouts/statistic/publishing.php +++ b/admin/layouts/statistic/publishing.php @@ -39,6 +39,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'title', 'created', 'created_by', 'modified', diff --git a/admin/layouts/trashhelper.php b/admin/layouts/trashhelper.php new file mode 100644 index 00000000..3275d977 --- /dev/null +++ b/admin/layouts/trashhelper.php @@ -0,0 +1,78 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + A sermon distributor that links to Dropbox. + +/----------------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('JPATH_BASE') or die('Restricted access'); + + + +?> +state->get('filter.published') == -2 && ($displayData->canState && $displayData->canDelete)) : ?> + +
+

+ + +

+

+ + +
+ diff --git a/admin/models/fields/externalsourcesfilterbuild.php b/admin/models/fields/externalsourcesfilterbuild.php index 19e8b490..3dcb5a77 100644 --- a/admin/models/fields/externalsourcesfilterbuild.php +++ b/admin/models/fields/externalsourcesfilterbuild.php @@ -63,14 +63,14 @@ class JFormFieldExternalsourcesfilterbuild extends JFormFieldList $db->setQuery($query); $results = $db->loadColumn(); + $_filter = array(); + $_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_SERMONDISTRIBUTOR_FILTER_SELECT_BUILD') . ' -'); if ($results) { // get external_sourcesmodel $model = SermondistributorHelper::getModel('external_sources'); $results = array_unique($results); - $_filter = array(); - $_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_SERMONDISTRIBUTOR_FILTER_SELECT_BUILD') . ' -'); foreach ($results as $build) { // Translate the build selection @@ -78,8 +78,7 @@ class JFormFieldExternalsourcesfilterbuild extends JFormFieldList // Now add the build and its text to the options array $_filter[] = JHtml::_('select.option', $build, JText::_($text)); } - return $_filter; } - return false; + return $_filter; } } diff --git a/admin/models/fields/externalsourcesfilterexternalsources.php b/admin/models/fields/externalsourcesfilterexternalsources.php index 4ce2ea50..c57cac0d 100644 --- a/admin/models/fields/externalsourcesfilterexternalsources.php +++ b/admin/models/fields/externalsourcesfilterexternalsources.php @@ -63,14 +63,14 @@ class JFormFieldExternalsourcesfilterexternalsources extends JFormFieldList $db->setQuery($query); $results = $db->loadColumn(); + $_filter = array(); + $_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_SERMONDISTRIBUTOR_FILTER_SELECT_EXTERNALSOURCES') . ' -'); if ($results) { // get external_sourcesmodel $model = SermondistributorHelper::getModel('external_sources'); $results = array_unique($results); - $_filter = array(); - $_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_SERMONDISTRIBUTOR_FILTER_SELECT_EXTERNALSOURCES') . ' -'); foreach ($results as $externalsources) { // Translate the externalsources selection @@ -78,8 +78,7 @@ class JFormFieldExternalsourcesfilterexternalsources extends JFormFieldList // Now add the externalsources and its text to the options array $_filter[] = JHtml::_('select.option', $externalsources, JText::_($text)); } - return $_filter; } - return false; + return $_filter; } } diff --git a/admin/models/fields/externalsourcesfilterupdatemethod.php b/admin/models/fields/externalsourcesfilterupdatemethod.php index 4ac66eae..34cb6ee0 100644 --- a/admin/models/fields/externalsourcesfilterupdatemethod.php +++ b/admin/models/fields/externalsourcesfilterupdatemethod.php @@ -63,14 +63,14 @@ class JFormFieldExternalsourcesfilterupdatemethod extends JFormFieldList $db->setQuery($query); $results = $db->loadColumn(); + $_filter = array(); + $_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_SERMONDISTRIBUTOR_FILTER_SELECT_UPDATE_METHOD') . ' -'); if ($results) { // get external_sourcesmodel $model = SermondistributorHelper::getModel('external_sources'); $results = array_unique($results); - $_filter = array(); - $_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_SERMONDISTRIBUTOR_FILTER_SELECT_UPDATE_METHOD') . ' -'); foreach ($results as $update_method) { // Translate the update_method selection @@ -78,8 +78,7 @@ class JFormFieldExternalsourcesfilterupdatemethod extends JFormFieldList // Now add the update_method and its text to the options array $_filter[] = JHtml::_('select.option', $update_method, JText::_($text)); } - return $_filter; } - return false; + return $_filter; } } diff --git a/admin/models/fields/helpdocumentsfilterlocation.php b/admin/models/fields/helpdocumentsfilterlocation.php index cd30c10b..6e778e67 100644 --- a/admin/models/fields/helpdocumentsfilterlocation.php +++ b/admin/models/fields/helpdocumentsfilterlocation.php @@ -63,14 +63,14 @@ class JFormFieldHelpdocumentsfilterlocation extends JFormFieldList $db->setQuery($query); $results = $db->loadColumn(); + $_filter = array(); + $_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_SERMONDISTRIBUTOR_FILTER_SELECT_LOCATION') . ' -'); if ($results) { // get help_documentsmodel $model = SermondistributorHelper::getModel('help_documents'); $results = array_unique($results); - $_filter = array(); - $_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_SERMONDISTRIBUTOR_FILTER_SELECT_LOCATION') . ' -'); foreach ($results as $location) { // Translate the location selection @@ -78,8 +78,7 @@ class JFormFieldHelpdocumentsfilterlocation extends JFormFieldList // Now add the location and its text to the options array $_filter[] = JHtml::_('select.option', $location, JText::_($text)); } - return $_filter; } - return false; + return $_filter; } } diff --git a/admin/models/fields/helpdocumentsfiltertype.php b/admin/models/fields/helpdocumentsfiltertype.php index aa9f8c1e..f6dfadf5 100644 --- a/admin/models/fields/helpdocumentsfiltertype.php +++ b/admin/models/fields/helpdocumentsfiltertype.php @@ -63,14 +63,14 @@ class JFormFieldHelpdocumentsfiltertype extends JFormFieldList $db->setQuery($query); $results = $db->loadColumn(); + $_filter = array(); + $_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_SERMONDISTRIBUTOR_FILTER_SELECT_TYPE') . ' -'); if ($results) { // get help_documentsmodel $model = SermondistributorHelper::getModel('help_documents'); $results = array_unique($results); - $_filter = array(); - $_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_SERMONDISTRIBUTOR_FILTER_SELECT_TYPE') . ' -'); foreach ($results as $type) { // Translate the type selection @@ -78,8 +78,7 @@ class JFormFieldHelpdocumentsfiltertype extends JFormFieldList // Now add the type and its text to the options array $_filter[] = JHtml::_('select.option', $type, JText::_($text)); } - return $_filter; } - return false; + return $_filter; } } diff --git a/admin/models/fields/locallistingsfilterbuild.php b/admin/models/fields/locallistingsfilterbuild.php index f9dcb932..21d5a8df 100644 --- a/admin/models/fields/locallistingsfilterbuild.php +++ b/admin/models/fields/locallistingsfilterbuild.php @@ -63,14 +63,14 @@ class JFormFieldLocallistingsfilterbuild extends JFormFieldList $db->setQuery($query); $results = $db->loadColumn(); + $_filter = array(); + $_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_SERMONDISTRIBUTOR_FILTER_SELECT_BUILD') . ' -'); if ($results) { // get local_listingsmodel $model = SermondistributorHelper::getModel('local_listings'); $results = array_unique($results); - $_filter = array(); - $_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_SERMONDISTRIBUTOR_FILTER_SELECT_BUILD') . ' -'); foreach ($results as $build) { // Translate the build selection @@ -78,8 +78,7 @@ class JFormFieldLocallistingsfilterbuild extends JFormFieldList // Now add the build and its text to the options array $_filter[] = JHtml::_('select.option', $build, JText::_($text)); } - return $_filter; } - return false; + return $_filter; } } diff --git a/admin/models/fields/sermonsfilterlinktype.php b/admin/models/fields/sermonsfilterlinktype.php index f07e6bea..34809199 100644 --- a/admin/models/fields/sermonsfilterlinktype.php +++ b/admin/models/fields/sermonsfilterlinktype.php @@ -63,14 +63,14 @@ class JFormFieldSermonsfilterlinktype extends JFormFieldList $db->setQuery($query); $results = $db->loadColumn(); + $_filter = array(); + $_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_SERMONDISTRIBUTOR_FILTER_SELECT_LINK_TYPE') . ' -'); if ($results) { // get sermonsmodel $model = SermondistributorHelper::getModel('sermons'); $results = array_unique($results); - $_filter = array(); - $_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_SERMONDISTRIBUTOR_FILTER_SELECT_LINK_TYPE') . ' -'); foreach ($results as $link_type) { // Translate the link_type selection @@ -78,8 +78,7 @@ class JFormFieldSermonsfilterlinktype extends JFormFieldList // Now add the link_type and its text to the options array $_filter[] = JHtml::_('select.option', $link_type, JText::_($text)); } - return $_filter; } - return false; + return $_filter; } } diff --git a/admin/models/fields/sermonsfiltersource.php b/admin/models/fields/sermonsfiltersource.php index 59308088..6c3282aa 100644 --- a/admin/models/fields/sermonsfiltersource.php +++ b/admin/models/fields/sermonsfiltersource.php @@ -63,14 +63,14 @@ class JFormFieldSermonsfiltersource extends JFormFieldList $db->setQuery($query); $results = $db->loadColumn(); + $_filter = array(); + $_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_SERMONDISTRIBUTOR_FILTER_SELECT_SOURCE') . ' -'); if ($results) { // get sermonsmodel $model = SermondistributorHelper::getModel('sermons'); $results = array_unique($results); - $_filter = array(); - $_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_SERMONDISTRIBUTOR_FILTER_SELECT_SOURCE') . ' -'); foreach ($results as $source) { // Translate the source selection @@ -78,8 +78,7 @@ class JFormFieldSermonsfiltersource extends JFormFieldList // Now add the source and its text to the options array $_filter[] = JHtml::_('select.option', $source, JText::_($text)); } - return $_filter; } - return false; + return $_filter; } } diff --git a/admin/models/forms/external_source.xml b/admin/models/forms/external_source.xml index 93fb3ae3..1fb420ca 100644 --- a/admin/models/forms/external_source.xml +++ b/admin/models/forms/external_source.xml @@ -76,6 +76,14 @@ readonly="true" filter="unset" /> + + + + + + + + + + + + + + + + + + + + + + + + getState('filter.id'); $id .= ':' . $this->getState('filter.search'); $id .= ':' . $this->getState('filter.published'); - $id .= ':' . $this->getState('filter.access'); + // Check if the value is an array + $_access = $this->getState('filter.access'); + if (SermondistributorHelper::checkArray($_access)) + { + $id .= ':' . implode(':', $_access); + } + // Check if this is only an number or string + elseif (is_numeric($_access) + || SermondistributorHelper::checkString($_access)) + { + $id .= ':' . $_access; + } $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); diff --git a/admin/models/preachers.php b/admin/models/preachers.php index b8f70e31..4609d1bf 100644 --- a/admin/models/preachers.php +++ b/admin/models/preachers.php @@ -366,7 +366,18 @@ class SermondistributorModelPreachers extends JModelList $id .= ':' . $this->getState('filter.id'); $id .= ':' . $this->getState('filter.search'); $id .= ':' . $this->getState('filter.published'); - $id .= ':' . $this->getState('filter.access'); + // Check if the value is an array + $_access = $this->getState('filter.access'); + if (SermondistributorHelper::checkArray($_access)) + { + $id .= ':' . implode(':', $_access); + } + // Check if this is only an number or string + elseif (is_numeric($_access) + || SermondistributorHelper::checkString($_access)) + { + $id .= ':' . $_access; + } $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); diff --git a/admin/models/series_list.php b/admin/models/series_list.php index f3c43b50..e62ee9a8 100644 --- a/admin/models/series_list.php +++ b/admin/models/series_list.php @@ -358,7 +358,18 @@ class SermondistributorModelSeries_list extends JModelList $id .= ':' . $this->getState('filter.id'); $id .= ':' . $this->getState('filter.search'); $id .= ':' . $this->getState('filter.published'); - $id .= ':' . $this->getState('filter.access'); + // Check if the value is an array + $_access = $this->getState('filter.access'); + if (SermondistributorHelper::checkArray($_access)) + { + $id .= ':' . implode(':', $_access); + } + // Check if this is only an number or string + elseif (is_numeric($_access) + || SermondistributorHelper::checkString($_access)) + { + $id .= ':' . $_access; + } $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); diff --git a/admin/models/sermons.php b/admin/models/sermons.php index 90da29bd..838b65fb 100644 --- a/admin/models/sermons.php +++ b/admin/models/sermons.php @@ -611,15 +611,81 @@ class SermondistributorModelSermons extends JModelList $id .= ':' . $this->getState('filter.id'); $id .= ':' . $this->getState('filter.search'); $id .= ':' . $this->getState('filter.published'); - $id .= ':' . $this->getState('filter.access'); + // Check if the value is an array + $_access = $this->getState('filter.access'); + if (SermondistributorHelper::checkArray($_access)) + { + $id .= ':' . implode(':', $_access); + } + // Check if this is only an number or string + elseif (is_numeric($_access) + || SermondistributorHelper::checkString($_access)) + { + $id .= ':' . $_access; + } $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); - $id .= ':' . $this->getState('filter.preacher'); - $id .= ':' . $this->getState('filter.series'); - $id .= ':' . $this->getState('filter.category'); - $id .= ':' . $this->getState('filter.category_id'); - $id .= ':' . $this->getState('filter.catid'); + // Check if the value is an array + $_preacher = $this->getState('filter.preacher'); + if (SermondistributorHelper::checkArray($_preacher)) + { + $id .= ':' . implode(':', $_preacher); + } + // Check if this is only an number or string + elseif (is_numeric($_preacher) + || SermondistributorHelper::checkString($_preacher)) + { + $id .= ':' . $_preacher; + } + // Check if the value is an array + $_series = $this->getState('filter.series'); + if (SermondistributorHelper::checkArray($_series)) + { + $id .= ':' . implode(':', $_series); + } + // Check if this is only an number or string + elseif (is_numeric($_series) + || SermondistributorHelper::checkString($_series)) + { + $id .= ':' . $_series; + } + // Check if the value is an array + $_category = $this->getState('filter.category'); + if (SermondistributorHelper::checkArray($_category)) + { + $id .= ':' . implode(':', $_category); + } + // Check if this is only an number or string + elseif (is_numeric($_category) + || SermondistributorHelper::checkString($_category)) + { + $id .= ':' . $_category; + } + // Check if the value is an array + $_category_id = $this->getState('filter.category_id'); + if (SermondistributorHelper::checkArray($_category_id)) + { + $id .= ':' . implode(':', $_category_id); + } + // Check if this is only an number or string + elseif (is_numeric($_category_id) + || SermondistributorHelper::checkString($_category_id)) + { + $id .= ':' . $_category_id; + } + // Check if the value is an array + $_catid = $this->getState('filter.catid'); + if (SermondistributorHelper::checkArray($_catid)) + { + $id .= ':' . implode(':', $_catid); + } + // Check if this is only an number or string + elseif (is_numeric($_catid) + || SermondistributorHelper::checkString($_catid)) + { + $id .= ':' . $_catid; + } $id .= ':' . $this->getState('filter.link_type'); $id .= ':' . $this->getState('filter.source'); $id .= ':' . $this->getState('filter.name'); diff --git a/admin/models/statistics.php b/admin/models/statistics.php index c8d9f43c..72d86c46 100644 --- a/admin/models/statistics.php +++ b/admin/models/statistics.php @@ -453,7 +453,18 @@ class SermondistributorModelStatistics extends JModelList $id .= ':' . $this->getState('filter.id'); $id .= ':' . $this->getState('filter.search'); $id .= ':' . $this->getState('filter.published'); - $id .= ':' . $this->getState('filter.access'); + // Check if the value is an array + $_access = $this->getState('filter.access'); + if (SermondistributorHelper::checkArray($_access)) + { + $id .= ':' . implode(':', $_access); + } + // Check if this is only an number or string + elseif (is_numeric($_access) + || SermondistributorHelper::checkString($_access)) + { + $id .= ':' . $_access; + } $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); diff --git a/admin/sermondistributor.php b/admin/sermondistributor.php index 5c24b748..22b2afbc 100644 --- a/admin/sermondistributor.php +++ b/admin/sermondistributor.php @@ -24,6 +24,7 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); + JHtml::_('behavior.tabstate'); // Access check. diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index 625796df..3af65e27 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -262,13 +262,3 @@ CREATE TABLE IF NOT EXISTS `#__sermondistributor_help_document` ( ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; - --- --- Always insure this column rules is large enough for all the access control values. --- -ALTER TABLE `#__assets` CHANGE `rules` `rules` MEDIUMTEXT NOT NULL COMMENT 'JSON encoded access control.'; - --- --- Always insure this column name is large enough for long component and view names. --- -ALTER TABLE `#__assets` CHANGE `name` `name` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'The unique name for the asset.'; diff --git a/admin/sql/uninstall.mysql.utf8.sql b/admin/sql/uninstall.mysql.utf8.sql index 825f072d..f6d3e657 100644 --- a/admin/sql/uninstall.mysql.utf8.sql +++ b/admin/sql/uninstall.mysql.utf8.sql @@ -6,13 +6,3 @@ DROP TABLE IF EXISTS `#__sermondistributor_external_source`; DROP TABLE IF EXISTS `#__sermondistributor_local_listing`; DROP TABLE IF EXISTS `#__sermondistributor_help_document`; - --- --- Always insure this column rules is reversed to Joomla defaults on uninstall. (as on 1st Dec 2020) --- -ALTER TABLE `#__assets` CHANGE `rules` `rules` varchar(5120) NOT NULL COMMENT 'JSON encoded access control.'; - --- --- Always insure this column name is reversed to Joomla defaults on uninstall. (as on 1st Dec 2020). --- -ALTER TABLE `#__assets` CHANGE `name` `name` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'The unique name for the asset.'; diff --git a/admin/views/external_sources/tmpl/default.php b/admin/views/external_sources/tmpl/default.php index 2b001b6a..df555478 100644 --- a/admin/views/external_sources/tmpl/default.php +++ b/admin/views/external_sources/tmpl/default.php @@ -23,7 +23,7 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); JHtml::_('behavior.tooltip'); JHtml::_('behavior.multiselect'); @@ -45,6 +45,8 @@ if ($this->saveOrder)
$this)); ?> diff --git a/admin/views/external_sources/tmpl/default_batch_body.php b/admin/views/external_sources/tmpl/default_batch_body.php index f83eb6f0..0e0d1a07 100644 --- a/admin/views/external_sources/tmpl/default_batch_body.php +++ b/admin/views/external_sources/tmpl/default_batch_body.php @@ -23,7 +23,7 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/external_sources/tmpl/default_batch_footer.php b/admin/views/external_sources/tmpl/default_batch_footer.php index e8744a86..bd5e3bbc 100644 --- a/admin/views/external_sources/tmpl/default_batch_footer.php +++ b/admin/views/external_sources/tmpl/default_batch_footer.php @@ -23,7 +23,7 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/external_sources/tmpl/default_body.php b/admin/views/external_sources/tmpl/default_body.php index 4ce39390..4cbe42ba 100644 --- a/admin/views/external_sources/tmpl/default_body.php +++ b/admin/views/external_sources/tmpl/default_body.php @@ -23,7 +23,7 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); $edit = "index.php?option=com_sermondistributor&view=external_sources&task=external_source.edit"; diff --git a/admin/views/help_document/tmpl/edit.php b/admin/views/help_document/tmpl/edit.php index 2b02c355..9bcc9ac6 100644 --- a/admin/views/help_document/tmpl/edit.php +++ b/admin/views/help_document/tmpl/edit.php @@ -95,25 +95,6 @@ $componentParams = $this->params; // will be removed just use $this->params inst - canDo->get('core.admin')) : ?> - -
-
-
-
- form->getFieldset('accesscontrol') as $field): ?> -
- label; echo $field->input;?> -
-
- -
-
-
-
- - -
diff --git a/admin/views/help_documents/tmpl/default.php b/admin/views/help_documents/tmpl/default.php index a0f103c2..027a6f0e 100644 --- a/admin/views/help_documents/tmpl/default.php +++ b/admin/views/help_documents/tmpl/default.php @@ -23,7 +23,7 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); JHtml::_('behavior.tooltip'); JHtml::_('behavior.multiselect'); @@ -46,6 +46,8 @@ if ($this->saveOrder)
$this)); ?> diff --git a/admin/views/help_documents/tmpl/default_batch_body.php b/admin/views/help_documents/tmpl/default_batch_body.php index 55f93607..4f67db32 100644 --- a/admin/views/help_documents/tmpl/default_batch_body.php +++ b/admin/views/help_documents/tmpl/default_batch_body.php @@ -23,7 +23,7 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/help_documents/tmpl/default_batch_footer.php b/admin/views/help_documents/tmpl/default_batch_footer.php index bf9be34c..26326a52 100644 --- a/admin/views/help_documents/tmpl/default_batch_footer.php +++ b/admin/views/help_documents/tmpl/default_batch_footer.php @@ -23,7 +23,7 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/help_documents/tmpl/default_body.php b/admin/views/help_documents/tmpl/default_body.php index 3cef34b6..d090d1c9 100644 --- a/admin/views/help_documents/tmpl/default_body.php +++ b/admin/views/help_documents/tmpl/default_body.php @@ -23,7 +23,7 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); $edit = "index.php?option=com_sermondistributor&view=help_documents&task=help_document.edit"; diff --git a/admin/views/local_listings/tmpl/default.php b/admin/views/local_listings/tmpl/default.php index 0b025f64..3e64dffb 100644 --- a/admin/views/local_listings/tmpl/default.php +++ b/admin/views/local_listings/tmpl/default.php @@ -23,7 +23,7 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); JHtml::_('behavior.tooltip'); JHtml::_('behavior.multiselect'); @@ -45,6 +45,8 @@ if ($this->saveOrder)
$this)); ?> diff --git a/admin/views/local_listings/tmpl/default_batch_body.php b/admin/views/local_listings/tmpl/default_batch_body.php index 32493151..f786a2d3 100644 --- a/admin/views/local_listings/tmpl/default_batch_body.php +++ b/admin/views/local_listings/tmpl/default_batch_body.php @@ -23,7 +23,7 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/local_listings/tmpl/default_batch_footer.php b/admin/views/local_listings/tmpl/default_batch_footer.php index b5a4c9a0..e84e49d3 100644 --- a/admin/views/local_listings/tmpl/default_batch_footer.php +++ b/admin/views/local_listings/tmpl/default_batch_footer.php @@ -23,7 +23,7 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/local_listings/tmpl/default_body.php b/admin/views/local_listings/tmpl/default_body.php index 5dc06f05..317b4789 100644 --- a/admin/views/local_listings/tmpl/default_body.php +++ b/admin/views/local_listings/tmpl/default_body.php @@ -23,7 +23,7 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); $edit = "index.php?option=com_sermondistributor&view=local_listings&task=local_listing.edit"; diff --git a/admin/views/preachers/tmpl/default.php b/admin/views/preachers/tmpl/default.php index 3b6e5df3..95bec4b2 100644 --- a/admin/views/preachers/tmpl/default.php +++ b/admin/views/preachers/tmpl/default.php @@ -23,7 +23,7 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); JHtml::_('behavior.tooltip'); JHtml::_('behavior.multiselect'); @@ -46,6 +46,8 @@ if ($this->saveOrder)
$this)); ?> diff --git a/admin/views/preachers/tmpl/default_batch_body.php b/admin/views/preachers/tmpl/default_batch_body.php index c34537a2..272bfd51 100644 --- a/admin/views/preachers/tmpl/default_batch_body.php +++ b/admin/views/preachers/tmpl/default_batch_body.php @@ -23,7 +23,7 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/preachers/tmpl/default_batch_footer.php b/admin/views/preachers/tmpl/default_batch_footer.php index 05656356..6c0705dc 100644 --- a/admin/views/preachers/tmpl/default_batch_footer.php +++ b/admin/views/preachers/tmpl/default_batch_footer.php @@ -23,7 +23,7 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/preachers/tmpl/default_body.php b/admin/views/preachers/tmpl/default_body.php index b8a17f35..cec53288 100644 --- a/admin/views/preachers/tmpl/default_body.php +++ b/admin/views/preachers/tmpl/default_body.php @@ -23,7 +23,7 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); $edit = "index.php?option=com_sermondistributor&view=preachers&task=preacher.edit"; diff --git a/admin/views/series_list/tmpl/default.php b/admin/views/series_list/tmpl/default.php index e9cd22b4..5757c2fc 100644 --- a/admin/views/series_list/tmpl/default.php +++ b/admin/views/series_list/tmpl/default.php @@ -23,7 +23,7 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); JHtml::_('behavior.tooltip'); JHtml::_('behavior.multiselect'); @@ -46,6 +46,8 @@ if ($this->saveOrder)
$this)); ?> diff --git a/admin/views/series_list/tmpl/default_batch_body.php b/admin/views/series_list/tmpl/default_batch_body.php index 64814a4f..272e8456 100644 --- a/admin/views/series_list/tmpl/default_batch_body.php +++ b/admin/views/series_list/tmpl/default_batch_body.php @@ -23,7 +23,7 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/series_list/tmpl/default_batch_footer.php b/admin/views/series_list/tmpl/default_batch_footer.php index ccf5ebce..889c6ee6 100644 --- a/admin/views/series_list/tmpl/default_batch_footer.php +++ b/admin/views/series_list/tmpl/default_batch_footer.php @@ -23,7 +23,7 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/series_list/tmpl/default_body.php b/admin/views/series_list/tmpl/default_body.php index 0a9ad66b..20424867 100644 --- a/admin/views/series_list/tmpl/default_body.php +++ b/admin/views/series_list/tmpl/default_body.php @@ -23,7 +23,7 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); $edit = "index.php?option=com_sermondistributor&view=series_list&task=series.edit"; diff --git a/admin/views/sermons/tmpl/default.php b/admin/views/sermons/tmpl/default.php index d45fffee..8b746267 100644 --- a/admin/views/sermons/tmpl/default.php +++ b/admin/views/sermons/tmpl/default.php @@ -23,7 +23,7 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); JHtml::_('behavior.tooltip'); JHtml::_('behavior.multiselect'); @@ -49,6 +49,8 @@ if ($this->saveOrder)
$this)); ?> diff --git a/admin/views/sermons/tmpl/default_batch_body.php b/admin/views/sermons/tmpl/default_batch_body.php index 4963c29a..9f990631 100644 --- a/admin/views/sermons/tmpl/default_batch_body.php +++ b/admin/views/sermons/tmpl/default_batch_body.php @@ -23,7 +23,7 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/sermons/tmpl/default_batch_footer.php b/admin/views/sermons/tmpl/default_batch_footer.php index 5d4c0bab..ed1ea16f 100644 --- a/admin/views/sermons/tmpl/default_batch_footer.php +++ b/admin/views/sermons/tmpl/default_batch_footer.php @@ -23,7 +23,7 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/sermons/tmpl/default_body.php b/admin/views/sermons/tmpl/default_body.php index cc1094ee..58466eb1 100644 --- a/admin/views/sermons/tmpl/default_body.php +++ b/admin/views/sermons/tmpl/default_body.php @@ -23,7 +23,7 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); $edit = "index.php?option=com_sermondistributor&view=sermons&task=sermon.edit"; diff --git a/admin/views/statistics/tmpl/default.php b/admin/views/statistics/tmpl/default.php index d10004da..1d9fb7c8 100644 --- a/admin/views/statistics/tmpl/default.php +++ b/admin/views/statistics/tmpl/default.php @@ -23,7 +23,7 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); JHtml::_('behavior.tooltip'); JHtml::_('behavior.multiselect'); @@ -46,6 +46,8 @@ if ($this->saveOrder)
$this)); ?> diff --git a/admin/views/statistics/tmpl/default_batch_body.php b/admin/views/statistics/tmpl/default_batch_body.php index ecd403de..ba4dfb12 100644 --- a/admin/views/statistics/tmpl/default_batch_body.php +++ b/admin/views/statistics/tmpl/default_batch_body.php @@ -23,7 +23,7 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/statistics/tmpl/default_batch_footer.php b/admin/views/statistics/tmpl/default_batch_footer.php index 4b20b8a8..27b0d36f 100644 --- a/admin/views/statistics/tmpl/default_batch_footer.php +++ b/admin/views/statistics/tmpl/default_batch_footer.php @@ -23,7 +23,7 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/statistics/tmpl/default_body.php b/admin/views/statistics/tmpl/default_body.php index 7d365174..9dcde32d 100644 --- a/admin/views/statistics/tmpl/default_body.php +++ b/admin/views/statistics/tmpl/default_body.php @@ -23,7 +23,7 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); $edit = "index.php?option=com_sermondistributor&view=statistics&task=statistic.edit"; diff --git a/script.php b/script.php index 9c7eda28..e5ded53f 100644 --- a/script.php +++ b/script.php @@ -88,7 +88,7 @@ class com_sermondistributorInstallerScript $preacher_done = $db->execute(); if ($preacher_done) { - // If succesfully remove Preacher add queued success message. + // If successfully remove Preacher add queued success message. $app->enqueueMessage(JText::_('The (com_sermondistributor.preacher) type alias was removed from the #__content_type table')); } @@ -103,7 +103,7 @@ class com_sermondistributorInstallerScript $preacher_done = $db->execute(); if ($preacher_done) { - // If succesfully remove Preacher add queued success message. + // If successfully remove Preacher add queued success message. $app->enqueueMessage(JText::_('The (com_sermondistributor.preacher) type alias was removed from the #__contentitem_tag_map table')); } @@ -118,7 +118,7 @@ class com_sermondistributorInstallerScript $preacher_done = $db->execute(); if ($preacher_done) { - // If succesfully remove Preacher add queued success message. + // If successfully removed Preacher add queued success message. $app->enqueueMessage(JText::_('The (com_sermondistributor.preacher) type alias was removed from the #__ucm_content table')); } @@ -174,7 +174,7 @@ class com_sermondistributorInstallerScript $sermon_done = $db->execute(); if ($sermon_done) { - // If succesfully remove Sermon add queued success message. + // If successfully remove Sermon add queued success message. $app->enqueueMessage(JText::_('The (com_sermondistributor.sermon) type alias was removed from the #__content_type table')); } @@ -189,7 +189,7 @@ class com_sermondistributorInstallerScript $sermon_done = $db->execute(); if ($sermon_done) { - // If succesfully remove Sermon add queued success message. + // If successfully remove Sermon add queued success message. $app->enqueueMessage(JText::_('The (com_sermondistributor.sermon) type alias was removed from the #__contentitem_tag_map table')); } @@ -204,7 +204,7 @@ class com_sermondistributorInstallerScript $sermon_done = $db->execute(); if ($sermon_done) { - // If succesfully remove Sermon add queued success message. + // If successfully removed Sermon add queued success message. $app->enqueueMessage(JText::_('The (com_sermondistributor.sermon) type alias was removed from the #__ucm_content table')); } @@ -260,7 +260,7 @@ class com_sermondistributorInstallerScript $sermon_catid_done = $db->execute(); if ($sermon_catid_done) { - // If succesfully remove Sermon catid add queued success message. + // If successfully remove Sermon catid add queued success message. $app->enqueueMessage(JText::_('The (com_sermondistributor.sermon.category) type alias was removed from the #__content_type table')); } @@ -275,7 +275,7 @@ class com_sermondistributorInstallerScript $sermon_catid_done = $db->execute(); if ($sermon_catid_done) { - // If succesfully remove Sermon catid add queued success message. + // If successfully remove Sermon catid add queued success message. $app->enqueueMessage(JText::_('The (com_sermondistributor.sermon.category) type alias was removed from the #__contentitem_tag_map table')); } @@ -290,7 +290,7 @@ class com_sermondistributorInstallerScript $sermon_catid_done = $db->execute(); if ($sermon_catid_done) { - // If succesfully remove Sermon catid add queued success message. + // If successfully removed Sermon catid add queued success message. $app->enqueueMessage(JText::_('The (com_sermondistributor.sermon.category) type alias was removed from the #__ucm_content table')); } @@ -346,7 +346,7 @@ class com_sermondistributorInstallerScript $series_done = $db->execute(); if ($series_done) { - // If succesfully remove Series add queued success message. + // If successfully remove Series add queued success message. $app->enqueueMessage(JText::_('The (com_sermondistributor.series) type alias was removed from the #__content_type table')); } @@ -361,7 +361,7 @@ class com_sermondistributorInstallerScript $series_done = $db->execute(); if ($series_done) { - // If succesfully remove Series add queued success message. + // If successfully remove Series add queued success message. $app->enqueueMessage(JText::_('The (com_sermondistributor.series) type alias was removed from the #__contentitem_tag_map table')); } @@ -376,7 +376,7 @@ class com_sermondistributorInstallerScript $series_done = $db->execute(); if ($series_done) { - // If succesfully remove Series add queued success message. + // If successfully removed Series add queued success message. $app->enqueueMessage(JText::_('The (com_sermondistributor.series) type alias was removed from the #__ucm_content table')); } @@ -432,7 +432,7 @@ class com_sermondistributorInstallerScript $statistic_done = $db->execute(); if ($statistic_done) { - // If succesfully remove Statistic add queued success message. + // If successfully remove Statistic add queued success message. $app->enqueueMessage(JText::_('The (com_sermondistributor.statistic) type alias was removed from the #__content_type table')); } @@ -447,7 +447,7 @@ class com_sermondistributorInstallerScript $statistic_done = $db->execute(); if ($statistic_done) { - // If succesfully remove Statistic add queued success message. + // If successfully remove Statistic add queued success message. $app->enqueueMessage(JText::_('The (com_sermondistributor.statistic) type alias was removed from the #__contentitem_tag_map table')); } @@ -462,7 +462,7 @@ class com_sermondistributorInstallerScript $statistic_done = $db->execute(); if ($statistic_done) { - // If succesfully remove Statistic add queued success message. + // If successfully removed Statistic add queued success message. $app->enqueueMessage(JText::_('The (com_sermondistributor.statistic) type alias was removed from the #__ucm_content table')); } @@ -518,7 +518,7 @@ class com_sermondistributorInstallerScript $external_source_done = $db->execute(); if ($external_source_done) { - // If succesfully remove External_source add queued success message. + // If successfully remove External_source add queued success message. $app->enqueueMessage(JText::_('The (com_sermondistributor.external_source) type alias was removed from the #__content_type table')); } @@ -533,7 +533,7 @@ class com_sermondistributorInstallerScript $external_source_done = $db->execute(); if ($external_source_done) { - // If succesfully remove External_source add queued success message. + // If successfully remove External_source add queued success message. $app->enqueueMessage(JText::_('The (com_sermondistributor.external_source) type alias was removed from the #__contentitem_tag_map table')); } @@ -548,7 +548,7 @@ class com_sermondistributorInstallerScript $external_source_done = $db->execute(); if ($external_source_done) { - // If succesfully remove External_source add queued success message. + // If successfully removed External_source add queued success message. $app->enqueueMessage(JText::_('The (com_sermondistributor.external_source) type alias was removed from the #__ucm_content table')); } @@ -604,7 +604,7 @@ class com_sermondistributorInstallerScript $local_listing_done = $db->execute(); if ($local_listing_done) { - // If succesfully remove Local_listing add queued success message. + // If successfully remove Local_listing add queued success message. $app->enqueueMessage(JText::_('The (com_sermondistributor.local_listing) type alias was removed from the #__content_type table')); } @@ -619,7 +619,7 @@ class com_sermondistributorInstallerScript $local_listing_done = $db->execute(); if ($local_listing_done) { - // If succesfully remove Local_listing add queued success message. + // If successfully remove Local_listing add queued success message. $app->enqueueMessage(JText::_('The (com_sermondistributor.local_listing) type alias was removed from the #__contentitem_tag_map table')); } @@ -634,7 +634,7 @@ class com_sermondistributorInstallerScript $local_listing_done = $db->execute(); if ($local_listing_done) { - // If succesfully remove Local_listing add queued success message. + // If successfully removed Local_listing add queued success message. $app->enqueueMessage(JText::_('The (com_sermondistributor.local_listing) type alias was removed from the #__ucm_content table')); } @@ -690,7 +690,7 @@ class com_sermondistributorInstallerScript $help_document_done = $db->execute(); if ($help_document_done) { - // If succesfully remove Help_document add queued success message. + // If successfully remove Help_document add queued success message. $app->enqueueMessage(JText::_('The (com_sermondistributor.help_document) type alias was removed from the #__content_type table')); } @@ -705,7 +705,7 @@ class com_sermondistributorInstallerScript $help_document_done = $db->execute(); if ($help_document_done) { - // If succesfully remove Help_document add queued success message. + // If successfully remove Help_document add queued success message. $app->enqueueMessage(JText::_('The (com_sermondistributor.help_document) type alias was removed from the #__contentitem_tag_map table')); } @@ -720,7 +720,7 @@ class com_sermondistributorInstallerScript $help_document_done = $db->execute(); if ($help_document_done) { - // If succesfully remove Help_document add queued success message. + // If successfully removed Help_document add queued success message. $app->enqueueMessage(JText::_('The (com_sermondistributor.help_document) type alias was removed from the #__ucm_content table')); } @@ -764,10 +764,31 @@ class com_sermondistributorInstallerScript $help_document_done = $db->execute(); if ($help_document_done) { - // If succesfully remove sermondistributor add queued success message. + // If successfully removed sermondistributor add queued success message. $app->enqueueMessage(JText::_('All related items was removed from the #__assets table')); } + // Get the biggest rule column in the assets table at this point. + $get_rule_length = "SELECT CHAR_LENGTH(`rules`) as rule_size FROM #__assets ORDER BY rule_size DESC LIMIT 1"; + $db->setQuery($get_rule_length); + if ($db->execute()) + { + $rule_length = $db->loadResult(); + // Check the size of the rules column + if ($rule_length < 5120) + { + // Revert the assets table rules column back to the default + $revert_rule = "ALTER TABLE `#__assets` CHANGE `rules` `rules` varchar(5120) NOT NULL COMMENT 'JSON encoded access control.';"; + $db->setQuery($revert_rule); + $db->execute(); + $app->enqueueMessage(JText::_('Reverted the #__assets table rules column back to its default size of varchar(5120)')); + } + else + { + + $app->enqueueMessage(JText::_('Could not revert the #__assets table rules column back to its default size of varchar(5120), since there is still one or more components that still requires the column to be larger.')); + } + } // Set db if not set already. if (!isset($db)) @@ -1227,9 +1248,9 @@ class com_sermondistributorInstallerScript $sermon->type_title = 'Sermondistributor Sermon'; $sermon->type_alias = 'com_sermondistributor.sermon'; $sermon->table = '{"special": {"dbtable": "#__sermondistributor_sermon","key": "id","type": "Sermon","prefix": "sermondistributorTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $sermon->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "description","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "catid","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","preacher":"preacher","series":"series","short_description":"short_description","link_type":"link_type","source":"source","local_files":"local_files","alias":"alias","description":"description","tags":"tags","icon":"icon","build":"build","not_required":"not_required","manual_files":"manual_files","auto_sermons":"auto_sermons","url":"url","scripture":"scripture"}}'; + $sermon->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "description","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "catid","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","preacher":"preacher","series":"series","short_description":"short_description","link_type":"link_type","source":"source","local_files":"local_files","alias":"alias","description":"description","tags":"tags","icon":"icon","build":"build","manual_files":"manual_files","auto_sermons":"auto_sermons","url":"url","scripture":"scripture"}}'; $sermon->router = 'SermondistributorHelperRoute::getSermonRoute'; - $sermon->content_history_options = '{"formFile": "administrator/components/com_sermondistributor/models/forms/sermon.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required","auto_sermons"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","preacher","series","catid","link_type","source","build"],"displayLookup": [{"sourceColumn": "catid","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "preacher","targetTable": "#__sermondistributor_preacher","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "series","targetTable": "#__sermondistributor_series","targetColumn": "id","displayColumn": "name"}]}'; + $sermon->content_history_options = '{"formFile": "administrator/components/com_sermondistributor/models/forms/sermon.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","auto_sermons"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","preacher","series","catid","link_type","source","build"],"displayLookup": [{"sourceColumn": "catid","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "preacher","targetTable": "#__sermondistributor_preacher","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "series","targetTable": "#__sermondistributor_series","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $sermon_Inserted = $db->insertObject('#__content_types', $sermon); @@ -1299,9 +1320,9 @@ class com_sermondistributorInstallerScript $help_document->type_title = 'Sermondistributor Help_document'; $help_document->type_alias = 'com_sermondistributor.help_document'; $help_document->table = '{"special": {"dbtable": "#__sermondistributor_help_document","key": "id","type": "Help_document","prefix": "sermondistributorTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $help_document->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "title","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "content","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"title":"title","type":"type","groups":"groups","location":"location","admin_view":"admin_view","site_view":"site_view","not_required":"not_required","alias":"alias","content":"content","article":"article","url":"url","target":"target"}}'; + $help_document->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "title","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "content","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"title":"title","type":"type","groups":"groups","location":"location","admin_view":"admin_view","site_view":"site_view","alias":"alias","content":"content","article":"article","url":"url","target":"target"}}'; $help_document->router = 'SermondistributorHelperRoute::getHelp_documentRoute'; - $help_document->content_history_options = '{"formFile": "administrator/components/com_sermondistributor/models/forms/help_document.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","type","location","article","target"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "article","targetTable": "#__content","targetColumn": "id","displayColumn": "title"}]}'; + $help_document->content_history_options = '{"formFile": "administrator/components/com_sermondistributor/models/forms/help_document.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","type","location","article","target"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "article","targetTable": "#__content","targetColumn": "id","displayColumn": "title"}]}'; // Set the object into the content types table. $help_document_Inserted = $db->insertObject('#__content_types', $help_document); @@ -1335,6 +1356,22 @@ class com_sermondistributorInstallerScript $db->setQuery($query); $allDone = $db->execute(); + // Get the biggest rule column in the assets table at this point. + $get_rule_length = "SELECT CHAR_LENGTH(`rules`) as rule_size FROM #__assets ORDER BY rule_size DESC LIMIT 1"; + $db->setQuery($get_rule_length); + if ($db->execute()) + { + $rule_length = $db->loadResult(); + // Check the size of the rules column + if ($rule_length <= 22240) + { + // Fix the assets table rules column size + $fix_rules_size = "ALTER TABLE `#__assets` CHANGE `rules` `rules` TEXT NOT NULL COMMENT 'JSON encoded access control. Enlarged to TEXT by JCB';"; + $db->setQuery($fix_rules_size); + $db->execute(); + $app->enqueueMessage(JText::_('The #__assets table rules column was resized to the TEXT datatype for the components possible large permission rules.')); + } + } echo ' '; @@ -1511,9 +1548,9 @@ class com_sermondistributorInstallerScript $sermon->type_title = 'Sermondistributor Sermon'; $sermon->type_alias = 'com_sermondistributor.sermon'; $sermon->table = '{"special": {"dbtable": "#__sermondistributor_sermon","key": "id","type": "Sermon","prefix": "sermondistributorTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $sermon->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "description","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "catid","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","preacher":"preacher","series":"series","short_description":"short_description","link_type":"link_type","source":"source","local_files":"local_files","alias":"alias","description":"description","tags":"tags","icon":"icon","build":"build","not_required":"not_required","manual_files":"manual_files","auto_sermons":"auto_sermons","url":"url","scripture":"scripture"}}'; + $sermon->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "description","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "catid","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","preacher":"preacher","series":"series","short_description":"short_description","link_type":"link_type","source":"source","local_files":"local_files","alias":"alias","description":"description","tags":"tags","icon":"icon","build":"build","manual_files":"manual_files","auto_sermons":"auto_sermons","url":"url","scripture":"scripture"}}'; $sermon->router = 'SermondistributorHelperRoute::getSermonRoute'; - $sermon->content_history_options = '{"formFile": "administrator/components/com_sermondistributor/models/forms/sermon.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required","auto_sermons"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","preacher","series","catid","link_type","source","build"],"displayLookup": [{"sourceColumn": "catid","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "preacher","targetTable": "#__sermondistributor_preacher","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "series","targetTable": "#__sermondistributor_series","targetColumn": "id","displayColumn": "name"}]}'; + $sermon->content_history_options = '{"formFile": "administrator/components/com_sermondistributor/models/forms/sermon.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","auto_sermons"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","preacher","series","catid","link_type","source","build"],"displayLookup": [{"sourceColumn": "catid","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "preacher","targetTable": "#__sermondistributor_preacher","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "series","targetTable": "#__sermondistributor_series","targetColumn": "id","displayColumn": "name"}]}'; // Check if sermon type is already in content_type DB. $sermon_id = null; @@ -1685,9 +1722,9 @@ class com_sermondistributorInstallerScript $help_document->type_title = 'Sermondistributor Help_document'; $help_document->type_alias = 'com_sermondistributor.help_document'; $help_document->table = '{"special": {"dbtable": "#__sermondistributor_help_document","key": "id","type": "Help_document","prefix": "sermondistributorTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $help_document->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "title","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "content","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"title":"title","type":"type","groups":"groups","location":"location","admin_view":"admin_view","site_view":"site_view","not_required":"not_required","alias":"alias","content":"content","article":"article","url":"url","target":"target"}}'; + $help_document->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "title","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "content","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"title":"title","type":"type","groups":"groups","location":"location","admin_view":"admin_view","site_view":"site_view","alias":"alias","content":"content","article":"article","url":"url","target":"target"}}'; $help_document->router = 'SermondistributorHelperRoute::getHelp_documentRoute'; - $help_document->content_history_options = '{"formFile": "administrator/components/com_sermondistributor/models/forms/help_document.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","type","location","article","target"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "article","targetTable": "#__content","targetColumn": "id","displayColumn": "title"}]}'; + $help_document->content_history_options = '{"formFile": "administrator/components/com_sermondistributor/models/forms/help_document.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","type","location","article","target"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "article","targetTable": "#__content","targetColumn": "id","displayColumn": "title"}]}'; // Check if help_document type is already in content_type DB. $help_document_id = null; diff --git a/sermondistributor.xml b/sermondistributor.xml index 3557733f..58343bab 100644 --- a/sermondistributor.xml +++ b/sermondistributor.xml @@ -1,7 +1,7 @@ COM_SERMONDISTRIBUTOR - 4th December, 2020 + 31st December, 2020 Llewellyn van der Merwe joomla@vdm.io https://www.vdm.io/ diff --git a/site/helpers/sermondistributor.php b/site/helpers/sermondistributor.php index 06db063b..20b38f12 100644 --- a/site/helpers/sermondistributor.php +++ b/site/helpers/sermondistributor.php @@ -25,9 +25,9 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -use Joomla\CMS\Language\Language; -use Joomla\Registry\Registry; -use Joomla\String\StringHelper; +use Joomla\CMS\Language\Language; +use Joomla\Registry\Registry; +use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; /** diff --git a/site/sermondistributor.php b/site/sermondistributor.php index c40bf64a..32aa4e95 100644 --- a/site/sermondistributor.php +++ b/site/sermondistributor.php @@ -24,6 +24,7 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); + JHtml::_('behavior.tabstate'); // Set the component css/js @@ -32,7 +33,7 @@ $document->addStyleSheet('components/com_sermondistributor/assets/css/site.css') $document->addScript('components/com_sermondistributor/assets/js/site.js'); // Require helper files -JLoader::register('SermondistributorHelper', __DIR__ . '/helpers/sermondistributor.php'); +JLoader::register('SermondistributorHelper', __DIR__ . '/helpers/sermondistributor.php'); JLoader::register('SermondistributorHelperRoute', __DIR__ . '/helpers/route.php'); // Get an instance of the controller prefixed by Sermondistributor