From f0e145b2dfd992294c919574dfe8a375c62a8e5c Mon Sep 17 00:00:00 2001 From: aB0t Date: Mon, 29 Jul 2024 18:16:23 +0200 Subject: [PATCH] Release of v4.0.15-alpha4 Improve the PHP environment setup validation. Add option to pass shared session via tag share. --- CHANGELOG.md | 8 +- GetbibleInstallerPowerloader.php | 64 ++++ GetbibleInstallerScript.php | 222 ++++--------- README.md | 28 +- admin/README.txt | 28 +- admin/src/Controller/BookController.php | 2 +- admin/src/Controller/ChapterController.php | 2 +- admin/src/Controller/LinkerController.php | 2 +- admin/src/Controller/NoteController.php | 2 +- .../Controller/Open_ai_messageController.php | 2 +- .../Controller/Open_ai_responseController.php | 2 +- admin/src/Controller/PasswordController.php | 2 +- admin/src/Controller/PromptController.php | 2 +- admin/src/Controller/TagController.php | 2 +- .../src/Controller/Tagged_verseController.php | 2 +- .../src/Controller/TranslationController.php | 2 +- admin/src/Controller/VerseController.php | 2 +- admin/src/View/Book/HtmlView.php | 83 ++++- admin/src/View/Books/HtmlView.php | 59 +++- admin/src/View/Chapter/HtmlView.php | 83 ++++- admin/src/View/Chapters/HtmlView.php | 59 +++- admin/src/View/Linker/HtmlView.php | 83 ++++- admin/src/View/Linkers/HtmlView.php | 59 +++- admin/src/View/Note/HtmlView.php | 83 ++++- admin/src/View/Notes/HtmlView.php | 59 +++- admin/src/View/Open_ai_message/HtmlView.php | 83 ++++- admin/src/View/Open_ai_messages/HtmlView.php | 59 +++- admin/src/View/Open_ai_response/HtmlView.php | 83 ++++- admin/src/View/Open_ai_responses/HtmlView.php | 59 +++- admin/src/View/Password/HtmlView.php | 83 ++++- admin/src/View/Passwords/HtmlView.php | 59 +++- admin/src/View/Prompt/HtmlView.php | 83 ++++- admin/src/View/Prompts/HtmlView.php | 59 +++- admin/src/View/Tag/HtmlView.php | 83 ++++- admin/src/View/Tagged_verse/HtmlView.php | 83 ++++- admin/src/View/Tagged_verses/HtmlView.php | 59 +++- admin/src/View/Tags/HtmlView.php | 59 +++- admin/src/View/Translation/HtmlView.php | 83 ++++- admin/src/View/Translations/HtmlView.php | 59 +++- admin/src/View/Verse/HtmlView.php | 83 ++++- admin/src/View/Verses/HtmlView.php | 59 +++- admin/tmpl/book/default.php | 12 +- admin/tmpl/chapter/default.php | 12 +- admin/tmpl/linker/default.php | 12 +- admin/tmpl/note/default.php | 12 +- admin/tmpl/open_ai_message/default.php | 12 +- admin/tmpl/open_ai_response/default.php | 12 +- admin/tmpl/password/default.php | 12 +- admin/tmpl/prompt/default.php | 12 +- admin/tmpl/tag/default.php | 12 +- admin/tmpl/tagged_verse/default.php | 12 +- admin/tmpl/translation/default.php | 12 +- admin/tmpl/verse/default.php | 12 +- getbible.xml | 6 +- .../src/Abstraction/Api.php | 3 +- .../src/Repository/Contents.php | 41 +-- .../src/Utilities/Http.php | 4 +- .../src/Abstraction/ActiveRegistry.php | 305 ++++++++++++++++++ .../Abstraction/PHPConfigurationChecker.php | 214 ++++++++++++ .../src/Abstraction/Registry.php | 191 +++++++++++ .../src/Abstraction/Schema.php | 4 +- .../src/Abstraction/SchemaChecker.php | 14 +- .../src/GetBible/PHPConfigurationChecker.php | 88 +++++ .../Interfaces/Activeregistryinterface.php | 100 ++++++ .../src/Interfaces/Git/ApiInterface.php | 50 +++ .../Git/Repository/ContentsInterface.php | 209 ++++++++++++ .../src/Interfaces/Git/Repository/index.html | 1 + .../src/Interfaces/Git/index.html | 1 + .../PHPConfigurationCheckerInterface.php | 30 ++ .../src/Interfaces/Registryinterface.php | 97 ++++++ .../src/Model/Load.php | 4 +- site/src/Controller/DisplayController.php | 180 ++++++++++- site/src/Model/TagModel.php | 9 +- site/src/View/App/HtmlView.php | 42 ++- site/src/View/Openai/HtmlView.php | 42 ++- site/src/View/Search/HtmlView.php | 50 +++ site/src/View/Tag/HtmlView.php | 50 +++ update_server.xml | 6 +- 78 files changed, 3577 insertions(+), 386 deletions(-) create mode 100644 GetbibleInstallerPowerloader.php create mode 100644 libraries/vendor_getbible/TrueChristianBible.Joomla/src/Abstraction/ActiveRegistry.php create mode 100644 libraries/vendor_getbible/TrueChristianBible.Joomla/src/Abstraction/PHPConfigurationChecker.php create mode 100644 libraries/vendor_getbible/TrueChristianBible.Joomla/src/Abstraction/Registry.php create mode 100644 libraries/vendor_getbible/TrueChristianBible.Joomla/src/GetBible/PHPConfigurationChecker.php create mode 100644 libraries/vendor_getbible/TrueChristianBible.Joomla/src/Interfaces/Activeregistryinterface.php create mode 100644 libraries/vendor_getbible/TrueChristianBible.Joomla/src/Interfaces/Git/ApiInterface.php create mode 100644 libraries/vendor_getbible/TrueChristianBible.Joomla/src/Interfaces/Git/Repository/ContentsInterface.php create mode 100644 libraries/vendor_getbible/TrueChristianBible.Joomla/src/Interfaces/Git/Repository/index.html create mode 100644 libraries/vendor_getbible/TrueChristianBible.Joomla/src/Interfaces/Git/index.html create mode 100644 libraries/vendor_getbible/TrueChristianBible.Joomla/src/Interfaces/PHPConfigurationCheckerInterface.php create mode 100644 libraries/vendor_getbible/TrueChristianBible.Joomla/src/Interfaces/Registryinterface.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 214e98f..67291c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,15 @@ -# v4.0.15-alpha3 +# v4.0.15-alpha4 -- Fix update error of undefined folder method (exists) +- Improve the PHP environment setup validation +- Add option to pass shared session via tag share # v4.0.15-alpha - Refactored the API classes - Add table schema checker - Fix install issue with missing method removeFolder -- Fix display error with correct component namespace update form JCB +- Fix display error with correct component namespace update form JCB +- Fix update error of undefined folder method (exists) # v4.0.13 diff --git a/GetbibleInstallerPowerloader.php b/GetbibleInstallerPowerloader.php new file mode 100644 index 0000000..3f0f764 --- /dev/null +++ b/GetbibleInstallerPowerloader.php @@ -0,0 +1,64 @@ + + @git Get Bible + @github Get Bible + @support Get Bible + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + +/------------------------------------------------------------------------------------------------------*/ + +// 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_getbible/TrueChristianBible.Joomla.Openai' => 'TrueChristianBible\\Joomla\\Openai', + 'libraries/vendor_getbible/TrueChristianBible.Joomla.Gitea' => 'TrueChristianBible\\Joomla\\Gitea', + 'libraries/vendor_getbible/TrueChristianBible.Joomla' => 'TrueChristianBible\\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 = __DIR__ . '/' . $found_base_dir . '/src' . str_replace('\\', '/', $relative_class) . '.php'; + // if the file exists, require it + if (file_exists($file)) + { + require $file; + } +}); diff --git a/GetbibleInstallerScript.php b/GetbibleInstallerScript.php index fcd6700..4e859ca 100644 --- a/GetbibleInstallerScript.php +++ b/GetbibleInstallerScript.php @@ -20,12 +20,12 @@ 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; +use TrueChristianBible\Joomla\GetBible\PHPConfigurationChecker; use TrueChristianBible\Joomla\GetBible\Table\SchemaChecker; // No direct access to this file @@ -41,7 +41,6 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface /** * The CMS Application. * - * @var CMSApplication * @since 4.4.2 */ protected $app; @@ -56,7 +55,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface /** * The version number of the extension. * - * @var string + * @var string * @since 3.6 */ protected $release; @@ -64,7 +63,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface /** * The table the parameters are stored in. * - * @var string + * @var string * @since 3.6 */ protected $paramTable; @@ -72,7 +71,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface /** * The extension name. This should be set in the installer script. * - * @var string + * @var string * @since 3.6 */ protected $extension; @@ -80,7 +79,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface /** * A list of files to be deleted * - * @var array + * @var array * @since 3.6 */ protected $deleteFiles = []; @@ -88,7 +87,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface /** * A list of folders to be deleted * - * @var array + * @var array * @since 3.6 */ protected $deleteFolders = []; @@ -96,7 +95,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface /** * A list of CLI script files to be copied to the cli directory * - * @var array + * @var array * @since 3.6 */ protected $cliScriptFiles = []; @@ -104,7 +103,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface /** * Minimum PHP version required to install the extension * - * @var string + * @var string * @since 3.6 */ protected $minimumPhp; @@ -112,7 +111,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface /** * Minimum Joomla! version required to install the extension * - * @var string + * @var string * @since 3.6 */ protected $minimumJoomla; @@ -166,7 +165,6 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface * @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;} @@ -188,7 +186,6 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface * @param InstallerAdapter $adapter The adapter calling this method * * @return boolean True on success - * * @since 4.2.0 */ public function uninstall(InstallerAdapter $adapter): bool @@ -275,7 +272,6 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface * @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 @@ -304,8 +300,11 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface if ($type === 'update') { - // Check that the required configuration are set for PHP - $this->phpConfigurationCheck($this->app); + // Check that the PHP configurations are sufficient + if ($this->classExists(PHPConfigurationChecker::class)) + { + (new PHPConfigurationChecker())->run(); + } // all things to clear out $removeFolders = []; @@ -326,8 +325,11 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface if ($type === 'install') { - // Check that the required configuration are set for PHP - $this->phpConfigurationCheck($this->app); + // Check that the PHP configurations are sufficient + if ($this->classExists(PHPConfigurationChecker::class)) + { + (new PHPConfigurationChecker())->run(); + } } return true; @@ -340,7 +342,6 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface * @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 @@ -790,7 +791,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface echo '
-

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

'; +

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

