From ac45d3736ddeef7c7c92409658701f42af999b25 Mon Sep 17 00:00:00 2001 From: aB0t Date: Mon, 11 Mar 2024 18:36:21 +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 | 8 +- ...sion_componentbuilderactionlogcompiler.ini | 4 +- ..._componentbuilderactionlogcompiler.sys.ini | 4 +- script.php | 108 ------------------ 5 files changed, 11 insertions(+), 118 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 b9828f1..e25f877 100644 --- a/componentbuilderactionlogcompiler.xml +++ b/componentbuilderactionlogcompiler.xml @@ -1,7 +1,7 @@ - + PLG_EXTENSION_COMPONENTBUILDERACTIONLOGCOMPILER - 9th March, 2024 + 11th March, 2024 Llewellyn van der Merwe joomla@vdm.io https://dev.vdm.io @@ -28,8 +28,8 @@ >
diff --git a/language/en-GB/en-GB.plg_extension_componentbuilderactionlogcompiler.ini b/language/en-GB/en-GB.plg_extension_componentbuilderactionlogcompiler.ini index 370bd7a..99a3431 100644 --- a/language/en-GB/en-GB.plg_extension_componentbuilderactionlogcompiler.ini +++ b/language/en-GB/en-GB.plg_extension_componentbuilderactionlogcompiler.ini @@ -1,6 +1,6 @@ PLG_EXTENSION_COMPONENTBUILDERACTIONLOGCOMPILER="Extension - Componentbuilder ActionLog Compiler" -PLG_EXTENSION_COMPONENTBUILDERACTIONLOGCOMPILER_DESCRIPTION="This plugin is used to improve your action log integration with Joomla for your component during compilation. To activate it you must first enable it here. Then open your JCB component global options, and under the Global tab, select this plugin in the Activate Compiler Plugins field." -PLG_EXTENSION_COMPONENTBUILDERACTIONLOGCOMPILER_XML_DESCRIPTION="

Extension - Componentbuilder ActionLog Compiler (v.2.0.0)

This plugin is used to improve your action log integration with Joomla for your component during compilation. To activate it you must first enable it here. Then open your JCB component global options, and under the Global tab, select this plugin in the Activate Compiler Plugins field.

Created by Llewellyn van der Merwe
Development started 27th August, 2019

" +PLG_EXTENSION_COMPONENTBUILDERACTIONLOGCOMPILER_DESCRIPTION="This plugin is used to improve your action log integration with Joomla for your component during compilation. To activate it you must first enable it here. Then open your JCB component global options, and under the Global tab, select this plugin in the Activate Compiler Plugins field./// not ready" +PLG_EXTENSION_COMPONENTBUILDERACTIONLOGCOMPILER_XML_DESCRIPTION="

Extension - Componentbuilder ActionLog Compiler (v.2.0.0)

This plugin is used to improve your action log integration with Joomla for your component during compilation. To activate it you must first enable it here. Then open your JCB component global options, and under the Global tab, select this plugin in the Activate Compiler Plugins field./// not ready

Created by Llewellyn van der Merwe
Development started 10th March, 2024

" PLG_EXTENSION_COMPONENTBUILDERACTIONLOGCOMPILER_COMPONENT_ACTIVATION="Component Activation" PLG_EXTENSION_COMPONENTBUILDERACTIONLOGCOMPILER_ACTIVATE_OPTION_LABEL="Activate Options" PLG_EXTENSION_COMPONENTBUILDERACTIONLOGCOMPILER_ACTIVATE_OPTION_DESCRIPTION="You can select the kind of activation control you would like to use. All will target all components, and Selected will let you select only those you want to be active." diff --git a/language/en-GB/en-GB.plg_extension_componentbuilderactionlogcompiler.sys.ini b/language/en-GB/en-GB.plg_extension_componentbuilderactionlogcompiler.sys.ini index 370bd7a..99a3431 100644 --- a/language/en-GB/en-GB.plg_extension_componentbuilderactionlogcompiler.sys.ini +++ b/language/en-GB/en-GB.plg_extension_componentbuilderactionlogcompiler.sys.ini @@ -1,6 +1,6 @@ PLG_EXTENSION_COMPONENTBUILDERACTIONLOGCOMPILER="Extension - Componentbuilder ActionLog Compiler" -PLG_EXTENSION_COMPONENTBUILDERACTIONLOGCOMPILER_DESCRIPTION="This plugin is used to improve your action log integration with Joomla for your component during compilation. To activate it you must first enable it here. Then open your JCB component global options, and under the Global tab, select this plugin in the Activate Compiler Plugins field." -PLG_EXTENSION_COMPONENTBUILDERACTIONLOGCOMPILER_XML_DESCRIPTION="

Extension - Componentbuilder ActionLog Compiler (v.2.0.0)

This plugin is used to improve your action log integration with Joomla for your component during compilation. To activate it you must first enable it here. Then open your JCB component global options, and under the Global tab, select this plugin in the Activate Compiler Plugins field.

Created by Llewellyn van der Merwe
Development started 27th August, 2019

" +PLG_EXTENSION_COMPONENTBUILDERACTIONLOGCOMPILER_DESCRIPTION="This plugin is used to improve your action log integration with Joomla for your component during compilation. To activate it you must first enable it here. Then open your JCB component global options, and under the Global tab, select this plugin in the Activate Compiler Plugins field./// not ready" +PLG_EXTENSION_COMPONENTBUILDERACTIONLOGCOMPILER_XML_DESCRIPTION="

Extension - Componentbuilder ActionLog Compiler (v.2.0.0)

This plugin is used to improve your action log integration with Joomla for your component during compilation. To activate it you must first enable it here. Then open your JCB component global options, and under the Global tab, select this plugin in the Activate Compiler Plugins field./// not ready

Created by Llewellyn van der Merwe
Development started 10th March, 2024

" PLG_EXTENSION_COMPONENTBUILDERACTIONLOGCOMPILER_COMPONENT_ACTIVATION="Component Activation" PLG_EXTENSION_COMPONENTBUILDERACTIONLOGCOMPILER_ACTIVATE_OPTION_LABEL="Activate Options" PLG_EXTENSION_COMPONENTBUILDERACTIONLOGCOMPILER_ACTIVATE_OPTION_DESCRIPTION="You can select the kind of activation control you would like to use. All will target all components, and Selected will let you select only those you want to be active." diff --git a/script.php b/script.php index 04b51aa..7d25754 100644 --- a/script.php +++ b/script.php @@ -24,112 +24,4 @@ use Joomla\CMS\Filesystem\Folder; */ class plgExtensionComponentbuilderActionLogCompilerInstallerScript { - - /** - * Called before any type of action - * - * @param string $route Which action is happening (install|uninstall|discover_install|update) - * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script - * - * @return boolean True on success - */ - public function preflight($route, $adapter) - { - // get application - $app = Factory::getApplication(); - - // the default for both install and update - $jversion = new JVersion(); - if (!$jversion->isCompatible('3.8.0')) - { - $app->enqueueMessage('Please upgrade to at least Joomla! 3.8.0 before continuing!', 'error'); - return false; - } - - 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)) - { - $app->enqueueMessage('Joomla Component Builder must first be installed from Joomla Component Builder.', 'error'); - return false; - } - } - - return true; - } }