From ec84f6486e6f19811037bb010533ff9e7f60358f Mon Sep 17 00:00:00 2001 From: aB0t Date: Mon, 11 Mar 2024 16:14:23 +0200 Subject: [PATCH] Release of v3.0.0 --- ...ntbuildercomponentdashboardheaderstabs.php | 15 +- ...ntbuildercomponentdashboardheaderstabs.xml | 6 +- forms/component_dashboard.xml | 4 +- ...ntbuildercomponentdashboardheaderstabs.ini | 2 +- ...ildercomponentdashboardheaderstabs.sys.ini | 2 +- script.php | 261 ------------------ 6 files changed, 14 insertions(+), 276 deletions(-) diff --git a/componentbuildercomponentdashboardheaderstabs.php b/componentbuildercomponentdashboardheaderstabs.php index e27e9ee..dd6b78a 100644 --- a/componentbuildercomponentdashboardheaderstabs.php +++ b/componentbuildercomponentdashboardheaderstabs.php @@ -13,22 +13,21 @@ defined('_JEXEC') or die('Restricted access'); use Joomla\CMS\Form\Form; -use Joomla\CMS\Plugin\CMSPlugin; +use Joomla\CMS\Plugin\CMSPlugin; +use Joomla\CMS\Component\ComponentHelper; use VDM\Joomla\Utilities\ArrayHelper; - -JLoader::register('ComponentbuilderHelper', JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/componentbuilder.php'); /** * Content - Componentbuilder Component Dashboard Headers Tabs plugin. * * @package ComponentbuilderComponentDashboardHeadersTabs - * @since 2.0.1 + * @since 3.0.0 */ class PlgContentComponentbuilderComponentDashboardHeadersTabs 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 +37,8 @@ class PlgContentComponentbuilderComponentDashboardHeadersTabs 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 +56,7 @@ class PlgContentComponentbuilderComponentDashboardHeadersTabs extends CMSPlugin // add the admin view params for privacy integration $form->loadFile('component_dashboard'); // 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="component_dashboard_headers"]//field[@type="editor"]'); // check if we found any diff --git a/componentbuildercomponentdashboardheaderstabs.xml b/componentbuildercomponentdashboardheaderstabs.xml index 75e0eef..8cb727d 100644 --- a/componentbuildercomponentdashboardheaderstabs.xml +++ b/componentbuildercomponentdashboardheaderstabs.xml @@ -1,13 +1,13 @@ - + PLG_CONTENT_COMPONENTBUILDERCOMPONENTDASHBOARDHEADERSTABS - 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_COMPONENTBUILDERCOMPONENTDASHBOARDHEADERSTABS_XML_DESCRIPTION diff --git a/forms/component_dashboard.xml b/forms/component_dashboard.xml index 0da818e..76e1c1b 100644 --- a/forms/component_dashboard.xml +++ b/forms/component_dashboard.xml @@ -1,8 +1,8 @@
diff --git a/language/en-GB/en-GB.plg_content_componentbuildercomponentdashboardheaderstabs.ini b/language/en-GB/en-GB.plg_content_componentbuildercomponentdashboardheaderstabs.ini index 6d78f27..e3429fe 100644 --- a/language/en-GB/en-GB.plg_content_componentbuildercomponentdashboardheaderstabs.ini +++ b/language/en-GB/en-GB.plg_content_componentbuildercomponentdashboardheaderstabs.ini @@ -1,6 +1,6 @@ PLG_CONTENT_COMPONENTBUILDERCOMPONENTDASHBOARDHEADERSTABS="Content - Componentbuilder Component Dashboard Headers Tabs" PLG_CONTENT_COMPONENTBUILDERCOMPONENTDASHBOARDHEADERSTABS_DESCRIPTION="This plugin is used to set component dashboard class custom headers." -PLG_CONTENT_COMPONENTBUILDERCOMPONENTDASHBOARDHEADERSTABS_XML_DESCRIPTION="

Content - Componentbuilder Component Dashboard Headers Tabs (v.2.0.1)

This plugin is used to set component dashboard class custom headers.

Created by Llewellyn van der Merwe
Development started 6th December, 2021

" +PLG_CONTENT_COMPONENTBUILDERCOMPONENTDASHBOARDHEADERSTABS_XML_DESCRIPTION="

Content - Componentbuilder Component Dashboard Headers Tabs (v.3.0.0)

This plugin is used to set component dashboard class custom headers.

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

" PLG_CONTENT_COMPONENTBUILDERCOMPONENTDASHBOARDHEADERSTABS_CLASS_HEADERS="Class Headers" PLG_CONTENT_COMPONENTBUILDERCOMPONENTDASHBOARDHEADERSTABS_ADD_DASHBOARD_VIEW_LABEL="Target Dashboard View
Default Template Header" PLG_CONTENT_COMPONENTBUILDERCOMPONENTDASHBOARDHEADERSTABS_YES="Yes" diff --git a/language/en-GB/en-GB.plg_content_componentbuildercomponentdashboardheaderstabs.sys.ini b/language/en-GB/en-GB.plg_content_componentbuildercomponentdashboardheaderstabs.sys.ini index 6d78f27..e3429fe 100644 --- a/language/en-GB/en-GB.plg_content_componentbuildercomponentdashboardheaderstabs.sys.ini +++ b/language/en-GB/en-GB.plg_content_componentbuildercomponentdashboardheaderstabs.sys.ini @@ -1,6 +1,6 @@ PLG_CONTENT_COMPONENTBUILDERCOMPONENTDASHBOARDHEADERSTABS="Content - Componentbuilder Component Dashboard Headers Tabs" PLG_CONTENT_COMPONENTBUILDERCOMPONENTDASHBOARDHEADERSTABS_DESCRIPTION="This plugin is used to set component dashboard class custom headers." -PLG_CONTENT_COMPONENTBUILDERCOMPONENTDASHBOARDHEADERSTABS_XML_DESCRIPTION="

Content - Componentbuilder Component Dashboard Headers Tabs (v.2.0.1)

This plugin is used to set component dashboard class custom headers.

Created by Llewellyn van der Merwe
Development started 6th December, 2021

" +PLG_CONTENT_COMPONENTBUILDERCOMPONENTDASHBOARDHEADERSTABS_XML_DESCRIPTION="

Content - Componentbuilder Component Dashboard Headers Tabs (v.3.0.0)

This plugin is used to set component dashboard class custom headers.

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

" PLG_CONTENT_COMPONENTBUILDERCOMPONENTDASHBOARDHEADERSTABS_CLASS_HEADERS="Class Headers" PLG_CONTENT_COMPONENTBUILDERCOMPONENTDASHBOARDHEADERSTABS_ADD_DASHBOARD_VIEW_LABEL="Target Dashboard View
Default Template Header" PLG_CONTENT_COMPONENTBUILDERCOMPONENTDASHBOARDHEADERSTABS_YES="Yes" diff --git a/script.php b/script.php index 8cc8e73..638676a 100644 --- a/script.php +++ b/script.php @@ -48,79 +48,6 @@ class plgContentComponentbuilderComponentDashboardHeadersTabsInstallerScript 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)) @@ -128,194 +55,6 @@ class plgContentComponentbuilderComponentDashboardHeadersTabsInstallerScript $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; - } - } return true;