From 60e9e3b32d6a161163687144d7d2b21f28dd9902 Mon Sep 17 00:00:00 2001 From: aB0t Date: Fri, 3 May 2024 07:46:28 +0200 Subject: [PATCH] Release of v5.0.0-beta2 First release of Sermon Distributor towards Joomla 5. Add PHP check to install/update class. Add Database check and fix to install/update class. --- CHANGELOG.md | 19 +- README.md | 24 +- SermondistributorInstallerScript.php | 185 ++- admin/README.txt | 24 +- admin/forms/help_document.xml | 3 + admin/layouts/preacher/sermons_fullwidth.php | 4 +- admin/layouts/series/sermons_fullwidth.php | 4 +- admin/layouts/sermon/stastics_fullwidth.php | 4 +- admin/services/provider.php | 51 +- admin/sql/install.mysql.utf8.sql | 14 +- .../updates/mysql/{3.0.4.sql => 3.0.5.sql} | 0 .../{4.0.0-beta1.sql => 4.0.0-beta2.sql} | 0 .../Controller/External_sourcesController.php | 4 +- .../Controller/Help_documentsController.php | 4 +- .../Controller/Local_listingsController.php | 4 +- admin/src/Controller/PreachersController.php | 4 +- .../src/Controller/Series_listController.php | 4 +- admin/src/Controller/SermonsController.php | 4 +- admin/src/Controller/StatisticsController.php | 4 +- admin/src/Field/AdminviewfolderlistField.php | 2 +- admin/src/Field/ArticlesField.php | 37 +- admin/src/Field/ExternalsourceField.php | 2 +- admin/src/Field/PreachersField.php | 2 +- admin/src/Field/SeriesField.php | 2 +- admin/src/Field/SermonField.php | 2 +- admin/src/Field/SiteviewfolderlistField.php | 2 +- admin/src/Helper/PowerloaderHelper.php | 70 + admin/src/Helper/SermondistributorHelper.php | 69 +- admin/src/Model/AjaxModel.php | 16 +- admin/src/Model/External_sourceModel.php | 8 +- admin/src/Model/External_sourcesModel.php | 8 +- admin/src/Model/Help_documentModel.php | 4 +- admin/src/Model/Help_documentsModel.php | 8 +- admin/src/Model/ImportModel.php | 2 +- admin/src/Model/Local_listingModel.php | 6 +- admin/src/Model/Local_listingsModel.php | 8 +- admin/src/Model/Manual_updaterModel.php | 6 +- admin/src/Model/PreacherModel.php | 6 +- admin/src/Model/PreachersModel.php | 6 +- admin/src/Model/SeriesModel.php | 6 +- admin/src/Model/Series_listModel.php | 6 +- admin/src/Model/SermonModel.php | 6 +- admin/src/Model/SermondistributorModel.php | 69 +- admin/src/Model/SermonsModel.php | 6 +- admin/src/Model/StatisticModel.php | 4 +- admin/src/Model/StatisticsModel.php | 6 +- admin/src/View/External_source/HtmlView.php | 5 +- admin/src/View/External_sources/HtmlView.php | 6 +- admin/src/View/Help_document/HtmlView.php | 5 +- admin/src/View/Help_documents/HtmlView.php | 6 +- admin/src/View/Import/HtmlView.php | 2 +- admin/src/View/Local_listing/HtmlView.php | 5 +- admin/src/View/Local_listings/HtmlView.php | 6 +- admin/src/View/Manual_updater/HtmlView.php | 2 +- admin/src/View/Preacher/HtmlView.php | 5 +- admin/src/View/Preachers/HtmlView.php | 6 +- admin/src/View/Series/HtmlView.php | 5 +- admin/src/View/Series_list/HtmlView.php | 6 +- admin/src/View/Sermon/HtmlView.php | 5 +- admin/src/View/Sermondistributor/HtmlView.php | 18 +- admin/src/View/Sermons/HtmlView.php | 6 +- admin/src/View/Statistic/HtmlView.php | 5 +- admin/src/View/Statistics/HtmlView.php | 6 +- admin/tmpl/import/default.php | 4 +- admin/tmpl/manual_updater/default.php | 7 +- admin/tmpl/sermondistributor/default_vdm.php | 2 +- .../.htaccess | 0 .../index.html | 0 .../src/Encrypt/AES.php | 10 +- .../src/Encrypt/AES/Abstraction.php | 2 +- .../src/Encrypt/AES/AesInterface.php | 4 +- .../src/Encrypt/AES/Mcrypt.php | 10 +- .../src/Encrypt/AES/Openssl.php | 10 +- .../src/Encrypt/AES/index.html | 0 .../src/Encrypt/Randval.php | 4 +- .../src/Encrypt/Randvalinterface.php | 2 +- .../src/Encrypt/index.html | 0 .../src/Utils/Phpfunc.php | 2 +- .../src/Utils/index.html | 0 .../index.html | 0 .../src/Table.php | 1304 +++++++++++++++++ .../src/Table/Schema.php | 65 + .../src/Table}/index.html | 0 .../TrueChristianChurch.Joomla}/index.html | 0 .../src/Abstraction/BaseTable.php | 502 +++++++ .../src/Abstraction/Schema.php | 754 ++++++++++ .../src/Abstraction}/index.html | 0 .../src/Interfaces/SchemaInterface.php | 53 + .../src/Interfaces/Tableinterface.php | 91 ++ .../src/Interfaces}/index.html | 0 .../src/Utilities/ArrayHelper.php | 2 +- .../src/Utilities/Component/Helper.php | 4 +- .../src/Utilities/Component/index.html | 1 + .../src/Utilities/FileHelper.php | 4 +- .../src/Utilities/FormHelper.php | 40 +- .../src/Utilities/GetHelper.php | 4 +- .../src/Utilities/JsonHelper.php | 2 +- .../src/Utilities/MimeHelper.php | 2 +- .../src/Utilities/ObjectHelper.php | 2 +- .../src/Utilities/String/NamespaceHelper.php | 4 +- .../src/Utilities/String/index.html | 1 + .../src/Utilities/StringHelper.php | 4 +- .../src/Utilities/index.html | 1 + .../htaccess.txt | 0 libraries/vendor_sermondistributor/index.html | 1 + .../web.config | 0 sermondistributor.xml | 6 +- sermondistributor_update_server.xml | 12 +- site/layouts/jplayerbluemonday.php | 4 +- site/layouts/jplayerbluemondaylist.php | 4 +- site/layouts/mediaplayer.php | 4 +- site/src/Controller/ApiController.php | 7 +- site/src/Controller/DisplayController.php | 4 +- site/src/Field/AdminviewfolderlistField.php | 2 +- site/src/Field/ArticlesField.php | 37 +- site/src/Field/ExternalsourceField.php | 2 +- site/src/Field/PreachersField.php | 2 +- site/src/Field/SeriesField.php | 2 +- site/src/Field/SermonField.php | 2 +- site/src/Field/SiteviewfolderlistField.php | 2 +- site/src/Helper/PowerloaderHelper.php | 70 + site/src/Helper/RouteHelper.php | 2 +- site/src/Helper/SermondistributorHelper.php | 69 +- site/src/Model/AjaxModel.php | 8 +- site/src/Model/ApiModel.php | 10 +- site/src/Model/CategoriesModel.php | 6 +- site/src/Model/CategoryModel.php | 6 +- site/src/Model/PreacherModel.php | 6 +- site/src/Model/PreachersModel.php | 4 +- site/src/Model/SeriesModel.php | 6 +- site/src/Model/SerieslistModel.php | 4 +- site/src/Model/SermonModel.php | 6 +- site/src/View/Api/HtmlView.php | 2 +- site/src/View/Categories/HtmlView.php | 2 +- site/src/View/Category/HtmlView.php | 4 +- site/src/View/Preacher/HtmlView.php | 4 +- site/src/View/Preachers/HtmlView.php | 2 +- site/src/View/Series/HtmlView.php | 4 +- site/src/View/Serieslist/HtmlView.php | 2 +- site/src/View/Sermon/HtmlView.php | 2 +- site/tmpl/category/default.php | 3 +- site/tmpl/preacher/default.php | 3 +- site/tmpl/series/default.php | 2 +- site/tmpl/sermon/default.php | 8 +- 144 files changed, 3576 insertions(+), 475 deletions(-) rename admin/sql/updates/mysql/{3.0.4.sql => 3.0.5.sql} (100%) rename admin/sql/updates/mysql/{4.0.0-beta1.sql => 4.0.0-beta2.sql} (100%) create mode 100644 admin/src/Helper/PowerloaderHelper.php rename libraries/{jcb_powers => vendor_sermondistributor}/.htaccess (100%) rename libraries/{jcb_powers/VDM.Joomla.FOF => vendor_sermondistributor/TrueChristianChurch.Joomla.FOF}/index.html (100%) rename libraries/{jcb_powers/VDM.Joomla.FOF => vendor_sermondistributor/TrueChristianChurch.Joomla.FOF}/src/Encrypt/AES.php (93%) rename libraries/{jcb_powers/VDM.Joomla.FOF => vendor_sermondistributor/TrueChristianChurch.Joomla.FOF}/src/Encrypt/AES/Abstraction.php (94%) rename libraries/{jcb_powers/VDM.Joomla.FOF => vendor_sermondistributor/TrueChristianChurch.Joomla.FOF}/src/Encrypt/AES/AesInterface.php (95%) rename libraries/{jcb_powers/VDM.Joomla.FOF => vendor_sermondistributor/TrueChristianChurch.Joomla.FOF}/src/Encrypt/AES/Mcrypt.php (89%) rename libraries/{jcb_powers/VDM.Joomla.FOF => vendor_sermondistributor/TrueChristianChurch.Joomla.FOF}/src/Encrypt/AES/Openssl.php (90%) rename libraries/{jcb_powers/VDM.Joomla.FOF => vendor_sermondistributor/TrueChristianChurch.Joomla.FOF}/src/Encrypt/AES/index.html (100%) rename libraries/{jcb_powers/VDM.Joomla.FOF => vendor_sermondistributor/TrueChristianChurch.Joomla.FOF}/src/Encrypt/Randval.php (94%) rename libraries/{jcb_powers/VDM.Joomla.FOF => vendor_sermondistributor/TrueChristianChurch.Joomla.FOF}/src/Encrypt/Randvalinterface.php (93%) rename libraries/{jcb_powers/VDM.Joomla.FOF => vendor_sermondistributor/TrueChristianChurch.Joomla.FOF}/src/Encrypt/index.html (100%) rename libraries/{jcb_powers/VDM.Joomla.FOF => vendor_sermondistributor/TrueChristianChurch.Joomla.FOF}/src/Utils/Phpfunc.php (93%) rename libraries/{jcb_powers/VDM.Joomla.FOF => vendor_sermondistributor/TrueChristianChurch.Joomla.FOF}/src/Utils/index.html (100%) rename libraries/{jcb_powers/VDM.Joomla => vendor_sermondistributor/TrueChristianChurch.Joomla.SermonDistributor}/index.html (100%) create mode 100644 libraries/vendor_sermondistributor/TrueChristianChurch.Joomla.SermonDistributor/src/Table.php create mode 100644 libraries/vendor_sermondistributor/TrueChristianChurch.Joomla.SermonDistributor/src/Table/Schema.php rename libraries/{jcb_powers/VDM.Joomla/src/Utilities/Component => vendor_sermondistributor/TrueChristianChurch.Joomla.SermonDistributor/src/Table}/index.html (100%) rename libraries/{jcb_powers/VDM.Joomla/src/Utilities/String => vendor_sermondistributor/TrueChristianChurch.Joomla}/index.html (100%) create mode 100644 libraries/vendor_sermondistributor/TrueChristianChurch.Joomla/src/Abstraction/BaseTable.php create mode 100644 libraries/vendor_sermondistributor/TrueChristianChurch.Joomla/src/Abstraction/Schema.php rename libraries/{jcb_powers/VDM.Joomla/src/Utilities => vendor_sermondistributor/TrueChristianChurch.Joomla/src/Abstraction}/index.html (100%) create mode 100644 libraries/vendor_sermondistributor/TrueChristianChurch.Joomla/src/Interfaces/SchemaInterface.php create mode 100644 libraries/vendor_sermondistributor/TrueChristianChurch.Joomla/src/Interfaces/Tableinterface.php rename libraries/{jcb_powers => vendor_sermondistributor/TrueChristianChurch.Joomla/src/Interfaces}/index.html (100%) rename libraries/{jcb_powers/VDM.Joomla => vendor_sermondistributor/TrueChristianChurch.Joomla}/src/Utilities/ArrayHelper.php (93%) rename libraries/{jcb_powers/VDM.Joomla => vendor_sermondistributor/TrueChristianChurch.Joomla}/src/Utilities/Component/Helper.php (94%) create mode 100644 libraries/vendor_sermondistributor/TrueChristianChurch.Joomla/src/Utilities/Component/index.html rename libraries/{jcb_powers/VDM.Joomla => vendor_sermondistributor/TrueChristianChurch.Joomla}/src/Utilities/FileHelper.php (95%) rename libraries/{jcb_powers/VDM.Joomla => vendor_sermondistributor/TrueChristianChurch.Joomla}/src/Utilities/FormHelper.php (84%) rename libraries/{jcb_powers/VDM.Joomla => vendor_sermondistributor/TrueChristianChurch.Joomla}/src/Utilities/GetHelper.php (94%) rename libraries/{jcb_powers/VDM.Joomla => vendor_sermondistributor/TrueChristianChurch.Joomla}/src/Utilities/JsonHelper.php (93%) rename libraries/{jcb_powers/VDM.Joomla => vendor_sermondistributor/TrueChristianChurch.Joomla}/src/Utilities/MimeHelper.php (99%) rename libraries/{jcb_powers/VDM.Joomla => vendor_sermondistributor/TrueChristianChurch.Joomla}/src/Utilities/ObjectHelper.php (94%) rename libraries/{jcb_powers/VDM.Joomla => vendor_sermondistributor/TrueChristianChurch.Joomla}/src/Utilities/String/NamespaceHelper.php (91%) create mode 100644 libraries/vendor_sermondistributor/TrueChristianChurch.Joomla/src/Utilities/String/index.html rename libraries/{jcb_powers/VDM.Joomla => vendor_sermondistributor/TrueChristianChurch.Joomla}/src/Utilities/StringHelper.php (95%) create mode 100644 libraries/vendor_sermondistributor/TrueChristianChurch.Joomla/src/Utilities/index.html rename libraries/{jcb_powers => vendor_sermondistributor}/htaccess.txt (100%) create mode 100644 libraries/vendor_sermondistributor/index.html rename libraries/{jcb_powers => vendor_sermondistributor}/web.config (100%) create mode 100644 site/src/Helper/PowerloaderHelper.php diff --git a/CHANGELOG.md b/CHANGELOG.md index c7b31589..160a9557 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,16 @@ -# v5.0.0-beta1 +# v5.0.0-beta2 -- First release of Sermon Distributor towards Joomla 5 +- First release of Sermon Distributor towards Joomla 5 +- Add PHP check to install/update class +- Add Database check and fix to install/update class -# v4.0.0-beta1 +# v4.0.0-beta2 -- First release of Sermon Distributor towards Joomla 4 +- First release of Sermon Distributor towards Joomla 4 +- Add PHP check to install/update class +- Add Database check and fix to install/update class -# v3.0.4 +# v3.0.5 -- Add the getDocument method call to view -- Add recall tab memory to view tabs -- Add root class calls like \JRoute \ No newline at end of file +- Add PHP check to install/update class +- Add Database check and fix to install/update class \ No newline at end of file diff --git a/README.md b/README.md index a9dcc576..6aee8c6f 100644 --- a/README.md +++ b/README.md @@ -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*: 7th March, 2024 ++ *Last Build*: 3rd May, 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: -**245 Hours** or **31 Eight Hour Days** (actual time the author saved - +**263 Hours** or **33 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*: **87680** -+ *File count*: **574** -+ *Folder count*: **120** ++ *Line count*: **94142** ++ *File count*: **602** ++ *Folder count*: **124** -**161 Hours** or **20 Eight Hour Days** (the actual time the author spent) +**173 Hours** or **22 Eight Hour Days** (the actual time the author spent) > (with the following break down: -> **debugging @61hours** = codingtime / 4; -> **planning @35hours** = codingtime / 7; -> **mapping @24hours** = codingtime / 10; -> **office @41hours** = codingtime / 6;) +> **debugging @66hours** = codingtime / 4; +> **planning @38hours** = codingtime / 7; +> **mapping @26hours** = codingtime / 10; +> **office @44hours** = codingtime / 6;) -**406 Hours** or **51 Eight Hour Days** +**436 Hours** or **55 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: **10.2 weeks** or **2.1 months** +Project duration: **11 weeks** or **2.3 months** > This **component** was build with a Joomla [Automated Component Builder](https://www.joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io) \ No newline at end of file diff --git a/SermondistributorInstallerScript.php b/SermondistributorInstallerScript.php index ffee91d0..9d34faa3 100644 --- a/SermondistributorInstallerScript.php +++ b/SermondistributorInstallerScript.php @@ -33,6 +33,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\Filesystem\Folder; use Joomla\Database\DatabaseInterface; +use TrueChristianChurch\Joomla\SermonDistributor\Table\Schema; // No direct access to this file defined('_JEXEC') or die; @@ -300,11 +301,17 @@ public function preflight(string $type, InstallerAdapter $adapter): bool // do any updates needed if ($type === 'update') { + + // Check that the required configuration are set for PHP + $this->phpConfigurationCheck($this->app); } // do any install needed if ($type === 'install') { + + // Check that the required configuration are set for PHP + $this->phpConfigurationCheck($this->app); } return true; @@ -480,6 +487,10 @@ public function postflight(string $type, InstallerAdapter $adapter): bool ); + + // Check that the database is up-to date + $this->databaseSchemaCheck($this->app); + echo '
'; @@ -743,10 +754,14 @@ public function postflight(string $type, InstallerAdapter $adapter): bool + + // Check that the database is up-to date + $this->databaseSchemaCheck($this->app); + echo '
-

