diff --git a/CHANGELOG.md b/CHANGELOG.md
index 93439eb3..6258b86b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,11 @@
-# v2.1.1
+# v5.0.0-beta1
-- Moved over to a Joomla Package
\ No newline at end of file
+- First release of [[[Component]]] towards Joomla 5
+
+# v3.0.3
+
+- Removed the not_required field from the sermon model. #36
+
+# v3.0.2
+
+- Add the HTML class to the site default layout.
\ No newline at end of file
diff --git a/README.md b/README.md
index d5b2c31e..37fc3d72 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,8 @@
-# Sermon Distributor (2.1.x)
+# Sermon Distributor (5.0.x)
![Sermon Distributor image](https://git.vdm.dev/christian/Joomla-Sermon-Distributor/raw/branch/master/admin/assets/images/vdm-component.jpg "The Sermon Distributor")
-Distributor is a highly advanced sermon distributor that runs on the [Joomla 3.x](http://www.joomla.org) framework. You can link a shared folder from Dropbox to the component and use Dropbox as your file host, not to mention the advanced auto builder that gives you the ability to simply load sermons to your website by only adding them to Dropbox.
+Distributor is a highly advanced sermon distributor that runs on the [Joomla 4.x & 5.x](http://www.joomla.org) framework. You can link a shared folder from Dropbox to the component and use Dropbox as your file host, not to mention the advanced auto builder that gives you the ability to simply load sermons to your website by only adding them to Dropbox.
The best way to see all your options is to install this component on you Joomla website and test all features yourself. Here is a [direct download link](https://git.vdm.dev/christian/Joomla-Sermon-Distributor/archive/master.zip)
@@ -24,38 +24,38 @@ 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*: 29th May, 2023
-+ *Version*: 2.1.x
++ *Last Build*: 2nd March, 2024
++ *Version*: 5.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:
-**210 Hours** or **26 Eight Hour Days** (actual time the author saved -
+**245 Hours** or **31 Eight Hour Days** (actual time the author saved -
due to [Automated Component Builder](https://www.joomlacomponentbuilder.com))
> (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*: **75271**
-+ *File count*: **486**
-+ *Folder count*: **105**
++ *Line count*: **87679**
++ *File count*: **575**
++ *Folder count*: **120**
-**138 Hours** or **18 Eight Hour Days** (the actual time the author spent)
+**161 Hours** or **20 Eight Hour Days** (the actual time the author spent)
> (with the following break down:
-> **debugging @52hours** = codingtime / 4;
-> **planning @30hours** = codingtime / 7;
-> **mapping @21hours** = codingtime / 10;
-> **office @35hours** = codingtime / 6;)
+> **debugging @61hours** = codingtime / 4;
+> **planning @35hours** = codingtime / 7;
+> **mapping @24hours** = codingtime / 10;
+> **office @41hours** = codingtime / 6;)
-**348 Hours** or **44 Eight Hour Days**
+**406 Hours** or **51 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**,
> with the normal everyday realities at the office, that includes the component planning, mapping & debugging.)
-Project duration: **8.8 weeks** or **1.8 months**
+Project duration: **10.2 weeks** or **2.1 months**
> This **component** was build with a Joomla [Automated Component Builder](https://www.joomlacomponentbuilder.com).
-> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
\ No newline at end of file
+> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)
\ No newline at end of file
diff --git a/SermondistributorInstallerScript.php b/SermondistributorInstallerScript.php
new file mode 100644
index 00000000..ffee91d0
--- /dev/null
+++ b/SermondistributorInstallerScript.php
@@ -0,0 +1,1731 @@
+
+ @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.
+
+/----------------------------------------------------------------------------------------------------------------------------------*/
+
+use Joomla\CMS\Factory;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\Filesystem\File;
+use Joomla\CMS\Installer\InstallerAdapter;
+use Joomla\CMS\Installer\InstallerScriptInterface;
+use Joomla\CMS\Application\CMSApplication;
+use Joomla\CMS\Log\Log;
+use Joomla\CMS\Version;
+use Joomla\CMS\HTML\HTMLHelper as Html;
+use Joomla\Filesystem\Folder;
+use Joomla\Database\DatabaseInterface;
+
+// No direct access to this file
+defined('_JEXEC') or die;
+
+/**
+ * Script File of Sermondistributor Component
+ *
+ * @since 3.6
+ */
+class Com_SermondistributorInstallerScript implements InstallerScriptInterface
+{
+ /**
+ * The CMS Application.
+ *
+ * @var CMSApplication
+ * @since 4.4.2
+ */
+ protected CMSApplication $app;
+
+ /**
+ * The database class.
+ *
+ * @since 4.4.2
+ */
+ protected $db;
+
+ /**
+ * The version number of the extension.
+ *
+ * @var string
+ * @since 3.6
+ */
+ protected $release;
+
+ /**
+ * The table the parameters are stored in.
+ *
+ * @var string
+ * @since 3.6
+ */
+ protected $paramTable;
+
+ /**
+ * The extension name. This should be set in the installer script.
+ *
+ * @var string
+ * @since 3.6
+ */
+ protected $extension;
+
+ /**
+ * A list of files to be deleted
+ *
+ * @var array
+ * @since 3.6
+ */
+ protected $deleteFiles = [];
+
+ /**
+ * A list of folders to be deleted
+ *
+ * @var array
+ * @since 3.6
+ */
+ protected $deleteFolders = [];
+
+ /**
+ * A list of CLI script files to be copied to the cli directory
+ *
+ * @var array
+ * @since 3.6
+ */
+ protected $cliScriptFiles = [];
+
+ /**
+ * Minimum PHP version required to install the extension
+ *
+ * @var string
+ * @since 3.6
+ */
+ protected $minimumPhp;
+
+ /**
+ * Minimum Joomla! version required to install the extension
+ *
+ * @var string
+ * @since 3.6
+ */
+ protected $minimumJoomla;
+
+ /**
+ * Extension script constructor.
+ *
+ * @since 3.0.0
+ */
+ public function __construct()
+ {
+ $this->minimumJoomla = '4.3';
+ $this->minimumPhp = JOOMLA_MINIMUM_PHP;
+ $this->app ??= Factory::getApplication();
+ $this->db = Factory::getContainer()->get(DatabaseInterface::class);
+
+ // check if the files exist
+ if (is_file(JPATH_ROOT . '/administrator/components/com_sermondistributor/sermondistributor.php'))
+ {
+ // remove Joomla 3 files
+ $this->deleteFiles = [
+ '/administrator/components/com_sermondistributor/sermondistributor.php',
+ '/administrator/components/com_sermondistributor/controller.php',
+ '/components/com_sermondistributor/sermondistributor.php',
+ '/components/com_sermondistributor/controller.php',
+ '/components/com_sermondistributor/router.php',
+ ];
+ }
+
+ // check if the Folders exist
+ if (is_dir(JPATH_ROOT . '/administrator/components/com_sermondistributor/modules'))
+ {
+ // remove Joomla 3 folder
+ $this->deleteFolders = [
+ '/administrator/components/com_sermondistributor/controllers',
+ '/administrator/components/com_sermondistributor/helpers',
+ '/administrator/components/com_sermondistributor/modules',
+ '/administrator/components/com_sermondistributor/tables',
+ '/administrator/components/com_sermondistributor/views',
+ '/components/com_sermondistributor/controllers',
+ '/components/com_sermondistributor/helpers',
+ '/components/com_sermondistributor/modules',
+ '/components/com_sermondistributor/views',
+ ];
+ }
+ }
+
+ /**
+ * Function called after the extension is installed.
+ *
+ * @param InstallerAdapter $adapter The adapter calling this method
+ *
+ * @return boolean True on success
+ *
+ * @since 4.2.0
+ */
+ public function install(InstallerAdapter $adapter): bool {return true;}
+
+ /**
+ * Function called after the extension is updated.
+ *
+ * @param InstallerAdapter $adapter The adapter calling this method
+ *
+ * @return boolean True on success
+ *
+ * @since 4.2.0
+ */
+ public function update(InstallerAdapter $adapter): bool {return true;}
+
+ /**
+ * Function called after the extension is uninstalled.
+ *
+ * @param InstallerAdapter $adapter The adapter calling this method
+ *
+ * @return boolean True on success
+ *
+ * @since 4.2.0
+ */
+ public function uninstall(InstallerAdapter $adapter): bool
+ {
+ // Remove Related Component Data.
+
+ // Remove Preacher Data
+ $this->removeViewData("com_sermondistributor.preacher");
+
+ // Remove Sermon Data
+ $this->removeViewData("com_sermondistributor.sermon");
+
+ // Remove Sermon catid Data
+ $this->removeViewData("com_sermondistributor.sermon.category");
+
+ // Remove Series Data
+ $this->removeViewData("com_sermondistributor.series");
+
+ // Remove Statistic Data
+ $this->removeViewData("com_sermondistributor.statistic");
+
+ // Remove External source Data
+ $this->removeViewData("com_sermondistributor.external_source");
+
+ // Remove Local listing Data
+ $this->removeViewData("com_sermondistributor.local_listing");
+
+ // Remove Help document Data
+ $this->removeViewData("com_sermondistributor.help_document");
+
+ // Remove Asset Data.
+ $this->removeAssetData();
+
+ // Revert the assets table rules column back to the default.
+ $this->removeDatabaseAssetsRulesFix();
+
+ // Remove component from action logs extensions table.
+ $this->removeActionLogsExtensions();
+
+ // Remove Preacher from action logs config table.
+ $this->removeActionLogConfig('com_sermondistributor.preacher');
+
+ // Remove Sermon from action logs config table.
+ $this->removeActionLogConfig('com_sermondistributor.sermon');
+
+ // Remove Series from action logs config table.
+ $this->removeActionLogConfig('com_sermondistributor.series');
+
+ // Remove Statistic from action logs config table.
+ $this->removeActionLogConfig('com_sermondistributor.statistic');
+
+ // Remove External_source from action logs config table.
+ $this->removeActionLogConfig('com_sermondistributor.external_source');
+
+ // Remove Local_listing from action logs config table.
+ $this->removeActionLogConfig('com_sermondistributor.local_listing');
+
+ // Remove Help_document from action logs config table.
+ $this->removeActionLogConfig('com_sermondistributor.help_document');
+ // little notice as after service, in case of bad experience with component.
+ echo '
+
Did something go wrong? Are you disappointed?
+
Please let me know at joomla@vdm.io .
+ We at Vast Development Method are committed to building extensions that performs proficiently! You can help us, really!
+ Send me your thoughts on improvements that is needed, trust me, I will be very grateful!
+ Visit us at https://www.vdm.io/ today!
';
+
+ return true;
+ }
+
+ /**
+ * Function called before extension installation/update/removal procedure commences.
+ *
+ * @param string $type The type of change (install or discover_install, update, uninstall)
+ * @param InstallerAdapter $adapter The adapter calling this method
+ *
+ * @return boolean True on success
+ *
+ * @since 4.2.0
+ */
+ public function preflight(string $type, InstallerAdapter $adapter): bool
+ {
+ // Check for the minimum PHP version before continuing
+ if (!empty($this->minimumPhp) && version_compare(PHP_VERSION, $this->minimumPhp, '<'))
+ {
+ Log::add(Text::sprintf('JLIB_INSTALLER_MINIMUM_PHP', $this->minimumPhp), Log::WARNING, 'jerror');
+
+ return false;
+ }
+
+ // Check for the minimum Joomla version before continuing
+ if (!empty($this->minimumJoomla) && version_compare(JVERSION, $this->minimumJoomla, '<'))
+ {
+ Log::add(Text::sprintf('JLIB_INSTALLER_MINIMUM_JOOMLA', $this->minimumJoomla), Log::WARNING, 'jerror');
+
+ return false;
+ }
+
+ // Extension manifest file version
+ $this->extension = $adapter->getName();
+ $this->release = $adapter->getManifest()->version;
+
+ // do any updates needed
+ if ($type === 'update')
+ {
+ }
+
+ // do any install needed
+ if ($type === 'install')
+ {
+ }
+
+ return true;
+ }
+
+ /**
+ * Function called after extension installation/update/removal procedure commences.
+ *
+ * @param string $type The type of change (install or discover_install, update, uninstall)
+ * @param InstallerAdapter $adapter The adapter calling this method
+ *
+ * @return boolean True on success
+ *
+ * @since 4.2.0
+ */
+ public function postflight(string $type, InstallerAdapter $adapter): bool
+ {
+ // We check if we have dynamic folders to copy
+ $this->moveFolders($adapter);
+
+ // set the default component settings
+ if ($type === 'install')
+ {
+
+ // Install Preacher Content Types.
+ $this->setContentType(
+ // typeTitle
+ 'Sermondistributor Preacher',
+ // typeAlias
+ 'com_sermondistributor.preacher',
+ // table
+ '{"special": {"dbtable": "#__sermondistributor_preacher","key": "id","type": "PreacherTable","prefix": "TrueChristianChurch\Component\Sermondistributor\Administrator\Table"}}',
+ // rules
+ '',
+ // fieldMappings
+ '{"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": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","description":"description","website":"website","email":"email","icon":"icon","alias":"alias"}}',
+ // router
+ '',
+ // contentHistoryOptions
+ '{"formFile": "administrator/components/com_sermondistributor/forms/preacher.xml","hideFields": ["asset_id","checked_out","checked_out_time"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits"],"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"}]}'
+ );
+ // Install Sermon Content Types.
+ $this->setContentType(
+ // typeTitle
+ 'Sermondistributor Sermon',
+ // typeAlias
+ 'com_sermondistributor.sermon',
+ // table
+ '{"special": {"dbtable": "#__sermondistributor_sermon","key": "id","type": "SermonTable","prefix": "TrueChristianChurch\Component\Sermondistributor\Administrator\Table"}}',
+ // rules
+ '',
+ // fieldMappings
+ '{"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"}}',
+ // router
+ '',
+ // contentHistoryOptions
+ '{"formFile": "administrator/components/com_sermondistributor/forms/sermon.xml","hideFields": ["asset_id","checked_out","checked_out_time","auto_sermons"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","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"}]}'
+ );
+ // Install Sermon category Content Types.
+ $this->setContentType(
+ // typeTitle
+ 'Sermondistributor Sermon Catid',
+ // typeAlias
+ 'com_sermondistributor.sermon.category',
+ // table
+ '{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}',
+ // rules
+ '',
+ // fieldMappings
+ '{"common":{"core_content_item_id":"id","core_title":"title","core_state":"published","core_alias":"alias","core_created_time":"created_time","core_modified_time":"modified_time","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":"language", "core_images":"null", "core_urls":"null", "core_version":"version", "core_ordering":"null", "core_metakey":"metakey", "core_metadesc":"metadesc", "core_catid":"parent_id", "core_xreference":"null", "asset_id":"asset_id"}, "special":{"parent_id":"parent_id","lft":"lft","rgt":"rgt","level":"level","path":"path","extension":"extension","note":"note"}}',
+ // router
+ '',
+ // contentHistoryOptions
+ '{"formFile":"administrator\/components\/com_categories\/forms\/category.xml", "hideFields":["asset_id","checked_out","checked_out_time","version","lft","rgt","level","path","extension"], "ignoreChanges":["modified_user_id", "modified_time", "checked_out", "checked_out_time", "version", "hits", "path"],"convertToInt":["publish_up", "publish_down"], "displayLookup":[{"sourceColumn":"created_user_id","targetTable":"#__users","targetColumn":"id","displayColumn":"name"},{"sourceColumn":"access","targetTable":"#__viewlevels","targetColumn":"id","displayColumn":"title"},{"sourceColumn":"modified_user_id","targetTable":"#__users","targetColumn":"id","displayColumn":"name"},{"sourceColumn":"parent_id","targetTable":"#__categories","targetColumn":"id","displayColumn":"title"}]}'
+ );
+ // Install Series Content Types.
+ $this->setContentType(
+ // typeTitle
+ 'Sermondistributor Series',
+ // typeAlias
+ 'com_sermondistributor.series',
+ // table
+ '{"special": {"dbtable": "#__sermondistributor_series","key": "id","type": "SeriesTable","prefix": "TrueChristianChurch\Component\Sermondistributor\Administrator\Table"}}',
+ // rules
+ '',
+ // fieldMappings
+ '{"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": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","description":"description","scripture":"scripture","icon":"icon","alias":"alias"}}',
+ // router
+ '',
+ // contentHistoryOptions
+ '{"formFile": "administrator/components/com_sermondistributor/forms/series.xml","hideFields": ["asset_id","checked_out","checked_out_time"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits"],"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"}]}'
+ );
+ // Install Statistic Content Types.
+ $this->setContentType(
+ // typeTitle
+ 'Sermondistributor Statistic',
+ // typeAlias
+ 'com_sermondistributor.statistic',
+ // table
+ '{"special": {"dbtable": "#__sermondistributor_statistic","key": "id","type": "StatisticTable","prefix": "TrueChristianChurch\Component\Sermondistributor\Administrator\Table"}}',
+ // rules
+ '',
+ // fieldMappings
+ '{"common": {"core_content_item_id": "id","core_title": "filename","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","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": {"filename":"filename","sermon":"sermon","preacher":"preacher","series":"series","counter":"counter"}}',
+ // router
+ '',
+ // contentHistoryOptions
+ '{"formFile": "administrator/components/com_sermondistributor/forms/statistic.xml","hideFields": ["asset_id","checked_out","checked_out_time"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","sermon","preacher","series","counter"],"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": "sermon","targetTable": "#__sermondistributor_sermon","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "preacher","targetTable": "#__sermondistributor_preacher","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "series","targetTable": "#__sermondistributor_series","targetColumn": "id","displayColumn": "name"}]}'
+ );
+ // Install External source Content Types.
+ $this->setContentType(
+ // typeTitle
+ 'Sermondistributor External_source',
+ // typeAlias
+ 'com_sermondistributor.external_source',
+ // table
+ '{"special": {"dbtable": "#__sermondistributor_external_source","key": "id","type": "External_sourceTable","prefix": "TrueChristianChurch\Component\Sermondistributor\Administrator\Table"}}',
+ // rules
+ '',
+ // fieldMappings
+ '{"common": {"core_content_item_id": "id","core_title": "description","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "null","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"description":"description","externalsources":"externalsources","update_method":"update_method","filetypes":"filetypes","build":"build","not_required":"not_required","update_timer":"update_timer","dropboxoptions":"dropboxoptions","permissiontype":"permissiontype","oauthtoken":"oauthtoken"}}',
+ // router
+ '',
+ // contentHistoryOptions
+ '{"formFile": "administrator/components/com_sermondistributor/forms/external_source.xml","hideFields": ["asset_id","checked_out","checked_out_time","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","externalsources","update_method","build","not_required","update_timer","dropboxoptions"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'
+ );
+ // Install Local listing Content Types.
+ $this->setContentType(
+ // typeTitle
+ 'Sermondistributor Local_listing',
+ // typeAlias
+ 'com_sermondistributor.local_listing',
+ // table
+ '{"special": {"dbtable": "#__sermondistributor_local_listing","key": "id","type": "Local_listingTable","prefix": "TrueChristianChurch\Component\Sermondistributor\Administrator\Table"}}',
+ // rules
+ '',
+ // fieldMappings
+ '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "null","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","build":"build","size":"size","external_source":"external_source","key":"key","url":"url"}}',
+ // router
+ '',
+ // contentHistoryOptions
+ '{"formFile": "administrator/components/com_sermondistributor/forms/local_listing.xml","hideFields": ["asset_id","checked_out","checked_out_time"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","build","size","external_source"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "external_source","targetTable": "#__sermondistributor_external_source","targetColumn": "id","displayColumn": "description"}]}'
+ );
+ // Install Help document Content Types.
+ $this->setContentType(
+ // typeTitle
+ 'Sermondistributor Help_document',
+ // typeAlias
+ 'com_sermondistributor.help_document',
+ // table
+ '{"special": {"dbtable": "#__sermondistributor_help_document","key": "id","type": "Help_documentTable","prefix": "TrueChristianChurch\Component\Sermondistributor\Administrator\Table"}}',
+ // rules
+ '',
+ // fieldMappings
+ '{"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"}}',
+ // router
+ '',
+ // contentHistoryOptions
+ '{"formFile": "administrator/components/com_sermondistributor/forms/help_document.xml","hideFields": ["asset_id","checked_out","checked_out_time"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","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"}]}'
+ );
+
+
+ // Fix the assets table rules column size.
+ $this->setDatabaseAssetsRulesFix(22240, "TEXT");
+ // Install the global extension assets permission.
+ $this->setAssetsRules(
+ '{"site.preachers.access":{"1":1},"site.preacher.access":{"1":1},"site.categories.access":{"1":1},"site.category.access":{"1":1},"site.serieslist.access":{"1":1},"site.series.access":{"1":1},"site.sermon.access":{"1":1}}'
+ );
+
+ // Install the global extension params.
+ $this->setExtensionsParams(
+ '{"autorName":"Llewellyn van der Merwe","autorEmail":"joomla@vdm.io","player":"1","add_to_button":"0","preachers_display":"2","preachers_list_style":"2","preachers_table_color":"0","preachers_icon":"1","preachers_desc":"1","preachers_sermon_count":"1","preachers_hits":"1","preachers_website":"1","preachers_email":"1","preacher_request_id":"0","preacher_display":"3","preacher_box_contrast":"1","preacher_list_style":"3","preacher_icon":"1","preacher_desc":"1","preacher_sermon_count":"1","preacher_hits":"1","preacher_email":"1","preacher_website":"1","preacher_sermons_display":"2","preacher_sermons_list_style":"2","preacher_sermons_table_color":"0","preacher_sermons_icon":"1","preacher_sermons_desc":"1","preacher_sermons_series":"1","preacher_sermons_category":"1","preacher_sermons_download_counter":"1","preacher_sermons_hits":"1","preacher_sermons_downloads":"1","preacher_sermons_open":"1","categories_display":"2","categories_list_style":"2","categories_table_color":"0","categories_icon":"1","categories_desc":"1","categories_sermon_count":"1","categories_hits":"1","category_display":"3","category_box_contrast":"1","category_list_style":"3","category_icon":"1","category_desc":"1","category_sermon_count":"1","category_hits":"1","category_sermons_display":"2","category_sermons_list_style":"1","category_sermons_table_color":"1","category_sermons_icon":"1","category_sermons_desc":"1","category_sermons_preacher":"1","category_sermons_series":"1","category_sermons_download_counter":"1","category_sermons_hits":"1","category_sermons_downloads":"1","category_sermons_open":"1","list_series_display":"2","list_series_list_style":"2","list_series_table_color":"0","list_series_icon":"1","list_series_desc":"1","list_series_sermon_count":"1","list_series_hits":"1","series_request_id":"0","series_display":"3","series_box_contrast":"1","series_list_style":"3","series_icon":"1","series_desc":"1","series_sermon_count":"1","series_hits":"1","series_sermons_display":"2","series_sermons_list_style":"1","series_sermons_table_color":"1","series_sermons_icon":"1","series_sermons_desc":"1","series_sermons_preacher":"1","series_sermons_category":"1","series_sermons_download_counter":"1","series_sermons_hits":"1","series_sermons_downloads":"1","series_sermons_open":"1","sermon_display":"1","sermon_box_contrast":"1","sermon_list_style":"1","sermon_icon":"1","sermon_desc":"1","sermon_preacher":"1","sermon_series":"1","sermon_category":"1","sermon_download_counter":"1","sermon_hits":"1","sermon_downloads":"1","max_execution_time":"500","check_in":"-1 day","save_history":"1","history_limit":"10","add_jquery_framework":"1","uikit_load":"1","uikit_min":""}'
+ );
+
+
+ echo '';
+
+ // Add component to the action logs extensions table.
+ $this->setActionLogsExtensions();
+
+ // Add Preacher to the action logs config table.
+ $this->setActionLogConfig(
+ // typeTitle
+ 'PREACHER',
+ // typeAlias
+ 'com_sermondistributor.preacher',
+ // idHolder
+ 'id',
+ // titleHolder
+ 'name',
+ // tableName
+ '#__sermondistributor_preacher',
+ // textPrefix
+ 'COM_SERMONDISTRIBUTOR'
+ );
+
+ // Add Sermon to the action logs config table.
+ $this->setActionLogConfig(
+ // typeTitle
+ 'SERMON',
+ // typeAlias
+ 'com_sermondistributor.sermon',
+ // idHolder
+ 'id',
+ // titleHolder
+ 'name',
+ // tableName
+ '#__sermondistributor_sermon',
+ // textPrefix
+ 'COM_SERMONDISTRIBUTOR'
+ );
+
+ // Add Series to the action logs config table.
+ $this->setActionLogConfig(
+ // typeTitle
+ 'SERIES',
+ // typeAlias
+ 'com_sermondistributor.series',
+ // idHolder
+ 'id',
+ // titleHolder
+ 'name',
+ // tableName
+ '#__sermondistributor_series',
+ // textPrefix
+ 'COM_SERMONDISTRIBUTOR'
+ );
+
+ // Add Statistic to the action logs config table.
+ $this->setActionLogConfig(
+ // typeTitle
+ 'STATISTIC',
+ // typeAlias
+ 'com_sermondistributor.statistic',
+ // idHolder
+ 'id',
+ // titleHolder
+ 'filename',
+ // tableName
+ '#__sermondistributor_statistic',
+ // textPrefix
+ 'COM_SERMONDISTRIBUTOR'
+ );
+
+ // Add External_source to the action logs config table.
+ $this->setActionLogConfig(
+ // typeTitle
+ 'EXTERNAL_SOURCE',
+ // typeAlias
+ 'com_sermondistributor.external_source',
+ // idHolder
+ 'id',
+ // titleHolder
+ 'description',
+ // tableName
+ '#__sermondistributor_external_source',
+ // textPrefix
+ 'COM_SERMONDISTRIBUTOR'
+ );
+
+ // Add Local_listing to the action logs config table.
+ $this->setActionLogConfig(
+ // typeTitle
+ 'LOCAL_LISTING',
+ // typeAlias
+ 'com_sermondistributor.local_listing',
+ // idHolder
+ 'id',
+ // titleHolder
+ 'name',
+ // tableName
+ '#__sermondistributor_local_listing',
+ // textPrefix
+ 'COM_SERMONDISTRIBUTOR'
+ );
+
+ // Add Help_document to the action logs config table.
+ $this->setActionLogConfig(
+ // typeTitle
+ 'HELP_DOCUMENT',
+ // typeAlias
+ 'com_sermondistributor.help_document',
+ // idHolder
+ 'id',
+ // titleHolder
+ 'title',
+ // tableName
+ '#__sermondistributor_help_document',
+ // textPrefix
+ 'COM_SERMONDISTRIBUTOR'
+ );
+ }
+
+ // do any updates needed
+ if ($type === 'update')
+ {
+
+ // Update Preacher Content Types.
+ $this->setContentType(
+ // typeTitle
+ 'Sermondistributor Preacher',
+ // typeAlias
+ 'com_sermondistributor.preacher',
+ // table
+ '{"special": {"dbtable": "#__sermondistributor_preacher","key": "id","type": "PreacherTable","prefix": "TrueChristianChurch\Component\Sermondistributor\Administrator\Table"}}',
+ // rules
+ '',
+ // fieldMappings
+ '{"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": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","description":"description","website":"website","email":"email","icon":"icon","alias":"alias"}}',
+ // router
+ '',
+ // contentHistoryOptions
+ '{"formFile": "administrator/components/com_sermondistributor/forms/preacher.xml","hideFields": ["asset_id","checked_out","checked_out_time"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits"],"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"}]}'
+ );
+ // Update Sermon Content Types.
+ $this->setContentType(
+ // typeTitle
+ 'Sermondistributor Sermon',
+ // typeAlias
+ 'com_sermondistributor.sermon',
+ // table
+ '{"special": {"dbtable": "#__sermondistributor_sermon","key": "id","type": "SermonTable","prefix": "TrueChristianChurch\Component\Sermondistributor\Administrator\Table"}}',
+ // rules
+ '',
+ // fieldMappings
+ '{"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"}}',
+ // router
+ '',
+ // contentHistoryOptions
+ '{"formFile": "administrator/components/com_sermondistributor/forms/sermon.xml","hideFields": ["asset_id","checked_out","checked_out_time","auto_sermons"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","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"}]}'
+ );
+ // Update Sermon category Content Types.
+ $this->setContentType(
+ // typeTitle
+ 'Sermondistributor Sermon Catid',
+ // typeAlias
+ 'com_sermondistributor.sermon.category',
+ // table
+ '{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}',
+ // rules
+ '',
+ // fieldMappings
+ '{"common":{"core_content_item_id":"id","core_title":"title","core_state":"published","core_alias":"alias","core_created_time":"created_time","core_modified_time":"modified_time","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":"language", "core_images":"null", "core_urls":"null", "core_version":"version", "core_ordering":"null", "core_metakey":"metakey", "core_metadesc":"metadesc", "core_catid":"parent_id", "core_xreference":"null", "asset_id":"asset_id"}, "special":{"parent_id":"parent_id","lft":"lft","rgt":"rgt","level":"level","path":"path","extension":"extension","note":"note"}}',
+ // router
+ '',
+ // contentHistoryOptions
+ '{"formFile":"administrator\/components\/com_categories\/forms\/category.xml", "hideFields":["asset_id","checked_out","checked_out_time","version","lft","rgt","level","path","extension"], "ignoreChanges":["modified_user_id", "modified_time", "checked_out", "checked_out_time", "version", "hits", "path"],"convertToInt":["publish_up", "publish_down"], "displayLookup":[{"sourceColumn":"created_user_id","targetTable":"#__users","targetColumn":"id","displayColumn":"name"},{"sourceColumn":"access","targetTable":"#__viewlevels","targetColumn":"id","displayColumn":"title"},{"sourceColumn":"modified_user_id","targetTable":"#__users","targetColumn":"id","displayColumn":"name"},{"sourceColumn":"parent_id","targetTable":"#__categories","targetColumn":"id","displayColumn":"title"}]}'
+ );
+ // Update Series Content Types.
+ $this->setContentType(
+ // typeTitle
+ 'Sermondistributor Series',
+ // typeAlias
+ 'com_sermondistributor.series',
+ // table
+ '{"special": {"dbtable": "#__sermondistributor_series","key": "id","type": "SeriesTable","prefix": "TrueChristianChurch\Component\Sermondistributor\Administrator\Table"}}',
+ // rules
+ '',
+ // fieldMappings
+ '{"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": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","description":"description","scripture":"scripture","icon":"icon","alias":"alias"}}',
+ // router
+ '',
+ // contentHistoryOptions
+ '{"formFile": "administrator/components/com_sermondistributor/forms/series.xml","hideFields": ["asset_id","checked_out","checked_out_time"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits"],"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"}]}'
+ );
+ // Update Statistic Content Types.
+ $this->setContentType(
+ // typeTitle
+ 'Sermondistributor Statistic',
+ // typeAlias
+ 'com_sermondistributor.statistic',
+ // table
+ '{"special": {"dbtable": "#__sermondistributor_statistic","key": "id","type": "StatisticTable","prefix": "TrueChristianChurch\Component\Sermondistributor\Administrator\Table"}}',
+ // rules
+ '',
+ // fieldMappings
+ '{"common": {"core_content_item_id": "id","core_title": "filename","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","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": {"filename":"filename","sermon":"sermon","preacher":"preacher","series":"series","counter":"counter"}}',
+ // router
+ '',
+ // contentHistoryOptions
+ '{"formFile": "administrator/components/com_sermondistributor/forms/statistic.xml","hideFields": ["asset_id","checked_out","checked_out_time"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","sermon","preacher","series","counter"],"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": "sermon","targetTable": "#__sermondistributor_sermon","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "preacher","targetTable": "#__sermondistributor_preacher","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "series","targetTable": "#__sermondistributor_series","targetColumn": "id","displayColumn": "name"}]}'
+ );
+ // Update External source Content Types.
+ $this->setContentType(
+ // typeTitle
+ 'Sermondistributor External_source',
+ // typeAlias
+ 'com_sermondistributor.external_source',
+ // table
+ '{"special": {"dbtable": "#__sermondistributor_external_source","key": "id","type": "External_sourceTable","prefix": "TrueChristianChurch\Component\Sermondistributor\Administrator\Table"}}',
+ // rules
+ '',
+ // fieldMappings
+ '{"common": {"core_content_item_id": "id","core_title": "description","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "null","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"description":"description","externalsources":"externalsources","update_method":"update_method","filetypes":"filetypes","build":"build","not_required":"not_required","update_timer":"update_timer","dropboxoptions":"dropboxoptions","permissiontype":"permissiontype","oauthtoken":"oauthtoken"}}',
+ // router
+ '',
+ // contentHistoryOptions
+ '{"formFile": "administrator/components/com_sermondistributor/forms/external_source.xml","hideFields": ["asset_id","checked_out","checked_out_time","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","externalsources","update_method","build","not_required","update_timer","dropboxoptions"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'
+ );
+ // Update Local listing Content Types.
+ $this->setContentType(
+ // typeTitle
+ 'Sermondistributor Local_listing',
+ // typeAlias
+ 'com_sermondistributor.local_listing',
+ // table
+ '{"special": {"dbtable": "#__sermondistributor_local_listing","key": "id","type": "Local_listingTable","prefix": "TrueChristianChurch\Component\Sermondistributor\Administrator\Table"}}',
+ // rules
+ '',
+ // fieldMappings
+ '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "null","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","build":"build","size":"size","external_source":"external_source","key":"key","url":"url"}}',
+ // router
+ '',
+ // contentHistoryOptions
+ '{"formFile": "administrator/components/com_sermondistributor/forms/local_listing.xml","hideFields": ["asset_id","checked_out","checked_out_time"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","build","size","external_source"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "external_source","targetTable": "#__sermondistributor_external_source","targetColumn": "id","displayColumn": "description"}]}'
+ );
+ // Update Help document Content Types.
+ $this->setContentType(
+ // typeTitle
+ 'Sermondistributor Help_document',
+ // typeAlias
+ 'com_sermondistributor.help_document',
+ // table
+ '{"special": {"dbtable": "#__sermondistributor_help_document","key": "id","type": "Help_documentTable","prefix": "TrueChristianChurch\Component\Sermondistributor\Administrator\Table"}}',
+ // rules
+ '',
+ // fieldMappings
+ '{"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"}}',
+ // router
+ '',
+ // contentHistoryOptions
+ '{"formFile": "administrator/components/com_sermondistributor/forms/help_document.xml","hideFields": ["asset_id","checked_out","checked_out_time"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","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"}]}'
+ );
+
+
+
+ echo '
+
+
+
Upgrade to Version 5.0.0-beta1 Was Successful! Let us know if anything is not working as expected. ';
+
+ // Add/Update component in the action logs extensions table.
+ $this->setActionLogsExtensions();
+
+ // Add/Update Preacher in the action logs config table.
+ $this->setActionLogConfig(
+ // typeTitle
+ 'PREACHER',
+ // typeAlias
+ 'com_sermondistributor.preacher',
+ // idHolder
+ 'id',
+ // titleHolder
+ 'name',
+ // tableName
+ '#__sermondistributor_preacher',
+ // textPrefix
+ 'COM_SERMONDISTRIBUTOR'
+ );
+
+ // Add/Update Sermon in the action logs config table.
+ $this->setActionLogConfig(
+ // typeTitle
+ 'SERMON',
+ // typeAlias
+ 'com_sermondistributor.sermon',
+ // idHolder
+ 'id',
+ // titleHolder
+ 'name',
+ // tableName
+ '#__sermondistributor_sermon',
+ // textPrefix
+ 'COM_SERMONDISTRIBUTOR'
+ );
+
+ // Add/Update Series in the action logs config table.
+ $this->setActionLogConfig(
+ // typeTitle
+ 'SERIES',
+ // typeAlias
+ 'com_sermondistributor.series',
+ // idHolder
+ 'id',
+ // titleHolder
+ 'name',
+ // tableName
+ '#__sermondistributor_series',
+ // textPrefix
+ 'COM_SERMONDISTRIBUTOR'
+ );
+
+ // Add/Update Statistic in the action logs config table.
+ $this->setActionLogConfig(
+ // typeTitle
+ 'STATISTIC',
+ // typeAlias
+ 'com_sermondistributor.statistic',
+ // idHolder
+ 'id',
+ // titleHolder
+ 'filename',
+ // tableName
+ '#__sermondistributor_statistic',
+ // textPrefix
+ 'COM_SERMONDISTRIBUTOR'
+ );
+
+ // Add/Update External_source in the action logs config table.
+ $this->setActionLogConfig(
+ // typeTitle
+ 'EXTERNAL_SOURCE',
+ // typeAlias
+ 'com_sermondistributor.external_source',
+ // idHolder
+ 'id',
+ // titleHolder
+ 'description',
+ // tableName
+ '#__sermondistributor_external_source',
+ // textPrefix
+ 'COM_SERMONDISTRIBUTOR'
+ );
+
+ // Add/Update Local_listing in the action logs config table.
+ $this->setActionLogConfig(
+ // typeTitle
+ 'LOCAL_LISTING',
+ // typeAlias
+ 'com_sermondistributor.local_listing',
+ // idHolder
+ 'id',
+ // titleHolder
+ 'name',
+ // tableName
+ '#__sermondistributor_local_listing',
+ // textPrefix
+ 'COM_SERMONDISTRIBUTOR'
+ );
+
+ // Add/Update Help_document in the action logs config table.
+ $this->setActionLogConfig(
+ // typeTitle
+ 'HELP_DOCUMENT',
+ // typeAlias
+ 'com_sermondistributor.help_document',
+ // idHolder
+ 'id',
+ // titleHolder
+ 'title',
+ // tableName
+ '#__sermondistributor_help_document',
+ // textPrefix
+ 'COM_SERMONDISTRIBUTOR'
+ );
+ }
+
+ // move CLI files
+ $this->moveCliFiles();
+
+ // remove old files and folders
+ $this->removeFiles();
+
+ return true;
+ }
+
+ /**
+ * Remove the files and folders in the given array from
+ *
+ * @return void
+ *
+ * @since 3.6
+ */
+ protected function removeFiles()
+ {
+ if (!empty($this->deleteFiles))
+ {
+ foreach ($this->deleteFiles as $file)
+ {
+ if (is_file(JPATH_ROOT . $file) && !File::delete(JPATH_ROOT . $file))
+ {
+ echo Text::sprintf('JLIB_INSTALLER_ERROR_FILE_FOLDER', $file) . ' ';
+ }
+ }
+ }
+
+ if (!empty($this->deleteFolders))
+ {
+ foreach ($this->deleteFolders as $folder)
+ {
+ if (is_dir(JPATH_ROOT . $folder) && !Folder::delete(JPATH_ROOT . $folder))
+ {
+ echo Text::sprintf('JLIB_INSTALLER_ERROR_FILE_FOLDER', $folder) . ' ';
+ }
+ }
+ }
+ }
+
+ /**
+ * Moves the CLI scripts into the CLI folder in the CMS
+ *
+ * @return void
+ *
+ * @since 3.6
+ */
+ protected function moveCliFiles()
+ {
+ if (!empty($this->cliScriptFiles))
+ {
+ foreach ($this->cliScriptFiles as $file)
+ {
+ $name = basename($file);
+
+ if (file_exists(JPATH_ROOT . $file) && !File::move(JPATH_ROOT . $file, JPATH_ROOT . '/cli/' . $name))
+ {
+ echo Text::sprintf('JLIB_INSTALLER_FILE_ERROR_MOVE', $name);
+ }
+ }
+ }
+ }
+
+ /**
+ * Set content type integration
+ *
+ * @param string $typeTitle
+ * @param string $typeAlias
+ * @param string $table
+ * @param string $rules
+ * @param string $fieldMappings
+ * @param string $router
+ * @param string $contentHistoryOptions
+ *
+ * @return void
+ * @since 4.4.2
+ */
+ protected function setContentType(
+ string $typeTitle,
+ string $typeAlias,
+ string $table,
+ string $rules,
+ string $fieldMappings,
+ string $router,
+ string $contentHistoryOptions): void
+ {
+ // Create the content type object.
+ $content = new stdClass();
+ $content->type_title = $typeTitle;
+ $content->type_alias = $typeAlias;
+ $content->table = $table;
+ $content->rules = $rules;
+ $content->field_mappings = $fieldMappings;
+ $content->router = $router;
+ $content->content_history_options = $contentHistoryOptions;
+
+ // Check if content type is already in content_type DB.
+ $query = $this->db->getQuery(true);
+ $query->select($this->db->quoteName(array('type_id')));
+ $query->from($this->db->quoteName('#__content_types'));
+ $query->where($this->db->quoteName('type_alias') . ' LIKE '. $this->db->quote($content->type_alias));
+
+ $this->db->setQuery($query);
+ $this->db->execute();
+
+ // Check if the type alias is already in the content types table.
+ if ($this->db->getNumRows())
+ {
+ $content->type_id = $this->db->loadResult();
+ if ($this->db->updateObject('#__content_types', $content, 'type_id'))
+ {
+ // If its successfully update.
+ $this->app->enqueueMessage(
+ Text::sprintf('The (%s) was found in the #__content_types table, and updated.', $content->type_alias)
+ );
+ }
+ }
+ elseif ($this->db->insertObject('#__content_types', $content))
+ {
+ // If its successfully added.
+ $this->app->enqueueMessage(
+ Text::sprintf('The (%s) was added to the #__content_types table.', $content->type_alias)
+ );
+ }
+ }
+
+ /**
+ * Set action log config integration
+ *
+ * @param string $typeTitle
+ * @param string $typeAlias
+ * @param string $idHolder
+ * @param string $titleHolder
+ * @param string $tableName
+ * @param string $textPrefix
+ *
+ * @return void
+ * @since 4.4.2
+ */
+ protected function setActionLogConfig(
+ string $typeTitle,
+ string $typeAlias,
+ string $idHolder,
+ string $titleHolder,
+ string $tableName,
+ string $textPrefix): void
+ {
+ // Create the content action log config object.
+ $content = new stdClass();
+ $content->type_title = $typeTitle;
+ $content->type_alias = $typeAlias;
+ $content->id_holder = $idHolder;
+ $content->title_holder = $titleHolder;
+ $content->table_name = $tableName;
+ $content->text_prefix = $textPrefix;
+
+ // Check if the action log config is already in action_log_config DB.
+ $query = $this->db->getQuery(true);
+ $query->select($this->db->quoteName(['id']));
+ $query->from($this->db->quoteName('#__action_log_config'));
+ $query->where($this->db->quoteName('type_alias') . ' LIKE '. $this->db->quote($content->type_alias));
+
+ $this->db->setQuery($query);
+ $this->db->execute();
+
+ // Check if the type alias is already in the action log config table.
+ if ($this->db->getNumRows())
+ {
+ $content->id = $this->db->loadResult();
+ if ($this->db->updateObject('#__action_log_config', $content, 'id'))
+ {
+ // If its successfully update.
+ $this->app->enqueueMessage(
+ Text::sprintf('The (%s) was found in the #__action_log_config table, and updated.', $content->type_alias)
+ );
+ }
+ }
+ elseif ($this->db->insertObject('#__action_log_config', $content))
+ {
+ // If its successfully added.
+ $this->app->enqueueMessage(
+ Text::sprintf('The (%s) was added to the #__action_log_config table.', $content->type_alias)
+ );
+ }
+ }
+
+ /**
+ * Set action logs extensions integration
+ *
+ * @return void
+ * @since 4.4.2
+ */
+ protected function setActionLogsExtensions(): void
+ {
+ // Create the extension action logs object.
+ $data = new stdClass();
+ $data->extension = 'com_sermondistributor';
+
+ // Check if sermondistributor action log extension is already in action logs extensions DB.
+ $query = $this->db->getQuery(true);
+ $query->select($this->db->quoteName(['id']));
+ $query->from($this->db->quoteName('#__action_logs_extensions'));
+ $query->where($this->db->quoteName('extension') . ' = '. $this->db->quote($data->extension));
+
+ $this->db->setQuery($query);
+ $this->db->execute();
+
+ // Set the object into the action logs extensions table if not found.
+ if ($this->db->getNumRows())
+ {
+ // If its already set don't set it again.
+ $this->app->enqueueMessage(
+ Text::_('The (com_sermondistributor) is already in the #__action_logs_extensions table.')
+ );
+ }
+ elseif ($this->db->insertObject('#__action_logs_extensions', $data))
+ {
+ // give a success message
+ $this->app->enqueueMessage(
+ Text::_('The (com_sermondistributor) was successfully added to the #__action_logs_extensions table.')
+ );
+ }
+ }
+
+ /**
+ * Set global extension assets permission of this component
+ * (on install only)
+ *
+ * @param string $rules The component rules
+ *
+ * @return void
+ * @since 4.4.2
+ */
+ protected function setAssetsRules(string $rules): void
+ {
+ // Condition.
+ $conditions = [
+ $this->db->quoteName('name') . ' = ' . $this->db->quote('com_sermondistributor')
+ ];
+
+ // Field to update.
+ $fields = [
+ $this->db->quoteName('rules') . ' = ' . $this->db->quote($rules),
+ ];
+
+ $query = $this->db->getQuery(true);
+ $query->update(
+ $this->db->quoteName('#__assets')
+ )->set($fields)->where($conditions);
+
+ $this->db->setQuery($query);
+
+ $done = $this->db->execute();
+ if ($done)
+ {
+ // give a success message
+ $this->app->enqueueMessage(
+ Text::_('The (com_sermondistributor) rules was successfully added to the #__assets table.')
+ );
+ }
+ }
+
+ /**
+ * Set global extension params of this component
+ * (on install only)
+ *
+ * @param string $params The component rules
+ *
+ * @return void
+ * @since 4.4.2
+ */
+ protected function setExtensionsParams(string $params): void
+ {
+ // Condition.
+ $conditions = [
+ $this->db->quoteName('element') . ' = ' . $this->db->quote('com_sermondistributor')
+ ];
+
+ // Field to update.
+ $fields = [
+ $this->db->quoteName('params') . ' = ' . $this->db->quote($params),
+ ];
+
+ $query = $this->db->getQuery(true);
+ $query->update(
+ $this->db->quoteName('#__extensions')
+ )->set($fields)->where($conditions);
+
+ $this->db->setQuery($query);
+
+ $done = $this->db->execute();
+ if ($done)
+ {
+ // give a success message
+ $this->app->enqueueMessage(
+ Text::_('The (com_sermondistributor) params was successfully added to the #__extensions table.')
+ );
+ }
+ }
+
+ /**
+ * Set database fix (if needed)
+ * => WHY DO WE NEED AN ASSET TABLE FIX?
+ * https://git.vdm.dev/joomla/Component-Builder/issues/616#issuecomment-12085
+ * https://www.mysqltutorial.org/mysql-varchar/
+ * https://stackoverflow.com/a/15227917/1429677
+ * https://forums.mysql.com/read.php?24,105964,105964
+ *
+ * @param int $accessWorseCase This is the max rules column size com_sermondistributor would needs.
+ * @param string $dataType This datatype we will change the rules column to if it to small.
+ *
+ * @return void
+ * @since 4.4.2
+ */
+ protected function setDatabaseAssetsRulesFix(int $accessWorseCase, string $dataType): void
+ {
+ // Get the biggest rule column in the assets table at this point.
+ $length = "SELECT CHAR_LENGTH(`rules`) as rule_size FROM #__assets ORDER BY rule_size DESC LIMIT 1";
+ $this->db->setQuery($length);
+ if ($this->db->execute())
+ {
+ $rule_length = $this->db->loadResult();
+ // Check the size of the rules column
+ if ($rule_length <= $accessWorseCase)
+ {
+ // Fix the assets table rules column size
+ $fix = "ALTER TABLE `#__assets` CHANGE `rules` `rules` {$dataType} NOT NULL COMMENT 'JSON encoded access control. Enlarged to {$dataType} by Sermondistributor';";
+ $this->db->setQuery($fix);
+
+ $done = $this->db->execute();
+ if ($done)
+ {
+ $this->app->enqueueMessage(
+ Text::sprintf('The #__assets table rules column was resized to the %s datatype for the components possible large permission rules.', $dataType)
+ );
+ }
+ }
+ }
+ }
+
+ /**
+ * Remove remnant data related to this view
+ *
+ * @param string $context The view context
+ * @param bool $fields The switch to also remove related field data
+ *
+ * @return void
+ * @since 4.4.2
+ */
+ protected function removeViewData(string $context, bool $fields = false): void
+ {
+ $this->removeContentTypes($context);
+ $this->removeViewHistory($context);
+ $this->removeUcmContent($context); // this might be obsolete...
+ $this->removeContentItemTagMap($context);
+ $this->removeActionLogConfig($context);
+
+ if ($fields)
+ {
+ $this->removeFields($context);
+ $this->removeFieldsGroups($context);
+ }
+ }
+
+ /**
+ * Remove content types related to this view
+ *
+ * @param string $context The view context
+ *
+ * @return void
+ * @since 4.4.2
+ */
+ protected function removeContentTypes(string $context): void
+ {
+ // Create a new query object.
+ $query = $this->db->getQuery(true);
+
+ // Select id from content type table
+ $query->select($this->db->quoteName('type_id'));
+ $query->from($this->db->quoteName('#__content_types'));
+
+ // Where Item alias is found
+ $query->where($this->db->quoteName('type_alias') . ' = '. $this->db->quote($context));
+ $this->db->setQuery($query);
+
+ // Execute query to see if alias is found
+ $this->db->execute();
+ $found = $this->db->getNumRows();
+
+ // Now check if there were any rows
+ if ($found)
+ {
+ // Since there are load the needed item type ids
+ $ids = $this->db->loadColumn();
+
+ // Remove Item from the content type table
+ $condition = [
+ $this->db->quoteName('type_alias') . ' = '. $this->db->quote($context)
+ ];
+
+ // Create a new query object.
+ $query = $this->db->getQuery(true);
+ $query->delete($this->db->quoteName('#__content_types'));
+ $query->where($condition);
+ $this->db->setQuery($query);
+
+ // Execute the query to remove Item items
+ $done = $this->db->execute();
+ if ($done)
+ {
+ // If successfully remove Item add queued success message.
+ $this->app->enqueueMessage(
+ Text::sprintf('The (%s) type alias was removed from the #__content_type table.', $context)
+ );
+ }
+
+ // Make sure that all the items are cleared from DB
+ $this->removeUcmBase($ids);
+ }
+ }
+
+ /**
+ * Remove fields related to this view
+ *
+ * @param string $context The view context
+ *
+ * @return void
+ * @since 4.4.2
+ */
+ protected function removeFields(string $context): void
+ {
+ // Create a new query object.
+ $query = $this->db->getQuery(true);
+
+ // Select ids from fields
+ $query->select($this->db->quoteName('id'));
+ $query->from($this->db->quoteName('#__fields'));
+
+ // Where context is found
+ $query->where(
+ $this->db->quoteName('context') . ' = '. $this->db->quote($context)
+ );
+ $this->db->setQuery($query);
+
+ // Execute query to see if context is found
+ $this->db->execute();
+ $found = $this->db->getNumRows();
+
+ // Now check if there were any rows
+ if ($found)
+ {
+ // Since there are load the needed release_check field ids
+ $ids = $this->db->loadColumn();
+
+ // Create a new query object.
+ $query = $this->db->getQuery(true);
+
+ // Remove context from the field table
+ $condition = [
+ $this->db->quoteName('context') . ' = '. $this->db->quote($context)
+ ];
+
+ $query->delete($this->db->quoteName('#__fields'));
+ $query->where($condition);
+
+ $this->db->setQuery($query);
+
+ // Execute the query to remove release_check items
+ $done = $this->db->execute();
+ if ($done)
+ {
+ // If successfully remove context add queued success message.
+ $this->app->enqueueMessage(
+ Text::sprintf('The fields with context (%s) was removed from the #__fields table.', $context)
+ );
+ }
+
+ // Make sure that all the field values are cleared from DB
+ $this->removeFieldsValues($context, $ids);
+ }
+ }
+
+ /**
+ * Remove fields values related to fields
+ *
+ * @param string $context The view context
+ * @param array $ids The view context
+ *
+ * @return void
+ * @since 4.4.2
+ */
+ protected function removeFieldsValues(string $context, array $ids): void
+ {
+ $condition = [
+ $this->db->quoteName('field_id') . ' IN ('. implode(',', $ids) .')'
+ ];
+
+ // Create a new query object.
+ $query = $this->db->getQuery(true);
+ $query->delete($this->db->quoteName('#__fields_values'));
+ $query->where($condition);
+ $this->db->setQuery($query);
+
+ // Execute the query to remove field values
+ $done = $this->db->execute();
+ if ($done)
+ {
+ // If successfully remove release_check add queued success message.
+ $this->app->enqueueMessage(
+ Text::sprintf('The fields values for (%s) was removed from the #__fields_values table.', $context)
+ );
+ }
+ }
+
+ /**
+ * Remove fields groups related to fields
+ *
+ * @param string $context The view context
+ *
+ * @return void
+ * @since 4.4.2
+ */
+ protected function removeFieldsGroups(string $context): void
+ {
+ // Create a new query object.
+ $query = $this->db->getQuery(true);
+
+ // Select ids from fields
+ $query->select($this->db->quoteName('id'));
+ $query->from($this->db->quoteName('#__fields_groups'));
+
+ // Where context is found
+ $query->where(
+ $this->db->quoteName('context') . ' = '. $this->db->quote($context)
+ );
+ $this->db->setQuery($query);
+
+ // Execute query to see if context is found
+ $this->db->execute();
+ $found = $this->db->getNumRows();
+
+ // Now check if there were any rows
+ if ($found)
+ {
+ // Create a new query object.
+ $query = $this->db->getQuery(true);
+
+ // Remove context from the field table
+ $condition = [
+ $this->db->quoteName('context') . ' = '. $this->db->quote($context)
+ ];
+
+ $query->delete($this->db->quoteName('#__fields_groups'));
+ $query->where($condition);
+
+ $this->db->setQuery($query);
+
+ // Execute the query to remove release_check items
+ $done = $this->db->execute();
+ if ($done)
+ {
+ // If successfully remove context add queued success message.
+ $this->app->enqueueMessage(
+ Text::sprintf('The fields with context (%s) was removed from the #__fields_groups table.', $context)
+ );
+ }
+ }
+ }
+
+ /**
+ * Remove history related to this view
+ *
+ * @param string $context The view context
+ *
+ * @return void
+ * @since 4.4.2
+ */
+ protected function removeViewHistory(string $context): void
+ {
+ // Remove Item items from the ucm content table
+ $condition = [
+ $this->db->quoteName('item_id') . ' LIKE ' . $this->db->quote($context . '.%')
+ ];
+
+ // Create a new query object.
+ $query = $this->db->getQuery(true);
+ $query->delete($this->db->quoteName('#__history'));
+ $query->where($condition);
+ $this->db->setQuery($query);
+
+ // Execute the query to remove Item items
+ $done = $this->db->execute();
+ if ($done)
+ {
+ // If successfully removed Items add queued success message.
+ $this->app->enqueueMessage(
+ Text::sprintf('The (%s) items were removed from the #__history table.', $context)
+ );
+ }
+ }
+
+ /**
+ * Remove ucm base values related to these IDs
+ *
+ * @param array $ids The type ids
+ *
+ * @return void
+ * @since 4.4.2
+ */
+ protected function removeUcmBase(array $ids): void
+ {
+ // Make sure that all the items are cleared from DB
+ foreach ($ids as $type_id)
+ {
+ // Remove Item items from the ucm base table
+ $condition = [
+ $this->db->quoteName('ucm_type_id') . ' = ' . $type_id
+ ];
+
+ // Create a new query object.
+ $query = $this->db->getQuery(true);
+ $query->delete($this->db->quoteName('#__ucm_base'));
+ $query->where($condition);
+ $this->db->setQuery($query);
+
+ // Execute the query to remove Item items
+ $this->db->execute();
+ }
+
+ $this->app->enqueueMessage(
+ Text::_('All related items was removed from the #__ucm_base table.')
+ );
+ }
+
+ /**
+ * Remove ucm content values related to this view
+ *
+ * @param string $context The view context
+ *
+ * @return void
+ * @since 4.4.2
+ */
+ protected function removeUcmContent(string $context): void
+ {
+ // Remove Item items from the ucm content table
+ $condition = [
+ $this->db->quoteName('core_type_alias') . ' = ' . $this->db->quote($context)
+ ];
+
+ // Create a new query object.
+ $query = $this->db->getQuery(true);
+ $query->delete($this->db->quoteName('#__ucm_content'));
+ $query->where($condition);
+ $this->db->setQuery($query);
+
+ // Execute the query to remove Item items
+ $done = $this->db->execute();
+ if ($done)
+ {
+ // If successfully removed Item add queued success message.
+ $this->app->enqueueMessage(
+ Text::sprintf('The (%s) type alias was removed from the #__ucm_content table.', $context)
+ );
+ }
+ }
+
+ /**
+ * Remove content item tag map related to this view
+ *
+ * @param string $context The view context
+ *
+ * @return void
+ * @since 4.4.2
+ */
+ protected function removeContentItemTagMap(string $context): void
+ {
+ // Create a new query object.
+ $query = $this->db->getQuery(true);
+
+ // Remove Item items from the contentitem tag map table
+ $condition = [
+ $this->db->quoteName('type_alias') . ' = '. $this->db->quote($context)
+ ];
+
+ // Create a new query object.
+ $query = $this->db->getQuery(true);
+ $query->delete($this->db->quoteName('#__contentitem_tag_map'));
+ $query->where($condition);
+ $this->db->setQuery($query);
+
+ // Execute the query to remove Item items
+ $done = $this->db->execute();
+ if ($done)
+ {
+ // If successfully remove Item add queued success message.
+ $this->app->enqueueMessage(
+ Text::sprintf('The (%s) type alias was removed from the #__contentitem_tag_map table.', $context)
+ );
+ }
+ }
+
+ /**
+ * Remove action log config related to this view
+ *
+ * @param string $context The view context
+ *
+ * @return void
+ * @since 4.4.2
+ */
+ protected function removeActionLogConfig(string $context): void
+ {
+ // Remove sermondistributor view from the action_log_config table
+ $condition = [
+ $this->db->quoteName('type_alias') . ' = '. $this->db->quote($context)
+ ];
+
+ // Create a new query object.
+ $query = $this->db->getQuery(true);
+ $query->delete($this->db->quoteName('#__action_log_config'));
+ $query->where($condition);
+ $this->db->setQuery($query);
+
+ // Execute the query to remove com_sermondistributor.view
+ $done = $this->db->execute();
+ if ($done)
+ {
+ // If successfully removed sermondistributor view add queued success message.
+ $this->app->enqueueMessage(
+ Text::sprintf('The (%s) type alias was removed from the #__action_log_config table.', $context)
+ );
+ }
+ }
+
+ /**
+ * Remove Asset Table Integrated
+ *
+ * @return void
+ * @since 4.4.2
+ */
+ protected function removeAssetData(): void
+ {
+ // Remove sermondistributor assets from the assets table
+ $condition = [
+ $this->db->quoteName('name') . ' LIKE ' . $this->db->quote('com_sermondistributor.%')
+ ];
+
+ // Create a new query object.
+ $query = $this->db->getQuery(true);
+ $query->delete($this->db->quoteName('#__assets'));
+ $query->where($condition);
+ $this->db->setQuery($query);
+ $done = $this->db->execute();
+ if ($done)
+ {
+ // If successfully removed sermondistributor add queued success message.
+ $this->app->enqueueMessage(
+ Text::_('All related (com_sermondistributor) items was removed from the #__assets table.')
+ );
+ }
+ }
+
+ /**
+ * Remove action logs extensions integrated
+ *
+ * @return void
+ * @since 4.4.2
+ */
+ protected function removeActionLogsExtensions(): void
+ {
+ // Remove sermondistributor from the action_logs_extensions table
+ $extension = [
+ $this->db->quoteName('extension') . ' = ' . $this->db->quote('com_sermondistributor')
+ ];
+
+ // Create a new query object.
+ $query = $this->db->getQuery(true);
+ $query->delete($this->db->quoteName('#__action_logs_extensions'));
+ $query->where($extension);
+ $this->db->setQuery($query);
+
+ // Execute the query to remove sermondistributor
+ $done = $this->db->execute();
+ if ($done)
+ {
+ // If successfully remove sermondistributor add queued success message.
+ $this->app->enqueueMessage(
+ Text::_('The (com_sermondistributor) extension was removed from the #__action_logs_extensions table.')
+ );
+ }
+ }
+
+ /**
+ * Remove remove database fix (if possible)
+ *
+ * @return void
+ * @since 4.4.2
+ */
+ protected function removeDatabaseAssetsRulesFix(): void
+ {
+ // Get the biggest rule column in the assets table at this point.
+ $length = "SELECT CHAR_LENGTH(`rules`) as rule_size FROM #__assets ORDER BY rule_size DESC LIMIT 1";
+ $this->db->setQuery($length);
+ if ($this->db->execute())
+ {
+ $rule_length = $this->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.';";
+ $this->db->setQuery($revert_rule);
+ $this->db->execute();
+
+ $this->app->enqueueMessage(
+ Text::_('Reverted the #__assets table rules column back to its default size of varchar(5120).')
+ );
+ }
+ else
+ {
+ $this->app->enqueueMessage(
+ Text::_('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.')
+ );
+ }
+ }
+ }
+
+ /**
+ * Method to move folders into place.
+ *
+ * @param InstallerAdapter $adapter The adapter calling this method
+ *
+ * @return void
+ * @since 4.4.2
+ */
+ protected function moveFolders(InstallerAdapter $adapter): void
+ {
+ // get the installation path
+ $installer = $adapter->getParent();
+ $installPath = $installer->getPath('source');
+ // get all the folders
+ $folders = Folder::folders($installPath);
+ // check if we have folders we may want to copy
+ $doNotCopy = ['media','admin','site']; // Joomla already deals with these
+ if (count((array) $folders) > 1)
+ {
+ foreach ($folders as $folder)
+ {
+ // Only copy if not a standard folders
+ if (!in_array($folder, $doNotCopy))
+ {
+ // set the source path
+ $src = $installPath.'/'.$folder;
+ // set the destination path
+ $dest = JPATH_ROOT.'/'.$folder;
+ // now try to copy the folder
+ if (!Folder::copy($src, $dest, '', true))
+ {
+ $this->app->enqueueMessage('Could not copy '.$folder.' folder into place, please make sure destination is writable!', 'error');
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/admin/README.txt b/admin/README.txt
index d5b2c31e..37fc3d72 100644
--- a/admin/README.txt
+++ b/admin/README.txt
@@ -1,8 +1,8 @@
-# Sermon Distributor (2.1.x)
+# Sermon Distributor (5.0.x)
![Sermon Distributor image](https://git.vdm.dev/christian/Joomla-Sermon-Distributor/raw/branch/master/admin/assets/images/vdm-component.jpg "The Sermon Distributor")
-Distributor is a highly advanced sermon distributor that runs on the [Joomla 3.x](http://www.joomla.org) framework. You can link a shared folder from Dropbox to the component and use Dropbox as your file host, not to mention the advanced auto builder that gives you the ability to simply load sermons to your website by only adding them to Dropbox.
+Distributor is a highly advanced sermon distributor that runs on the [Joomla 4.x & 5.x](http://www.joomla.org) framework. You can link a shared folder from Dropbox to the component and use Dropbox as your file host, not to mention the advanced auto builder that gives you the ability to simply load sermons to your website by only adding them to Dropbox.
The best way to see all your options is to install this component on you Joomla website and test all features yourself. Here is a [direct download link](https://git.vdm.dev/christian/Joomla-Sermon-Distributor/archive/master.zip)
@@ -24,38 +24,38 @@ 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*: 29th May, 2023
-+ *Version*: 2.1.x
++ *Last Build*: 2nd March, 2024
++ *Version*: 5.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:
-**210 Hours** or **26 Eight Hour Days** (actual time the author saved -
+**245 Hours** or **31 Eight Hour Days** (actual time the author saved -
due to [Automated Component Builder](https://www.joomlacomponentbuilder.com))
> (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*: **75271**
-+ *File count*: **486**
-+ *Folder count*: **105**
++ *Line count*: **87679**
++ *File count*: **575**
++ *Folder count*: **120**
-**138 Hours** or **18 Eight Hour Days** (the actual time the author spent)
+**161 Hours** or **20 Eight Hour Days** (the actual time the author spent)
> (with the following break down:
-> **debugging @52hours** = codingtime / 4;
-> **planning @30hours** = codingtime / 7;
-> **mapping @21hours** = codingtime / 10;
-> **office @35hours** = codingtime / 6;)
+> **debugging @61hours** = codingtime / 4;
+> **planning @35hours** = codingtime / 7;
+> **mapping @24hours** = codingtime / 10;
+> **office @41hours** = codingtime / 6;)
-**348 Hours** or **44 Eight Hour Days**
+**406 Hours** or **51 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**,
> with the normal everyday realities at the office, that includes the component planning, mapping & debugging.)
-Project duration: **8.8 weeks** or **1.8 months**
+Project duration: **10.2 weeks** or **2.1 months**
> This **component** was build with a Joomla [Automated Component Builder](https://www.joomlacomponentbuilder.com).
-> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
\ No newline at end of file
+> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)
\ No newline at end of file
diff --git a/admin/assets/css/admin.css b/admin/assets/css/admin.css
index b5842c4c..a8118ece 100644
--- a/admin/assets/css/admin.css
+++ b/admin/assets/css/admin.css
@@ -9,7 +9,7 @@
/------------------------------------------------------------------------------------------------------------------------------------/
- @version 2.1.x
+ @version 5.0.x
@created 22nd October, 2015
@package Sermon Distributor
@subpackage admin.css
diff --git a/admin/assets/css/dashboard.css b/admin/assets/css/dashboard.css
index 407f3138..6a4cd635 100644
--- a/admin/assets/css/dashboard.css
+++ b/admin/assets/css/dashboard.css
@@ -9,7 +9,7 @@
/------------------------------------------------------------------------------------------------------------------------------------/
- @version 2.1.x
+ @version 5.0.x
@created 22nd October, 2015
@package Sermon Distributor
@subpackage dashboard.css
@@ -24,153 +24,153 @@
/* CSS Document */
.dashboard-container {
- margin-left: 10px;
- margin-top: 10px;
- width: 100%;
+ margin-left: 10px;
+ margin-top: 10px;
+ width: 100%;
}
.dashboard-container [class*="span"] {
- display: block;
- float: none;
- margin-left: 0;
- width: auto;
+ display: block;
+ float: none;
+ margin-left: 0;
+ width: auto;
}
.dashboard-container:before, .dashboard-container:after {
- content: "";
- display: table;
+ content: "";
+ display: table;
}
.dashboard-container:after {
- clear: both;
+ clear: both;
}
.dashboard-container [class*="span"] {
- box-sizing: border-box;
- display: block;
- float: left;
- min-height: 145px;
- min-width: 96px;
- width: 100%;
+ box-sizing: border-box;
+ display: block;
+ float: left;
+ min-height: 145px;
+ min-width: 96px;
+ width: 100%;
}
.dashboard-container [class*="span"]:first-child {
- margin-left: 0;
+ margin-left: 0;
}
.dashboard-wraper {
- background: none repeat scroll 0 0 hsl(0, 0%, 93%);
- border-radius: 5px;
- float: left;
- margin: 1%;
- padding: 3px;
- width: 17%;
- min-height: 194px;
- min-width: 96px;
+ background: none repeat scroll 0 0 hsl(0, 0%, 93%);
+ border-radius: 5px;
+ float: left;
+ margin: 1%;
+ padding: 3px;
+ width: 17%;
+ min-height: 194px;
+ min-width: 96px;
}
.dashboard-content a {
- background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%, 96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0);
- border: 1px solid hsl(0, 0%, 85%);
- border-radius: 4px;
- box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset;
- color: hsl(0, 0%, 20%);
- display: block;
- min-height: 89px;
- padding: 10px;
- text-align: center;
- text-decoration: none;
+ background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%, 96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0);
+ border: 1px solid hsl(0, 0%, 85%);
+ border-radius: 4px;
+ box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset;
+ color: hsl(0, 0%, 20%);
+ display: block;
+ min-height: 89px;
+ padding: 10px;
+ text-align: center;
+ text-decoration: none;
}
.dashboard-content a:hover {
- background: linear-gradient(to bottom, hsl(0, 0%, 90%) 0%, hsl(0, 0%, 100%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0);
- color: hsl(200, 100%, 30%);
- text-decoration: none;
+ background: linear-gradient(to bottom, hsl(0, 0%, 90%) 0%, hsl(0, 0%, 100%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0);
+ color: hsl(200, 100%, 30%);
+ text-decoration: none;
}
.dashboard-title {
- display: block;
- padding-top: 5px;
+ display: block;
+ padding-top: 5px;
}
.dashboard-info {
- background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%, 96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0);
- border: 1px solid hsl(0, 0%, 85%);
- border-radius: 4px;
- box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset;
- color: hsl(0, 0%, 20%);
- display: block;
- font-size: 12px;
- padding: 10px;
- text-align: center;
+ background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%, 96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0);
+ border: 1px solid hsl(0, 0%, 85%);
+ border-radius: 4px;
+ box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset;
+ color: hsl(0, 0%, 20%);
+ display: block;
+ font-size: 12px;
+ padding: 10px;
+ text-align: center;
}
.dashboard-info span {
- display: block;
- text-align: center;
+ display: block;
+ text-align: center;
}
.dashboard-info img {
- margin: 0 auto;
+ margin: 0 auto;
}
.dashboard-table {
- border-top: 1px solid hsl(0, 0%, 87%);
- margin-top: 5px;
- width: 100%;
+ border-top: 1px solid hsl(0, 0%, 87%);
+ margin-top: 5px;
+ width: 100%;
}
.dashboard-info h5 {
- font-size: 11px;
- font-weight: bold;
+ font-size: 11px;
+ font-weight: bold;
}
.dashboard-block {
- background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%, 86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0);
- border: 1px solid hsl(0, 0%, 76%);
- border-radius: 3px;
- box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset;
- margin-bottom: 20px;
+ background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%, 86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0);
+ border: 1px solid hsl(0, 0%, 76%);
+ border-radius: 3px;
+ box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset;
+ margin-bottom: 20px;
}
.dashboard-block .dashboard-block-head {
- background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%, 86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0);
- border-bottom: 1px solid hsl(0, 0%, 76%);
- border-radius: 3px 3px 0 0;
- box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset, 0 0 3px hsl(0, 0%, 87%);
- height: 40px;
- position: relative;
+ background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%, 86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0);
+ border-bottom: 1px solid hsl(0, 0%, 76%);
+ border-radius: 3px 3px 0 0;
+ box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset, 0 0 3px hsl(0, 0%, 87%);
+ height: 40px;
+ position: relative;
}
.dashboard-block .dashboard-block-head h5 {
- font-size: 12px;
- margin: 0;
- padding-left: 10px;
- padding-top: 11px;
- text-transform: uppercase;
+ font-size: 12px;
+ margin: 0;
+ padding-left: 10px;
+ padding-top: 11px;
+ text-transform: uppercase;
}
.dashboard-block .dashboard-block-content {
- background: none repeat scroll 0 0 hsl(0, 0%, 93%);
- border-radius: 0 0 3px 3px;
+ background: none repeat scroll 0 0 hsl(0, 0%, 93%);
+ border-radius: 0 0 3px 3px;
}
.dashboard-block .dashboard-block-box {
- background: none repeat scroll 0 0 hsl(0, 0%, 100%);
- border-top: 1px solid hsl(0, 0%, 82%);
- box-shadow: 0 0 5px hsl(0, 0%, 87%) inset;
+ background: none repeat scroll 0 0 hsl(0, 0%, 100%);
+ border-top: 1px solid hsl(0, 0%, 82%);
+ box-shadow: 0 0 5px hsl(0, 0%, 87%) inset;
}
.dashboard-block .dashboard-block-content .dashboard-block-box {
- margin-top: 0 !important;
+ margin-top: 0 !important;
}
.dashboard-block .dashboard-block-content .dashboard-block-box .dashboard-block-table {
- margin-bottom: 0 !important;
+ margin-bottom: 0 !important;
}
.dashboard-block-table {
- background-color: hsla(0, 0%, 0%, 0);
- border-collapse: collapse;
- border-spacing: 0;
- margin-bottom: 20px;
- max-width: 100%;
- width: 100%;
+ background-color: hsla(0, 0%, 0%, 0);
+ border-collapse: collapse;
+ border-spacing: 0;
+ margin-bottom: 20px;
+ max-width: 100%;
+ width: 100%;
}
.dashboard-block-table th, .dashboard-block-table td {
- border-top: 1px solid hsl(0, 0%, 87%);
- line-height: 20px;
- padding: 5px;
- text-align: left;
- vertical-align: middle;
+ border-top: 1px solid hsl(0, 0%, 87%);
+ line-height: 20px;
+ padding: 5px;
+ text-align: left;
+ vertical-align: middle;
}
.dashboard-badge {
- background-color: hsl(0, 0%, 60%);
- border-radius: 9px;
- color: hsl(0, 0%, 100%);
- font-size: 11.844px;
- font-weight: bold;
- line-height: 14px;
- padding: 1px 9px 2px;
- text-shadow: 0 -1px 0 hsla(0, 0%, 0%, 0.25);
- vertical-align: baseline;
- white-space: nowrap;
+ background-color: hsl(0, 0%, 60%);
+ border-radius: 9px;
+ color: hsl(0, 0%, 100%);
+ font-size: 11.844px;
+ font-weight: bold;
+ line-height: 14px;
+ padding: 1px 9px 2px;
+ text-shadow: 0 -1px 0 hsla(0, 0%, 0%, 0.25);
+ vertical-align: baseline;
+ white-space: nowrap;
}
\ No newline at end of file
diff --git a/admin/assets/css/external_source.css b/admin/assets/css/external_source.css
index d5dcd5d6..9c0037ee 100644
--- a/admin/assets/css/external_source.css
+++ b/admin/assets/css/external_source.css
@@ -9,7 +9,7 @@
/------------------------------------------------------------------------------------------------------------------------------------/
- @version 2.1.x
+ @version 5.0.x
@created 22nd October, 2015
@package Sermon Distributor
@subpackage external_source.css
diff --git a/admin/assets/css/external_sources.css b/admin/assets/css/external_sources.css
index b0ebcb10..67fef4a2 100644
--- a/admin/assets/css/external_sources.css
+++ b/admin/assets/css/external_sources.css
@@ -9,7 +9,7 @@
/------------------------------------------------------------------------------------------------------------------------------------/
- @version 2.1.x
+ @version 5.0.x
@created 22nd October, 2015
@package Sermon Distributor
@subpackage external_sources.css
diff --git a/admin/assets/css/help_document.css b/admin/assets/css/help_document.css
index d466832c..94d5a0ae 100644
--- a/admin/assets/css/help_document.css
+++ b/admin/assets/css/help_document.css
@@ -9,7 +9,7 @@
/------------------------------------------------------------------------------------------------------------------------------------/
- @version 2.1.x
+ @version 5.0.x
@created 22nd October, 2015
@package Sermon Distributor
@subpackage help_document.css
diff --git a/admin/assets/css/help_documents.css b/admin/assets/css/help_documents.css
index 8f301dc7..6d21c372 100644
--- a/admin/assets/css/help_documents.css
+++ b/admin/assets/css/help_documents.css
@@ -9,7 +9,7 @@
/------------------------------------------------------------------------------------------------------------------------------------/
- @version 2.1.x
+ @version 5.0.x
@created 22nd October, 2015
@package Sermon Distributor
@subpackage help_documents.css
diff --git a/admin/assets/css/local_listing.css b/admin/assets/css/local_listing.css
index 668726f4..1972b2f7 100644
--- a/admin/assets/css/local_listing.css
+++ b/admin/assets/css/local_listing.css
@@ -9,7 +9,7 @@
/------------------------------------------------------------------------------------------------------------------------------------/
- @version 2.1.x
+ @version 5.0.x
@created 22nd October, 2015
@package Sermon Distributor
@subpackage local_listing.css
diff --git a/admin/assets/css/local_listings.css b/admin/assets/css/local_listings.css
index 34354d3d..1f96f390 100644
--- a/admin/assets/css/local_listings.css
+++ b/admin/assets/css/local_listings.css
@@ -9,7 +9,7 @@
/------------------------------------------------------------------------------------------------------------------------------------/
- @version 2.1.x
+ @version 5.0.x
@created 22nd October, 2015
@package Sermon Distributor
@subpackage local_listings.css
diff --git a/admin/assets/css/manual_updater.css b/admin/assets/css/manual_updater.css
index eea232d1..002fc6a6 100644
--- a/admin/assets/css/manual_updater.css
+++ b/admin/assets/css/manual_updater.css
@@ -9,7 +9,7 @@
/------------------------------------------------------------------------------------------------------------------------------------/
- @version 2.1.x
+ @version 5.0.x
@created 22nd October, 2015
@package Sermon Distributor
@subpackage manual_updater.css
diff --git a/admin/assets/css/preacher.css b/admin/assets/css/preacher.css
index 99d15e58..560a0836 100644
--- a/admin/assets/css/preacher.css
+++ b/admin/assets/css/preacher.css
@@ -9,7 +9,7 @@
/------------------------------------------------------------------------------------------------------------------------------------/
- @version 2.1.x
+ @version 5.0.x
@created 22nd October, 2015
@package Sermon Distributor
@subpackage preacher.css
diff --git a/admin/assets/css/preachers.css b/admin/assets/css/preachers.css
index 5f209cd8..1882e456 100644
--- a/admin/assets/css/preachers.css
+++ b/admin/assets/css/preachers.css
@@ -9,7 +9,7 @@
/------------------------------------------------------------------------------------------------------------------------------------/
- @version 2.1.x
+ @version 5.0.x
@created 22nd October, 2015
@package Sermon Distributor
@subpackage preachers.css
diff --git a/admin/assets/css/series.css b/admin/assets/css/series.css
index 7bcfec11..ef610b1a 100644
--- a/admin/assets/css/series.css
+++ b/admin/assets/css/series.css
@@ -9,7 +9,7 @@
/------------------------------------------------------------------------------------------------------------------------------------/
- @version 2.1.x
+ @version 5.0.x
@created 22nd October, 2015
@package Sermon Distributor
@subpackage series.css
diff --git a/admin/assets/css/series_list.css b/admin/assets/css/series_list.css
index 52c14012..53eb0edb 100644
--- a/admin/assets/css/series_list.css
+++ b/admin/assets/css/series_list.css
@@ -9,7 +9,7 @@
/------------------------------------------------------------------------------------------------------------------------------------/
- @version 2.1.x
+ @version 5.0.x
@created 22nd October, 2015
@package Sermon Distributor
@subpackage series_list.css
diff --git a/admin/assets/css/sermon.css b/admin/assets/css/sermon.css
index f4192d9c..157753d7 100644
--- a/admin/assets/css/sermon.css
+++ b/admin/assets/css/sermon.css
@@ -9,7 +9,7 @@
/------------------------------------------------------------------------------------------------------------------------------------/
- @version 2.1.x
+ @version 5.0.x
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermon.css
diff --git a/admin/assets/css/sermons.css b/admin/assets/css/sermons.css
index b16e2bea..b9855003 100644
--- a/admin/assets/css/sermons.css
+++ b/admin/assets/css/sermons.css
@@ -9,7 +9,7 @@
/------------------------------------------------------------------------------------------------------------------------------------/
- @version 2.1.x
+ @version 5.0.x
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermons.css
diff --git a/admin/assets/css/statistic.css b/admin/assets/css/statistic.css
index 93f896fa..ebb6be7c 100644
--- a/admin/assets/css/statistic.css
+++ b/admin/assets/css/statistic.css
@@ -9,7 +9,7 @@
/------------------------------------------------------------------------------------------------------------------------------------/
- @version 2.1.x
+ @version 5.0.x
@created 22nd October, 2015
@package Sermon Distributor
@subpackage statistic.css
diff --git a/admin/assets/css/statistics.css b/admin/assets/css/statistics.css
index 637e843b..60aca4a0 100644
--- a/admin/assets/css/statistics.css
+++ b/admin/assets/css/statistics.css
@@ -9,7 +9,7 @@
/------------------------------------------------------------------------------------------------------------------------------------/
- @version 2.1.x
+ @version 5.0.x
@created 22nd October, 2015
@package Sermon Distributor
@subpackage statistics.css
diff --git a/admin/assets/images/import.gif b/admin/assets/images/import.gif
index 4371cc61..10bcb856 100644
Binary files a/admin/assets/images/import.gif and b/admin/assets/images/import.gif differ
diff --git a/admin/assets/js/admin.js b/admin/assets/js/admin.js
index 0ac8b757..ae73268f 100644
--- a/admin/assets/js/admin.js
+++ b/admin/assets/js/admin.js
@@ -9,7 +9,7 @@
/------------------------------------------------------------------------------------------------------------------------------------/
- @version 2.1.x
+ @version 5.0.x
@created 22nd October, 2015
@package Sermon Distributor
@subpackage admin.js
diff --git a/admin/config.xml b/admin/config.xml
index bbd532ef..739f1a52 100644
--- a/admin/config.xml
+++ b/admin/config.xml
@@ -1,8 +1,8 @@
@@ -301,17 +301,17 @@
name="uikit_config"
label="COM_SERMONDISTRIBUTOR_CONFIG_UIKIT_LABEL"
description="COM_SERMONDISTRIBUTOR_CONFIG_UIKIT_DESC">
-
+ default="">
-
- COM_SERMONDISTRIBUTOR_CONFIG_UIKIT_V2 "
-
- COM_SERMONDISTRIBUTOR_CONFIG_UIKIT_V3 "
+
+ COM_SERMONDISTRIBUTOR_CONFIG_JQUERY_REMOVE "
+
+ COM_SERMONDISTRIBUTOR_CONFIG_JQUERY_LOAD "
"
COM_SERMONDISTRIBUTOR_CONFIG_FORCE_LOAD "
-
- COM_SERMONDISTRIBUTOR_CONFIG_ONLY_EXTRA "
COM_SERMONDISTRIBUTOR_CONFIG_DONT_LOAD "
@@ -341,21 +339,6 @@
COM_SERMONDISTRIBUTOR_CONFIG_YES "
-
-
-
- COM_SERMONDISTRIBUTOR_CONFIG_FLAT_LOAD "
-
- COM_SERMONDISTRIBUTOR_CONFIG_ALMOST_FLAT_LOAD "
-
- COM_SERMONDISTRIBUTOR_CONFIG_GRADIANT_LOAD "
-
- @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('_JEXEC') or die('Restricted access');
-
-use Joomla\CMS\MVC\Controller\BaseController;
-use Joomla\Utilities\ArrayHelper;
-
-/**
- * General Controller of Sermondistributor component
- */
-class SermondistributorController extends BaseController
-{
- /**
- * Constructor.
- *
- * @param array $config An optional associative array of configuration settings.
- * Recognized key values include 'name', 'default_task', 'model_path', and
- * 'view_path' (this list is not meant to be comprehensive).
- *
- * @since 3.0
- */
- public function __construct($config = array())
- {
- // set the default view
- $config['default_view'] = 'sermondistributor';
-
- parent::__construct($config);
- }
-
- /**
- * display task
- *
- * @return void
- */
- function display($cachable = false, $urlparams = false)
- {
- // set default view if not set
- $view = $this->input->getCmd('view', 'sermondistributor');
- $data = $this->getViewRelation($view);
- $layout = $this->input->get('layout', null, 'WORD');
- $id = $this->input->getInt('id');
-
- // Check for edit form.
- if(SermondistributorHelper::checkArray($data))
- {
- if ($data['edit'] && $layout == 'edit' && !$this->checkEditId('com_sermondistributor.edit.'.$data['view'], $id))
- {
- // Somehow the person just went to the form - we don't allow that.
- $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
- $this->setMessage($this->getError(), 'error');
- // check if item was opend from other then its own list view
- $ref = $this->input->getCmd('ref', 0);
- $refid = $this->input->getInt('refid', 0);
- // set redirect
- if ($refid > 0 && SermondistributorHelper::checkString($ref))
- {
- // redirect to item of ref
- $this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false));
- }
- elseif (SermondistributorHelper::checkString($ref))
- {
-
- // redirect to ref
- $this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view='.(string)$ref, false));
- }
- else
- {
- // normal redirect back to the list view
- $this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view='.$data['views'], false));
- }
-
- return false;
- }
- }
-
- return parent::display($cachable, $urlparams);
- }
-
- protected function getViewRelation($view)
- {
- // check the we have a value
- if (SermondistributorHelper::checkString($view))
- {
- // the view relationships
- $views = array(
- 'preacher' => 'preachers',
- 'sermon' => 'sermons',
- 'series' => 'series_list',
- 'statistic' => 'statistics',
- 'external_source' => 'external_sources',
- 'local_listing' => 'local_listings',
- 'help_document' => 'help_documents'
- );
- // check if this is a list view
- if (in_array($view, $views))
- {
- // this is a list view
- return array('edit' => false, 'view' => array_search($view,$views), 'views' => $view);
- }
- // check if it is an edit view
- elseif (array_key_exists($view, $views))
- {
- // this is a edit view
- return array('edit' => true, 'view' => $view, 'views' => $views[$view]);
- }
- }
- return false;
- }
-}
diff --git a/admin/models/forms/external_source.xml b/admin/forms/external_source.xml
similarity index 98%
rename from admin/models/forms/external_source.xml
rename to admin/forms/external_source.xml
index 8b4fd726..c34b1d7a 100644
--- a/admin/models/forms/external_source.xml
+++ b/admin/forms/external_source.xml
@@ -1,8 +1,11 @@