From 01bc682ce7fc62405a1548575853d0d31cdb399c Mon Sep 17 00:00:00 2001 From: aB0t Date: Mon, 11 Mar 2024 18:33:33 +0200 Subject: [PATCH] Release of v3.0.0 --- componentbuilderdynamicgetheaderstabs.php | 18 +- componentbuilderdynamicgetheaderstabs.xml | 6 +- forms/dynamic_get.xml | 4 +- ..._componentbuilderdynamicgetheaderstabs.ini | 2 +- ...ponentbuilderdynamicgetheaderstabs.sys.ini | 2 +- script.php | 542 ------------------ 6 files changed, 15 insertions(+), 559 deletions(-) diff --git a/componentbuilderdynamicgetheaderstabs.php b/componentbuilderdynamicgetheaderstabs.php index 947d131..c47b463 100644 --- a/componentbuilderdynamicgetheaderstabs.php +++ b/componentbuilderdynamicgetheaderstabs.php @@ -13,22 +13,20 @@ defined('_JEXEC') or die('Restricted access'); use Joomla\CMS\Form\Form; -use Joomla\CMS\Plugin\CMSPlugin; -use VDM\Joomla\Utilities\ArrayHelper; - -JLoader::register('ComponentbuilderHelper', JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/componentbuilder.php'); - +use Joomla\CMS\Plugin\CMSPlugin; +use Joomla\CMS\Component\ComponentHelper; +use VDM\Joomla\Utilities\ArrayHelper; /** * Content - Componentbuilder Dynamic Get Headers Tabs plugin. * * @package ComponentbuilderDynamicGetHeadersTabs - * @since 2.0.2 + * @since 3.0.0 */ class PlgContentComponentbuilderDynamicGetHeadersTabs extends CMSPlugin { /** - * Affects constructor behavior. If true, language files will be loaded automatically. + * Affects constructor behaviour. If true, language files will be loaded automatically. * * @var boolean * @since 1.0 @@ -38,8 +36,8 @@ class PlgContentComponentbuilderDynamicGetHeadersTabs extends CMSPlugin /** * Runs on content preparation of form. * - * @param JForm $form The form - * @param stdClass $data The data + * @param Form $form The form + * @param \stdClass $data The data * * @return boolean * @@ -57,7 +55,7 @@ class PlgContentComponentbuilderDynamicGetHeadersTabs extends CMSPlugin // add the admin view params for privacy integration $form->loadFile('dynamic_get'); // update all editors to use this components global editor - $global_editor = \JComponentHelper::getParams('com_componentbuilder')->get('editor', 'none'); + $global_editor = ComponentHelper::getParams('com_componentbuilder')->get('editor', 'none'); // set the field editor value (with none as fallback) $editors = $form->getXml()->xpath('descendant::fields[@name="dynamic_get_headers"]//field[@type="editor"]'); // check if we found any diff --git a/componentbuilderdynamicgetheaderstabs.xml b/componentbuilderdynamicgetheaderstabs.xml index f2b330b..46d7275 100644 --- a/componentbuilderdynamicgetheaderstabs.xml +++ b/componentbuilderdynamicgetheaderstabs.xml @@ -1,13 +1,13 @@ - + PLG_CONTENT_COMPONENTBUILDERDYNAMICGETHEADERSTABS - 9th March, 2024 + 11th March, 2024 Llewellyn van der Merwe joomla@vdm.io https://dev.vdm.io Copyright (C) 2015 Vast Development Method. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt - 2.0.2 + 3.0.0 PLG_CONTENT_COMPONENTBUILDERDYNAMICGETHEADERSTABS_XML_DESCRIPTION diff --git a/forms/dynamic_get.xml b/forms/dynamic_get.xml index d6b990d..6c0f4c1 100644 --- a/forms/dynamic_get.xml +++ b/forms/dynamic_get.xml @@ -1,8 +1,8 @@
diff --git a/language/en-GB/en-GB.plg_content_componentbuilderdynamicgetheaderstabs.ini b/language/en-GB/en-GB.plg_content_componentbuilderdynamicgetheaderstabs.ini index 7bd1afc..4702db9 100644 --- a/language/en-GB/en-GB.plg_content_componentbuilderdynamicgetheaderstabs.ini +++ b/language/en-GB/en-GB.plg_content_componentbuilderdynamicgetheaderstabs.ini @@ -1,6 +1,6 @@ PLG_CONTENT_COMPONENTBUILDERDYNAMICGETHEADERSTABS="Content - Componentbuilder Dynamic Get Headers Tabs" PLG_CONTENT_COMPONENTBUILDERDYNAMICGETHEADERSTABS_DESCRIPTION="This plugin is used to set dynamic gets class headers." -PLG_CONTENT_COMPONENTBUILDERDYNAMICGETHEADERSTABS_XML_DESCRIPTION="

Content - Componentbuilder Dynamic Get Headers Tabs (v.2.0.2)

This plugin is used to set dynamic gets class headers.

Created by Llewellyn van der Merwe
Development started 10th January, 2022

" +PLG_CONTENT_COMPONENTBUILDERDYNAMICGETHEADERSTABS_XML_DESCRIPTION="

Content - Componentbuilder Dynamic Get Headers Tabs (v.3.0.0)

This plugin is used to set dynamic gets class headers.

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

" PLG_CONTENT_COMPONENTBUILDERDYNAMICGETHEADERSTABS_CLASS_HEADERS="Class Headers" PLG_CONTENT_COMPONENTBUILDERDYNAMICGETHEADERSTABS_ADD_SITE_VIEW_MODEL_LABEL="Target Site View
Model Header" PLG_CONTENT_COMPONENTBUILDERDYNAMICGETHEADERSTABS_ADD_SITE_VIEW_MODEL_DESCRIPTION="Only use this option if you have a getItem as your Main Get." diff --git a/language/en-GB/en-GB.plg_content_componentbuilderdynamicgetheaderstabs.sys.ini b/language/en-GB/en-GB.plg_content_componentbuilderdynamicgetheaderstabs.sys.ini index 7bd1afc..4702db9 100644 --- a/language/en-GB/en-GB.plg_content_componentbuilderdynamicgetheaderstabs.sys.ini +++ b/language/en-GB/en-GB.plg_content_componentbuilderdynamicgetheaderstabs.sys.ini @@ -1,6 +1,6 @@ PLG_CONTENT_COMPONENTBUILDERDYNAMICGETHEADERSTABS="Content - Componentbuilder Dynamic Get Headers Tabs" PLG_CONTENT_COMPONENTBUILDERDYNAMICGETHEADERSTABS_DESCRIPTION="This plugin is used to set dynamic gets class headers." -PLG_CONTENT_COMPONENTBUILDERDYNAMICGETHEADERSTABS_XML_DESCRIPTION="

Content - Componentbuilder Dynamic Get Headers Tabs (v.2.0.2)

This plugin is used to set dynamic gets class headers.

Created by Llewellyn van der Merwe
Development started 10th January, 2022

" +PLG_CONTENT_COMPONENTBUILDERDYNAMICGETHEADERSTABS_XML_DESCRIPTION="

Content - Componentbuilder Dynamic Get Headers Tabs (v.3.0.0)

This plugin is used to set dynamic gets class headers.

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

" PLG_CONTENT_COMPONENTBUILDERDYNAMICGETHEADERSTABS_CLASS_HEADERS="Class Headers" PLG_CONTENT_COMPONENTBUILDERDYNAMICGETHEADERSTABS_ADD_SITE_VIEW_MODEL_LABEL="Target Site View
Model Header" PLG_CONTENT_COMPONENTBUILDERDYNAMICGETHEADERSTABS_ADD_SITE_VIEW_MODEL_DESCRIPTION="Only use this option if you have a getItem as your Main Get." diff --git a/script.php b/script.php index dc835d1..91d7b94 100644 --- a/script.php +++ b/script.php @@ -24,546 +24,4 @@ use Joomla\CMS\Filesystem\Folder; */ class plgContentComponentbuilderDynamicGetHeadersTabsInstallerScript { - - /** - * 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; - } - - // 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; - } - - // 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; - } - - // 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; - } - - - // 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 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 3.1.18 or higher installed - if (count($jcbVersion) == 3 && $jcbVersion[0] >= 3 && - ( - ($jcbVersion[0] == 3 && $jcbVersion[1] == 1 && $jcbVersion[2] >= 18) || - ($jcbVersion[0] == 3 && $jcbVersion[1] > 1) || - $jcbVersion[0] > 3) - ) - { - $blockInstall = false; - } - } - - // allow install if all conditions are met - if ($blockInstall) - { - $app->enqueueMessage('Please upgrade to JCB v3.1.18 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 3.0.14 or higher installed - if (count($jcbVersion) == 3 && $jcbVersion[0] >= 3 && - ( - ($jcbVersion[0] == 3 && $jcbVersion[1] == 0 && $jcbVersion[2] >= 14) || - ($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.14 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 3.1.18 or higher installed - if (count($jcbVersion) == 3 && $jcbVersion[0] >= 3 && - ( - ($jcbVersion[0] == 3 && $jcbVersion[1] == 1 && $jcbVersion[2] >= 18) || - ($jcbVersion[0] == 3 && $jcbVersion[1] > 1) || - $jcbVersion[0] > 3) - ) - { - $blockInstall = false; - } - } - - // allow install if all conditions are met - if ($blockInstall) - { - $app->enqueueMessage('Please upgrade to JCB v3.1.18 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 3.0.14 or higher installed - if (count($jcbVersion) == 3 && $jcbVersion[0] >= 3 && - ( - ($jcbVersion[0] == 3 && $jcbVersion[1] == 0 && $jcbVersion[2] >= 14) || - ($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.14 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 3.0.14 or higher installed - if (count($jcbVersion) == 3 && $jcbVersion[0] >= 3 && - ( - ($jcbVersion[0] == 3 && $jcbVersion[1] == 0 && $jcbVersion[2] >= 14) || - ($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.14 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 3.0.14 or higher installed - if (count($jcbVersion) == 3 && $jcbVersion[0] >= 3 && - ( - ($jcbVersion[0] == 3 && $jcbVersion[1] == 0 && $jcbVersion[2] >= 14) || - ($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.14 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 3.0.10 or higher installed - if (count($jcbVersion) == 3 && $jcbVersion[0] >= 3 && - ( - ($jcbVersion[0] == 3 && $jcbVersion[1] == 0 && $jcbVersion[2] >= 10) || - ($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.10 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 3.0.14 or higher installed - if (count($jcbVersion) == 3 && $jcbVersion[0] >= 3 && - ( - ($jcbVersion[0] == 3 && $jcbVersion[1] == 0 && $jcbVersion[2] >= 14) || - ($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.14 or higher before installing this plugin.', 'error'); - return false; - } - - } - - return true; - } }