Upgrade to Version 5.0.0-beta1 Was Successful! Let us know if anything is not working as expected.

'; +

Upgrade to Version 5.0.0-beta2 Was Successful! Let us know if anything is not working as expected.

'; // Add/Update component in the action logs extensions table. $this->setActionLogsExtensions(); @@ -1691,6 +1706,174 @@ protected function removeDatabaseAssetsRulesFix(): void } } + /** + * Define the required limits with specific messages for success and warning scenarios + * + * @var array + * @since 3.0.5 + */ + protected array $requiredPHPConfigs = [ + 'upload_max_filesize' => [ + 'value' => '64M', + 'success' => 'The upload_max_filesize is appropriately set to handle large files, which is essential for uploading substantial components and media.', + 'warning' => 'The current upload_max_filesize may not support large file uploads effectively, potentially causing failures during component installation.' + ], + 'post_max_size' => [ + 'value' => '128M', + 'success' => 'The post_max_size setting is sufficient to manage large data submissions, ensuring smooth data processing within forms and uploads.', + 'warning' => 'An insufficient post_max_size can lead to truncated data submissions, affecting form functionality and data integrity.' + ], + 'max_execution_time' => [ + 'value' => 60, + 'success' => 'Max execution time is set high enough to execute complex operations without premature termination, which is crucial for lengthy operations.', + 'warning' => 'A low max execution time could lead to script timeouts, especially during intensive operations, which might interrupt execution and cause failures during the compiling of a large extension.' + ], + 'max_input_vars' => [ + 'value' => 5000, + 'success' => 'The max_input_vars setting supports a high number of input variables, facilitating complex forms and detailed component configurations.', + 'warning' => 'Too few max_input_vars may result in lost data during processing complex forms, which can lead to incomplete configurations and operational issues.' + ], + 'max_input_time' => [ + 'value' => 60, + 'success' => 'Max input time is adequate for processing inputs efficiently during high-load operations, ensuring no premature timeouts.', + 'warning' => 'An insufficient max input time could result in incomplete data processing during input-heavy operations, potentially leading to errors and data loss.' + ], + 'memory_limit' => [ + 'value' => '256M', + 'success' => 'The memory limit is set high to accommodate extensive operations and data processing, which enhances overall performance and stability.', + 'warning' => 'A low memory limit can lead to frequent crashes and performance issues, particularly when processing large amounts of data or complex calculations.' + ] + ]; + + /** + * Helper function to convert PHP INI memory values to bytes + * + * @param string $value The value to convert + * + * @return int The bytes value + * @since 3.0.5 + */ + protected function convertToBytes(string $value): int + { + $value = trim($value); + $lastChar = strtolower($value[strlen($value) - 1]); + $numValue = substr($value, 0, -1); + + switch ($lastChar) + { + case 'g': + return $numValue * 1024 * 1024 * 1024; + case 'm': + return $numValue * 1024 * 1024; + case 'k': + return $numValue * 1024; + default: + return (int) $value; + } + } + + /** + * Check that the required configurations are set for PHP + * + * @param $app The application + * + * @return void + * @since 3.0.5 + */ + protected function phpConfigurationCheck($app): void + { + $showHelp = false; + + // Check each configuration and provide detailed feedback + foreach ($this->requiredPHPConfigs as $configName => $configDetails) + { + $currentValue = ini_get($configName); + if ($currentValue === false) + { + $app->enqueueMessage("Error: Unable to retrieve current setting for '{$configName}'.", 'error'); + continue; + } + + $isMemoryValue = strpbrk($configDetails['value'], 'KMG') !== false; + $requiredValueBytes = $isMemoryValue ? $this->convertToBytes($configDetails['value']) : (int) $configDetails['value']; + $currentValueBytes = $isMemoryValue ? $this->convertToBytes($currentValue) : (int) $currentValue; + $conditionMet = $currentValueBytes >= $requiredValueBytes; + + $messageType = $conditionMet ? 'message' : 'warning'; + $messageText = $conditionMet ? + "Success: {$configName} is set to {$currentValue}. " . $configDetails['success'] : + "Warning: {$configName} configuration should be at least {$configDetails['value']} but is currently {$currentValue}. " . $configDetails['warning']; + $showHelp = ($showHelp || $messageType === 'warning') ? true : false; + $app->enqueueMessage($messageText, $messageType); + } + + if ($showHelp) + { + $app->enqueueMessage('To optimize your Sermon Distributor environment, specific PHP settings must be enhanced.
These settings are crucial for ensuring the successful installation and stable functionality of the extension.
We\'ve identified that certain configurations currently do not meet the recommended standards.
To adjust these settings and prevent potential issues, please consult our detailed guide available at Sermon Distributor PHP Settings Wiki. +', 'notice'); + } + } + + /** + * Make sure that the sermondistributor database schema is up to date. + * + * @return void + * @since 3.0.5 + */ + protected function databaseSchemaCheck($app): void + { + // try to load the schema class + try + { + // make sure the class is loaded + $this->ensureClassExists( + Schema::class + ); + + // instantiate the schema class and check/update the database + $messages = (new Schema())->update(); + } + catch (\Exception $e) + { + $app->enqueueMessage($e->getMessage(), 'warning'); + return; + } + + foreach ($messages as $message) + { + $app->enqueueMessage($message, 'message'); + } + } + + /** + * Ensures that a class in the namespace is available. + * If the class is not already loaded, it attempts to load it via the power autoloader. + * + * @param mixed $nameClass The name::class we are looking for. + * + * @return void + * @since 3.0.5 + * @throws \Exception If the class could not be loaded. + */ + protected function ensureClassExists($nameClass): void + { + if (!class_exists($nameClass, true)) + { + // The power autoloader for this project admin area. + $power_autoloader = JPATH_ADMINISTRATOR . '/components/com_sermondistributor/src/Helper/PowerloaderHelper.php'; + if (file_exists($power_autoloader)) + { + require_once $power_autoloader; + } + + // Check again if the class now exists after requiring it + if (!class_exists($nameClass, true)) + { + throw new \Exception("We failed to find/load the $nameClass"); + } + } + } + /** * Method to move folders into place. * diff --git a/admin/README.txt b/admin/README.txt index a9dcc576..6aee8c6f 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -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*: 7th March, 2024 ++ *Last Build*: 3rd May, 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: -**245 Hours** or **31 Eight Hour Days** (actual time the author saved - +**263 Hours** or **33 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*: **87680** -+ *File count*: **574** -+ *Folder count*: **120** ++ *Line count*: **94142** ++ *File count*: **602** ++ *Folder count*: **124** -**161 Hours** or **20 Eight Hour Days** (the actual time the author spent) +**173 Hours** or **22 Eight Hour Days** (the actual time the author spent) > (with the following break down: -> **debugging @61hours** = codingtime / 4; -> **planning @35hours** = codingtime / 7; -> **mapping @24hours** = codingtime / 10; -> **office @41hours** = codingtime / 6;) +> **debugging @66hours** = codingtime / 4; +> **planning @38hours** = codingtime / 7; +> **mapping @26hours** = codingtime / 10; +> **office @44hours** = codingtime / 6;) -**406 Hours** or **51 Eight Hour Days** +**436 Hours** or **55 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: **10.2 weeks** or **2.1 months** +Project duration: **11 weeks** or **2.3 months** > This **component** was build with a Joomla [Automated Component Builder](https://www.joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io) \ No newline at end of file diff --git a/admin/forms/help_document.xml b/admin/forms/help_document.xml index 3fa146f2..cc3aa65a 100644 --- a/admin/forms/help_document.xml +++ b/admin/forms/help_document.xml @@ -174,6 +174,7 @@ label="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ADMIN_VIEW_LABEL" description="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ADMIN_VIEW_DESCRIPTION" class="list_class" + layout="joomla.form.field.list-fancy-select" multiple="false" default="" required="true" @@ -186,6 +187,7 @@ label="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_SITE_VIEW_LABEL" description="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_SITE_VIEW_DESCRIPTION" class="list_class" + layout="joomla.form.field.list-fancy-select" multiple="false" required="true" button="false" @@ -221,6 +223,7 @@ name="article" label="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ARTICLE_LABEL" class="list_class" + layout="joomla.form.field.list-fancy-select" multiple="false" default="0" required="true" diff --git a/admin/layouts/preacher/sermons_fullwidth.php b/admin/layouts/preacher/sermons_fullwidth.php index 331ea9f3..feff2d37 100644 --- a/admin/layouts/preacher/sermons_fullwidth.php +++ b/admin/layouts/preacher/sermons_fullwidth.php @@ -26,8 +26,8 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\HTML\HTMLHelper as Html; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\StringHelper; -use VDM\Joomla\Utilities\ArrayHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper; // No direct access to this file defined('_JEXEC') or die; diff --git a/admin/layouts/series/sermons_fullwidth.php b/admin/layouts/series/sermons_fullwidth.php index 52d61db9..3d940b0c 100644 --- a/admin/layouts/series/sermons_fullwidth.php +++ b/admin/layouts/series/sermons_fullwidth.php @@ -26,8 +26,8 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\HTML\HTMLHelper as Html; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\StringHelper; -use VDM\Joomla\Utilities\ArrayHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper; // No direct access to this file defined('_JEXEC') or die; diff --git a/admin/layouts/sermon/stastics_fullwidth.php b/admin/layouts/sermon/stastics_fullwidth.php index 892ab210..4d76bb2e 100644 --- a/admin/layouts/sermon/stastics_fullwidth.php +++ b/admin/layouts/sermon/stastics_fullwidth.php @@ -26,8 +26,8 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\HTML\HTMLHelper as Html; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\StringHelper; -use VDM\Joomla\Utilities\ArrayHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper; // No direct access to this file defined('_JEXEC') or die; diff --git a/admin/services/provider.php b/admin/services/provider.php index eb26cdbe..d85eecea 100644 --- a/admin/services/provider.php +++ b/admin/services/provider.php @@ -22,51 +22,12 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ - - -// register additional namespace -\spl_autoload_register(function ($class) { - // project-specific base directories and namespace prefix - $search = [ - 'libraries/jcb_powers/VDM.Joomla.FOF' => 'VDM\\Joomla\\FOF', - 'libraries/jcb_powers/VDM.Joomla' => 'VDM\\Joomla' - ]; - // Start the search and load if found - $found = false; - $found_base_dir = ""; - $found_len = 0; - foreach ($search as $base_dir => $prefix) - { - // does the class use the namespace prefix? - $len = strlen($prefix); - if (strncmp($prefix, $class, $len) === 0) - { - // we have a match so load the values - $found = true; - $found_base_dir = $base_dir; - $found_len = $len; - // done here - break; - } - } - // check if we found a match - if (!$found) - { - // not found so move to the next registered autoloader - return; - } - // get the relative class name - $relative_class = substr($class, $found_len); - // replace the namespace prefix with the base directory, replace namespace - // separators with directory separators in the relative class name, append - // with .php - $file = JPATH_ROOT . '/' . $found_base_dir . '/src' . str_replace('\\', '/', $relative_class) . '.php'; - // if the file exists, require it - if (file_exists($file)) - { - require $file; - } -}); +// The power autoloader for this project (JPATH_ADMINISTRATOR) area. +$power_autoloader = JPATH_ADMINISTRATOR . '/components/com_sermondistributor/src/Helper/PowerloaderHelper.php'; +if (file_exists($power_autoloader)) +{ + require_once $power_autoloader; +} // (soon) use Joomla\CMS\Association\AssociationExtensionInterface; use Joomla\CMS\Categories\CategoryFactoryInterface; diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index f1dd79f7..90894303 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -10,7 +10,7 @@ CREATE TABLE IF NOT EXISTS `#__sermondistributor_preacher` ( `icon` CHAR(64) NOT NULL DEFAULT '', `name` VARCHAR(255) NOT NULL DEFAULT '', `website` VARCHAR(255) NOT NULL DEFAULT '', - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -55,7 +55,7 @@ CREATE TABLE IF NOT EXISTS `#__sermondistributor_sermon` ( `source` TINYINT(1) NOT NULL DEFAULT 0, `tags` CHAR(11) NOT NULL DEFAULT 0, `url` VARCHAR(255) NOT NULL DEFAULT '', - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -93,7 +93,7 @@ CREATE TABLE IF NOT EXISTS `#__sermondistributor_series` ( `icon` CHAR(64) NOT NULL DEFAULT '', `name` VARCHAR(255) NOT NULL DEFAULT '', `scripture` VARCHAR(255) NOT NULL DEFAULT '', - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -126,7 +126,7 @@ CREATE TABLE IF NOT EXISTS `#__sermondistributor_statistic` ( `preacher` INT(11) NOT NULL DEFAULT 0, `series` INT(11) NOT NULL DEFAULT 0, `sermon` INT(11) NOT NULL DEFAULT 0, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -168,7 +168,7 @@ CREATE TABLE IF NOT EXISTS `#__sermondistributor_external_source` ( `sharedurl` TEXT NOT NULL, `update_method` TINYINT NOT NULL DEFAULT 0, `update_timer` INT(1) NOT NULL DEFAULT 0, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -201,7 +201,7 @@ CREATE TABLE IF NOT EXISTS `#__sermondistributor_local_listing` ( `name` VARCHAR(255) NOT NULL DEFAULT '', `size` INT(50) NOT NULL DEFAULT 0, `url` TEXT NOT NULL, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -236,7 +236,7 @@ CREATE TABLE IF NOT EXISTS `#__sermondistributor_help_document` ( `title` CHAR(64) NOT NULL DEFAULT '', `type` TINYINT(1) NOT NULL DEFAULT 0, `url` VARCHAR(255) NOT NULL DEFAULT '', - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, diff --git a/admin/sql/updates/mysql/3.0.4.sql b/admin/sql/updates/mysql/3.0.5.sql similarity index 100% rename from admin/sql/updates/mysql/3.0.4.sql rename to admin/sql/updates/mysql/3.0.5.sql diff --git a/admin/sql/updates/mysql/4.0.0-beta1.sql b/admin/sql/updates/mysql/4.0.0-beta2.sql similarity index 100% rename from admin/sql/updates/mysql/4.0.0-beta1.sql rename to admin/sql/updates/mysql/4.0.0-beta2.sql diff --git a/admin/src/Controller/External_sourcesController.php b/admin/src/Controller/External_sourcesController.php index af2655ce..8a6b55d5 100644 --- a/admin/src/Controller/External_sourcesController.php +++ b/admin/src/Controller/External_sourcesController.php @@ -30,8 +30,8 @@ use Joomla\CMS\Router\Route; use Joomla\CMS\Session\Session; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; -use VDM\Joomla\Utilities\ObjectHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use TrueChristianChurch\Joomla\Utilities\ObjectHelper; // No direct access to this file \defined('_JEXEC') or die; diff --git a/admin/src/Controller/Help_documentsController.php b/admin/src/Controller/Help_documentsController.php index ea63d422..2759dd22 100644 --- a/admin/src/Controller/Help_documentsController.php +++ b/admin/src/Controller/Help_documentsController.php @@ -30,8 +30,8 @@ use Joomla\CMS\Router\Route; use Joomla\CMS\Session\Session; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; -use VDM\Joomla\Utilities\ObjectHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use TrueChristianChurch\Joomla\Utilities\ObjectHelper; // No direct access to this file \defined('_JEXEC') or die; diff --git a/admin/src/Controller/Local_listingsController.php b/admin/src/Controller/Local_listingsController.php index 5fc4b054..755d36cd 100644 --- a/admin/src/Controller/Local_listingsController.php +++ b/admin/src/Controller/Local_listingsController.php @@ -30,8 +30,8 @@ use Joomla\CMS\Router\Route; use Joomla\CMS\Session\Session; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; -use VDM\Joomla\Utilities\ObjectHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use TrueChristianChurch\Joomla\Utilities\ObjectHelper; // No direct access to this file \defined('_JEXEC') or die; diff --git a/admin/src/Controller/PreachersController.php b/admin/src/Controller/PreachersController.php index 6c91b382..8c1f45de 100644 --- a/admin/src/Controller/PreachersController.php +++ b/admin/src/Controller/PreachersController.php @@ -30,8 +30,8 @@ use Joomla\CMS\Router\Route; use Joomla\CMS\Session\Session; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; -use VDM\Joomla\Utilities\ObjectHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use TrueChristianChurch\Joomla\Utilities\ObjectHelper; // No direct access to this file \defined('_JEXEC') or die; diff --git a/admin/src/Controller/Series_listController.php b/admin/src/Controller/Series_listController.php index c6e200cc..8686ae93 100644 --- a/admin/src/Controller/Series_listController.php +++ b/admin/src/Controller/Series_listController.php @@ -30,8 +30,8 @@ use Joomla\CMS\Router\Route; use Joomla\CMS\Session\Session; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; -use VDM\Joomla\Utilities\ObjectHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use TrueChristianChurch\Joomla\Utilities\ObjectHelper; // No direct access to this file \defined('_JEXEC') or die; diff --git a/admin/src/Controller/SermonsController.php b/admin/src/Controller/SermonsController.php index 3bf5ecf6..31673ad0 100644 --- a/admin/src/Controller/SermonsController.php +++ b/admin/src/Controller/SermonsController.php @@ -30,8 +30,8 @@ use Joomla\CMS\Router\Route; use Joomla\CMS\Session\Session; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; -use VDM\Joomla\Utilities\ObjectHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use TrueChristianChurch\Joomla\Utilities\ObjectHelper; // No direct access to this file \defined('_JEXEC') or die; diff --git a/admin/src/Controller/StatisticsController.php b/admin/src/Controller/StatisticsController.php index 35013bbe..be4a4803 100644 --- a/admin/src/Controller/StatisticsController.php +++ b/admin/src/Controller/StatisticsController.php @@ -30,8 +30,8 @@ use Joomla\CMS\Router\Route; use Joomla\CMS\Session\Session; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; -use VDM\Joomla\Utilities\ObjectHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use TrueChristianChurch\Joomla\Utilities\ObjectHelper; // No direct access to this file \defined('_JEXEC') or die; diff --git a/admin/src/Field/AdminviewfolderlistField.php b/admin/src/Field/AdminviewfolderlistField.php index b5dfe904..a91560fe 100644 --- a/admin/src/Field/AdminviewfolderlistField.php +++ b/admin/src/Field/AdminviewfolderlistField.php @@ -29,7 +29,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Component\ComponentHelper; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; // No direct access to this file \defined('_JEXEC') or die; diff --git a/admin/src/Field/ArticlesField.php b/admin/src/Field/ArticlesField.php index dc2cd781..f08cfa7d 100644 --- a/admin/src/Field/ArticlesField.php +++ b/admin/src/Field/ArticlesField.php @@ -55,23 +55,24 @@ class ArticlesField extends ListField */ protected function getOptions() { - $db = Factory::getDBO(); - $query = $db->getQuery(true); - $query->select($db->quoteName(array('a.id','a.title','a.alias'),array('id','article_title','alias'))); - $query->from($db->quoteName('#__content', 'a')); - $query->where($db->quoteName('a.state') . ' = 1'); - $query->order('a.title ASC'); - $db->setQuery((string)$query); - $items = $db->loadObjectList(); - $options = array(); - if ($items) - { - $options[] = Html::_('select.option', '', 'Select an Article'); - foreach($items as $item) - { - $options[] = Html::_('select.option', $item->id, $item->article_title . ' (' . $item->alias . ')'); - } - } - return $options; + $db = Factory::getDBO(); +$query = $db->getQuery(true); +$query->select($db->quoteName(array('a.id','a.title','a.alias'),array('id','article_title','alias'))); +$query->from($db->quoteName('#__content', 'a')); +$query->where($db->quoteName('a.state') . ' = 1'); +$query->order('a.title ASC'); +$db->setQuery((string)$query); +$items = $db->loadObjectList(); +$options = array(); +if ($items) +{ + $options[] = Html::_('select.option', '', 'Select an Article'); + foreach($items as $item) + { + $options[] = Html::_('select.option', $item->id, $item->article_title . ' (' . $item->alias . ')'); + } +} + +return $options; } } diff --git a/admin/src/Field/ExternalsourceField.php b/admin/src/Field/ExternalsourceField.php index 71462789..0514da31 100644 --- a/admin/src/Field/ExternalsourceField.php +++ b/admin/src/Field/ExternalsourceField.php @@ -109,7 +109,7 @@ protected function getInput() if ($user->authorise('external_source.edit', 'com_sermondistributor') && $app->isClient('administrator')) // TODO for now only in admin area. { // build edit button - $button[] = ''; // build script $script[] = " diff --git a/admin/src/Field/PreachersField.php b/admin/src/Field/PreachersField.php index c01847e2..798531b1 100644 --- a/admin/src/Field/PreachersField.php +++ b/admin/src/Field/PreachersField.php @@ -109,7 +109,7 @@ protected function getInput() if ($user->authorise('preacher.edit', 'com_sermondistributor') && $app->isClient('administrator')) // TODO for now only in admin area. { // build edit button - $button[] = ''; // build script $script[] = " diff --git a/admin/src/Field/SeriesField.php b/admin/src/Field/SeriesField.php index cbea9125..2fa6b352 100644 --- a/admin/src/Field/SeriesField.php +++ b/admin/src/Field/SeriesField.php @@ -109,7 +109,7 @@ protected function getInput() if ($user->authorise('series.edit', 'com_sermondistributor') && $app->isClient('administrator')) // TODO for now only in admin area. { // build edit button - $button[] = ''; // build script $script[] = " diff --git a/admin/src/Field/SermonField.php b/admin/src/Field/SermonField.php index 391aa758..a4bdd670 100644 --- a/admin/src/Field/SermonField.php +++ b/admin/src/Field/SermonField.php @@ -109,7 +109,7 @@ protected function getInput() if ($user->authorise('sermon.edit', 'com_sermondistributor') && $app->isClient('administrator')) // TODO for now only in admin area. { // build edit button - $button[] = ''; // build script $script[] = " diff --git a/admin/src/Field/SiteviewfolderlistField.php b/admin/src/Field/SiteviewfolderlistField.php index 1bbc08ef..48429863 100644 --- a/admin/src/Field/SiteviewfolderlistField.php +++ b/admin/src/Field/SiteviewfolderlistField.php @@ -29,7 +29,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Component\ComponentHelper; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; // No direct access to this file \defined('_JEXEC') or die; diff --git a/admin/src/Helper/PowerloaderHelper.php b/admin/src/Helper/PowerloaderHelper.php new file mode 100644 index 00000000..616e9efc --- /dev/null +++ b/admin/src/Helper/PowerloaderHelper.php @@ -0,0 +1,70 @@ + + @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; + +// register additional namespace +spl_autoload_register(function ($class) { + // project-specific base directories and namespace prefix + $search = [ + 'libraries/vendor_sermondistributor/TrueChristianChurch.Joomla.FOF' => 'TrueChristianChurch\\Joomla\\FOF', + 'libraries/vendor_sermondistributor/TrueChristianChurch.Joomla' => 'TrueChristianChurch\\Joomla' + ]; + // Start the search and load if found + $found = false; + $found_base_dir = ""; + $found_len = 0; + foreach ($search as $base_dir => $prefix) + { + // does the class use the namespace prefix? + $len = strlen($prefix); + if (strncmp($prefix, $class, $len) === 0) + { + // we have a match so load the values + $found = true; + $found_base_dir = $base_dir; + $found_len = $len; + // done here + break; + } + } + // check if we found a match + if (!$found) + { + // not found so move to the next registered autoloader + return; + } + // get the relative class name + $relative_class = substr($class, $found_len); + // replace the namespace prefix with the base directory, replace namespace + // separators with directory separators in the relative class name, append + // with .php + $file = JPATH_ROOT . '/' . $found_base_dir . '/src' . str_replace('\\', '/', $relative_class) . '.php'; + // if the file exists, require it + if (file_exists($file)) + { + require $file; + } +}); diff --git a/admin/src/Helper/SermondistributorHelper.php b/admin/src/Helper/SermondistributorHelper.php index 1cd86725..2fbdd075 100644 --- a/admin/src/Helper/SermondistributorHelper.php +++ b/admin/src/Helper/SermondistributorHelper.php @@ -23,51 +23,12 @@ /----------------------------------------------------------------------------------------------------------------------------------*/ namespace TrueChristianChurch\Component\Sermondistributor\Administrator\Helper; - - -// register additional namespace -\spl_autoload_register(function ($class) { - // project-specific base directories and namespace prefix - $search = [ - 'libraries/jcb_powers/VDM.Joomla.FOF' => 'VDM\\Joomla\\FOF', - 'libraries/jcb_powers/VDM.Joomla' => 'VDM\\Joomla' - ]; - // Start the search and load if found - $found = false; - $found_base_dir = ""; - $found_len = 0; - foreach ($search as $base_dir => $prefix) - { - // does the class use the namespace prefix? - $len = strlen($prefix); - if (strncmp($prefix, $class, $len) === 0) - { - // we have a match so load the values - $found = true; - $found_base_dir = $base_dir; - $found_len = $len; - // done here - break; - } - } - // check if we found a match - if (!$found) - { - // not found so move to the next registered autoloader - return; - } - // get the relative class name - $relative_class = substr($class, $found_len); - // replace the namespace prefix with the base directory, replace namespace - // separators with directory separators in the relative class name, append - // with .php - $file = JPATH_ROOT . '/' . $found_base_dir . '/src' . str_replace('\\', '/', $relative_class) . '.php'; - // if the file exists, require it - if (file_exists($file)) - { - require $file; - } -}); +// The power autoloader for this project (JPATH_ADMINISTRATOR) area. +$power_autoloader = JPATH_ADMINISTRATOR . '/components/com_sermondistributor/src/Helper/PowerloaderHelper.php'; +if (file_exists($power_autoloader)) +{ + require_once $power_autoloader; +} use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; @@ -90,15 +51,15 @@ use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Writer\Xlsx; use Joomla\CMS\Filesystem\Folder; -use VDM\Joomla\FOF\Encrypt\AES; -use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; -use VDM\Joomla\Utilities\FileHelper; -use VDM\Joomla\Utilities\JsonHelper; -use VDM\Joomla\Utilities\ObjectHelper; -use VDM\Joomla\Utilities\StringHelper as UtilitiesStringHelper; -use VDM\Joomla\Utilities\MimeHelper; -use VDM\Joomla\Utilities\GetHelper; -use VDM\Joomla\Utilities\FormHelper; +use TrueChristianChurch\Joomla\FOF\Encrypt\AES; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use TrueChristianChurch\Joomla\Utilities\FileHelper; +use TrueChristianChurch\Joomla\Utilities\JsonHelper; +use TrueChristianChurch\Joomla\Utilities\ObjectHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper as UtilitiesStringHelper; +use TrueChristianChurch\Joomla\Utilities\MimeHelper; +use TrueChristianChurch\Joomla\Utilities\GetHelper; +use TrueChristianChurch\Joomla\Utilities\FormHelper; // No direct access to this file \defined('_JEXEC') or die; diff --git a/admin/src/Model/AjaxModel.php b/admin/src/Model/AjaxModel.php index c79e34e7..91ac645b 100644 --- a/admin/src/Model/AjaxModel.php +++ b/admin/src/Model/AjaxModel.php @@ -40,12 +40,12 @@ use Joomla\CMS\Uri\Uri; use Joomla\Registry\Registry; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\FileHelper; -use VDM\Joomla\Utilities\StringHelper; -use VDM\Joomla\Utilities\JsonHelper; -use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; -use VDM\Joomla\Utilities\ObjectHelper; -use VDM\Joomla\Utilities\GetHelper; +use TrueChristianChurch\Joomla\Utilities\FileHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\JsonHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use TrueChristianChurch\Joomla\Utilities\ObjectHelper; +use TrueChristianChurch\Joomla\Utilities\GetHelper; // No direct access to this file \defined('_JEXEC') or die; @@ -282,11 +282,11 @@ public function getCronPath($type) $result['error'] = '' . Text::sprintf('COM_SERMONDISTRIBUTOR_NO_CRONJOB_PATH_FOUND_FOR_S', $type) . ''; if ($this->hasCurl()) { - $path = '*/15 * * * * curl -s "' .\JUri::root() . 'index.php?option=com_sermondistributor&task=api.externalUpdate" >/dev/null 2>&1'; + $path = '*/15 * * * * curl -s "' .Uri::root() . 'index.php?option=com_sermondistributor&task=api.externalUpdate" >/dev/null 2>&1'; } else { - $path = '*/15 * * * * wget "' .\JUri::root() . 'index.php?option=com_sermondistributor&task=api.externalUpdate" >/dev/null 2>&1'; + $path = '*/15 * * * * wget "' .Uri::root() . 'index.php?option=com_sermondistributor&task=api.externalUpdate" >/dev/null 2>&1'; } $result['path'] = '' . $path . ''; } diff --git a/admin/src/Model/External_sourceModel.php b/admin/src/Model/External_sourceModel.php index 560e4121..42395e4c 100644 --- a/admin/src/Model/External_sourceModel.php +++ b/admin/src/Model/External_sourceModel.php @@ -42,10 +42,10 @@ use Joomla\Input\Input; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; use Joomla\CMS\Helper\TagsHelper; -use VDM\Joomla\Utilities\StringHelper as UtilitiesStringHelper; -use VDM\Joomla\Utilities\FileHelper; -use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; -use VDM\Joomla\FOF\Encrypt\AES; +use TrueChristianChurch\Joomla\Utilities\StringHelper as UtilitiesStringHelper; +use TrueChristianChurch\Joomla\Utilities\FileHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use TrueChristianChurch\Joomla\FOF\Encrypt\AES; // No direct access to this file \defined('_JEXEC') or die; diff --git a/admin/src/Model/External_sourcesModel.php b/admin/src/Model/External_sourcesModel.php index ce1d1980..0f1c43fe 100644 --- a/admin/src/Model/External_sourcesModel.php +++ b/admin/src/Model/External_sourcesModel.php @@ -36,10 +36,10 @@ use Joomla\Input\Input; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; use Joomla\CMS\Helper\TagsHelper; -use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; -use VDM\Joomla\Utilities\ObjectHelper; -use VDM\Joomla\Utilities\StringHelper; -use VDM\Joomla\FOF\Encrypt\AES; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use TrueChristianChurch\Joomla\Utilities\ObjectHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\FOF\Encrypt\AES; // No direct access to this file \defined('_JEXEC') or die; diff --git a/admin/src/Model/Help_documentModel.php b/admin/src/Model/Help_documentModel.php index 99a12fa7..8252b0ff 100644 --- a/admin/src/Model/Help_documentModel.php +++ b/admin/src/Model/Help_documentModel.php @@ -42,8 +42,8 @@ use Joomla\Input\Input; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; use Joomla\CMS\Helper\TagsHelper; -use VDM\Joomla\Utilities\StringHelper as UtilitiesStringHelper; -use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper as UtilitiesStringHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; // No direct access to this file \defined('_JEXEC') or die; diff --git a/admin/src/Model/Help_documentsModel.php b/admin/src/Model/Help_documentsModel.php index 52281852..44a1005c 100644 --- a/admin/src/Model/Help_documentsModel.php +++ b/admin/src/Model/Help_documentsModel.php @@ -36,10 +36,10 @@ use Joomla\Input\Input; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; use Joomla\CMS\Helper\TagsHelper; -use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; -use VDM\Joomla\Utilities\ObjectHelper; -use VDM\Joomla\Utilities\JsonHelper; -use VDM\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use TrueChristianChurch\Joomla\Utilities\ObjectHelper; +use TrueChristianChurch\Joomla\Utilities\JsonHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; // No direct access to this file \defined('_JEXEC') or die; diff --git a/admin/src/Model/ImportModel.php b/admin/src/Model/ImportModel.php index 2db5852b..f1b113ba 100644 --- a/admin/src/Model/ImportModel.php +++ b/admin/src/Model/ImportModel.php @@ -35,7 +35,7 @@ use Joomla\Utilities\ArrayHelper; use PhpOffice\PhpSpreadsheet\IOFactory; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; // No direct access to this file \defined('_JEXEC') or die; diff --git a/admin/src/Model/Local_listingModel.php b/admin/src/Model/Local_listingModel.php index 83be4850..4af66a9c 100644 --- a/admin/src/Model/Local_listingModel.php +++ b/admin/src/Model/Local_listingModel.php @@ -42,9 +42,9 @@ use Joomla\Input\Input; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; use Joomla\CMS\Helper\TagsHelper; -use VDM\Joomla\FOF\Encrypt\AES; -use VDM\Joomla\Utilities\StringHelper as UtilitiesStringHelper; -use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use TrueChristianChurch\Joomla\FOF\Encrypt\AES; +use TrueChristianChurch\Joomla\Utilities\StringHelper as UtilitiesStringHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; // No direct access to this file \defined('_JEXEC') or die; diff --git a/admin/src/Model/Local_listingsModel.php b/admin/src/Model/Local_listingsModel.php index 6c957533..716b662e 100644 --- a/admin/src/Model/Local_listingsModel.php +++ b/admin/src/Model/Local_listingsModel.php @@ -36,10 +36,10 @@ use Joomla\Input\Input; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; use Joomla\CMS\Helper\TagsHelper; -use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; -use VDM\Joomla\Utilities\ObjectHelper; -use VDM\Joomla\Utilities\StringHelper; -use VDM\Joomla\FOF\Encrypt\AES; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use TrueChristianChurch\Joomla\Utilities\ObjectHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\FOF\Encrypt\AES; // No direct access to this file \defined('_JEXEC') or die; diff --git a/admin/src/Model/Manual_updaterModel.php b/admin/src/Model/Manual_updaterModel.php index d80bce48..dbb98a3a 100644 --- a/admin/src/Model/Manual_updaterModel.php +++ b/admin/src/Model/Manual_updaterModel.php @@ -35,9 +35,9 @@ use Joomla\Utilities\ArrayHelper; use Joomla\Input\Input; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\FOF\Encrypt\AES; -use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; -use VDM\Joomla\Utilities\JsonHelper; +use TrueChristianChurch\Joomla\FOF\Encrypt\AES; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use TrueChristianChurch\Joomla\Utilities\JsonHelper; // No direct access to this file \defined('_JEXEC') or die; diff --git a/admin/src/Model/PreacherModel.php b/admin/src/Model/PreacherModel.php index fa80729b..ad75860d 100644 --- a/admin/src/Model/PreacherModel.php +++ b/admin/src/Model/PreacherModel.php @@ -42,9 +42,9 @@ use Joomla\Input\Input; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; use Joomla\CMS\Helper\TagsHelper; -use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; -use VDM\Joomla\Utilities\ObjectHelper; -use VDM\Joomla\Utilities\StringHelper as UtilitiesStringHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use TrueChristianChurch\Joomla\Utilities\ObjectHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper as UtilitiesStringHelper; // No direct access to this file \defined('_JEXEC') or die; diff --git a/admin/src/Model/PreachersModel.php b/admin/src/Model/PreachersModel.php index 08b30318..0440a4f4 100644 --- a/admin/src/Model/PreachersModel.php +++ b/admin/src/Model/PreachersModel.php @@ -36,9 +36,9 @@ use Joomla\Input\Input; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; use Joomla\CMS\Helper\TagsHelper; -use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; -use VDM\Joomla\Utilities\ObjectHelper; -use VDM\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use TrueChristianChurch\Joomla\Utilities\ObjectHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; // No direct access to this file \defined('_JEXEC') or die; diff --git a/admin/src/Model/SeriesModel.php b/admin/src/Model/SeriesModel.php index 48cf6f0c..c2ee9c2b 100644 --- a/admin/src/Model/SeriesModel.php +++ b/admin/src/Model/SeriesModel.php @@ -42,9 +42,9 @@ use Joomla\Input\Input; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; use Joomla\CMS\Helper\TagsHelper; -use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; -use VDM\Joomla\Utilities\ObjectHelper; -use VDM\Joomla\Utilities\StringHelper as UtilitiesStringHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use TrueChristianChurch\Joomla\Utilities\ObjectHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper as UtilitiesStringHelper; // No direct access to this file \defined('_JEXEC') or die; diff --git a/admin/src/Model/Series_listModel.php b/admin/src/Model/Series_listModel.php index 8bc695a4..6aa664b1 100644 --- a/admin/src/Model/Series_listModel.php +++ b/admin/src/Model/Series_listModel.php @@ -36,9 +36,9 @@ use Joomla\Input\Input; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; use Joomla\CMS\Helper\TagsHelper; -use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; -use VDM\Joomla\Utilities\ObjectHelper; -use VDM\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use TrueChristianChurch\Joomla\Utilities\ObjectHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; // No direct access to this file \defined('_JEXEC') or die; diff --git a/admin/src/Model/SermonModel.php b/admin/src/Model/SermonModel.php index f52f17bb..17eee01c 100644 --- a/admin/src/Model/SermonModel.php +++ b/admin/src/Model/SermonModel.php @@ -42,9 +42,9 @@ use Joomla\Input\Input; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; use Joomla\CMS\Helper\TagsHelper; -use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; -use VDM\Joomla\Utilities\ObjectHelper; -use VDM\Joomla\Utilities\StringHelper as UtilitiesStringHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use TrueChristianChurch\Joomla\Utilities\ObjectHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper as UtilitiesStringHelper; // No direct access to this file \defined('_JEXEC') or die; diff --git a/admin/src/Model/SermondistributorModel.php b/admin/src/Model/SermondistributorModel.php index ab59be37..bd9c2676 100644 --- a/admin/src/Model/SermondistributorModel.php +++ b/admin/src/Model/SermondistributorModel.php @@ -38,8 +38,8 @@ use Joomla\Utilities\ArrayHelper; use Joomla\Input\Input; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; -use VDM\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; // No direct access to this file \defined('_JEXEC') or die; @@ -51,6 +51,27 @@ */ class SermondistributorModel extends ListModel { + /** + * The styles array. + * + * @var array + * @since 4.3 + */ + protected array $styles = [ + 'administrator/components/com_sermondistributor/assets/css/admin.css', + 'administrator/components/com_sermondistributor/assets/css/dashboard.css' + ]; + + /** + * The scripts array. + * + * @var array + * @since 4.3 + */ + protected array $scripts = [ + 'administrator/components/com_sermondistributor/assets/js/admin.js' + ]; + public function getIcons() { // load user for access menus @@ -292,6 +313,50 @@ public function getIcons() return $icons; } + /** + * Method to get the styles that have to be included on the view + * + * @return array styles files + * @since 4.3 + */ + public function getStyles(): array + { + return $this->styles; + } + + /** + * Method to set the styles that have to be included on the view + * + * @return void + * @since 4.3 + */ + public function setStyles(string $path): void + { + $this->styles[] = $path; + } + + /** + * Method to get the script that have to be included on the view + * + * @return array script files + * @since 4.3 + */ + public function getScripts(): array + { + return $this->scripts; + } + + /** + * Method to set the script that have to be included on the view + * + * @return void + * @since 4.3 + */ + public function setScript(string $path): void + { + $this->scripts[] = $path; + } + public function getWiki() { diff --git a/admin/src/Model/SermonsModel.php b/admin/src/Model/SermonsModel.php index cae7cd31..9bf3c0ce 100644 --- a/admin/src/Model/SermonsModel.php +++ b/admin/src/Model/SermonsModel.php @@ -36,9 +36,9 @@ use Joomla\Input\Input; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; use Joomla\CMS\Helper\TagsHelper; -use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; -use VDM\Joomla\Utilities\ObjectHelper; -use VDM\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use TrueChristianChurch\Joomla\Utilities\ObjectHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; // No direct access to this file \defined('_JEXEC') or die; diff --git a/admin/src/Model/StatisticModel.php b/admin/src/Model/StatisticModel.php index ffd4f69f..d6592d16 100644 --- a/admin/src/Model/StatisticModel.php +++ b/admin/src/Model/StatisticModel.php @@ -42,8 +42,8 @@ use Joomla\Input\Input; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; use Joomla\CMS\Helper\TagsHelper; -use VDM\Joomla\Utilities\StringHelper as UtilitiesStringHelper; -use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper as UtilitiesStringHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; // No direct access to this file \defined('_JEXEC') or die; diff --git a/admin/src/Model/StatisticsModel.php b/admin/src/Model/StatisticsModel.php index fa88b63f..5d83d62b 100644 --- a/admin/src/Model/StatisticsModel.php +++ b/admin/src/Model/StatisticsModel.php @@ -36,9 +36,9 @@ use Joomla\Input\Input; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; use Joomla\CMS\Helper\TagsHelper; -use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; -use VDM\Joomla\Utilities\ObjectHelper; -use VDM\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use TrueChristianChurch\Joomla\Utilities\ObjectHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; // No direct access to this file \defined('_JEXEC') or die; diff --git a/admin/src/View/External_source/HtmlView.php b/admin/src/View/External_source/HtmlView.php index 979663a3..a35cc217 100644 --- a/admin/src/View/External_source/HtmlView.php +++ b/admin/src/View/External_source/HtmlView.php @@ -37,7 +37,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\CMS\Document\Document; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; // No direct access to this file \defined('_JEXEC') or die; @@ -61,6 +61,7 @@ public function display($tpl = null) { // set params $this->params = ComponentHelper::getParams('com_sermondistributor'); + $this->useCoreUI = true; // Assign the variables $this->form = $this->get('Form'); $this->item = $this->get('Item'); @@ -235,6 +236,8 @@ public function escape($var, bool $shorten = true, int $length = 30) */ protected function _prepareDocument(): void { + // Load jQuery + Html::_('jquery.framework'); $isNew = ($this->item->id < 1); $this->getDocument()->setTitle(Text::_($isNew ? 'COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_NEW' : 'COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_EDIT')); // add styles diff --git a/admin/src/View/External_sources/HtmlView.php b/admin/src/View/External_sources/HtmlView.php index a04a3141..cf4a8b53 100644 --- a/admin/src/View/External_sources/HtmlView.php +++ b/admin/src/View/External_sources/HtmlView.php @@ -37,8 +37,8 @@ use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\CMS\Document\Document; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\ArrayHelper; -use VDM\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; // No direct access to this file \defined('_JEXEC') or die; @@ -177,6 +177,8 @@ protected function addToolbar(): void */ protected function _prepareDocument(): void { + // Load jQuery + Html::_('jquery.framework'); $this->getDocument()->setTitle(Text::_('COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCES')); // add styles foreach ($this->styles as $style) diff --git a/admin/src/View/Help_document/HtmlView.php b/admin/src/View/Help_document/HtmlView.php index 0d872107..79d551d3 100644 --- a/admin/src/View/Help_document/HtmlView.php +++ b/admin/src/View/Help_document/HtmlView.php @@ -37,7 +37,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\CMS\Document\Document; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; // No direct access to this file \defined('_JEXEC') or die; @@ -61,6 +61,7 @@ public function display($tpl = null) { // set params $this->params = ComponentHelper::getParams('com_sermondistributor'); + $this->useCoreUI = true; // Assign the variables $this->form = $this->get('Form'); $this->item = $this->get('Item'); @@ -225,6 +226,8 @@ public function escape($var, bool $shorten = true, int $length = 30) */ protected function _prepareDocument(): void { + // Load jQuery + Html::_('jquery.framework'); $isNew = ($this->item->id < 1); $this->getDocument()->setTitle(Text::_($isNew ? 'COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_NEW' : 'COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_EDIT')); // add styles diff --git a/admin/src/View/Help_documents/HtmlView.php b/admin/src/View/Help_documents/HtmlView.php index 1bd2bf78..f9761b12 100644 --- a/admin/src/View/Help_documents/HtmlView.php +++ b/admin/src/View/Help_documents/HtmlView.php @@ -37,8 +37,8 @@ use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\CMS\Document\Document; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\ArrayHelper; -use VDM\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; // No direct access to this file \defined('_JEXEC') or die; @@ -177,6 +177,8 @@ protected function addToolbar(): void */ protected function _prepareDocument(): void { + // Load jQuery + Html::_('jquery.framework'); $this->getDocument()->setTitle(Text::_('COM_SERMONDISTRIBUTOR_HELP_DOCUMENTS')); // add styles foreach ($this->styles as $style) diff --git a/admin/src/View/Import/HtmlView.php b/admin/src/View/Import/HtmlView.php index e36f6067..ea236fc0 100644 --- a/admin/src/View/Import/HtmlView.php +++ b/admin/src/View/Import/HtmlView.php @@ -28,7 +28,7 @@ use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; use Joomla\CMS\Toolbar\ToolbarHelper; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; // No direct access to this file \defined('_JEXEC') or die; diff --git a/admin/src/View/Local_listing/HtmlView.php b/admin/src/View/Local_listing/HtmlView.php index 06b9440a..1fb8b1f3 100644 --- a/admin/src/View/Local_listing/HtmlView.php +++ b/admin/src/View/Local_listing/HtmlView.php @@ -37,7 +37,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\CMS\Document\Document; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; // No direct access to this file \defined('_JEXEC') or die; @@ -61,6 +61,7 @@ public function display($tpl = null) { // set params $this->params = ComponentHelper::getParams('com_sermondistributor'); + $this->useCoreUI = true; // Assign the variables $this->form = $this->get('Form'); $this->item = $this->get('Item'); @@ -225,6 +226,8 @@ public function escape($var, bool $shorten = true, int $length = 30) */ protected function _prepareDocument(): void { + // Load jQuery + Html::_('jquery.framework'); $isNew = ($this->item->id < 1); $this->getDocument()->setTitle(Text::_($isNew ? 'COM_SERMONDISTRIBUTOR_LOCAL_LISTING_NEW' : 'COM_SERMONDISTRIBUTOR_LOCAL_LISTING_EDIT')); // add styles diff --git a/admin/src/View/Local_listings/HtmlView.php b/admin/src/View/Local_listings/HtmlView.php index b32a4bc7..d27ec1c3 100644 --- a/admin/src/View/Local_listings/HtmlView.php +++ b/admin/src/View/Local_listings/HtmlView.php @@ -37,8 +37,8 @@ use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\CMS\Document\Document; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\ArrayHelper; -use VDM\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; // No direct access to this file \defined('_JEXEC') or die; @@ -177,6 +177,8 @@ protected function addToolbar(): void */ protected function _prepareDocument(): void { + // Load jQuery + Html::_('jquery.framework'); $this->getDocument()->setTitle(Text::_('COM_SERMONDISTRIBUTOR_LOCAL_LISTINGS')); // add styles foreach ($this->styles as $style) diff --git a/admin/src/View/Manual_updater/HtmlView.php b/admin/src/View/Manual_updater/HtmlView.php index c09d9043..72566a5a 100644 --- a/admin/src/View/Manual_updater/HtmlView.php +++ b/admin/src/View/Manual_updater/HtmlView.php @@ -34,7 +34,7 @@ use Joomla\CMS\Document\Document; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\HeaderCheck; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; // No direct access to this file \defined('_JEXEC') or die; diff --git a/admin/src/View/Preacher/HtmlView.php b/admin/src/View/Preacher/HtmlView.php index d815958e..f83efe00 100644 --- a/admin/src/View/Preacher/HtmlView.php +++ b/admin/src/View/Preacher/HtmlView.php @@ -37,7 +37,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\CMS\Document\Document; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; // No direct access to this file \defined('_JEXEC') or die; @@ -61,6 +61,7 @@ public function display($tpl = null) { // set params $this->params = ComponentHelper::getParams('com_sermondistributor'); + $this->useCoreUI = true; // Assign the variables $this->form = $this->get('Form'); $this->item = $this->get('Item'); @@ -228,6 +229,8 @@ public function escape($var, bool $shorten = true, int $length = 30) */ protected function _prepareDocument(): void { + // Load jQuery + Html::_('jquery.framework'); $isNew = ($this->item->id < 1); $this->getDocument()->setTitle(Text::_($isNew ? 'COM_SERMONDISTRIBUTOR_PREACHER_NEW' : 'COM_SERMONDISTRIBUTOR_PREACHER_EDIT')); // add styles diff --git a/admin/src/View/Preachers/HtmlView.php b/admin/src/View/Preachers/HtmlView.php index 438d1cc4..5be4e10e 100644 --- a/admin/src/View/Preachers/HtmlView.php +++ b/admin/src/View/Preachers/HtmlView.php @@ -37,8 +37,8 @@ use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\CMS\Document\Document; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\ArrayHelper; -use VDM\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; // No direct access to this file \defined('_JEXEC') or die; @@ -177,6 +177,8 @@ protected function addToolbar(): void */ protected function _prepareDocument(): void { + // Load jQuery + Html::_('jquery.framework'); $this->getDocument()->setTitle(Text::_('COM_SERMONDISTRIBUTOR_PREACHERS')); // add styles foreach ($this->styles as $style) diff --git a/admin/src/View/Series/HtmlView.php b/admin/src/View/Series/HtmlView.php index c55ce269..538b83c7 100644 --- a/admin/src/View/Series/HtmlView.php +++ b/admin/src/View/Series/HtmlView.php @@ -37,7 +37,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\CMS\Document\Document; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; // No direct access to this file \defined('_JEXEC') or die; @@ -61,6 +61,7 @@ public function display($tpl = null) { // set params $this->params = ComponentHelper::getParams('com_sermondistributor'); + $this->useCoreUI = true; // Assign the variables $this->form = $this->get('Form'); $this->item = $this->get('Item'); @@ -228,6 +229,8 @@ public function escape($var, bool $shorten = true, int $length = 30) */ protected function _prepareDocument(): void { + // Load jQuery + Html::_('jquery.framework'); $isNew = ($this->item->id < 1); $this->getDocument()->setTitle(Text::_($isNew ? 'COM_SERMONDISTRIBUTOR_SERIES_NEW' : 'COM_SERMONDISTRIBUTOR_SERIES_EDIT')); // add styles diff --git a/admin/src/View/Series_list/HtmlView.php b/admin/src/View/Series_list/HtmlView.php index 5fb722fd..2668f96d 100644 --- a/admin/src/View/Series_list/HtmlView.php +++ b/admin/src/View/Series_list/HtmlView.php @@ -37,8 +37,8 @@ use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\CMS\Document\Document; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\ArrayHelper; -use VDM\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; // No direct access to this file \defined('_JEXEC') or die; @@ -177,6 +177,8 @@ protected function addToolbar(): void */ protected function _prepareDocument(): void { + // Load jQuery + Html::_('jquery.framework'); $this->getDocument()->setTitle(Text::_('COM_SERMONDISTRIBUTOR_SERIES_LIST')); // add styles foreach ($this->styles as $style) diff --git a/admin/src/View/Sermon/HtmlView.php b/admin/src/View/Sermon/HtmlView.php index e4a75b7b..4e7405b4 100644 --- a/admin/src/View/Sermon/HtmlView.php +++ b/admin/src/View/Sermon/HtmlView.php @@ -37,7 +37,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\CMS\Document\Document; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; // No direct access to this file \defined('_JEXEC') or die; @@ -61,6 +61,7 @@ public function display($tpl = null) { // set params $this->params = ComponentHelper::getParams('com_sermondistributor'); + $this->useCoreUI = true; // Assign the variables $this->form = $this->get('Form'); $this->item = $this->get('Item'); @@ -228,6 +229,8 @@ public function escape($var, bool $shorten = true, int $length = 30) */ protected function _prepareDocument(): void { + // Load jQuery + Html::_('jquery.framework'); $isNew = ($this->item->id < 1); $this->getDocument()->setTitle(Text::_($isNew ? 'COM_SERMONDISTRIBUTOR_SERMON_NEW' : 'COM_SERMONDISTRIBUTOR_SERMON_EDIT')); // add styles diff --git a/admin/src/View/Sermondistributor/HtmlView.php b/admin/src/View/Sermondistributor/HtmlView.php index 352c7b91..8e8df391 100644 --- a/admin/src/View/Sermondistributor/HtmlView.php +++ b/admin/src/View/Sermondistributor/HtmlView.php @@ -30,7 +30,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\CMS\Document\Document; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; // No direct access to this file \defined('_JEXEC') or die; @@ -50,6 +50,8 @@ function display($tpl = null) { // Assign data to the view $this->icons = $this->get('Icons'); + $this->styles = $this->get('Styles'); + $this->scripts = $this->get('Scripts'); $this->contributors = SermondistributorHelper::getContributors(); // get the manifest details of the component @@ -108,11 +110,17 @@ protected function _prepareDocument(): void { // set page title $this->getDocument()->setTitle(Text::_('COM_SERMONDISTRIBUTOR_DASHBOARD')); - // add manifest to page JavaScript $this->getDocument()->addScriptDeclaration("var manifest = JSON.parse('" . json_encode($this->manifest) . "');", "text/javascript"); - - // add dashboard style sheets - Html::_('stylesheet', "administrator/components/com_sermondistributor/assets/css/dashboard.css", ['version' => 'auto']); + // add styles + foreach ($this->styles as $style) + { + Html::_('stylesheet', $style, ['version' => 'auto']); + } + // add scripts + foreach ($this->scripts as $script) + { + Html::_('script', $script, ['version' => 'auto']); + } } } diff --git a/admin/src/View/Sermons/HtmlView.php b/admin/src/View/Sermons/HtmlView.php index cb7ffc55..0d386f37 100644 --- a/admin/src/View/Sermons/HtmlView.php +++ b/admin/src/View/Sermons/HtmlView.php @@ -37,8 +37,8 @@ use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\CMS\Document\Document; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\ArrayHelper; -use VDM\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; // No direct access to this file \defined('_JEXEC') or die; @@ -177,6 +177,8 @@ protected function addToolbar(): void */ protected function _prepareDocument(): void { + // Load jQuery + Html::_('jquery.framework'); $this->getDocument()->setTitle(Text::_('COM_SERMONDISTRIBUTOR_SERMONS')); // add styles foreach ($this->styles as $style) diff --git a/admin/src/View/Statistic/HtmlView.php b/admin/src/View/Statistic/HtmlView.php index 19506431..a1ccba0b 100644 --- a/admin/src/View/Statistic/HtmlView.php +++ b/admin/src/View/Statistic/HtmlView.php @@ -37,7 +37,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\CMS\Document\Document; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; // No direct access to this file \defined('_JEXEC') or die; @@ -61,6 +61,7 @@ public function display($tpl = null) { // set params $this->params = ComponentHelper::getParams('com_sermondistributor'); + $this->useCoreUI = true; // Assign the variables $this->form = $this->get('Form'); $this->item = $this->get('Item'); @@ -225,6 +226,8 @@ public function escape($var, bool $shorten = true, int $length = 30) */ protected function _prepareDocument(): void { + // Load jQuery + Html::_('jquery.framework'); $isNew = ($this->item->id < 1); $this->getDocument()->setTitle(Text::_($isNew ? 'COM_SERMONDISTRIBUTOR_STATISTIC_NEW' : 'COM_SERMONDISTRIBUTOR_STATISTIC_EDIT')); // add styles diff --git a/admin/src/View/Statistics/HtmlView.php b/admin/src/View/Statistics/HtmlView.php index ebb08c02..d6636f2d 100644 --- a/admin/src/View/Statistics/HtmlView.php +++ b/admin/src/View/Statistics/HtmlView.php @@ -37,8 +37,8 @@ use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\CMS\Document\Document; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\ArrayHelper; -use VDM\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; // No direct access to this file \defined('_JEXEC') or die; @@ -177,6 +177,8 @@ protected function addToolbar(): void */ protected function _prepareDocument(): void { + // Load jQuery + Html::_('jquery.framework'); $this->getDocument()->setTitle(Text::_('COM_SERMONDISTRIBUTOR_STATISTICS')); // add styles foreach ($this->styles as $style) diff --git a/admin/tmpl/import/default.php b/admin/tmpl/import/default.php index f4db377e..10502ac2 100644 --- a/admin/tmpl/import/default.php +++ b/admin/tmpl/import/default.php @@ -25,8 +25,8 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\Router\Route; use Joomla\CMS\HTML\HTMLHelper as Html; -use VDM\Joomla\Utilities\ArrayHelper; -use VDM\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; // No direct access to this file defined('_JEXEC') or die; diff --git a/admin/tmpl/manual_updater/default.php b/admin/tmpl/manual_updater/default.php index d1a8f3a9..47bd1f6e 100644 --- a/admin/tmpl/manual_updater/default.php +++ b/admin/tmpl/manual_updater/default.php @@ -28,8 +28,9 @@ use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use TrueChristianChurch\Component\Sermondistributor\Administrator\Helper\SermondistributorHelper; -use VDM\Joomla\Utilities\ArrayHelper; -use VDM\Joomla\Utilities\StringHelper; +use TrueChristianChurch\Joomla\Utilities\ArrayHelper; +use TrueChristianChurch\Joomla\Utilities\StringHelper; +use Joomla\CMS\Session\Session; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->getDocument()->getWebAssetManager(); @@ -130,7 +131,7 @@ class="span12"