34
0

Release of v3.0.0

This commit is contained in:
Robot 2024-03-11 16:14:23 +02:00
parent cb601bf2e4
commit ec84f6486e
Signed by: Robot
GPG Key ID: 14DECD44E7E1BB95
6 changed files with 14 additions and 276 deletions

View File

@ -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

View File

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="plugin" version="3.10" group="content" method="upgrade">
<extension type="plugin" version="4.0" group="content" method="upgrade">
<name>PLG_CONTENT_COMPONENTBUILDERCOMPONENTDASHBOARDHEADERSTABS</name>
<creationDate>9th March, 2024</creationDate>
<creationDate>11th March, 2024</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>joomla@vdm.io</authorEmail>
<authorUrl>https://dev.vdm.io</authorUrl>
<copyright>Copyright (C) 2015 Vast Development Method. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<version>2.0.1</version>
<version>3.0.0</version>
<description>PLG_CONTENT_COMPONENTBUILDERCOMPONENTDASHBOARDHEADERSTABS_XML_DESCRIPTION</description>
<!-- Scripts to run on installation -->

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- default paths of component_dashboard form points to componentbuilder -->
<form
addrulepath="/administrator/components/com_componentbuilder/models/rules"
addfieldpath="/administrator/components/com_componentbuilder/models/fields"
addruleprefix="VDM\Component\Componentbuilder\Administrator\Rule"
addfieldprefix="VDM\Component\Componentbuilder\Administrator\Field"
>
<fields name="params">
<fieldset name="component_dashboard_headers" label="PLG_CONTENT_COMPONENTBUILDERCOMPONENTDASHBOARDHEADERSTABS_CLASS_HEADERS">

View File

@ -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="<h1>Content - Componentbuilder Component Dashboard Headers Tabs (v.2.0.1)</h1> <div style='clear: both;'></div><p>This plugin is used to set component dashboard class custom headers.</p><p>Created by <a href='https://dev.vdm.io' target='_blank'>Llewellyn van der Merwe</a><br /><small>Development started 6th December, 2021</small></p>"
PLG_CONTENT_COMPONENTBUILDERCOMPONENTDASHBOARDHEADERSTABS_XML_DESCRIPTION="<h1>Content - Componentbuilder Component Dashboard Headers Tabs (v.3.0.0)</h1> <div style='clear: both;'></div><p>This plugin is used to set component dashboard class custom headers.</p><p>Created by <a href='https://dev.vdm.io' target='_blank'>Llewellyn van der Merwe</a><br /><small>Development started 10th March, 2024</small></p>"
PLG_CONTENT_COMPONENTBUILDERCOMPONENTDASHBOARDHEADERSTABS_CLASS_HEADERS="Class Headers"
PLG_CONTENT_COMPONENTBUILDERCOMPONENTDASHBOARDHEADERSTABS_ADD_DASHBOARD_VIEW_LABEL="Target Dashboard View<br />Default Template Header"
PLG_CONTENT_COMPONENTBUILDERCOMPONENTDASHBOARDHEADERSTABS_YES="Yes"

View File

@ -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="<h1>Content - Componentbuilder Component Dashboard Headers Tabs (v.2.0.1)</h1> <div style='clear: both;'></div><p>This plugin is used to set component dashboard class custom headers.</p><p>Created by <a href='https://dev.vdm.io' target='_blank'>Llewellyn van der Merwe</a><br /><small>Development started 6th December, 2021</small></p>"
PLG_CONTENT_COMPONENTBUILDERCOMPONENTDASHBOARDHEADERSTABS_XML_DESCRIPTION="<h1>Content - Componentbuilder Component Dashboard Headers Tabs (v.3.0.0)</h1> <div style='clear: both;'></div><p>This plugin is used to set component dashboard class custom headers.</p><p>Created by <a href='https://dev.vdm.io' target='_blank'>Llewellyn van der Merwe</a><br /><small>Development started 10th March, 2024</small></p>"
PLG_CONTENT_COMPONENTBUILDERCOMPONENTDASHBOARDHEADERSTABS_CLASS_HEADERS="Class Headers"
PLG_CONTENT_COMPONENTBUILDERCOMPONENTDASHBOARDHEADERSTABS_ADD_DASHBOARD_VIEW_LABEL="Target Dashboard View<br />Default Template Header"
PLG_CONTENT_COMPONENTBUILDERCOMPONENTDASHBOARDHEADERSTABS_YES="Yes"

View File

@ -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 <a href="https://www.joomlacomponentbuilder.com/ " target="_blank">Joomla Component Builder</a>.', '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 <a href="https://www.joomlacomponentbuilder.com/ " target="_blank">Joomla Component Builder</a>.', '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 <a href="https://www.joomlacomponentbuilder.com/ " target="_blank">Joomla Component Builder</a>.', '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 <a href="https://www.joomlacomponentbuilder.com/ " target="_blank">Joomla Component Builder</a>.', '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 <a href="https://www.joomlacomponentbuilder.com/ " target="_blank">Joomla Component Builder</a>.', '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 <a href="https://www.joomlacomponentbuilder.com/ " target="_blank">Joomla Component Builder</a>.', '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 <a href="https://www.joomlacomponentbuilder.com/ " target="_blank">Joomla Component Builder</a>.', '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 <a href="https://www.joomlacomponentbuilder.com/ " target="_blank">Joomla Component Builder</a>.', '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 <a href="https://www.joomlacomponentbuilder.com/ " target="_blank">Joomla Component Builder</a>.', '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 <a href="https://www.joomlacomponentbuilder.com/ " target="_blank">Joomla Component Builder</a>.', '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;