Compare commits
41 Commits
Author | SHA1 | Date | |
---|---|---|---|
319c64e789 | |||
976f3f7e4f | |||
53f0aab067 | |||
64d1b6b2c4 | |||
d750aade2f | |||
273bead98a | |||
38e87173c2 | |||
a7357d3f6e | |||
69c7f28dae | |||
33de1ca8af | |||
09f97fcaa9 | |||
463e2fb8b3 | |||
fa0299ac35 | |||
031d423b5a | |||
a2e891b599 | |||
434467f2bb | |||
a5b668f9af | |||
f4fea98d1d | |||
a32a6c9b4a | |||
8686abcdab | |||
f9eb5b3649 | |||
79ed7d4128 | |||
cb7ab7413f | |||
8a914b477f | |||
b68fa0bf61 | |||
dc175e0fef | |||
f7e27e711c | |||
b5ff162fd5 | |||
f6ded1c6d2 | |||
5fc5467669 | |||
318babf0fe | |||
0ff21aba5b | |||
b8bfd62138 | |||
fe1a595646 | |||
c78d07d0f3 | |||
8c171f2d16 | |||
74b8b6647f | |||
e41a799757 | |||
0510e222ff | |||
79bcbde0d0 | |||
972343a4eb |
@ -1,13 +1,14 @@
|
||||
<?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_COMPONENTBUILDERCUSTOMADMINHEADERSTABS</name>
|
||||
<creationDate>9th March, 2024</creationDate>
|
||||
<creationDate>7th November, 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>4.0.0</version>
|
||||
<namespace path="src">VDM\Plugin\Content\ComponentbuilderCustomAdminHeadersTabs</namespace>
|
||||
<description>PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_XML_DESCRIPTION</description>
|
||||
|
||||
<!-- Scripts to run on installation -->
|
||||
@ -15,15 +16,16 @@
|
||||
|
||||
<!-- Language files -->
|
||||
<languages folder="language">
|
||||
<language tag="en-GB">en-GB/en-GB.plg_content_componentbuildercustomadminheaderstabs.ini</language>
|
||||
<language tag="en-GB">en-GB/en-GB.plg_content_componentbuildercustomadminheaderstabs.sys.ini</language>
|
||||
<language tag="en-GB">en-GB/plg_content_componentbuildercustomadminheaderstabs.ini</language>
|
||||
<language tag="en-GB">en-GB/plg_content_componentbuildercustomadminheaderstabs.sys.ini</language>
|
||||
</languages>
|
||||
|
||||
<!-- Plugin files -->
|
||||
<files>
|
||||
<filename plugin="componentbuildercustomadminheaderstabs">componentbuildercustomadminheaderstabs.php</filename>
|
||||
<folder plugin="componentbuildercustomadminheaderstabs">services</folder>
|
||||
<filename>index.html</filename>
|
||||
<folder>language</folder>
|
||||
<folder>forms</folder>
|
||||
<folder>services</folder>
|
||||
<folder>src</folder>
|
||||
</files>
|
||||
</extension>
|
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- default paths of custom_admin_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="custom_admin_view_headers" label="PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CLASS_HEADERS">
|
||||
@ -59,6 +59,7 @@
|
||||
name="power"
|
||||
label="PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_LABEL"
|
||||
class="list_class span12"
|
||||
layout="joomla.form.field.list-fancy-select"
|
||||
multiple="false"
|
||||
default="0"
|
||||
button="false"
|
||||
@ -145,6 +146,7 @@
|
||||
name="power"
|
||||
label="PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_LABEL"
|
||||
class="list_class span12"
|
||||
layout="joomla.form.field.list-fancy-select"
|
||||
multiple="false"
|
||||
default="0"
|
||||
button="false"
|
||||
@ -231,6 +233,7 @@
|
||||
name="power"
|
||||
label="PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_LABEL"
|
||||
class="list_class span12"
|
||||
layout="joomla.form.field.list-fancy-select"
|
||||
multiple="false"
|
||||
default="0"
|
||||
button="false"
|
||||
@ -317,6 +320,7 @@
|
||||
name="power"
|
||||
label="PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_LABEL"
|
||||
class="list_class span12"
|
||||
layout="joomla.form.field.list-fancy-select"
|
||||
multiple="false"
|
||||
default="0"
|
||||
button="false"
|
||||
@ -403,6 +407,7 @@
|
||||
name="power"
|
||||
label="PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_LABEL"
|
||||
class="list_class span12"
|
||||
layout="joomla.form.field.list-fancy-select"
|
||||
multiple="false"
|
||||
default="0"
|
||||
button="false"
|
||||
@ -489,6 +494,7 @@
|
||||
name="power"
|
||||
label="PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_LABEL"
|
||||
class="list_class span12"
|
||||
layout="joomla.form.field.list-fancy-select"
|
||||
multiple="false"
|
||||
default="0"
|
||||
button="false"
|
||||
@ -575,6 +581,7 @@
|
||||
name="power"
|
||||
label="PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_LABEL"
|
||||
class="list_class span12"
|
||||
layout="joomla.form.field.list-fancy-select"
|
||||
multiple="false"
|
||||
default="0"
|
||||
button="false"
|
||||
@ -661,6 +668,7 @@
|
||||
name="power"
|
||||
label="PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_LABEL"
|
||||
class="list_class span12"
|
||||
layout="joomla.form.field.list-fancy-select"
|
||||
multiple="false"
|
||||
default="0"
|
||||
button="false"
|
||||
@ -746,6 +754,7 @@
|
||||
name="power"
|
||||
label="PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_LABEL"
|
||||
class="list_class span12"
|
||||
layout="joomla.form.field.list-fancy-select"
|
||||
multiple="false"
|
||||
default="0"
|
||||
button="false"
|
||||
|
@ -1,6 +1,6 @@
|
||||
PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS="Content - Componentbuilder Custom Admin Headers Tabs"
|
||||
PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_DESCRIPTION="This plugin is used to set custom admin class custom headers."
|
||||
PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_XML_DESCRIPTION="<h1>Content - Componentbuilder Custom Admin Headers Tabs (v.2.0.1)</h1> <div style='clear: both;'></div><p>This plugin is used to set custom admin 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_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_XML_DESCRIPTION="<h1>Content - Componentbuilder Custom Admin Headers Tabs (v.4.0.0)</h1> <div style='clear: both;'></div><p>This plugin is used to set custom admin 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_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CLASS_HEADERS="Class Headers"
|
||||
PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEW_MODEL_LABEL="Target Custom Admin View<br />Model Header"
|
||||
PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_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_COMPONENTBUILDERCUSTOMADMINHEADERSTABS="Content - Componentbuilder Custom Admin Headers Tabs"
|
||||
PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_DESCRIPTION="This plugin is used to set custom admin class custom headers."
|
||||
PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_XML_DESCRIPTION="<h1>Content - Componentbuilder Custom Admin Headers Tabs (v.2.0.1)</h1> <div style='clear: both;'></div><p>This plugin is used to set custom admin 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_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_XML_DESCRIPTION="<h1>Content - Componentbuilder Custom Admin Headers Tabs (v.4.0.0)</h1> <div style='clear: both;'></div><p>This plugin is used to set custom admin 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_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CLASS_HEADERS="Class Headers"
|
||||
PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEW_MODEL_LABEL="Target Custom Admin View<br />Model Header"
|
||||
PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEW_MODEL_DESCRIPTION="Only use this option if you have a <b>getItem</b> as your <b>Main Get</b>."
|
380
script.php
380
script.php
@ -20,386 +20,8 @@ use Joomla\CMS\Filesystem\Folder;
|
||||
/**
|
||||
* Content - Componentbuilder Custom Admin Headers Tabs script file.
|
||||
*
|
||||
* @package PlgContentComponentbuilderCustomAdminHeadersTabs
|
||||
* @package ComponentbuilderCustomAdminHeadersTabs
|
||||
*/
|
||||
class plgContentComponentbuilderCustomAdminHeadersTabsInstallerScript
|
||||
{
|
||||
|
||||
/**
|
||||
* 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 <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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
1
services/index.html
Normal file
1
services/index.html
Normal file
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
48
services/provider.php
Normal file
48
services/provider.php
Normal file
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Plugin\PluginHelper;
|
||||
use Joomla\CMS\Extension\PluginInterface;
|
||||
use Joomla\Event\DispatcherInterface;
|
||||
use Joomla\DI\ServiceProviderInterface;
|
||||
use Joomla\DI\Container;
|
||||
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
|
||||
use VDM\Plugin\Content\ComponentbuilderCustomAdminHeadersTabs\Extension\ComponentbuilderCustomAdminHeadersTabs;
|
||||
|
||||
return new class () implements ServiceProviderInterface {
|
||||
/**
|
||||
* Registers the service provider with a DI container.
|
||||
*
|
||||
* @param Container $container The DI container.
|
||||
*
|
||||
* @return void
|
||||
* @since 4.3.0
|
||||
*/
|
||||
public function register(Container $container)
|
||||
{
|
||||
$container->set(
|
||||
PluginInterface::class,
|
||||
function (Container $container) {
|
||||
$plugin = new ComponentbuilderCustomAdminHeadersTabs(
|
||||
$container->get(DispatcherInterface::class),
|
||||
(array) PluginHelper::getPlugin('content', 'componentbuildercustomadminheaderstabs')
|
||||
);
|
||||
$plugin->setApplication(Factory::getApplication());
|
||||
|
||||
return $plugin;
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
@ -8,27 +8,28 @@
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
namespace VDM\Plugin\Content\ComponentbuilderCustomAdminHeadersTabs\Extension;
|
||||
|
||||
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
|
||||
use Joomla\CMS\Form\Form;
|
||||
use Joomla\CMS\Plugin\CMSPlugin;
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
|
||||
// No direct access to this file
|
||||
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');
|
||||
|
||||
/**
|
||||
* Content - Componentbuilder Custom Admin Headers Tabs plugin.
|
||||
*
|
||||
* @package ComponentbuilderCustomAdminHeadersTabs
|
||||
* @since 2.0.1
|
||||
* @since 4.0.0
|
||||
*/
|
||||
class PlgContentComponentbuilderCustomAdminHeadersTabs extends CMSPlugin
|
||||
final class ComponentbuilderCustomAdminHeadersTabs 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 +39,8 @@ class PlgContentComponentbuilderCustomAdminHeadersTabs 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
|
||||
*
|
||||
@ -53,11 +54,11 @@ class PlgContentComponentbuilderCustomAdminHeadersTabs extends CMSPlugin
|
||||
if (strpos($context, 'com_componentbuilder.custom_admin_view') === 0)
|
||||
{
|
||||
// Add the forms path
|
||||
Form::addFormPath(__DIR__ . '/forms');
|
||||
Form::addFormPath(__DIR__ . '/../../forms');
|
||||
// add the admin view params for privacy integration
|
||||
$form->loadFile('custom_admin_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="custom_admin_view_headers"]//field[@type="editor"]');
|
||||
// check if we found any
|
1
src/Extension/index.html
Normal file
1
src/Extension/index.html
Normal file
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
Loading…
Reference in New Issue
Block a user