From d006135dc4398a9a6dfba4d0bc95916325ee1820 Mon Sep 17 00:00:00 2001 From: aB0t Date: Mon, 11 Mar 2024 18:32:26 +0200 Subject: [PATCH] Release of v3.0.0 --- componentbuildercomponentheaderstabs.php | 18 +- componentbuildercomponentheaderstabs.xml | 6 +- forms/joomla_component.xml | 4 +- ...t_componentbuildercomponentheaderstabs.ini | 2 +- ...mponentbuildercomponentheaderstabs.sys.ini | 2 +- script.php | 460 ------------------ 6 files changed, 15 insertions(+), 477 deletions(-) diff --git a/componentbuildercomponentheaderstabs.php b/componentbuildercomponentheaderstabs.php index a4c0b59..a540b41 100644 --- a/componentbuildercomponentheaderstabs.php +++ b/componentbuildercomponentheaderstabs.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 Component Headers Tabs plugin. * * @package ComponentbuilderComponentHeadersTabs - * @since 2.0.1 + * @since 3.0.0 */ class PlgContentComponentbuilderComponentHeadersTabs 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 PlgContentComponentbuilderComponentHeadersTabs 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 PlgContentComponentbuilderComponentHeadersTabs extends CMSPlugin // add the admin view params for privacy integration $form->loadFile('joomla_component'); // 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="joomla_component_headers"]//field[@type="editor"]'); // check if we found any diff --git a/componentbuildercomponentheaderstabs.xml b/componentbuildercomponentheaderstabs.xml index 2d525a0..b69d2b0 100644 --- a/componentbuildercomponentheaderstabs.xml +++ b/componentbuildercomponentheaderstabs.xml @@ -1,13 +1,13 @@ - + PLG_CONTENT_COMPONENTBUILDERCOMPONENTHEADERSTABS - 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.1 + 3.0.0 PLG_CONTENT_COMPONENTBUILDERCOMPONENTHEADERSTABS_XML_DESCRIPTION diff --git a/forms/joomla_component.xml b/forms/joomla_component.xml index 0713990..b623584 100644 --- a/forms/joomla_component.xml +++ b/forms/joomla_component.xml @@ -1,8 +1,8 @@
diff --git a/language/en-GB/en-GB.plg_content_componentbuildercomponentheaderstabs.ini b/language/en-GB/en-GB.plg_content_componentbuildercomponentheaderstabs.ini index 0878a50..f4d4077 100644 --- a/language/en-GB/en-GB.plg_content_componentbuildercomponentheaderstabs.ini +++ b/language/en-GB/en-GB.plg_content_componentbuildercomponentheaderstabs.ini @@ -1,6 +1,6 @@ PLG_CONTENT_COMPONENTBUILDERCOMPONENTHEADERSTABS="Content - Componentbuilder Component Headers Tabs" PLG_CONTENT_COMPONENTBUILDERCOMPONENTHEADERSTABS_DESCRIPTION="This plugin is used to set component class custom headers." -PLG_CONTENT_COMPONENTBUILDERCOMPONENTHEADERSTABS_XML_DESCRIPTION="

Content - Componentbuilder Component Headers Tabs (v.2.0.1)

This plugin is used to set component class custom headers.

Created by Llewellyn van der Merwe
Development started 26th December, 2020

" +PLG_CONTENT_COMPONENTBUILDERCOMPONENTHEADERSTABS_XML_DESCRIPTION="

Content - Componentbuilder Component Headers Tabs (v.3.0.0)

This plugin is used to set component class custom headers.

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

" PLG_CONTENT_COMPONENTBUILDERCOMPONENTHEADERSTABS_CLASS_HEADERS="Class Headers" PLG_CONTENT_COMPONENTBUILDERCOMPONENTHEADERSTABS_ADD_ADMIN_COMPONENT_LABEL="Admin Component
Header" PLG_CONTENT_COMPONENTBUILDERCOMPONENTHEADERSTABS_YES="Yes" diff --git a/language/en-GB/en-GB.plg_content_componentbuildercomponentheaderstabs.sys.ini b/language/en-GB/en-GB.plg_content_componentbuildercomponentheaderstabs.sys.ini index 0878a50..f4d4077 100644 --- a/language/en-GB/en-GB.plg_content_componentbuildercomponentheaderstabs.sys.ini +++ b/language/en-GB/en-GB.plg_content_componentbuildercomponentheaderstabs.sys.ini @@ -1,6 +1,6 @@ PLG_CONTENT_COMPONENTBUILDERCOMPONENTHEADERSTABS="Content - Componentbuilder Component Headers Tabs" PLG_CONTENT_COMPONENTBUILDERCOMPONENTHEADERSTABS_DESCRIPTION="This plugin is used to set component class custom headers." -PLG_CONTENT_COMPONENTBUILDERCOMPONENTHEADERSTABS_XML_DESCRIPTION="

Content - Componentbuilder Component Headers Tabs (v.2.0.1)

This plugin is used to set component class custom headers.

Created by Llewellyn van der Merwe
Development started 26th December, 2020

" +PLG_CONTENT_COMPONENTBUILDERCOMPONENTHEADERSTABS_XML_DESCRIPTION="

Content - Componentbuilder Component Headers Tabs (v.3.0.0)

This plugin is used to set component class custom headers.

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

" PLG_CONTENT_COMPONENTBUILDERCOMPONENTHEADERSTABS_CLASS_HEADERS="Class Headers" PLG_CONTENT_COMPONENTBUILDERCOMPONENTHEADERSTABS_ADD_ADMIN_COMPONENT_LABEL="Admin Component
Header" PLG_CONTENT_COMPONENTBUILDERCOMPONENTHEADERSTABS_YES="Yes" diff --git a/script.php b/script.php index 3d51925..e7d1218 100644 --- a/script.php +++ b/script.php @@ -24,464 +24,4 @@ use Joomla\CMS\Filesystem\Folder; */ class plgContentComponentbuilderComponentHeadersTabsInstallerScript { - - /** - * 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; - } - - } - - return true; - } }