'; // Add/Update component in the action logs extensions table. $this->setActionLogsExtensions(); @@ -1004,7 +1005,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface * @param array|null $ignore The folders and files to ignore and not remove. * * @return bool True if all specified files/folders are removed, false otherwise. - * @since 3.2.2 + * @since 3.2.2 */ protected function removeFolder(string $dir, ?array $ignore = null): bool { @@ -1055,7 +1056,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface * @param array $ignore The folders and files to ignore. * * @return bool True if the directory is empty or contains only ignored items, false otherwise. - * @since 3.2.1 + * @since 3.2.1 */ protected function isDirEmpty(string $dir, array $ignore): bool { @@ -1075,7 +1076,6 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface * Remove the files and folders in the given array from * * @return void - * * @since 3.6 */ protected function removeFiles() @@ -1107,7 +1107,6 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface * Moves the CLI scripts into the CLI folder in the CMS * * @return void - * * @since 3.6 */ protected function moveCliFiles() @@ -1138,7 +1137,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface * @param string $contentHistoryOptions * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function setContentType( string $typeTitle, @@ -1200,7 +1199,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface * @param string $textPrefix * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function setActionLogConfig( string $typeTitle, @@ -1253,7 +1252,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface * Set action logs extensions integration * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function setActionLogsExtensions(): void { @@ -1294,7 +1293,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface * @param string $rules The component rules * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function setAssetsRules(string $rules): void { @@ -1332,7 +1331,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface * @param string $params The component rules * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function setExtensionsParams(string $params): void { @@ -1375,7 +1374,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface * @param string $dataType This datatype we will change the rules column to if it to small. * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function setDatabaseAssetsRulesFix(int $accessWorseCase, string $dataType): void { @@ -1410,7 +1409,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface * @param bool $fields The switch to also remove related field data * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeViewData(string $context, bool $fields = false): void { @@ -1433,7 +1432,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface * @param string $context The view context * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeContentTypes(string $context): void { @@ -1490,7 +1489,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface * @param string $context The view context * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeFields(string $context): void { @@ -1552,7 +1551,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface * @param array $ids The view context * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeFieldsValues(string $context, array $ids): void { @@ -1583,7 +1582,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface * @param string $context The view context * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeFieldsGroups(string $context): void { @@ -1638,7 +1637,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface * @param string $context The view context * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeViewHistory(string $context): void { @@ -1670,7 +1669,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface * @param array $ids The type ids * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeUcmBase(array $ids): void { @@ -1703,7 +1702,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface * @param string $context The view context * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeUcmContent(string $context): void { @@ -1735,7 +1734,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface * @param string $context The view context * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeContentItemTagMap(string $context): void { @@ -1770,7 +1769,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface * @param string $context The view context * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeActionLogConfig(string $context): void { @@ -1800,7 +1799,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface * Remove Asset Table Integrated * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeAssetData(): void { @@ -1828,7 +1827,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface * Remove action logs extensions integrated * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeActionLogsExtensions(): void { @@ -1858,7 +1857,7 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface * Remove remove database fix (if possible) * * @return void - * @since 4.4.2 + * @since 4.4.2 */ protected function removeDatabaseAssetsRulesFix(): void { @@ -1896,134 +1895,35 @@ class Com_GetbibleInstallerScript implements InstallerScriptInterface * @param string $className The fully qualified name of the class to check. * * @return bool True if the class exists or was successfully loaded, false otherwise. - * @since 4.0.1 + * @since 4.0.1 */ protected function classExists(string $className): bool { - if (!class_exists($className, true)) + if (class_exists($className, true)) { - // The power autoloader for this project (JPATH_ADMINISTRATOR) area. - $power_autoloader = JPATH_ADMINISTRATOR . '/components/com_getbible/src/Helper/PowerloaderHelper.php'; - if (file_exists($power_autoloader)) - { - require_once $power_autoloader; - } + return true; + } - // Check again if the class now exists after requiring the autoloader - if (!class_exists($className, true)) + // Autoloaders to check + $autoloaders = [ + __DIR__ . '/GetbibleInstallerPowerloader.php', + JPATH_ADMINISTRATOR . '/components/com_getbible/src/Helper/PowerloaderHelper.php' + ]; + + foreach ($autoloaders as $autoloader) + { + if (file_exists($autoloader)) { - return false; + require_once $autoloader; + + if (class_exists($className, true)) + { + return true; + } } } - return true; - } - /** - * Define the required limits with specific messages for success and warning scenarios - * - * @var array - * @since 3.0.8 - */ - 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.8 - */ - 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.8 - */ - 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 Get Bible 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 Get Bible PHP Settings Wiki. -', 'notice'); - } + return false; } /** diff --git a/README.md b/README.md index fe08126..42e6028 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Get Bible (4.0.15-alpha3) +# Get Bible (4.0.15-alpha4) ![Get Bible image](https://git.vdm.dev/getBible/joomla-component/raw/branch/5.0/admin/assets/images/vdm-component.jpg "GetBible") @@ -18,38 +18,38 @@ In essence, The Bible for Joomla is designed to transform how the Word of God is + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Get Bible](https://getbible.net) + *First Build*: 3rd December, 2015 -+ *Last Build*: 15th July, 2024 -+ *Version*: 4.0.15-alpha3 ++ *Last Build*: 29th July, 2024 ++ *Version*: 4.0.15-alpha4 + *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 -**636 Hours** or **80 Eight Hour Days** (actual time the author saved - +**664 Hours** or **83 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*: **227917** -+ *File count*: **1873** -+ *Folder count*: **178** ++ *Line count*: **237927** ++ *File count*: **1921** ++ *Folder count*: **180** -**419 Hours** or **52 Eight Hour Days** (the actual time the author spent) +**438 Hours** or **55 Eight Hour Days** (the actual time the author spent) > (with the following break down: -> **debugging @159hours** = codingtime / 4; -> **planning @91hours** = codingtime / 7; -> **mapping @64hours** = codingtime / 10; -> **office @106hours** = codingtime / 6;) +> **debugging @166hours** = codingtime / 4; +> **planning @95hours** = codingtime / 7; +> **mapping @66hours** = codingtime / 10; +> **office @111hours** = codingtime / 6;) -**1055 Hours** or **132 Eight Hour Days** +**1102 Hours** or **138 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: **26.4 weeks** or **5.5 months** +Project duration: **27.6 weeks** or **5.8 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) diff --git a/admin/README.txt b/admin/README.txt index fe08126..42e6028 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -1,4 +1,4 @@ -# Get Bible (4.0.15-alpha3) +# Get Bible (4.0.15-alpha4) ![Get Bible image](https://git.vdm.dev/getBible/joomla-component/raw/branch/5.0/admin/assets/images/vdm-component.jpg "GetBible") @@ -18,38 +18,38 @@ In essence, The Bible for Joomla is designed to transform how the Word of God is + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Get Bible](https://getbible.net) + *First Build*: 3rd December, 2015 -+ *Last Build*: 15th July, 2024 -+ *Version*: 4.0.15-alpha3 ++ *Last Build*: 29th July, 2024 ++ *Version*: 4.0.15-alpha4 + *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 -**636 Hours** or **80 Eight Hour Days** (actual time the author saved - +**664 Hours** or **83 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*: **227917** -+ *File count*: **1873** -+ *Folder count*: **178** ++ *Line count*: **237927** ++ *File count*: **1921** ++ *Folder count*: **180** -**419 Hours** or **52 Eight Hour Days** (the actual time the author spent) +**438 Hours** or **55 Eight Hour Days** (the actual time the author spent) > (with the following break down: -> **debugging @159hours** = codingtime / 4; -> **planning @91hours** = codingtime / 7; -> **mapping @64hours** = codingtime / 10; -> **office @106hours** = codingtime / 6;) +> **debugging @166hours** = codingtime / 4; +> **planning @95hours** = codingtime / 7; +> **mapping @66hours** = codingtime / 10; +> **office @111hours** = codingtime / 6;) -**1055 Hours** or **132 Eight Hour Days** +**1102 Hours** or **138 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: **26.4 weeks** or **5.5 months** +Project duration: **27.6 weeks** or **5.8 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) diff --git a/admin/src/Controller/BookController.php b/admin/src/Controller/BookController.php index 0593b18..25ec40a 100644 --- a/admin/src/Controller/BookController.php +++ b/admin/src/Controller/BookController.php @@ -335,7 +335,7 @@ class BookController extends FormController * Function that allows child controller access to model data * after the data has been saved. * - * @param BaseDatabaseModel &$model The data model object. + * @param BaseDatabaseModel $model The data model object. * @param array $validData The validated data. * * @return void diff --git a/admin/src/Controller/ChapterController.php b/admin/src/Controller/ChapterController.php index 76b9a2a..2c931e0 100644 --- a/admin/src/Controller/ChapterController.php +++ b/admin/src/Controller/ChapterController.php @@ -335,7 +335,7 @@ class ChapterController extends FormController * Function that allows child controller access to model data * after the data has been saved. * - * @param BaseDatabaseModel &$model The data model object. + * @param BaseDatabaseModel $model The data model object. * @param array $validData The validated data. * * @return void diff --git a/admin/src/Controller/LinkerController.php b/admin/src/Controller/LinkerController.php index 2588935..722b0fb 100644 --- a/admin/src/Controller/LinkerController.php +++ b/admin/src/Controller/LinkerController.php @@ -335,7 +335,7 @@ class LinkerController extends FormController * Function that allows child controller access to model data * after the data has been saved. * - * @param BaseDatabaseModel &$model The data model object. + * @param BaseDatabaseModel $model The data model object. * @param array $validData The validated data. * * @return void diff --git a/admin/src/Controller/NoteController.php b/admin/src/Controller/NoteController.php index 3d367b3..9eeddbd 100644 --- a/admin/src/Controller/NoteController.php +++ b/admin/src/Controller/NoteController.php @@ -335,7 +335,7 @@ class NoteController extends FormController * Function that allows child controller access to model data * after the data has been saved. * - * @param BaseDatabaseModel &$model The data model object. + * @param BaseDatabaseModel $model The data model object. * @param array $validData The validated data. * * @return void diff --git a/admin/src/Controller/Open_ai_messageController.php b/admin/src/Controller/Open_ai_messageController.php index 23d9aa7..602deee 100644 --- a/admin/src/Controller/Open_ai_messageController.php +++ b/admin/src/Controller/Open_ai_messageController.php @@ -335,7 +335,7 @@ class Open_ai_messageController extends FormController * Function that allows child controller access to model data * after the data has been saved. * - * @param BaseDatabaseModel &$model The data model object. + * @param BaseDatabaseModel $model The data model object. * @param array $validData The validated data. * * @return void diff --git a/admin/src/Controller/Open_ai_responseController.php b/admin/src/Controller/Open_ai_responseController.php index b0f7dd1..ea94014 100644 --- a/admin/src/Controller/Open_ai_responseController.php +++ b/admin/src/Controller/Open_ai_responseController.php @@ -335,7 +335,7 @@ class Open_ai_responseController extends FormController * Function that allows child controller access to model data * after the data has been saved. * - * @param BaseDatabaseModel &$model The data model object. + * @param BaseDatabaseModel $model The data model object. * @param array $validData The validated data. * * @return void diff --git a/admin/src/Controller/PasswordController.php b/admin/src/Controller/PasswordController.php index 8c31b3d..6130c54 100644 --- a/admin/src/Controller/PasswordController.php +++ b/admin/src/Controller/PasswordController.php @@ -335,7 +335,7 @@ class PasswordController extends FormController * Function that allows child controller access to model data * after the data has been saved. * - * @param BaseDatabaseModel &$model The data model object. + * @param BaseDatabaseModel $model The data model object. * @param array $validData The validated data. * * @return void diff --git a/admin/src/Controller/PromptController.php b/admin/src/Controller/PromptController.php index 7408bfc..6351993 100644 --- a/admin/src/Controller/PromptController.php +++ b/admin/src/Controller/PromptController.php @@ -335,7 +335,7 @@ class PromptController extends FormController * Function that allows child controller access to model data * after the data has been saved. * - * @param BaseDatabaseModel &$model The data model object. + * @param BaseDatabaseModel $model The data model object. * @param array $validData The validated data. * * @return void diff --git a/admin/src/Controller/TagController.php b/admin/src/Controller/TagController.php index f309e64..42eeebe 100644 --- a/admin/src/Controller/TagController.php +++ b/admin/src/Controller/TagController.php @@ -335,7 +335,7 @@ class TagController extends FormController * Function that allows child controller access to model data * after the data has been saved. * - * @param BaseDatabaseModel &$model The data model object. + * @param BaseDatabaseModel $model The data model object. * @param array $validData The validated data. * * @return void diff --git a/admin/src/Controller/Tagged_verseController.php b/admin/src/Controller/Tagged_verseController.php index c07ea4f..87b7126 100644 --- a/admin/src/Controller/Tagged_verseController.php +++ b/admin/src/Controller/Tagged_verseController.php @@ -335,7 +335,7 @@ class Tagged_verseController extends FormController * Function that allows child controller access to model data * after the data has been saved. * - * @param BaseDatabaseModel &$model The data model object. + * @param BaseDatabaseModel $model The data model object. * @param array $validData The validated data. * * @return void diff --git a/admin/src/Controller/TranslationController.php b/admin/src/Controller/TranslationController.php index 66b9e76..9d00505 100644 --- a/admin/src/Controller/TranslationController.php +++ b/admin/src/Controller/TranslationController.php @@ -335,7 +335,7 @@ class TranslationController extends FormController * Function that allows child controller access to model data * after the data has been saved. * - * @param BaseDatabaseModel &$model The data model object. + * @param BaseDatabaseModel $model The data model object. * @param array $validData The validated data. * * @return void diff --git a/admin/src/Controller/VerseController.php b/admin/src/Controller/VerseController.php index 2405149..7f12ac8 100644 --- a/admin/src/Controller/VerseController.php +++ b/admin/src/Controller/VerseController.php @@ -335,7 +335,7 @@ class VerseController extends FormController * Function that allows child controller access to model data * after the data has been saved. * - * @param BaseDatabaseModel &$model The data model object. + * @param BaseDatabaseModel $model The data model object. * @param array $validData The validated data. * * @return void diff --git a/admin/src/View/Book/HtmlView.php b/admin/src/View/Book/HtmlView.php index 590457a..d7ca064 100644 --- a/admin/src/View/Book/HtmlView.php +++ b/admin/src/View/Book/HtmlView.php @@ -22,6 +22,7 @@ use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; +use Joomla\CMS\User\User; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\FileLayout; @@ -42,6 +43,86 @@ use TrueChristianBible\Joomla\Utilities\StringHelper; */ class HtmlView extends BaseHtmlView { + /** + * The item from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $item; + + /** + * The state object + * + * @var mixed + * @since 3.10.11 + */ + public mixed $state; + + /** + * The form from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $form; + + /** + * The toolbar object + * + * @var Toolbar + * @since 3.10.11 + */ + public Toolbar $toolbar; + + /** + * The styles url array + * + * @var array + * @since 5.0.0 + */ + protected array $styles; + + /** + * The scripts url array + * + * @var array + * @since 5.0.0 + */ + protected array $scripts; + + /** + * The actions object + * + * @var object + * @since 3.10.11 + */ + public object $canDo; + + /** + * The origin referral view name + * + * @var string + * @since 3.10.11 + */ + public string $ref; + + /** + * The origin referral item id + * + * @var int + * @since 3.10.11 + */ + public int $refid; + + /** + * The referral url suffix values + * + * @var string + * @since 3.10.11 + */ + public string $referral; + /** * Book view display method * @@ -56,7 +137,7 @@ class HtmlView extends BaseHtmlView $this->params = ComponentHelper::getParams('com_getbible'); $this->useCoreUI = true; // Assign the variables - $this->form = $this->get('Form'); + $this->form ??= $this->get('Form'); $this->item = $this->get('Item'); $this->styles = $this->get('Styles'); $this->scripts = $this->get('Scripts'); diff --git a/admin/src/View/Books/HtmlView.php b/admin/src/View/Books/HtmlView.php index a0086be..bbc8362 100644 --- a/admin/src/View/Books/HtmlView.php +++ b/admin/src/View/Books/HtmlView.php @@ -22,6 +22,7 @@ use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; +use Joomla\CMS\User\User; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\FileLayout; @@ -43,6 +44,62 @@ use TrueChristianBible\Joomla\Utilities\StringHelper; */ class HtmlView extends BaseHtmlView { + /** + * The items from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $items; + + /** + * The state object + * + * @var mixed + * @since 3.10.11 + */ + public mixed $state; + + /** + * The styles url array + * + * @var array + * @since 5.0.0 + */ + protected array $styles; + + /** + * The scripts url array + * + * @var array + * @since 5.0.0 + */ + protected array $scripts; + + /** + * The actions object + * + * @var object + * @since 3.10.11 + */ + public object $canDo; + + /** + * The return here base64 url + * + * @var string + * @since 3.10.11 + */ + public string $return_here; + + /** + * The user object. + * + * @var User + * @since 3.10.11 + */ + public User $user; + /** * Books view display method * @@ -59,7 +116,7 @@ class HtmlView extends BaseHtmlView $this->state = $this->get('State'); $this->styles = $this->get('Styles'); $this->scripts = $this->get('Scripts'); - $this->user ??= Factory::getApplication()->getIdentity(); + $this->user ??= $this->getCurrentUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. diff --git a/admin/src/View/Chapter/HtmlView.php b/admin/src/View/Chapter/HtmlView.php index 100e2e1..9a18b11 100644 --- a/admin/src/View/Chapter/HtmlView.php +++ b/admin/src/View/Chapter/HtmlView.php @@ -22,6 +22,7 @@ use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; +use Joomla\CMS\User\User; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\FileLayout; @@ -42,6 +43,86 @@ use TrueChristianBible\Joomla\Utilities\StringHelper; */ class HtmlView extends BaseHtmlView { + /** + * The item from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $item; + + /** + * The state object + * + * @var mixed + * @since 3.10.11 + */ + public mixed $state; + + /** + * The form from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $form; + + /** + * The toolbar object + * + * @var Toolbar + * @since 3.10.11 + */ + public Toolbar $toolbar; + + /** + * The styles url array + * + * @var array + * @since 5.0.0 + */ + protected array $styles; + + /** + * The scripts url array + * + * @var array + * @since 5.0.0 + */ + protected array $scripts; + + /** + * The actions object + * + * @var object + * @since 3.10.11 + */ + public object $canDo; + + /** + * The origin referral view name + * + * @var string + * @since 3.10.11 + */ + public string $ref; + + /** + * The origin referral item id + * + * @var int + * @since 3.10.11 + */ + public int $refid; + + /** + * The referral url suffix values + * + * @var string + * @since 3.10.11 + */ + public string $referral; + /** * Chapter view display method * @@ -56,7 +137,7 @@ class HtmlView extends BaseHtmlView $this->params = ComponentHelper::getParams('com_getbible'); $this->useCoreUI = true; // Assign the variables - $this->form = $this->get('Form'); + $this->form ??= $this->get('Form'); $this->item = $this->get('Item'); $this->styles = $this->get('Styles'); $this->scripts = $this->get('Scripts'); diff --git a/admin/src/View/Chapters/HtmlView.php b/admin/src/View/Chapters/HtmlView.php index b2dd0cf..7cb13aa 100644 --- a/admin/src/View/Chapters/HtmlView.php +++ b/admin/src/View/Chapters/HtmlView.php @@ -22,6 +22,7 @@ use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; +use Joomla\CMS\User\User; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\FileLayout; @@ -43,6 +44,62 @@ use TrueChristianBible\Joomla\Utilities\StringHelper; */ class HtmlView extends BaseHtmlView { + /** + * The items from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $items; + + /** + * The state object + * + * @var mixed + * @since 3.10.11 + */ + public mixed $state; + + /** + * The styles url array + * + * @var array + * @since 5.0.0 + */ + protected array $styles; + + /** + * The scripts url array + * + * @var array + * @since 5.0.0 + */ + protected array $scripts; + + /** + * The actions object + * + * @var object + * @since 3.10.11 + */ + public object $canDo; + + /** + * The return here base64 url + * + * @var string + * @since 3.10.11 + */ + public string $return_here; + + /** + * The user object. + * + * @var User + * @since 3.10.11 + */ + public User $user; + /** * Chapters view display method * @@ -59,7 +116,7 @@ class HtmlView extends BaseHtmlView $this->state = $this->get('State'); $this->styles = $this->get('Styles'); $this->scripts = $this->get('Scripts'); - $this->user ??= Factory::getApplication()->getIdentity(); + $this->user ??= $this->getCurrentUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. diff --git a/admin/src/View/Linker/HtmlView.php b/admin/src/View/Linker/HtmlView.php index 7802143..33deeb2 100644 --- a/admin/src/View/Linker/HtmlView.php +++ b/admin/src/View/Linker/HtmlView.php @@ -22,6 +22,7 @@ use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; +use Joomla\CMS\User\User; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\FileLayout; @@ -42,6 +43,86 @@ use TrueChristianBible\Joomla\Utilities\StringHelper; */ class HtmlView extends BaseHtmlView { + /** + * The item from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $item; + + /** + * The state object + * + * @var mixed + * @since 3.10.11 + */ + public mixed $state; + + /** + * The form from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $form; + + /** + * The toolbar object + * + * @var Toolbar + * @since 3.10.11 + */ + public Toolbar $toolbar; + + /** + * The styles url array + * + * @var array + * @since 5.0.0 + */ + protected array $styles; + + /** + * The scripts url array + * + * @var array + * @since 5.0.0 + */ + protected array $scripts; + + /** + * The actions object + * + * @var object + * @since 3.10.11 + */ + public object $canDo; + + /** + * The origin referral view name + * + * @var string + * @since 3.10.11 + */ + public string $ref; + + /** + * The origin referral item id + * + * @var int + * @since 3.10.11 + */ + public int $refid; + + /** + * The referral url suffix values + * + * @var string + * @since 3.10.11 + */ + public string $referral; + /** * Linker view display method * @@ -56,7 +137,7 @@ class HtmlView extends BaseHtmlView $this->params = ComponentHelper::getParams('com_getbible'); $this->useCoreUI = true; // Assign the variables - $this->form = $this->get('Form'); + $this->form ??= $this->get('Form'); $this->item = $this->get('Item'); $this->styles = $this->get('Styles'); $this->scripts = $this->get('Scripts'); diff --git a/admin/src/View/Linkers/HtmlView.php b/admin/src/View/Linkers/HtmlView.php index 2bfe5ff..d9a5087 100644 --- a/admin/src/View/Linkers/HtmlView.php +++ b/admin/src/View/Linkers/HtmlView.php @@ -22,6 +22,7 @@ use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; +use Joomla\CMS\User\User; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\FileLayout; @@ -43,6 +44,62 @@ use TrueChristianBible\Joomla\Utilities\StringHelper; */ class HtmlView extends BaseHtmlView { + /** + * The items from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $items; + + /** + * The state object + * + * @var mixed + * @since 3.10.11 + */ + public mixed $state; + + /** + * The styles url array + * + * @var array + * @since 5.0.0 + */ + protected array $styles; + + /** + * The scripts url array + * + * @var array + * @since 5.0.0 + */ + protected array $scripts; + + /** + * The actions object + * + * @var object + * @since 3.10.11 + */ + public object $canDo; + + /** + * The return here base64 url + * + * @var string + * @since 3.10.11 + */ + public string $return_here; + + /** + * The user object. + * + * @var User + * @since 3.10.11 + */ + public User $user; + /** * Linkers view display method * @@ -59,7 +116,7 @@ class HtmlView extends BaseHtmlView $this->state = $this->get('State'); $this->styles = $this->get('Styles'); $this->scripts = $this->get('Scripts'); - $this->user ??= Factory::getApplication()->getIdentity(); + $this->user ??= $this->getCurrentUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. diff --git a/admin/src/View/Note/HtmlView.php b/admin/src/View/Note/HtmlView.php index 1d668c1..4d194fa 100644 --- a/admin/src/View/Note/HtmlView.php +++ b/admin/src/View/Note/HtmlView.php @@ -22,6 +22,7 @@ use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; +use Joomla\CMS\User\User; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\FileLayout; @@ -42,6 +43,86 @@ use TrueChristianBible\Joomla\Utilities\StringHelper; */ class HtmlView extends BaseHtmlView { + /** + * The item from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $item; + + /** + * The state object + * + * @var mixed + * @since 3.10.11 + */ + public mixed $state; + + /** + * The form from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $form; + + /** + * The toolbar object + * + * @var Toolbar + * @since 3.10.11 + */ + public Toolbar $toolbar; + + /** + * The styles url array + * + * @var array + * @since 5.0.0 + */ + protected array $styles; + + /** + * The scripts url array + * + * @var array + * @since 5.0.0 + */ + protected array $scripts; + + /** + * The actions object + * + * @var object + * @since 3.10.11 + */ + public object $canDo; + + /** + * The origin referral view name + * + * @var string + * @since 3.10.11 + */ + public string $ref; + + /** + * The origin referral item id + * + * @var int + * @since 3.10.11 + */ + public int $refid; + + /** + * The referral url suffix values + * + * @var string + * @since 3.10.11 + */ + public string $referral; + /** * Note view display method * @@ -56,7 +137,7 @@ class HtmlView extends BaseHtmlView $this->params = ComponentHelper::getParams('com_getbible'); $this->useCoreUI = true; // Assign the variables - $this->form = $this->get('Form'); + $this->form ??= $this->get('Form'); $this->item = $this->get('Item'); $this->styles = $this->get('Styles'); $this->scripts = $this->get('Scripts'); diff --git a/admin/src/View/Notes/HtmlView.php b/admin/src/View/Notes/HtmlView.php index cbac0c3..2e949f6 100644 --- a/admin/src/View/Notes/HtmlView.php +++ b/admin/src/View/Notes/HtmlView.php @@ -22,6 +22,7 @@ use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; +use Joomla\CMS\User\User; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\FileLayout; @@ -43,6 +44,62 @@ use TrueChristianBible\Joomla\Utilities\StringHelper; */ class HtmlView extends BaseHtmlView { + /** + * The items from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $items; + + /** + * The state object + * + * @var mixed + * @since 3.10.11 + */ + public mixed $state; + + /** + * The styles url array + * + * @var array + * @since 5.0.0 + */ + protected array $styles; + + /** + * The scripts url array + * + * @var array + * @since 5.0.0 + */ + protected array $scripts; + + /** + * The actions object + * + * @var object + * @since 3.10.11 + */ + public object $canDo; + + /** + * The return here base64 url + * + * @var string + * @since 3.10.11 + */ + public string $return_here; + + /** + * The user object. + * + * @var User + * @since 3.10.11 + */ + public User $user; + /** * Notes view display method * @@ -59,7 +116,7 @@ class HtmlView extends BaseHtmlView $this->state = $this->get('State'); $this->styles = $this->get('Styles'); $this->scripts = $this->get('Scripts'); - $this->user ??= Factory::getApplication()->getIdentity(); + $this->user ??= $this->getCurrentUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. diff --git a/admin/src/View/Open_ai_message/HtmlView.php b/admin/src/View/Open_ai_message/HtmlView.php index 0bb31c4..bdc9260 100644 --- a/admin/src/View/Open_ai_message/HtmlView.php +++ b/admin/src/View/Open_ai_message/HtmlView.php @@ -22,6 +22,7 @@ use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; +use Joomla\CMS\User\User; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\FileLayout; @@ -42,6 +43,86 @@ use TrueChristianBible\Joomla\Utilities\StringHelper; */ class HtmlView extends BaseHtmlView { + /** + * The item from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $item; + + /** + * The state object + * + * @var mixed + * @since 3.10.11 + */ + public mixed $state; + + /** + * The form from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $form; + + /** + * The toolbar object + * + * @var Toolbar + * @since 3.10.11 + */ + public Toolbar $toolbar; + + /** + * The styles url array + * + * @var array + * @since 5.0.0 + */ + protected array $styles; + + /** + * The scripts url array + * + * @var array + * @since 5.0.0 + */ + protected array $scripts; + + /** + * The actions object + * + * @var object + * @since 3.10.11 + */ + public object $canDo; + + /** + * The origin referral view name + * + * @var string + * @since 3.10.11 + */ + public string $ref; + + /** + * The origin referral item id + * + * @var int + * @since 3.10.11 + */ + public int $refid; + + /** + * The referral url suffix values + * + * @var string + * @since 3.10.11 + */ + public string $referral; + /** * Open_ai_message view display method * @@ -56,7 +137,7 @@ class HtmlView extends BaseHtmlView $this->params = ComponentHelper::getParams('com_getbible'); $this->useCoreUI = true; // Assign the variables - $this->form = $this->get('Form'); + $this->form ??= $this->get('Form'); $this->item = $this->get('Item'); $this->styles = $this->get('Styles'); $this->scripts = $this->get('Scripts'); diff --git a/admin/src/View/Open_ai_messages/HtmlView.php b/admin/src/View/Open_ai_messages/HtmlView.php index 937e82f..dc9c422 100644 --- a/admin/src/View/Open_ai_messages/HtmlView.php +++ b/admin/src/View/Open_ai_messages/HtmlView.php @@ -22,6 +22,7 @@ use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; +use Joomla\CMS\User\User; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\FileLayout; @@ -43,6 +44,62 @@ use TrueChristianBible\Joomla\Utilities\StringHelper; */ class HtmlView extends BaseHtmlView { + /** + * The items from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $items; + + /** + * The state object + * + * @var mixed + * @since 3.10.11 + */ + public mixed $state; + + /** + * The styles url array + * + * @var array + * @since 5.0.0 + */ + protected array $styles; + + /** + * The scripts url array + * + * @var array + * @since 5.0.0 + */ + protected array $scripts; + + /** + * The actions object + * + * @var object + * @since 3.10.11 + */ + public object $canDo; + + /** + * The return here base64 url + * + * @var string + * @since 3.10.11 + */ + public string $return_here; + + /** + * The user object. + * + * @var User + * @since 3.10.11 + */ + public User $user; + /** * Open_ai_messages view display method * @@ -59,7 +116,7 @@ class HtmlView extends BaseHtmlView $this->state = $this->get('State'); $this->styles = $this->get('Styles'); $this->scripts = $this->get('Scripts'); - $this->user ??= Factory::getApplication()->getIdentity(); + $this->user ??= $this->getCurrentUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. diff --git a/admin/src/View/Open_ai_response/HtmlView.php b/admin/src/View/Open_ai_response/HtmlView.php index 547fead..58e830b 100644 --- a/admin/src/View/Open_ai_response/HtmlView.php +++ b/admin/src/View/Open_ai_response/HtmlView.php @@ -22,6 +22,7 @@ use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; +use Joomla\CMS\User\User; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\FileLayout; @@ -42,6 +43,86 @@ use TrueChristianBible\Joomla\Utilities\StringHelper; */ class HtmlView extends BaseHtmlView { + /** + * The item from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $item; + + /** + * The state object + * + * @var mixed + * @since 3.10.11 + */ + public mixed $state; + + /** + * The form from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $form; + + /** + * The toolbar object + * + * @var Toolbar + * @since 3.10.11 + */ + public Toolbar $toolbar; + + /** + * The styles url array + * + * @var array + * @since 5.0.0 + */ + protected array $styles; + + /** + * The scripts url array + * + * @var array + * @since 5.0.0 + */ + protected array $scripts; + + /** + * The actions object + * + * @var object + * @since 3.10.11 + */ + public object $canDo; + + /** + * The origin referral view name + * + * @var string + * @since 3.10.11 + */ + public string $ref; + + /** + * The origin referral item id + * + * @var int + * @since 3.10.11 + */ + public int $refid; + + /** + * The referral url suffix values + * + * @var string + * @since 3.10.11 + */ + public string $referral; + /** * Open_ai_response view display method * @@ -56,7 +137,7 @@ class HtmlView extends BaseHtmlView $this->params = ComponentHelper::getParams('com_getbible'); $this->useCoreUI = true; // Assign the variables - $this->form = $this->get('Form'); + $this->form ??= $this->get('Form'); $this->item = $this->get('Item'); $this->styles = $this->get('Styles'); $this->scripts = $this->get('Scripts'); diff --git a/admin/src/View/Open_ai_responses/HtmlView.php b/admin/src/View/Open_ai_responses/HtmlView.php index 2eded6f..340019b 100644 --- a/admin/src/View/Open_ai_responses/HtmlView.php +++ b/admin/src/View/Open_ai_responses/HtmlView.php @@ -22,6 +22,7 @@ use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; +use Joomla\CMS\User\User; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\FileLayout; @@ -43,6 +44,62 @@ use TrueChristianBible\Joomla\Utilities\StringHelper; */ class HtmlView extends BaseHtmlView { + /** + * The items from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $items; + + /** + * The state object + * + * @var mixed + * @since 3.10.11 + */ + public mixed $state; + + /** + * The styles url array + * + * @var array + * @since 5.0.0 + */ + protected array $styles; + + /** + * The scripts url array + * + * @var array + * @since 5.0.0 + */ + protected array $scripts; + + /** + * The actions object + * + * @var object + * @since 3.10.11 + */ + public object $canDo; + + /** + * The return here base64 url + * + * @var string + * @since 3.10.11 + */ + public string $return_here; + + /** + * The user object. + * + * @var User + * @since 3.10.11 + */ + public User $user; + /** * Open_ai_responses view display method * @@ -59,7 +116,7 @@ class HtmlView extends BaseHtmlView $this->state = $this->get('State'); $this->styles = $this->get('Styles'); $this->scripts = $this->get('Scripts'); - $this->user ??= Factory::getApplication()->getIdentity(); + $this->user ??= $this->getCurrentUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. diff --git a/admin/src/View/Password/HtmlView.php b/admin/src/View/Password/HtmlView.php index 5bd900d..d04745e 100644 --- a/admin/src/View/Password/HtmlView.php +++ b/admin/src/View/Password/HtmlView.php @@ -22,6 +22,7 @@ use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; +use Joomla\CMS\User\User; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\FileLayout; @@ -42,6 +43,86 @@ use TrueChristianBible\Joomla\Utilities\StringHelper; */ class HtmlView extends BaseHtmlView { + /** + * The item from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $item; + + /** + * The state object + * + * @var mixed + * @since 3.10.11 + */ + public mixed $state; + + /** + * The form from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $form; + + /** + * The toolbar object + * + * @var Toolbar + * @since 3.10.11 + */ + public Toolbar $toolbar; + + /** + * The styles url array + * + * @var array + * @since 5.0.0 + */ + protected array $styles; + + /** + * The scripts url array + * + * @var array + * @since 5.0.0 + */ + protected array $scripts; + + /** + * The actions object + * + * @var object + * @since 3.10.11 + */ + public object $canDo; + + /** + * The origin referral view name + * + * @var string + * @since 3.10.11 + */ + public string $ref; + + /** + * The origin referral item id + * + * @var int + * @since 3.10.11 + */ + public int $refid; + + /** + * The referral url suffix values + * + * @var string + * @since 3.10.11 + */ + public string $referral; + /** * Password view display method * @@ -56,7 +137,7 @@ class HtmlView extends BaseHtmlView $this->params = ComponentHelper::getParams('com_getbible'); $this->useCoreUI = true; // Assign the variables - $this->form = $this->get('Form'); + $this->form ??= $this->get('Form'); $this->item = $this->get('Item'); $this->styles = $this->get('Styles'); $this->scripts = $this->get('Scripts'); diff --git a/admin/src/View/Passwords/HtmlView.php b/admin/src/View/Passwords/HtmlView.php index 5ae1da1..e121c10 100644 --- a/admin/src/View/Passwords/HtmlView.php +++ b/admin/src/View/Passwords/HtmlView.php @@ -22,6 +22,7 @@ use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; +use Joomla\CMS\User\User; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\FileLayout; @@ -43,6 +44,62 @@ use TrueChristianBible\Joomla\Utilities\StringHelper; */ class HtmlView extends BaseHtmlView { + /** + * The items from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $items; + + /** + * The state object + * + * @var mixed + * @since 3.10.11 + */ + public mixed $state; + + /** + * The styles url array + * + * @var array + * @since 5.0.0 + */ + protected array $styles; + + /** + * The scripts url array + * + * @var array + * @since 5.0.0 + */ + protected array $scripts; + + /** + * The actions object + * + * @var object + * @since 3.10.11 + */ + public object $canDo; + + /** + * The return here base64 url + * + * @var string + * @since 3.10.11 + */ + public string $return_here; + + /** + * The user object. + * + * @var User + * @since 3.10.11 + */ + public User $user; + /** * Passwords view display method * @@ -59,7 +116,7 @@ class HtmlView extends BaseHtmlView $this->state = $this->get('State'); $this->styles = $this->get('Styles'); $this->scripts = $this->get('Scripts'); - $this->user ??= Factory::getApplication()->getIdentity(); + $this->user ??= $this->getCurrentUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. diff --git a/admin/src/View/Prompt/HtmlView.php b/admin/src/View/Prompt/HtmlView.php index 5c6480c..5a11b78 100644 --- a/admin/src/View/Prompt/HtmlView.php +++ b/admin/src/View/Prompt/HtmlView.php @@ -22,6 +22,7 @@ use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; +use Joomla\CMS\User\User; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\FileLayout; @@ -42,6 +43,86 @@ use TrueChristianBible\Joomla\Utilities\StringHelper; */ class HtmlView extends BaseHtmlView { + /** + * The item from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $item; + + /** + * The state object + * + * @var mixed + * @since 3.10.11 + */ + public mixed $state; + + /** + * The form from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $form; + + /** + * The toolbar object + * + * @var Toolbar + * @since 3.10.11 + */ + public Toolbar $toolbar; + + /** + * The styles url array + * + * @var array + * @since 5.0.0 + */ + protected array $styles; + + /** + * The scripts url array + * + * @var array + * @since 5.0.0 + */ + protected array $scripts; + + /** + * The actions object + * + * @var object + * @since 3.10.11 + */ + public object $canDo; + + /** + * The origin referral view name + * + * @var string + * @since 3.10.11 + */ + public string $ref; + + /** + * The origin referral item id + * + * @var int + * @since 3.10.11 + */ + public int $refid; + + /** + * The referral url suffix values + * + * @var string + * @since 3.10.11 + */ + public string $referral; + /** * Prompt view display method * @@ -56,7 +137,7 @@ class HtmlView extends BaseHtmlView $this->params = ComponentHelper::getParams('com_getbible'); $this->useCoreUI = true; // Assign the variables - $this->form = $this->get('Form'); + $this->form ??= $this->get('Form'); $this->item = $this->get('Item'); $this->styles = $this->get('Styles'); $this->scripts = $this->get('Scripts'); diff --git a/admin/src/View/Prompts/HtmlView.php b/admin/src/View/Prompts/HtmlView.php index acbb1bb..715f3b7 100644 --- a/admin/src/View/Prompts/HtmlView.php +++ b/admin/src/View/Prompts/HtmlView.php @@ -22,6 +22,7 @@ use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; +use Joomla\CMS\User\User; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\FileLayout; @@ -43,6 +44,62 @@ use TrueChristianBible\Joomla\Utilities\StringHelper; */ class HtmlView extends BaseHtmlView { + /** + * The items from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $items; + + /** + * The state object + * + * @var mixed + * @since 3.10.11 + */ + public mixed $state; + + /** + * The styles url array + * + * @var array + * @since 5.0.0 + */ + protected array $styles; + + /** + * The scripts url array + * + * @var array + * @since 5.0.0 + */ + protected array $scripts; + + /** + * The actions object + * + * @var object + * @since 3.10.11 + */ + public object $canDo; + + /** + * The return here base64 url + * + * @var string + * @since 3.10.11 + */ + public string $return_here; + + /** + * The user object. + * + * @var User + * @since 3.10.11 + */ + public User $user; + /** * Prompts view display method * @@ -59,7 +116,7 @@ class HtmlView extends BaseHtmlView $this->state = $this->get('State'); $this->styles = $this->get('Styles'); $this->scripts = $this->get('Scripts'); - $this->user ??= Factory::getApplication()->getIdentity(); + $this->user ??= $this->getCurrentUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. diff --git a/admin/src/View/Tag/HtmlView.php b/admin/src/View/Tag/HtmlView.php index d6eb7d2..d0fbee7 100644 --- a/admin/src/View/Tag/HtmlView.php +++ b/admin/src/View/Tag/HtmlView.php @@ -22,6 +22,7 @@ use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; +use Joomla\CMS\User\User; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\FileLayout; @@ -42,6 +43,86 @@ use TrueChristianBible\Joomla\Utilities\StringHelper; */ class HtmlView extends BaseHtmlView { + /** + * The item from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $item; + + /** + * The state object + * + * @var mixed + * @since 3.10.11 + */ + public mixed $state; + + /** + * The form from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $form; + + /** + * The toolbar object + * + * @var Toolbar + * @since 3.10.11 + */ + public Toolbar $toolbar; + + /** + * The styles url array + * + * @var array + * @since 5.0.0 + */ + protected array $styles; + + /** + * The scripts url array + * + * @var array + * @since 5.0.0 + */ + protected array $scripts; + + /** + * The actions object + * + * @var object + * @since 3.10.11 + */ + public object $canDo; + + /** + * The origin referral view name + * + * @var string + * @since 3.10.11 + */ + public string $ref; + + /** + * The origin referral item id + * + * @var int + * @since 3.10.11 + */ + public int $refid; + + /** + * The referral url suffix values + * + * @var string + * @since 3.10.11 + */ + public string $referral; + /** * Tag view display method * @@ -56,7 +137,7 @@ class HtmlView extends BaseHtmlView $this->params = ComponentHelper::getParams('com_getbible'); $this->useCoreUI = true; // Assign the variables - $this->form = $this->get('Form'); + $this->form ??= $this->get('Form'); $this->item = $this->get('Item'); $this->styles = $this->get('Styles'); $this->scripts = $this->get('Scripts'); diff --git a/admin/src/View/Tagged_verse/HtmlView.php b/admin/src/View/Tagged_verse/HtmlView.php index d413523..239253d 100644 --- a/admin/src/View/Tagged_verse/HtmlView.php +++ b/admin/src/View/Tagged_verse/HtmlView.php @@ -22,6 +22,7 @@ use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; +use Joomla\CMS\User\User; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\FileLayout; @@ -42,6 +43,86 @@ use TrueChristianBible\Joomla\Utilities\StringHelper; */ class HtmlView extends BaseHtmlView { + /** + * The item from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $item; + + /** + * The state object + * + * @var mixed + * @since 3.10.11 + */ + public mixed $state; + + /** + * The form from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $form; + + /** + * The toolbar object + * + * @var Toolbar + * @since 3.10.11 + */ + public Toolbar $toolbar; + + /** + * The styles url array + * + * @var array + * @since 5.0.0 + */ + protected array $styles; + + /** + * The scripts url array + * + * @var array + * @since 5.0.0 + */ + protected array $scripts; + + /** + * The actions object + * + * @var object + * @since 3.10.11 + */ + public object $canDo; + + /** + * The origin referral view name + * + * @var string + * @since 3.10.11 + */ + public string $ref; + + /** + * The origin referral item id + * + * @var int + * @since 3.10.11 + */ + public int $refid; + + /** + * The referral url suffix values + * + * @var string + * @since 3.10.11 + */ + public string $referral; + /** * Tagged_verse view display method * @@ -56,7 +137,7 @@ class HtmlView extends BaseHtmlView $this->params = ComponentHelper::getParams('com_getbible'); $this->useCoreUI = true; // Assign the variables - $this->form = $this->get('Form'); + $this->form ??= $this->get('Form'); $this->item = $this->get('Item'); $this->styles = $this->get('Styles'); $this->scripts = $this->get('Scripts'); diff --git a/admin/src/View/Tagged_verses/HtmlView.php b/admin/src/View/Tagged_verses/HtmlView.php index 7327867..44b10ed 100644 --- a/admin/src/View/Tagged_verses/HtmlView.php +++ b/admin/src/View/Tagged_verses/HtmlView.php @@ -22,6 +22,7 @@ use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; +use Joomla\CMS\User\User; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\FileLayout; @@ -43,6 +44,62 @@ use TrueChristianBible\Joomla\Utilities\StringHelper; */ class HtmlView extends BaseHtmlView { + /** + * The items from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $items; + + /** + * The state object + * + * @var mixed + * @since 3.10.11 + */ + public mixed $state; + + /** + * The styles url array + * + * @var array + * @since 5.0.0 + */ + protected array $styles; + + /** + * The scripts url array + * + * @var array + * @since 5.0.0 + */ + protected array $scripts; + + /** + * The actions object + * + * @var object + * @since 3.10.11 + */ + public object $canDo; + + /** + * The return here base64 url + * + * @var string + * @since 3.10.11 + */ + public string $return_here; + + /** + * The user object. + * + * @var User + * @since 3.10.11 + */ + public User $user; + /** * Tagged_verses view display method * @@ -59,7 +116,7 @@ class HtmlView extends BaseHtmlView $this->state = $this->get('State'); $this->styles = $this->get('Styles'); $this->scripts = $this->get('Scripts'); - $this->user ??= Factory::getApplication()->getIdentity(); + $this->user ??= $this->getCurrentUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. diff --git a/admin/src/View/Tags/HtmlView.php b/admin/src/View/Tags/HtmlView.php index 9e88357..53393af 100644 --- a/admin/src/View/Tags/HtmlView.php +++ b/admin/src/View/Tags/HtmlView.php @@ -22,6 +22,7 @@ use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; +use Joomla\CMS\User\User; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\FileLayout; @@ -43,6 +44,62 @@ use TrueChristianBible\Joomla\Utilities\StringHelper; */ class HtmlView extends BaseHtmlView { + /** + * The items from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $items; + + /** + * The state object + * + * @var mixed + * @since 3.10.11 + */ + public mixed $state; + + /** + * The styles url array + * + * @var array + * @since 5.0.0 + */ + protected array $styles; + + /** + * The scripts url array + * + * @var array + * @since 5.0.0 + */ + protected array $scripts; + + /** + * The actions object + * + * @var object + * @since 3.10.11 + */ + public object $canDo; + + /** + * The return here base64 url + * + * @var string + * @since 3.10.11 + */ + public string $return_here; + + /** + * The user object. + * + * @var User + * @since 3.10.11 + */ + public User $user; + /** * Tags view display method * @@ -59,7 +116,7 @@ class HtmlView extends BaseHtmlView $this->state = $this->get('State'); $this->styles = $this->get('Styles'); $this->scripts = $this->get('Scripts'); - $this->user ??= Factory::getApplication()->getIdentity(); + $this->user ??= $this->getCurrentUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. diff --git a/admin/src/View/Translation/HtmlView.php b/admin/src/View/Translation/HtmlView.php index e217189..6fc8b5b 100644 --- a/admin/src/View/Translation/HtmlView.php +++ b/admin/src/View/Translation/HtmlView.php @@ -22,6 +22,7 @@ use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; +use Joomla\CMS\User\User; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\FileLayout; @@ -42,6 +43,86 @@ use TrueChristianBible\Joomla\Utilities\StringHelper; */ class HtmlView extends BaseHtmlView { + /** + * The item from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $item; + + /** + * The state object + * + * @var mixed + * @since 3.10.11 + */ + public mixed $state; + + /** + * The form from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $form; + + /** + * The toolbar object + * + * @var Toolbar + * @since 3.10.11 + */ + public Toolbar $toolbar; + + /** + * The styles url array + * + * @var array + * @since 5.0.0 + */ + protected array $styles; + + /** + * The scripts url array + * + * @var array + * @since 5.0.0 + */ + protected array $scripts; + + /** + * The actions object + * + * @var object + * @since 3.10.11 + */ + public object $canDo; + + /** + * The origin referral view name + * + * @var string + * @since 3.10.11 + */ + public string $ref; + + /** + * The origin referral item id + * + * @var int + * @since 3.10.11 + */ + public int $refid; + + /** + * The referral url suffix values + * + * @var string + * @since 3.10.11 + */ + public string $referral; + /** * Translation view display method * @@ -56,7 +137,7 @@ class HtmlView extends BaseHtmlView $this->params = ComponentHelper::getParams('com_getbible'); $this->useCoreUI = true; // Assign the variables - $this->form = $this->get('Form'); + $this->form ??= $this->get('Form'); $this->item = $this->get('Item'); $this->styles = $this->get('Styles'); $this->scripts = $this->get('Scripts'); diff --git a/admin/src/View/Translations/HtmlView.php b/admin/src/View/Translations/HtmlView.php index 311571c..ab4bc4f 100644 --- a/admin/src/View/Translations/HtmlView.php +++ b/admin/src/View/Translations/HtmlView.php @@ -22,6 +22,7 @@ use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; +use Joomla\CMS\User\User; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\FileLayout; @@ -43,6 +44,62 @@ use TrueChristianBible\Joomla\Utilities\StringHelper; */ class HtmlView extends BaseHtmlView { + /** + * The items from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $items; + + /** + * The state object + * + * @var mixed + * @since 3.10.11 + */ + public mixed $state; + + /** + * The styles url array + * + * @var array + * @since 5.0.0 + */ + protected array $styles; + + /** + * The scripts url array + * + * @var array + * @since 5.0.0 + */ + protected array $scripts; + + /** + * The actions object + * + * @var object + * @since 3.10.11 + */ + public object $canDo; + + /** + * The return here base64 url + * + * @var string + * @since 3.10.11 + */ + public string $return_here; + + /** + * The user object. + * + * @var User + * @since 3.10.11 + */ + public User $user; + /** * Translations view display method * @@ -59,7 +116,7 @@ class HtmlView extends BaseHtmlView $this->state = $this->get('State'); $this->styles = $this->get('Styles'); $this->scripts = $this->get('Scripts'); - $this->user ??= Factory::getApplication()->getIdentity(); + $this->user ??= $this->getCurrentUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. diff --git a/admin/src/View/Verse/HtmlView.php b/admin/src/View/Verse/HtmlView.php index 1b93347..6c211c1 100644 --- a/admin/src/View/Verse/HtmlView.php +++ b/admin/src/View/Verse/HtmlView.php @@ -22,6 +22,7 @@ use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; +use Joomla\CMS\User\User; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\FileLayout; @@ -42,6 +43,86 @@ use TrueChristianBible\Joomla\Utilities\StringHelper; */ class HtmlView extends BaseHtmlView { + /** + * The item from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $item; + + /** + * The state object + * + * @var mixed + * @since 3.10.11 + */ + public mixed $state; + + /** + * The form from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $form; + + /** + * The toolbar object + * + * @var Toolbar + * @since 3.10.11 + */ + public Toolbar $toolbar; + + /** + * The styles url array + * + * @var array + * @since 5.0.0 + */ + protected array $styles; + + /** + * The scripts url array + * + * @var array + * @since 5.0.0 + */ + protected array $scripts; + + /** + * The actions object + * + * @var object + * @since 3.10.11 + */ + public object $canDo; + + /** + * The origin referral view name + * + * @var string + * @since 3.10.11 + */ + public string $ref; + + /** + * The origin referral item id + * + * @var int + * @since 3.10.11 + */ + public int $refid; + + /** + * The referral url suffix values + * + * @var string + * @since 3.10.11 + */ + public string $referral; + /** * Verse view display method * @@ -56,7 +137,7 @@ class HtmlView extends BaseHtmlView $this->params = ComponentHelper::getParams('com_getbible'); $this->useCoreUI = true; // Assign the variables - $this->form = $this->get('Form'); + $this->form ??= $this->get('Form'); $this->item = $this->get('Item'); $this->styles = $this->get('Styles'); $this->scripts = $this->get('Scripts'); diff --git a/admin/src/View/Verses/HtmlView.php b/admin/src/View/Verses/HtmlView.php index 8e88bb3..dca1fa6 100644 --- a/admin/src/View/Verses/HtmlView.php +++ b/admin/src/View/Verses/HtmlView.php @@ -22,6 +22,7 @@ use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; +use Joomla\CMS\User\User; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\FileLayout; @@ -43,6 +44,62 @@ use TrueChristianBible\Joomla\Utilities\StringHelper; */ class HtmlView extends BaseHtmlView { + /** + * The items from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $items; + + /** + * The state object + * + * @var mixed + * @since 3.10.11 + */ + public mixed $state; + + /** + * The styles url array + * + * @var array + * @since 5.0.0 + */ + protected array $styles; + + /** + * The scripts url array + * + * @var array + * @since 5.0.0 + */ + protected array $scripts; + + /** + * The actions object + * + * @var object + * @since 3.10.11 + */ + public object $canDo; + + /** + * The return here base64 url + * + * @var string + * @since 3.10.11 + */ + public string $return_here; + + /** + * The user object. + * + * @var User + * @since 3.10.11 + */ + public User $user; + /** * Verses view display method * @@ -59,7 +116,7 @@ class HtmlView extends BaseHtmlView $this->state = $this->get('State'); $this->styles = $this->get('Styles'); $this->scripts = $this->get('Scripts'); - $this->user ??= Factory::getApplication()->getIdentity(); + $this->user ??= $this->getCurrentUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. diff --git a/admin/tmpl/book/default.php b/admin/tmpl/book/default.php index 1f2469e..948a7d8 100644 --- a/admin/tmpl/book/default.php +++ b/admin/tmpl/book/default.php @@ -86,14 +86,10 @@ defined('_JEXEC') or die;
-
-
- form->getFieldset('accesscontrol') as $field): ?> -
- label; echo $field->input;?> -
-
- +
+ +
+ form->getInput('rules'); ?>
diff --git a/admin/tmpl/chapter/default.php b/admin/tmpl/chapter/default.php index 855fa3d..9efadf3 100644 --- a/admin/tmpl/chapter/default.php +++ b/admin/tmpl/chapter/default.php @@ -86,14 +86,10 @@ defined('_JEXEC') or die;
-
-
- form->getFieldset('accesscontrol') as $field): ?> -
- label; echo $field->input;?> -
-
- +
+ +
+ form->getInput('rules'); ?>
diff --git a/admin/tmpl/linker/default.php b/admin/tmpl/linker/default.php index ffaa752..bbe47b0 100644 --- a/admin/tmpl/linker/default.php +++ b/admin/tmpl/linker/default.php @@ -122,14 +122,10 @@ defined('_JEXEC') or die;
-
-
- form->getFieldset('accesscontrol') as $field): ?> -
- label; echo $field->input;?> -
-
- +
+ +
+ form->getInput('rules'); ?>
diff --git a/admin/tmpl/note/default.php b/admin/tmpl/note/default.php index 1a960ce..b5c9a2a 100644 --- a/admin/tmpl/note/default.php +++ b/admin/tmpl/note/default.php @@ -86,14 +86,10 @@ defined('_JEXEC') or die;
-
-
- form->getFieldset('accesscontrol') as $field): ?> -
- label; echo $field->input;?> -
-
- +
+ +
+ form->getInput('rules'); ?>
diff --git a/admin/tmpl/open_ai_message/default.php b/admin/tmpl/open_ai_message/default.php index 2c0d51e..b5cc621 100644 --- a/admin/tmpl/open_ai_message/default.php +++ b/admin/tmpl/open_ai_message/default.php @@ -91,14 +91,10 @@ defined('_JEXEC') or die;
-
-
- form->getFieldset('accesscontrol') as $field): ?> -
- label; echo $field->input;?> -
-
- +
+ +
+ form->getInput('rules'); ?>
diff --git a/admin/tmpl/open_ai_response/default.php b/admin/tmpl/open_ai_response/default.php index 8dc964e..44dda04 100644 --- a/admin/tmpl/open_ai_response/default.php +++ b/admin/tmpl/open_ai_response/default.php @@ -120,14 +120,10 @@ defined('_JEXEC') or die;
-
-
- form->getFieldset('accesscontrol') as $field): ?> -
- label; echo $field->input;?> -
-
- +
+ +
+ form->getInput('rules'); ?>
diff --git a/admin/tmpl/password/default.php b/admin/tmpl/password/default.php index 2186a9b..c805f7d 100644 --- a/admin/tmpl/password/default.php +++ b/admin/tmpl/password/default.php @@ -86,14 +86,10 @@ defined('_JEXEC') or die;
-
-
- form->getFieldset('accesscontrol') as $field): ?> -
- label; echo $field->input;?> -
-
- +
+ +
+ form->getInput('rules'); ?>
diff --git a/admin/tmpl/prompt/default.php b/admin/tmpl/prompt/default.php index 7686b45..548a8a8 100644 --- a/admin/tmpl/prompt/default.php +++ b/admin/tmpl/prompt/default.php @@ -102,14 +102,10 @@ defined('_JEXEC') or die;
-
-
- form->getFieldset('accesscontrol') as $field): ?> -
- label; echo $field->input;?> -
-
- +
+ +
+ form->getInput('rules'); ?>
diff --git a/admin/tmpl/tag/default.php b/admin/tmpl/tag/default.php index 82fe5cd..eabc623 100644 --- a/admin/tmpl/tag/default.php +++ b/admin/tmpl/tag/default.php @@ -88,14 +88,10 @@ defined('_JEXEC') or die;
-
-
- form->getFieldset('accesscontrol') as $field): ?> -
- label; echo $field->input;?> -
-
- +
+ +
+ form->getInput('rules'); ?>
diff --git a/admin/tmpl/tagged_verse/default.php b/admin/tmpl/tagged_verse/default.php index 56ab900..3f9c051 100644 --- a/admin/tmpl/tagged_verse/default.php +++ b/admin/tmpl/tagged_verse/default.php @@ -86,14 +86,10 @@ defined('_JEXEC') or die;
-
-
- form->getFieldset('accesscontrol') as $field): ?> -
- label; echo $field->input;?> -
-
- +
+ +
+ form->getInput('rules'); ?>
diff --git a/admin/tmpl/translation/default.php b/admin/tmpl/translation/default.php index acb3be2..69c0c38 100644 --- a/admin/tmpl/translation/default.php +++ b/admin/tmpl/translation/default.php @@ -91,14 +91,10 @@ defined('_JEXEC') or die;
-
-
- form->getFieldset('accesscontrol') as $field): ?> -
- label; echo $field->input;?> -
-
- +
+ +
+ form->getInput('rules'); ?>
diff --git a/admin/tmpl/verse/default.php b/admin/tmpl/verse/default.php index 00c261f..d99e69f 100644 --- a/admin/tmpl/verse/default.php +++ b/admin/tmpl/verse/default.php @@ -91,14 +91,10 @@ defined('_JEXEC') or die;
-
-
- form->getFieldset('accesscontrol') as $field): ?> -
- label; echo $field->input;?> -
-
- +
+ +
+ form->getInput('rules'); ?>
diff --git a/getbible.xml b/getbible.xml index 63006cd..0ac6459 100644 --- a/getbible.xml +++ b/getbible.xml @@ -1,15 +1,15 @@ COM_GETBIBLE - 15th July, 2024 + 29th July, 2024 Llewellyn van der Merwe joomla@vdm.io https://getbible.net Copyright (C) 2015. All Rights Reserved GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html - 4.0.15-alpha3 + 4.0.15-alpha4 Get Bible (v.4.0.15-alpha3) +

Get Bible (v.4.0.15-alpha4)

Welcome to the next level of scripture engagement - The Bible for Joomla! Our purpose is to bring the Word of God to every person, in their native language, entirely free. This isn't just a typical extension; it's a groundbreaking tool developed to span language divides and deliver a rich, customizable Bible study experience to users worldwide. diff --git a/libraries/vendor_getbible/TrueChristianBible.Joomla.Gitea/src/Abstraction/Api.php b/libraries/vendor_getbible/TrueChristianBible.Joomla.Gitea/src/Abstraction/Api.php index 31ee77b..1af2613 100644 --- a/libraries/vendor_getbible/TrueChristianBible.Joomla.Gitea/src/Abstraction/Api.php +++ b/libraries/vendor_getbible/TrueChristianBible.Joomla.Gitea/src/Abstraction/Api.php @@ -15,6 +15,7 @@ namespace TrueChristianBible\Joomla\Gitea\Abstraction; use TrueChristianBible\Joomla\Gitea\Utilities\Http; use TrueChristianBible\Joomla\Gitea\Utilities\Uri; use TrueChristianBible\Joomla\Gitea\Utilities\Response; +use TrueChristianBible\Joomla\Interfaces\Git\ApiInterface; /** @@ -22,7 +23,7 @@ use TrueChristianBible\Joomla\Gitea\Utilities\Response; * * @since 3.2.0 */ -abstract class Api +abstract class Api implements ApiInterface { /** * The Http class diff --git a/libraries/vendor_getbible/TrueChristianBible.Joomla.Gitea/src/Repository/Contents.php b/libraries/vendor_getbible/TrueChristianBible.Joomla.Gitea/src/Repository/Contents.php index 5fee209..73ce18c 100644 --- a/libraries/vendor_getbible/TrueChristianBible.Joomla.Gitea/src/Repository/Contents.php +++ b/libraries/vendor_getbible/TrueChristianBible.Joomla.Gitea/src/Repository/Contents.php @@ -12,6 +12,7 @@ namespace TrueChristianBible\Joomla\Gitea\Repository; +use TrueChristianBible\Joomla\Interfaces\Git\Repository\ContentsInterface; use TrueChristianBible\Joomla\Gitea\Abstraction\Api; @@ -20,7 +21,7 @@ use TrueChristianBible\Joomla\Gitea\Abstraction\Api; * * @since 3.2.0 */ -class Contents extends Api +class Contents extends Api implements ContentsInterface { /** * Get a file from a repository. @@ -345,20 +346,20 @@ class Contents extends Api /** * Delete a file in a repository. * - * @param string $owner The owner name. - * @param string $repo The repository name. - * @param string $filepath The file path. - * @param string $message The commit message. - * @param string $branch The branch name (optional). - * @param string $sha The blob SHA of the file. - * @param string $authorName The author name (optional). - * @param string $authorEmail The author email (optional). - * @param string $committerName The committer name (optional). - * @param string $committerEmail The committer email (optional). - * @param string $authorDate The author date (optional). - * @param string $committerDate The committer date (optional). - * @param string $newBranch The new branch name (optional). - * @param bool $signoff Add a Signed-off-by trailer (optional). + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $filepath The file path. + * @param string $message The commit message. + * @param string $sha The blob SHA of the file. + * @param string|null $branch The branch name (optional). + * @param string|null $authorName The author name (optional). + * @param string|null $authorEmail The author email (optional). + * @param string|null $committerName The committer name (optional). + * @param string|null $committerEmail The committer email (optional). + * @param string|null $authorDate The author date (optional). + * @param string|null $committerDate The committer date (optional). + * @param string|null $newBranch The new branch name (optional). + * @param bool|null $signoff Add a Signed-off-by trailer (optional). * * @return object|null * @since 3.2.0 @@ -449,7 +450,7 @@ class Contents extends Api // Send the delete request. return $this->response->get( $this->http->delete( - $this->uri->get($path), + $this->uri->get($path), [], null, json_encode($data) ) ); @@ -458,10 +459,10 @@ class Contents extends Api /** * Get the EditorConfig definitions of a file in a repository. * - * @param string $owner The owner name. - * @param string $repo The repository name. - * @param string $filepath The file path. - * @param string $ref The name of the commit/branch/tag. + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $filepath The file path. + * @param string|null $ref The name of the commit/branch/tag. * * @return string|null * @since 3.2.0 diff --git a/libraries/vendor_getbible/TrueChristianBible.Joomla.Gitea/src/Utilities/Http.php b/libraries/vendor_getbible/TrueChristianBible.Joomla.Gitea/src/Utilities/Http.php index d0f9340..e000697 100644 --- a/libraries/vendor_getbible/TrueChristianBible.Joomla.Gitea/src/Utilities/Http.php +++ b/libraries/vendor_getbible/TrueChristianBible.Joomla.Gitea/src/Utilities/Http.php @@ -13,7 +13,9 @@ namespace TrueChristianBible\Joomla\Gitea\Utilities; use Joomla\CMS\Http\Http as JoomlaHttp; -use Joomla\Registry\Registry; +use Joomla\CMS\Uri\Uri; +use Joomla\Registry\Registry; + /** diff --git a/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Abstraction/ActiveRegistry.php b/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Abstraction/ActiveRegistry.php new file mode 100644 index 0000000..37b0f43 --- /dev/null +++ b/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Abstraction/ActiveRegistry.php @@ -0,0 +1,305 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace TrueChristianBible\Joomla\Abstraction; + + +use TrueChristianBible\Joomla\Interfaces\Activeregistryinterface; + + +/** + * Active Storage Registry. + * + * Don't use this beyond 10 dimensional depth for best performance. + * + * @since 3.2.0 + */ +abstract class ActiveRegistry implements Activeregistryinterface +{ + /** + * The registry array. + * + * @var array + * @since 3.2.0 + **/ + protected array $active = []; + + /** + * Base switch to add values as string or array + * + * @var boolean + * @since 3.2.0 + **/ + protected bool $addAsArray = false; + + /** + * Base switch to keep array values unique + * + * @var boolean + * @since 3.2.2 + **/ + protected bool $uniqueArray = false; + + /** + * Check if the registry has any content. + * + * @return bool Returns true if the active array is not empty, false otherwise. + * @since 3.2.0 + */ + public function isActive(): bool + { + return !empty($this->active); + } + + /** + * Get all value from the active registry. + * + * @return array The values or empty array. + * @since 3.2.0 + */ + public function allActive(): array + { + return $this->active; + } + + /** + * Sets a value into the registry using multiple keys. + * + * @param mixed $value The value to set. + * @param string ...$keys The keys to determine the location. + * + * @throws \InvalidArgumentException If any of the keys are not a number or string. + * @return void + * @since 3.2.0 + */ + public function setActive($value, string ...$keys): void + { + if (!$this->validActiveKeys($keys)) + { + throw new \InvalidArgumentException("Keys must only be strings or numbers to set any value."); + } + + $array = &$this->active; + + foreach ($keys as $key) + { + if (!isset($array[$key])) + { + if (!is_array($array)) + { + $path = '[' . implode('][', $keys) . ']'; + throw new \InvalidArgumentException("Attempted to use key '{$key}' on a non-array value: {$array}. Path: {$path} Value: {$value}"); + } + + $array[$key] = []; + } + $array = &$array[$key]; + } + + $array = $value; + } + + /** + * Adds content into the registry. If a key exists, + * it either appends or concatenates based on the value's type. + * + * @param mixed $value The value to set. + * @param bool|null $asArray Determines if the new value should be treated as an array. + * Default is $addAsArray = false (if null) in base class. + * Override in child class allowed set class property $addAsArray = true. + * @param string ...$keys The keys to determine the location. + * + * @throws \InvalidArgumentException If any of the keys are not a number or string. + * @return void + * @since 3.2.0 + */ + public function addActive($value, ?bool $asArray, string ...$keys): void + { + if (!$this->validActiveKeys($keys)) + { + throw new \InvalidArgumentException("Keys must only be strings or numbers to add any value."); + } + + // null fallback to class value + if ($asArray === null) + { + $asArray = $this->addAsArray; + } + + $array = &$this->active; + + foreach ($keys as $key) + { + if (!isset($array[$key])) + { + if (!is_array($array)) + { + $path = '[' . implode('][', $keys) . ']'; + throw new \InvalidArgumentException("Attempted to use key '{$key}' on a non-array value: {$array}. Path: {$path} Value: {$value}"); + } + + $array[$key] = []; + } + $array = &$array[$key]; + } + + // add string + if (!$asArray && $array === []) + { + $array = ''; + } + + // Handle the adding logic at the tip of the array + if (is_array($array) || $asArray) + { + if (!is_array($array)) + { + // Convert to array if it's not already an array + $array = [$array]; + } + + if ($this->uniqueArray && in_array($value, $array)) + { + // we do nothing + return; + } + else + { + $array[] = $value; + } + } + else + { + if (is_string($value) || is_numeric($value)) + { + $array .= (string) $value; + } + else + { + $array = $value; + } + } + } + + /** + * Retrieves a value (or sub-array) from the registry using multiple keys. + * + * @param mixed $default The default value if not set. + * @param string ...$keys The keys to determine the location. + * + * @throws \InvalidArgumentException If any of the keys are not a number or string. + * @return mixed The value or sub-array from the storage. Null if the location doesn't exist. + * @since 3.2.0 + */ + public function getActive($default, string ...$keys) + { + if (!$this->validActiveKeys($keys)) + { + throw new \InvalidArgumentException("Keys must only be strings or numbers to get any value."); + } + + $array = $this->active; + + foreach ($keys as $key) + { + if (!isset($array[$key])) + { + return $default; + } + $array = $array[$key]; + } + + return $array; + } + + /** + * Removes a value (or sub-array) from the registry using multiple keys. + * + * @param string ...$keys The keys to determine the location. + * + * @throws \InvalidArgumentException If any of the keys are not a number or string. + * @return void + * @since 3.2.0 + */ + public function removeActive(string ...$keys): void + { + if (!$this->validActiveKeys($keys)) + { + throw new \InvalidArgumentException("Keys must only be strings or numbers to remove any value."); + } + + $array = &$this->active; + $lastKey = array_pop($keys); + + foreach ($keys as $key) + { + if (!isset($array[$key])) + { + return; // Exit early if the key doesn't exist + } + $array = &$array[$key]; + } + + unset($array[$lastKey]); + } + + /** + * Checks the existence of a particular location in the registry using multiple keys. + * + * @param string ...$keys The keys to determine the location. + * + * @throws \InvalidArgumentException If any of the keys are not a number or string. + * @return bool True if the location exists, false otherwise. + * @since 3.2.0 + */ + public function existsActive(string ...$keys): bool + { + if (!$this->validActiveKeys($keys)) + { + throw new \InvalidArgumentException("Keys must only be strings or numbers to check if any value exist."); + } + + $array = $this->active; + + foreach ($keys as $key) + { + if (!isset($array[$key])) + { + return false; + } + $array = $array[$key]; + } + + return true; + } + + /** + * Checks that the keys are valid + * + * @param array $keys The keys to determine the location. + * + * @return bool False if any of the keys are not a number or string. + * @since 3.2.0 + */ + protected function validActiveKeys(array $keys): bool + { + foreach ($keys as $key) + { + if ($key === '' || (!is_string($key) && !is_numeric($key))) + { + return false; + } + } + + return true; + } +} + diff --git a/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Abstraction/PHPConfigurationChecker.php b/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Abstraction/PHPConfigurationChecker.php new file mode 100644 index 0000000..824eda2 --- /dev/null +++ b/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Abstraction/PHPConfigurationChecker.php @@ -0,0 +1,214 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace TrueChristianBible\Joomla\Abstraction; + + +use Joomla\CMS\Factory; +use TrueChristianBible\Joomla\Interfaces\PHPConfigurationCheckerInterface; +use TrueChristianBible\Joomla\Abstraction\Registry; + + +/** + * PHP Configuration Checker + * + * @since 5.0.2 + */ +abstract class PHPConfigurationChecker extends Registry implements PHPConfigurationCheckerInterface +{ + /** + * The upload max filesize value + * + * @var string + * @since 5.0.2 + **/ + protected string $upload_max_filesize; + + /** + * The post max size value + * + * @var string + * @since 5.0.2 + **/ + protected string $post_max_size; + + /** + * The max execution time value + * + * @var int + * @since 5.0.2 + **/ + protected int $max_execution_time; + + /** + * The max input vars value + * + * @var int + * @since 5.0.2 + **/ + protected int $max_input_vars; + + /** + * The max input time value + * + * @var int + * @since 5.0.2 + **/ + protected int $max_input_time; + + /** + * The memory limit value + * + * @var string + * @since 5.0.2 + **/ + protected string $memory_limit; + + /** + * The registry array. + * + * @var array + * @since 5.0.2 + **/ + protected array $active = [ + 'php' => [ + 'upload_max_filesize' => [ + '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' => [ + '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' => [ + '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' => [ + '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' => [ + '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' => [ + '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.' + ] + ], + 'environment' => [ + 'name' => 'extension environment', + 'objective' => 'These settings are crucial for ensuring the successful installation and stable functionality of the extension.', + 'wiki_name' => 'PHP Settings Wiki', + 'wiki_url' => '#' + ] + ]; + + /** + * Application object. + * + * @since 5.0.2 + **/ + protected $app; + + /** + * Constructor. + * + * @param $app The app object. + * + * @since 5.0.2 + */ + public function __construct($app = null) + { + $this->app = $app ?: Factory::getApplication(); + + // set the required PHP Configures + $this->set('php.upload_max_filesize.value', $this->upload_max_filesize); + $this->set('php.post_max_size.value', $this->post_max_size); + $this->set('php.max_execution_time.value', $this->max_execution_time); + $this->set('php.max_input_vars.value', $this->max_input_vars); + $this->set('php.max_input_time.value', $this->max_input_time); + $this->set('php.memory_limit.value', $this->memory_limit); + } + + /** + * Check that the required configurations are set for PHP + * + * @return void + * @since 5.0.2 + **/ + public function run(): void + { + $showHelp = false; + + // Check each configuration and provide detailed feedback + $configurations = $this->active['php'] ?? []; + foreach ($configurations as $configName => $configDetails) + { + $currentValue = ini_get($configName); + if ($currentValue === false) + { + $this->app->enqueueMessage("Error: Unable to retrieve current setting for '{$configName}'.", 'error'); + continue; + } + + $requiredValue = $configDetails['value'] ?? 0; + $isMemoryValue = strpbrk($requiredValue, 'KMG') !== false; + + $requiredValueBytes = $isMemoryValue ? $this->convertToBytes($requiredValue) : (int) $requiredValue; + $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 {$requiredValue} but is currently {$currentValue}. " . $configDetails['warning'] ?? ''; + + $showHelp = ($showHelp || $messageType === 'warning') ? true : false; + + $this->app->enqueueMessage($messageText, $messageType); + } + + if ($showHelp) + { + $this->app->enqueueMessage("To optimize your {$this->get('environment.name', 'extension')}, specific PHP settings must be enhanced.
{$this->get('environment.objective', '')}
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 get('environment.wiki_url', '#')}\" target=\"_blank\">{$this->get('environment.wiki_name', 'PHP Settings Wiki')}.", 'notice'); + } + } + + /** + * Helper function to convert PHP INI memory values to bytes + * + * @param string $value The value to convert + * + * @return int The bytes value + * @since 5.0.2 + */ + 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; + } + } +} + diff --git a/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Abstraction/Registry.php b/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Abstraction/Registry.php new file mode 100644 index 0000000..8fe4cc0 --- /dev/null +++ b/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Abstraction/Registry.php @@ -0,0 +1,191 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace TrueChristianBible\Joomla\Abstraction; + + +use TrueChristianBible\Joomla\Interfaces\Registryinterface; +use TrueChristianBible\Joomla\Abstraction\ActiveRegistry; + + +/** + * VDM Basic Registry. + * + * Don't use this beyond 10 dimensional depth for best performance. + * + * @since 3.2.0 + */ +abstract class Registry extends ActiveRegistry implements Registryinterface +{ + /** + * Path separator + * + * @var string|null + * @since 3.2.0 + */ + protected ?string $separator = '.'; + + /** + * Sets a value into the registry using multiple keys. + * + * @param string $path Registry path (e.g. vdm.content.builder) + * @param mixed $value Value of entry + * + * @throws \InvalidArgumentException If any of the path values are not a number or string. + * @return self + * @since 3.2.0 + */ + public function set(string $path, $value): self + { + if (($keys = $this->getActiveKeys($path)) === null) + { + throw new \InvalidArgumentException("Path must only be strings or numbers to set any value."); + } + + $this->setActive($value, ...$keys); + + return $this; + } + + /** + * Adds content into the registry. If a key exists, + * it either appends or concatenates based on $asArray switch. + * + * @param string $path Registry path (e.g. vdm.content.builder) + * @param mixed $value Value of entry + * @param bool|null $asArray Determines if the new value should be treated as an array. + * Default is $addAsArray = false (if null) in base class. + * Override in child class allowed set class property $addAsArray = true. + * + * @throws \InvalidArgumentException If any of the path values are not a number or string. + * @return self + * @since 3.2.0 + */ + public function add(string $path, $value, ?bool $asArray = null): self + { + if (($keys = $this->getActiveKeys($path)) === null) + { + throw new \InvalidArgumentException("Path must only be strings or numbers to add any value."); + } + + $this->addActive($value, $asArray, ...$keys); + + return $this; + } + + /** + * Retrieves a value (or sub-array) from the registry using multiple keys. + * + * @param string $path Registry path (e.g. vdm.content.builder) + * @param mixed $default Optional default value, returned if the internal doesn't exist. + * + * @throws \InvalidArgumentException If any of the path values are not a number or string. + * @return mixed The value or sub-array from the storage. Null if the location doesn't exist. + * @since 3.2.0 + */ + public function get(string $path, $default = null) + { + if (($keys = $this->getActiveKeys($path)) === null) + { + throw new \InvalidArgumentException("Path must only be strings or numbers to get any value."); + } + + return $this->getActive($default, ...$keys); + } + + /** + * Removes a value (or sub-array) from the registry using multiple keys. + * + * @param string $path Registry path (e.g. vdm.content.builder) + * + * @throws \InvalidArgumentException If any of the path values are not a number or string. + * @return self + * @since 3.2.0 + */ + public function remove(string $path): self + { + if (($keys = $this->getActiveKeys($path)) === null) + { + throw new \InvalidArgumentException("Path must only be strings or numbers to remove any value."); + } + + $this->removeActive(...$keys); + + return $this; + } + + /** + * Checks the existence of a particular location in the registry using multiple keys. + * + * @param string $path Registry path (e.g. vdm.content.builder) + * + * @throws \InvalidArgumentException If any of the path values are not a number or string. + * @return bool True if the location exists, false otherwise. + * @since 3.2.0 + */ + public function exists(string $path): bool + { + if (($keys = $this->getActiveKeys($path)) === null) + { + throw new \InvalidArgumentException("Path must only be strings or numbers to check if any value exist."); + } + + return $this->existsActive(...$keys); + } + + /** + * Sets a separator value + * + * @param string|null $value The value to set. + * + * @return self + * @since 3.2.0 + */ + public function setSeparator(?string $value): self + { + $this->separator = $value; + + return $this; + } + + /** + * Get that the active keys from a path + * + * @param string $path The path to determine the location registry. + * + * @return array|null The valid array of keys + * @since 3.2.0 + */ + protected function getActiveKeys(string $path): ?array + { + // empty path no allowed + if ($path === '') + { + return null; + } + + // Flatten the path + if ($this->separator === null || $this->separator === '') + { + return [$path]; + } + + $keys = array_values(array_filter(explode($this->separator, $path), 'strlen')); + + if (empty($keys)) + { + return null; + } + + return $keys; + } +} + diff --git a/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Abstraction/Schema.php b/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Abstraction/Schema.php index 3db207a..6edf36c 100644 --- a/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Abstraction/Schema.php +++ b/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Abstraction/Schema.php @@ -455,8 +455,8 @@ abstract class Schema implements SchemaInterface return true; } - if (is_string($expected['default']) && strtoupper($expected['default']) === 'EMPTY' && - is_string($current->Default) && strpos($current->Default, 'EMPTY') !== false) + if (isset($expected['default']) && is_string($expected['default']) && strtoupper($expected['default']) === 'EMPTY' && + isset($current->Default) && is_string($current->Default) && strpos($current->Default, 'EMPTY') !== false) { return true; // little fix } diff --git a/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Abstraction/SchemaChecker.php b/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Abstraction/SchemaChecker.php index 5180413..0d3a4e3 100644 --- a/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Abstraction/SchemaChecker.php +++ b/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Abstraction/SchemaChecker.php @@ -12,8 +12,7 @@ namespace TrueChristianBible\Joomla\Abstraction; -use Joomla\CMS\Factory; -use Joomla\CMS\Application\CMSApplication; +use Joomla\CMS\Factory; use TrueChristianBible\Joomla\Interfaces\SchemaInterface as Schema; use TrueChristianBible\Joomla\Interfaces\Tableinterface as Table; use TrueChristianBible\Joomla\Utilities\ClassHelper; @@ -46,22 +45,21 @@ abstract class SchemaChecker implements SchemaCheckerInterface /** * Application object. * - * @var CMSApplication * @since 3.2.2 **/ - protected CMSApplication $app; + protected $app; /** * Constructor. * - * @param Schema|null $schema The Schema Class. - * @param Table|null $table The Table Class. - * @param CMSApplication|null $app The app object. + * @param Schema|null $schema The Schema Class. + * @param Table|null $table The Table Class. + * @param $app The app object. * * @throws \Exception * @since 3.2.2 */ - public function __construct(?Schema $schema = null, ?Table $table = null, ?CMSApplication $app = null) + public function __construct(?Schema $schema = null, ?Table $table = null, $app = null) { $this->schema = $schema; $this->table = $table; diff --git a/libraries/vendor_getbible/TrueChristianBible.Joomla/src/GetBible/PHPConfigurationChecker.php b/libraries/vendor_getbible/TrueChristianBible.Joomla/src/GetBible/PHPConfigurationChecker.php new file mode 100644 index 0000000..b022105 --- /dev/null +++ b/libraries/vendor_getbible/TrueChristianBible.Joomla/src/GetBible/PHPConfigurationChecker.php @@ -0,0 +1,88 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace TrueChristianBible\Joomla\GetBible; + + +use TrueChristianBible\Joomla\Interfaces\PHPConfigurationCheckerInterface; +use TrueChristianBible\Joomla\Abstraction\PHPConfigurationChecker as ExtendingPHPConfigurationChecker; + + +/** + * Getbible PHP Configuration Checker + * + * @since 5.02 + */ +final class PHPConfigurationChecker extends ExtendingPHPConfigurationChecker implements PHPConfigurationCheckerInterface +{ + /** + * The upload max filesize value + * + * @var string + * @since 5.0.2 + **/ + protected string $upload_max_filesize = '64M'; + + /** + * The post max size value + * + * @var string + * @since 5.0.2 + **/ + protected string $post_max_size = '128M'; + + /** + * The max execution time value + * + * @var int + * @since 5.0.2 + **/ + protected int $max_execution_time = 60; + + /** + * The max input vars value + * + * @var int + * @since 5.0.2 + **/ + protected int $max_input_vars = 5000; + + /** + * The max input time value + * + * @var int + * @since 5.0.2 + **/ + protected int $max_input_time = 60; + + /** + * The memory limit value + * + * @var string + * @since 5.0.2 + **/ + protected string $memory_limit = '256M'; + + /** + * Constructor. + * + * @since 5.0.2 + */ + public function __construct($app = null) + { + parent::__construct($app); + + // set the required PHP Configures + $this->set('environment.name', 'Getbible environment'); + $this->set('environment.wiki_url', 'git.vdm.dev/getBible/support/wiki/PHP-Settings'); + } +} + diff --git a/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Interfaces/Activeregistryinterface.php b/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Interfaces/Activeregistryinterface.php new file mode 100644 index 0000000..0b81aaa --- /dev/null +++ b/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Interfaces/Activeregistryinterface.php @@ -0,0 +1,100 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace TrueChristianBible\Joomla\Interfaces; + + +/** + * The Active Registry Interface + * + * @since 3.2.0 + */ +interface Activeregistryinterface +{ + /** + * Check if the registry has any content. + * + * @return bool Returns true if the active array is not empty, false otherwise. + * @since 3.2.0 + */ + public function isActive(): bool; + + /** + * Retrieves all value from the registry. + * + * @return array The values. + * @since 3.2.0 + */ + public function allActive(): array; + + /** + * Sets a value into the registry using multiple keys. + * + * @param mixed $value The value to set. + * @param string ...$keys The keys to determine the location. + * + * @throws \InvalidArgumentException If any of the keys are not a number or string. + * @return void + * @since 3.2.0 + */ + public function setActive($value, string ...$keys): void; + + /** + * Adds content into the registry. If a key exists, + * it either appends or concatenates based on the value's type. + * + * @param mixed $value The value to set. + * @param bool|null $asArray Determines if the new value should be treated as an array. + * Default is $addAsArray = false (if null) in base class. + * Override in child class allowed set class property $addAsArray = true. + * @param string ...$keys The keys to determine the location. + * + * @throws \InvalidArgumentException If any of the keys are not a number or string. + * @return void + * @since 3.2.0 + */ + public function addActive($value, ?bool $asArray, string ...$keys): void; + + /** + * Retrieves a value (or sub-array) from the registry using multiple keys. + * + * @param mixed $default The default value if not set. + * @param string ...$keys The keys to determine the location. + * + * @throws \InvalidArgumentException If any of the keys are not a number or string. + * @return mixed The value or sub-array from the storage. Null if the location doesn't exist. + * @since 3.2.0 + */ + public function getActive($default, string ...$keys); + + /** + * Removes a value (or sub-array) from the registry using multiple keys. + * + * @param string ...$keys The keys to determine the location. + * + * @throws \InvalidArgumentException If any of the keys are not a number or string. + * @return void + * @since 3.2.0 + */ + public function removeActive(string ...$keys): void; + + /** + * Checks the existence of a particular location in the registry using multiple keys. + * + * @param string ...$keys The keys to determine the location. + * + * @throws \InvalidArgumentException If any of the keys are not a number or string. + * @return bool True if the location exists, false otherwise. + * @since 3.2.0 + */ + public function existsActive(string ...$keys): bool; +} + diff --git a/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Interfaces/Git/ApiInterface.php b/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Interfaces/Git/ApiInterface.php new file mode 100644 index 0000000..23305a7 --- /dev/null +++ b/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Interfaces/Git/ApiInterface.php @@ -0,0 +1,50 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace TrueChristianBible\Joomla\Interfaces\Git; + + +/** + * The Git Api Interface + * + * @since 3.2.0 + */ +interface ApiInterface +{ + /** + * Load/Reload API. + * + * @param string|null $url The url. + * @param token|null $token The token. + * @param bool $backup The backup swapping switch. + * + * @return void + * @since 3.2.0 + **/ + public function load_(?string $url = null, ?string $token = null, bool $backup = true): void; + + /** + * Reset to previous toke, url it set + * + * @return void + * @since 3.2.0 + **/ + public function reset_(): void; + + /** + * Get the API url + * + * @return string + * @since 3.2.0 + **/ + public function api(); +} + diff --git a/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Interfaces/Git/Repository/ContentsInterface.php b/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Interfaces/Git/Repository/ContentsInterface.php new file mode 100644 index 0000000..569d54b --- /dev/null +++ b/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Interfaces/Git/Repository/ContentsInterface.php @@ -0,0 +1,209 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace TrueChristianBible\Joomla\Interfaces\Git\Repository; + + +use TrueChristianBible\Joomla\Interfaces\Git\ApiInterface; + + +/** + * The Git Repository Contents Interface + * + * @since 3.2.2 + */ +interface ContentsInterface extends ApiInterface +{ + /** + * Get a file from a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $filepath The file path. + * @param string|null $ref Optional. The name of the commit/branch/tag. + * Default the repository's default branch (usually master). + * + * @return mixed + * @since 3.2.0 + **/ + public function get(string $owner, string $repo, string $filepath, ?string $ref = null); + + /** + * Get the metadata and contents (if a file) of an entry in a repository, + * or a list of entries if a directory. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $filepath The file or directory path. + * @param string|null $ref Optional. The name of the commit/branch/tag. + * Default the repository's default branch (usually master). + * + * @return null|array|object + * @since 3.2.0 + **/ + public function metadata(string $owner, string $repo, string $filepath, ?string $ref = null): null|array|object; + + /** + * Create a file in a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $filepath The file path. + * @param string $content The file content. + * @param string $message The commit message. + * @param string $branch The branch name. Defaults to the repository's default branch. + * @param string|null $authorName The author's name. + * @param string|null $authorEmail The author's email. + * @param string|null $committerName The committer's name. + * @param string|null $committerEmail The committer's email. + * @param string|null $newBranch Whether to create a new branch. Defaults to null. + * @param string|null $authorDate The author's date. + * @param string|null $committerDate The committer's date. + * @param bool|null $signoff Add a Signed-off-by trailer. Defaults to null. + * + * @return object|null + * @since 3.2.0 + **/ + public function create( + string $owner, + string $repo, + string $filepath, + string $content, + string $message, + string $branch = 'master', + ?string $authorName = null, + ?string $authorEmail = null, + ?string $committerName = null, + ?string $committerEmail = null, + ?string $newBranch = null, + ?string $authorDate = null, + ?string $committerDate = null, + ?bool $signoff = null + ): ?object; + + /** + * Get the metadata of all the entries of the root directory. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string|null $ref The name of the commit/branch/tag. Default the repository's default branch (usually master). + * + * @return array|null + * @since 3.2.0 + **/ + public function root(string $owner, string $repo, ?string $ref = null): ?array; + + /** + * Update a file in a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $filepath The file path. + * @param string $content The file content. + * @param string $message The commit message. + * @param string $sha The blob SHA of the file. + * @param string $branch The branch name. Defaults to the repository's default branch. + * @param string|null $authorName The author name. Defaults to the authenticated user. + * @param string|null $authorEmail The author email. Defaults to the authenticated user. + * @param string|null $committerName The committer name. Defaults to the authenticated user. + * @param string|null $committerEmail The committer email. Defaults to the authenticated user. + * @param string|null $authorDate The author date. + * @param string|null $committerDate The committer date. + * @param string|null $fromPath The original file path to move/rename. + * @param string|null $newBranch The new branch to create from the specified branch. + * @param bool|null $signoff Add a Signed-off-by trailer. + * + * @return object|null + * @since 3.2.0 + **/ + public function update( + string $owner, + string $repo, + string $filepath, + string $content, + string $message, + string $sha, + string $branch = 'master', + ?string $authorName = null, + ?string $authorEmail = null, + ?string $committerName = null, + ?string $committerEmail = null, + ?string $authorDate = null, + ?string $committerDate = null, + ?string $fromPath = null, + ?string $newBranch = null, + ?bool $signoff = null + ): ?object; + + /** + * Delete a file in a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $filepath The file path. + * @param string $message The commit message. + * @param string $sha The blob SHA of the file. + * @param string|null $branch The branch name (optional). + * @param string|null $authorName The author name (optional). + * @param string|null $authorEmail The author email (optional). + * @param string|null $committerName The committer name (optional). + * @param string|null $committerEmail The committer email (optional). + * @param string|null $authorDate The author date (optional). + * @param string|null $committerDate The committer date (optional). + * @param string|null $newBranch The new branch name (optional). + * @param bool|null $signoff Add a Signed-off-by trailer (optional). + * + * @return object|null + * @since 3.2.0 + **/ + public function delete( + string $owner, + string $repo, + string $filepath, + string $message, + string $sha, + ?string $branch = null, + ?string $authorName = null, + ?string $authorEmail = null, + ?string $committerName = null, + ?string $committerEmail = null, + ?string $authorDate = null, + ?string $committerDate = null, + ?string $newBranch = null, + ?bool $signoff = null + ): ?object; + + /** + * Get the EditorConfig definitions of a file in a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $filepath The file path. + * @param string|null $ref The name of the commit/branch/tag. + * + * @return string|null + * @since 3.2.0 + **/ + public function editor(string $owner, string $repo, string $filepath, string $ref = null): ?string; + + /** + * Get the blob of a repository. + * + * @param string $owner The owner name. + * @param string $repo The repository name. + * @param string $sha The SHA hash of the blob. + * + * @return object|null + * @since 3.2.0 + **/ + public function blob(string $owner, string $repo, string $sha): ?object; +} + diff --git a/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Interfaces/Git/Repository/index.html b/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Interfaces/Git/Repository/index.html new file mode 100644 index 0000000..fa6d84e --- /dev/null +++ b/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Interfaces/Git/Repository/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Interfaces/Git/index.html b/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Interfaces/Git/index.html new file mode 100644 index 0000000..fa6d84e --- /dev/null +++ b/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Interfaces/Git/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Interfaces/PHPConfigurationCheckerInterface.php b/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Interfaces/PHPConfigurationCheckerInterface.php new file mode 100644 index 0000000..2ee3bf0 --- /dev/null +++ b/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Interfaces/PHPConfigurationCheckerInterface.php @@ -0,0 +1,30 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace TrueChristianBible\Joomla\Interfaces; + + +/** + * PHP Configuration Checker + * + * @since 5.0.2 + */ +interface PHPConfigurationCheckerInterface +{ + /** + * Check that the required configurations are set for PHP + * + * @return void + * @since 5.0.2 + **/ + public function run(): void; +} + diff --git a/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Interfaces/Registryinterface.php b/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Interfaces/Registryinterface.php new file mode 100644 index 0000000..160e2cb --- /dev/null +++ b/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Interfaces/Registryinterface.php @@ -0,0 +1,97 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace TrueChristianBible\Joomla\Interfaces; + + +use TrueChristianBible\Joomla\Interfaces\Activeregistryinterface; + + +/** + * The Registry Interface + * + * @since 3.2.0 + */ +interface Registryinterface extends Activeregistryinterface +{ + /** + * Sets a value into the registry using multiple keys. + * + * @param string $path Registry path (e.g. vdm.content.builder) + * @param mixed $value Value of entry + * + * @throws \InvalidArgumentException If any of the path values are not a number or string. + * @return self + * @since 3.2.0 + */ + public function set(string $path, $value): self; + + /** + * Adds content into the registry. If a key exists, + * it either appends or concatenates based on $asArray switch. + * + * @param string $path Registry path (e.g. vdm.content.builder) + * @param mixed $value Value of entry + * @param bool|null $asArray Determines if the new value should be treated as an array. + * Default is $addAsArray = false (if null) in base class. + * Override in child class allowed set class property $addAsArray = true. + * + * @throws \InvalidArgumentException If any of the path values are not a number or string. + * @return self + * @since 3.2.0 + */ + public function add(string $path, $value, ?bool $asArray = null): self; + + /** + * Retrieves a value (or sub-array) from the registry using multiple keys. + * + * @param string $path Registry path (e.g. vdm.content.builder) + * @param mixed $default Optional default value, returned if the internal doesn't exist. + * + * @throws \InvalidArgumentException If any of the path values are not a number or string. + * @return mixed The value or sub-array from the storage. Null if the location doesn't exist. + * @since 3.2.0 + */ + public function get(string $path, $default = null); + + /** + * Removes a value (or sub-array) from the registry using multiple keys. + * + * @param string $path Registry path (e.g. vdm.content.builder) + * + * @throws \InvalidArgumentException If any of the path values are not a number or string. + * @return self + * @since 3.2.0 + */ + public function remove(string $path): self; + + /** + * Checks the existence of a particular location in the registry using multiple keys. + * + * @param string $path Registry path (e.g. vdm.content.builder) + * + * @throws \InvalidArgumentException If any of the path values are not a number or string. + * @return bool True if the location exists, false otherwise. + * @since 3.2.0 + */ + public function exists(string $path): bool; + + /** + * Sets a separator value + * + * @param string|null $value The value to set. + * + * @return self + * @since 3.2.0 + */ + public function setSeparator(?string $value): self; +} + diff --git a/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Model/Load.php b/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Model/Load.php index 51729db..7068eb4 100644 --- a/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Model/Load.php +++ b/libraries/vendor_getbible/TrueChristianBible.Joomla/src/Model/Load.php @@ -45,8 +45,8 @@ final class Load extends Model implements ModelInterface $table = $this->getTable(); } - // check if this is a valid table - if (($store = $this->table->get($table, $field, 'store')) !== null) + // check if this is a valid table (don't touch null) + if ($value !== null && ($store = $this->table->get($table, $field, 'store')) !== null) { // open the value based on the store method switch($store) diff --git a/site/src/Controller/DisplayController.php b/site/src/Controller/DisplayController.php index 37d9ea5..2781c91 100644 --- a/site/src/Controller/DisplayController.php +++ b/site/src/Controller/DisplayController.php @@ -16,9 +16,13 @@ /------------------------------------------------------------------------------------------------------*/ namespace TrueChristianBible\Component\GetBible\Site\Controller; +use Joomla\Input\Input; use Joomla\CMS\Factory; +use Joomla\CMS\Application\CMSApplication; use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\Router\Route; +use Joomla\CMS\User\User; use Joomla\Utilities\ArrayHelper; use Joomla\CMS\Language\Text; use TrueChristianBible\Joomla\Utilities\StringHelper; @@ -34,13 +38,50 @@ use TrueChristianBible\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; */ class DisplayController extends BaseController { + /** + * The allowed edit views. + * + * @var array + * @since 4.0.0 + */ + protected array $allowed_edit_views = [ + ]; + + /** + * The application identity object. + * + * @var User + * @since 4.0.0 + */ + protected $identity; + + /** + * @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). + * @param MVCFactoryInterface|null $factory The factory. + * @param CMSApplication|null $app The Application for the dispatcher + * @param Input|null $input The Input object for the request + * + * @throws \Exception + * @since 3.0.1 + */ + public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + { + $app ??= Factory::getApplication(); + $this->identity ??= $app->getIdentity(); + + parent::__construct($config, $factory, $app, $input); + } + /** * Method to display a view. * - * @param boolean $cachable If true, the view output will be cached. - * @param boolean $urlparams An array of safe URL parameters and their variable types, for valid values see {@link InputFilter::clean()}. + * @param boolean $cachable If true, the view output will be cached. + * @param boolean|array $urlparams An array of safe URL parameters and their variable types, for valid values see {@link InputFilter::clean()}. * * @return DisplayController This object to support chaining. + * @throws \Exception * @since 1.5 */ function display($cachable = false, $urlparams = false) @@ -54,14 +95,13 @@ class DisplayController extends BaseController $cachable = true; // ensure that the view is not cashable if edit view or if user is logged in - $user = $this->app->getIdentity(); - if ($user->get('id') || $this->input->getMethod() === 'POST' || $isEdit) + if ($this->identity->get('id') || $this->input->getMethod() === 'POST' || $isEdit) { $cachable = false; } // Check for edit form. - if ($isEdit && !$this->checkEditId('com_getbible.edit.'.$view, $id)) + if ($isEdit && !$this->checkEditId($view, $id)) { // check if item was opened from other than its own list view $ref = $this->input->getCmd('ref', 0); @@ -71,12 +111,12 @@ class DisplayController extends BaseController if ($refid > 0 && StringHelper::check($ref)) { // redirect to item of ref - $this->setRedirect(Route::_('index.php?option=com_getbible&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false)); + $this->setRedirect(Route::_('index.php?option=com_getbible&view=' . (string) $ref . '&layout=edit&id=' . (int) $refid, false)); } elseif (StringHelper::check($ref)) { // redirect to ref - $this->setRedirect(Route::_('index.php?option=com_getbible&view='.(string)$ref, false)); + $this->setRedirect(Route::_('index.php?option=com_getbible&view=' . (string) $ref, false)); } else { @@ -118,19 +158,133 @@ class DisplayController extends BaseController return $this; } - protected function checkEditView($view) + /** + * Method to check whether an ID is in the edit list. + * + * @param string $context The view name. + * @param integer $id The ID of the record to add to the edit list. + * + * @return boolean True if the ID is in the edit list. + * + * @throws \Exception + * @since 3.0 + */ + protected function checkEditId($context, $id) + { + if (parent::checkEditId("com_getbible.edit.{$context}", $id)) + { + return true; + } + + // check user edit access + if ($this->canEditId($context, $id)) + { + $this->holdEditId("com_getbible.edit.{$context}", $id); + + return true; + } + + return false; + } + + /** + * Method to check whether an ID is allowed to be edited by the active user. + * + * @param string $view The view name. + * @param integer $id The ID of the record to add to the edit list. + * + * @return boolean True if the ID is in the edit list. + * + * @since 5.0.2 + */ + protected function canEditId($view, $id): bool + { + // check that this view is even allowed + $allowed = $this->getAllowedEditView($view); + if ($allowed === null) + { + return false; + } + + // check if this item has custom function set for canEditId + if (isset($allowed['function']) + && method_exists($this, $allowed['function']) + && $this->{$allowed['function']}(['id' => $id], 'id')) + { + return true; + } + + // check if this item can be accessed (and has access) + $access = true; + if (isset($allowed['access'])) + { + $access = ($this->identity->authorise($allowed['access'], "com_getbible.{$view}." . (int) $id) + && $this->identity->authorise($allowed['access'], 'com_getbible')); + } + + // check if this item can be edited + $edit = false; + if ($access && isset($allowed['edit'])) + { + $edit = ($this->identity->authorise($allowed['edit'], "com_getbible.{$view}." . (int) $id) + && $this->identity->authorise($allowed['edit'], 'com_getbible')); + } + + // check if this item can be edited by owner + if ($access && !$edit && isset($allowed['edit.own'])) + { + $edit = ($this->identity->authorise($allowed['edit.own'], "com_getbible.{$view}." . (int) $id) + && $this->identity->authorise($allowed['edit.own'], 'com_getbible')); + } + + return $edit; + } + + /** + * Checks if the provided view is an edit view. + * + * This method verifies whether the given view name is recognized as an edit view. + * It uses the StringHelper::check() method to validate the input and then checks + * against a predefined list of edit views. + * + * @param string|null $view The name of the view to check. + * + * @return bool True if the view is an edit view, false otherwise. + * @since 4.0.0 + */ + protected function checkEditView(?string $view): bool { if (StringHelper::check($view)) { - $views = [ - - ]; - // check if this is a edit view - if (in_array($view,$views)) + // check if this is an edit view + if (isset($this->allowed_edit_views[$view])) { return true; } } + return false; } + + /** + * Get the allowed edit view permission map + * + * @param string|null $view The name of the view to check. + * + * @return array|null The permissions map + * @since 5.0.2 + */ + protected function getAllowedEditView(?string $view): ?array + { + if (StringHelper::check($view)) + { + // check if this is an edit view + if (isset($this->allowed_edit_views[$view])) + { + return $this->allowed_edit_views[$view]; + } + } + + return null; + } } diff --git a/site/src/Model/TagModel.php b/site/src/Model/TagModel.php index 6b52068..7fbfc19 100644 --- a/site/src/Model/TagModel.php +++ b/site/src/Model/TagModel.php @@ -31,11 +31,11 @@ use TrueChristianBible\Component\GetBible\Site\Helper\GetbibleHelper; use TrueChristianBible\Component\GetBible\Site\Helper\RouteHelper; use Joomla\CMS\Helper\TagsHelper; use TrueChristianBible\Joomla\Utilities\StringHelper; +use TrueChristianBible\Joomla\GetBible\Factory as GetBibleFactory; use TrueChristianBible\Joomla\Utilities\Component\Helper; use TrueChristianBible\Joomla\Utilities\GuidHelper; use TrueChristianBible\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; use TrueChristianBible\Joomla\Utilities\JsonHelper; -use TrueChristianBible\Joomla\GetBible\Factory as GetBibleFactory; // No direct access to this file \defined('_JEXEC') or die; @@ -261,6 +261,13 @@ class TagModel extends ListModel $this->input ??= Factory::getApplication()->input; + // we add a Share_His_Word option to set the session key + if (($linker = $this->input->getString('Share_His_Word', null)) !== null + && GetBibleFactory::_('GetBible.Linker')->valid($linker)) + { + GetBibleFactory::_('GetBible.Linker')->trigger($linker); + } + $this->translation = $this->input->getString('t') ?? $this->input->getString('translation', Helper::getParams('com_getbible')->get('default_translation', 'kjv')) ; $this->tag = $this->input->getString('guid') ?? ''; diff --git a/site/src/View/App/HtmlView.php b/site/src/View/App/HtmlView.php index d6e913f..ea454e6 100644 --- a/site/src/View/App/HtmlView.php +++ b/site/src/View/App/HtmlView.php @@ -36,6 +36,7 @@ use Joomla\CMS\Helper\ModuleHelper; use TrueChristianBible\Joomla\GetBible\Factory as GetBibleFactory; use TrueChristianBible\Joomla\Utilities\StringHelper; use TrueChristianBible\Joomla\Utilities\ArrayHelper; +use Joomla\CMS\User\User; // No direct access to this file \defined('_JEXEC') or die; @@ -47,6 +48,38 @@ use TrueChristianBible\Joomla\Utilities\ArrayHelper; */ class HtmlView extends BaseHtmlView { + /** + * The toolbar object + * + * @var Toolbar + * @since 3.10.11 + */ + public Toolbar $toolbar; + + /** + * The styles url array + * + * @var array + * @since 3.10.11 + */ + protected array $styles; + + /** + * The scripts url array + * + * @var array + * @since 3.10.11 + */ + protected array $scripts; + + /** + * The user object. + * + * @var User + * @since 3.10.11 + */ + public User $user; + /** * Display the view * @@ -61,10 +94,10 @@ class HtmlView extends BaseHtmlView $this->app ??= Factory::getApplication(); $this->params = $this->app->getParams(); $this->menu = $this->app->getMenu()->getActive(); - $this->styles = $this->get('Styles'); - $this->scripts = $this->get('Scripts'); + $this->styles = $this->get('Styles') ?? []; + $this->scripts = $this->get('Scripts') ?? []; // get the user object - $this->user ??= $this->app->getIdentity(); + $this->user ??= $this->getCurrentUser(); // Initialise variables. $this->item = $this->get('Item'); $this->chapter = $this->get('Chapter'); @@ -1101,8 +1134,9 @@ class HtmlView extends BaseHtmlView { ToolbarHelper::help('COM_GETBIBLE_HELP_MANAGER', false, $this->help_url); } + // now initiate the toolbar - $this->toolbar = Toolbar::getInstance(); + $this->toolbar ??= Toolbar::getInstance(); } /** diff --git a/site/src/View/Openai/HtmlView.php b/site/src/View/Openai/HtmlView.php index 1a05d11..f573ae7 100644 --- a/site/src/View/Openai/HtmlView.php +++ b/site/src/View/Openai/HtmlView.php @@ -36,6 +36,7 @@ use Joomla\CMS\Uri\Uri; use Joomla\CMS\Helper\ModuleHelper; use TrueChristianBible\Joomla\Utilities\StringHelper; use TrueChristianBible\Joomla\Utilities\ArrayHelper; +use Joomla\CMS\User\User; // No direct access to this file \defined('_JEXEC') or die; @@ -47,6 +48,38 @@ use TrueChristianBible\Joomla\Utilities\ArrayHelper; */ class HtmlView extends BaseHtmlView { + /** + * The toolbar object + * + * @var Toolbar + * @since 3.10.11 + */ + public Toolbar $toolbar; + + /** + * The styles url array + * + * @var array + * @since 3.10.11 + */ + protected array $styles; + + /** + * The scripts url array + * + * @var array + * @since 3.10.11 + */ + protected array $scripts; + + /** + * The user object. + * + * @var User + * @since 3.10.11 + */ + public User $user; + /** * Display the view * @@ -61,10 +94,10 @@ class HtmlView extends BaseHtmlView $this->app ??= Factory::getApplication(); $this->params = $this->app->getParams(); $this->menu = $this->app->getMenu()->getActive(); - $this->styles = $this->get('Styles'); - $this->scripts = $this->get('Scripts'); + $this->styles = $this->get('Styles') ?? []; + $this->scripts = $this->get('Scripts') ?? []; // get the user object - $this->user ??= $this->app->getIdentity(); + $this->user ??= $this->getCurrentUser(); // Initialise variables. $this->item = $this->get('Item'); $this->translation = $this->get('Translation'); @@ -680,8 +713,9 @@ class HtmlView extends BaseHtmlView { ToolbarHelper::help('COM_GETBIBLE_HELP_MANAGER', false, $this->help_url); } + // now initiate the toolbar - $this->toolbar = Toolbar::getInstance(); + $this->toolbar ??= Toolbar::getInstance(); } /** diff --git a/site/src/View/Search/HtmlView.php b/site/src/View/Search/HtmlView.php index 519c4eb..6cb812c 100644 --- a/site/src/View/Search/HtmlView.php +++ b/site/src/View/Search/HtmlView.php @@ -37,6 +37,7 @@ use Joomla\CMS\Helper\ModuleHelper; use TrueChristianBible\Joomla\GetBible\Factory as GetBibleFactory; use TrueChristianBible\Joomla\Utilities\StringHelper; use TrueChristianBible\Joomla\Utilities\ArrayHelper; +use Joomla\CMS\User\User; // No direct access to this file \defined('_JEXEC') or die; @@ -48,6 +49,54 @@ use TrueChristianBible\Joomla\Utilities\ArrayHelper; */ class HtmlView extends BaseHtmlView { + /** + * The items from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $items; + + /** + * The toolbar object + * + * @var Toolbar + * @since 3.10.11 + */ + public Toolbar $toolbar; + + /** + * The styles url array + * + * @var array + * @since 5.0.0 + */ + protected array $styles; + + /** + * The scripts url array + * + * @var array + * @since 5.0.0 + */ + protected array $scripts; + + /** + * The actions object + * + * @var object + * @since 3.10.11 + */ + public object $canDo; + + /** + * The user object. + * + * @var User + * @since 3.10.11 + */ + public User $user; + /** * Display the view * @@ -861,6 +910,7 @@ class HtmlView extends BaseHtmlView { ToolbarHelper::help('COM_GETBIBLE_HELP_MANAGER', false, $this->help_url); } + // now initiate the toolbar $this->toolbar = Toolbar::getInstance(); } diff --git a/site/src/View/Tag/HtmlView.php b/site/src/View/Tag/HtmlView.php index 7c73cf5..1320e1a 100644 --- a/site/src/View/Tag/HtmlView.php +++ b/site/src/View/Tag/HtmlView.php @@ -37,6 +37,7 @@ use Joomla\CMS\Helper\ModuleHelper; use TrueChristianBible\Joomla\GetBible\Factory as GetBibleFactory; use TrueChristianBible\Joomla\Utilities\StringHelper; use TrueChristianBible\Joomla\Utilities\ArrayHelper; +use Joomla\CMS\User\User; // No direct access to this file \defined('_JEXEC') or die; @@ -48,6 +49,54 @@ use TrueChristianBible\Joomla\Utilities\ArrayHelper; */ class HtmlView extends BaseHtmlView { + /** + * The items from the model + * + * @var mixed + * @since 3.10.11 + */ + public mixed $items; + + /** + * The toolbar object + * + * @var Toolbar + * @since 3.10.11 + */ + public Toolbar $toolbar; + + /** + * The styles url array + * + * @var array + * @since 5.0.0 + */ + protected array $styles; + + /** + * The scripts url array + * + * @var array + * @since 5.0.0 + */ + protected array $scripts; + + /** + * The actions object + * + * @var object + * @since 3.10.11 + */ + public object $canDo; + + /** + * The user object. + * + * @var User + * @since 3.10.11 + */ + public User $user; + /** * Display the view * @@ -617,6 +666,7 @@ class HtmlView extends BaseHtmlView { ToolbarHelper::help('COM_GETBIBLE_HELP_MANAGER', false, $this->help_url); } + // now initiate the toolbar $this->toolbar = Toolbar::getInstance(); } diff --git a/update_server.xml b/update_server.xml index 3b4d181..5e2627b 100644 --- a/update_server.xml +++ b/update_server.xml @@ -278,7 +278,7 @@ 4.0.15-alpha https://getbible.net - https://git.vdm.dev/api/v1/repos/getBible/joomla-pkg/archive/v4.0.15-alpha3.zip + https://git.vdm.dev/api/v1/repos/getBible/joomla-pkg/archive/v4.0.15-alpha4.zip alpha @@ -293,10 +293,10 @@ pkg_getbible package site - 4.0.15-alpha3 + 4.0.15-alpha4 https://getbible.net - https://git.vdm.dev/api/v1/repos/getBible/joomla-pkg/archive/v4.0.15-alpha3.zip + https://git.vdm.dev/api/v1/repos/getBible/joomla-pkg/archive/v4.0.15-alpha4.zip alpha