From ada169358222e38a75c8742badb245ba906ed90b Mon Sep 17 00:00:00 2001 From: aB0t Date: Mon, 11 Mar 2024 16:56:07 +0200 Subject: [PATCH] Update on v2.0.0 (changes towards the next release) Here's an update on the current version, which includes changes towards the next release still in development. --- componentbuilderactionlogcompiler.php | 5 +- componentbuilderactionlogcompiler.xml | 2 +- script.php | 73 --------------------------- 3 files changed, 4 insertions(+), 76 deletions(-) diff --git a/componentbuilderactionlogcompiler.php b/componentbuilderactionlogcompiler.php index cebd6e0..61999e7 100644 --- a/componentbuilderactionlogcompiler.php +++ b/componentbuilderactionlogcompiler.php @@ -15,7 +15,8 @@ defined('_JEXEC') or die('Restricted access'); use Joomla\CMS\Application\CMSApplication; use Joomla\CMS\Plugin\CMSPlugin; use Joomla\Registry\Registry; -use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory; JLoader::register('ComponentbuilderHelper', JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/componentbuilder.php'); @@ -536,7 +537,7 @@ class PlgExtensionComponentbuilderActionLogCompiler extends CMSPlugin // only check if there are active if (ArrayHelper::check($this->componentsActive)) { - return in_array((int) CFactory::_('Config')->component_id, $this->componentsActive); + return in_array((int) Factory::_('Config')->component_id, $this->componentsActive); } return false; } diff --git a/componentbuilderactionlogcompiler.xml b/componentbuilderactionlogcompiler.xml index a8aa511..afb0025 100644 --- a/componentbuilderactionlogcompiler.xml +++ b/componentbuilderactionlogcompiler.xml @@ -1,7 +1,7 @@ PLG_EXTENSION_COMPONENTBUILDERACTIONLOGCOMPILER - 10th March, 2024 + 11th March, 2024 Llewellyn van der Merwe joomla@vdm.io https://dev.vdm.io diff --git a/script.php b/script.php index 04b51aa..9a8d4bc 100644 --- a/script.php +++ b/script.php @@ -48,79 +48,6 @@ class plgExtensionComponentbuilderActionLogCompilerInstallerScript if ('install' === $route) { -// needs fix - - - // check that componentbuilder is installed - $pathToCore = JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/componentbuilder.php'; - if (!JFile::exists($pathToCore)) - { - $app->enqueueMessage('Joomla Component Builder must first be installed from Joomla Component Builder.', 'error'); - return false; - } - - // load the helper class - JLoader::register('ComponentbuilderHelper', JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/componentbuilder.php'); - - // block install - $blockInstall = true; - - // check the version of JCB - $manifest = ComponentbuilderHelper::manifest(); - if (isset($manifest->version) && strpos($manifest->version, '.') !== false) - { - // get the version - $jcbVersion = explode('.', $manifest->version); - // check that we have JCB 3.0.0 or higher installed - if (count($jcbVersion) == 3 && $jcbVersion[0] >= 3 && - ( - ($jcbVersion[0] == 3 && $jcbVersion[1] == 0 && $jcbVersion[2] >= 0) || - ($jcbVersion[0] == 3 && $jcbVersion[1] > 0) || - $jcbVersion[0] > 3) - ) - { - $blockInstall = false; - } - } - - // allow install if all conditions are met - if ($blockInstall) - { - $app->enqueueMessage('Please upgrade to JCB v3.0.0 or higher before installing this plugin.', 'error'); - return false; - } - - - // check that componentbuilder is installed - $pathToCore = JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/componentbuilder.php'; - if (!JFile::exists($pathToCore)) - { - $app->enqueueMessage('Joomla Component Builder must first be installed from Joomla Component Builder.', 'error'); - return false; - } - // load the helper class - JLoader::register('ComponentbuilderHelper', JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/componentbuilder.php'); - // block install - $blockInstall = true; - // check the version of JCB - $manifest = ComponentbuilderHelper::manifest(); - if (isset($manifest->version) && strpos($manifest->version, '.') !== false) - { - // get the version - $jcbVersion = explode('.', $manifest->version); - // check that we have JCB 2.10.13 or higher installed - if (count($jcbVersion) == 3 && (($jcbVersion[0] == 2 && $jcbVersion[1] >= 10 && (($jcbVersion[1] == 10 && $jcbVersion[2] >= 13) || ($jcbVersion[1] > 10))) || $jcbVersion[0] >= 3)) - { - $blockInstall = false; - } - } - // allow install if all conditions are met - if ($blockInstall) - { - $app->enqueueMessage('Please upgrade to JCB 2.10.13 or higher before installing this plugin.', 'error'); - return false; - } - // check that componentbuilder is installed $pathToCore = JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/componentbuilder.php'; if (!JFile::exists($pathToCore))