Release of v3.0.0
This commit is contained in:
parent
262c4727d9
commit
cddef43aea
@ -14,21 +14,20 @@ defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\Form\Form;
|
||||
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 Site Headers Tabs plugin.
|
||||
*
|
||||
* @package ComponentbuilderSiteHeadersTabs
|
||||
* @since 2.0.1
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class PlgContentComponentbuilderSiteHeadersTabs 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 PlgContentComponentbuilderSiteHeadersTabs 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 PlgContentComponentbuilderSiteHeadersTabs extends CMSPlugin
|
||||
// add the admin view params for privacy integration
|
||||
$form->loadFile('site_view');
|
||||
// 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="site_view_headers"]//field[@type="editor"]');
|
||||
// check if we found any
|
||||
|
@ -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_COMPONENTBUILDERSITEHEADERSTABS</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_COMPONENTBUILDERSITEHEADERSTABS_XML_DESCRIPTION</description>
|
||||
|
||||
<!-- Scripts to run on installation -->
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- default paths of site_view 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="site_view_headers" label="PLG_CONTENT_COMPONENTBUILDERSITEHEADERSTABS_CLASS_HEADERS">
|
||||
|
@ -1,6 +1,6 @@
|
||||
PLG_CONTENT_COMPONENTBUILDERSITEHEADERSTABS="Content - Componentbuilder Site Headers Tabs"
|
||||
PLG_CONTENT_COMPONENTBUILDERSITEHEADERSTABS_DESCRIPTION="This plugin is used to set site class custom headers."
|
||||
PLG_CONTENT_COMPONENTBUILDERSITEHEADERSTABS_XML_DESCRIPTION="<h1>Content - Componentbuilder Site Headers Tabs (v.2.0.1)</h1> <div style='clear: both;'></div><p>This plugin is used to set site class custom headers.</p><p>Created by <a href='https://dev.vdm.io' target='_blank'>Llewellyn van der Merwe</a><br /><small>Development started 8th December, 2020</small></p>"
|
||||
PLG_CONTENT_COMPONENTBUILDERSITEHEADERSTABS_XML_DESCRIPTION="<h1>Content - Componentbuilder Site Headers Tabs (v.3.0.0)</h1> <div style='clear: both;'></div><p>This plugin is used to set site 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_COMPONENTBUILDERSITEHEADERSTABS_CLASS_HEADERS="Class Headers"
|
||||
PLG_CONTENT_COMPONENTBUILDERSITEHEADERSTABS_ADD_SITE_VIEW_MODEL_LABEL="Target Site View<br />Model Header"
|
||||
PLG_CONTENT_COMPONENTBUILDERSITEHEADERSTABS_ADD_SITE_VIEW_MODEL_DESCRIPTION="Only use this option if you have a <b>getItem</b> as your <b>Main Get</b>."
|
||||
|
@ -1,6 +1,6 @@
|
||||
PLG_CONTENT_COMPONENTBUILDERSITEHEADERSTABS="Content - Componentbuilder Site Headers Tabs"
|
||||
PLG_CONTENT_COMPONENTBUILDERSITEHEADERSTABS_DESCRIPTION="This plugin is used to set site class custom headers."
|
||||
PLG_CONTENT_COMPONENTBUILDERSITEHEADERSTABS_XML_DESCRIPTION="<h1>Content - Componentbuilder Site Headers Tabs (v.2.0.1)</h1> <div style='clear: both;'></div><p>This plugin is used to set site class custom headers.</p><p>Created by <a href='https://dev.vdm.io' target='_blank'>Llewellyn van der Merwe</a><br /><small>Development started 8th December, 2020</small></p>"
|
||||
PLG_CONTENT_COMPONENTBUILDERSITEHEADERSTABS_XML_DESCRIPTION="<h1>Content - Componentbuilder Site Headers Tabs (v.3.0.0)</h1> <div style='clear: both;'></div><p>This plugin is used to set site 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_COMPONENTBUILDERSITEHEADERSTABS_CLASS_HEADERS="Class Headers"
|
||||
PLG_CONTENT_COMPONENTBUILDERSITEHEADERSTABS_ADD_SITE_VIEW_MODEL_LABEL="Target Site View<br />Model Header"
|
||||
PLG_CONTENT_COMPONENTBUILDERSITEHEADERSTABS_ADD_SITE_VIEW_MODEL_DESCRIPTION="Only use this option if you have a <b>getItem</b> as your <b>Main Get</b>."
|
||||
|
384
script.php
384
script.php
@ -48,9 +48,6 @@ class plgContentComponentbuilderSiteHeadersTabsInstallerScript
|
||||
|
||||
if ('install' === $route)
|
||||
{
|
||||
// needs fix
|
||||
|
||||
|
||||
// check that componentbuilder is installed
|
||||
$pathToCore = JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/componentbuilder.php';
|
||||
if (!JFile::exists($pathToCore))
|
||||
@ -58,387 +55,6 @@ class plgContentComponentbuilderSiteHeadersTabsInstallerScript
|
||||
$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))
|
||||
{
|
||||
$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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 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;
|
||||
|
Loading…
Reference in New Issue
Block a user