diff --git a/componentbuilderexportcompiler.php b/componentbuilderexportcompiler.php
index 55e77f6..27653d6 100644
--- a/componentbuilderexportcompiler.php
+++ b/componentbuilderexportcompiler.php
@@ -14,19 +14,15 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Plugin\CMSPlugin;
-use VDM\Joomla\Utilities\ArrayHelper;
-
-JLoader::register('ComponentbuilderHelper', JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/componentbuilder.php');
-
-use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory;
-use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
-use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
-
+use VDM\Joomla\Componentbuilder\Compiler\Factory;
+use VDM\Joomla\Utilities\ArrayHelper;
+use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
+use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
/**
* Extension - Componentbuilder Export Compiler plugin.
*
* @package ComponentbuilderExportCompiler
- * @since 1.2.0
+ * @since 2.0.0
*/
class PlgExtensionComponentbuilderExportCompiler extends CMSPlugin
{
@@ -79,10 +75,10 @@ class PlgExtensionComponentbuilderExportCompiler extends CMSPlugin
if ($this->exportTextOnly && $this->componentActive())
{
// activate export text only
- CFactory::_('Config')->set('export_text_only', (int) $this->exportTextOnly);
+ Factory::_('Config')->set('export_text_only', (int) $this->exportTextOnly);
// activate strict_permission_per_field if set in plugin (default true)
- CFactory::_('Config')->set('permission_strict_per_field', (bool) $this->strictFieldExportPermissions);
+ Factory::_('Config')->set('permission_strict_per_field', (bool) $this->strictFieldExportPermissions);
}
}
@@ -126,7 +122,7 @@ class PlgExtensionComponentbuilderExportCompiler extends CMSPlugin
{
foreach($this->languageArray as $key => $string)
{
- CFactory::_('Language')->set('adminsys', $key, $string);
+ Factory::_('Language')->set('adminsys', $key, $string);
}
}
}
@@ -144,19 +140,19 @@ class PlgExtensionComponentbuilderExportCompiler extends CMSPlugin
if ($this->exportTextOnly && $this->componentActive() && $timer == 2)
{
// main lang prefix
- $lang = CFactory::_('Config')->lang_prefix . '_CONFIG';
+ $lang = Factory::_('Config')->lang_prefix . '_CONFIG';
// start building field set for config
- $configFieldSets[] = Indent::_(1) . "
");
}
}
@@ -250,7 +246,7 @@ class PlgExtensionComponentbuilderExportCompiler extends CMSPlugin
// only check if there are active
if (ArrayHelper::check($this->componentsActive))
{
- return in_array((int) CFactory::_('Config')->component_id, $this->componentsActive);
+ return in_array((int) Factory::_('Config')->component_id, $this->componentsActive);
}
return false;
}
diff --git a/componentbuilderexportcompiler.xml b/componentbuilderexportcompiler.xml
index c5f0423..33e64bc 100644
--- a/componentbuilderexportcompiler.xml
+++ b/componentbuilderexportcompiler.xml
@@ -1,13 +1,13 @@
-
+PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER
- 9th March, 2024
+ 11th March, 2024Llewellyn van der Merwejoomla@vdm.iohttps://dev.vdm.ioCopyright (C) 2015 Vast Development Method. All rights reserved.GNU General Public License version 2 or later; see LICENSE.txt
- 1.2.0
+ 2.0.0PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER_XML_DESCRIPTION
@@ -28,8 +28,8 @@
>
diff --git a/language/en-GB/en-GB.plg_extension_componentbuilderexportcompiler.ini b/language/en-GB/en-GB.plg_extension_componentbuilderexportcompiler.ini
index 541b9c3..6988449 100644
--- a/language/en-GB/en-GB.plg_extension_componentbuilderexportcompiler.ini
+++ b/language/en-GB/en-GB.plg_extension_componentbuilderexportcompiler.ini
@@ -1,6 +1,6 @@
PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER="Extension - Componentbuilder Export Compiler"
PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER_DESCRIPTION="This plugin is used to tweak the export options for your components during compilation. To activate it you must first enable it here. Then open your JCB component global options, and under the Global tab, select this plugin in the Activate Compiler Plugins field.Also be sure to activate the component/s that should be targeted with this added export feature under the Component Activation tab."
-PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER_XML_DESCRIPTION="
This plugin is used to tweak the export options for your components during compilation. To activate it you must first enable it here. Then open your JCB component global options, and under the Global tab, select this plugin in the Activate Compiler Plugins field.Also be sure to activate the component/s that should be targeted with this added export feature under the Component Activation tab.
This plugin is used to tweak the export options for your components during compilation. To activate it you must first enable it here. Then open your JCB component global options, and under the Global tab, select this plugin in the Activate Compiler Plugins field.Also be sure to activate the component/s that should be targeted with this added export feature under the Component Activation tab.
"
PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER_SETTINGS="Settings"
PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER_ACTIVATE_OPTION_LABEL="Activate Options"
PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER_ACTIVATE_OPTION_DESCRIPTION="You can select the kind of activation control you would like to use. All will target all components, and Selected will let you select only those you want to be active."
diff --git a/language/en-GB/en-GB.plg_extension_componentbuilderexportcompiler.sys.ini b/language/en-GB/en-GB.plg_extension_componentbuilderexportcompiler.sys.ini
index 541b9c3..6988449 100644
--- a/language/en-GB/en-GB.plg_extension_componentbuilderexportcompiler.sys.ini
+++ b/language/en-GB/en-GB.plg_extension_componentbuilderexportcompiler.sys.ini
@@ -1,6 +1,6 @@
PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER="Extension - Componentbuilder Export Compiler"
PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER_DESCRIPTION="This plugin is used to tweak the export options for your components during compilation. To activate it you must first enable it here. Then open your JCB component global options, and under the Global tab, select this plugin in the Activate Compiler Plugins field.Also be sure to activate the component/s that should be targeted with this added export feature under the Component Activation tab."
-PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER_XML_DESCRIPTION="
This plugin is used to tweak the export options for your components during compilation. To activate it you must first enable it here. Then open your JCB component global options, and under the Global tab, select this plugin in the Activate Compiler Plugins field.Also be sure to activate the component/s that should be targeted with this added export feature under the Component Activation tab.
This plugin is used to tweak the export options for your components during compilation. To activate it you must first enable it here. Then open your JCB component global options, and under the Global tab, select this plugin in the Activate Compiler Plugins field.Also be sure to activate the component/s that should be targeted with this added export feature under the Component Activation tab.
"
PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER_SETTINGS="Settings"
PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER_ACTIVATE_OPTION_LABEL="Activate Options"
PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER_ACTIVATE_OPTION_DESCRIPTION="You can select the kind of activation control you would like to use. All will target all components, and Selected will let you select only those you want to be active."
diff --git a/script.php b/script.php
index d83dcbc..66d8a04 100644
--- a/script.php
+++ b/script.php
@@ -24,136 +24,4 @@ use Joomla\CMS\Filesystem\Folder;
*/
class plgExtensionComponentbuilderExportCompilerInstallerScript
{
-
- /**
- * 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;
- }
- }
-
- return true;
- }
}