Stable release of v5.0.0-alpha2

Fix the plug-in installer script builder bug #1067. Fix Event triggers for Joomla 4 and 5 builds.
This commit is contained in:
Robot 2024-03-11 18:30:57 +02:00
parent 87cd4305bb
commit a920cb429b
Signed by: Robot
GPG Key ID: 14DECD44E7E1BB95
90 changed files with 908 additions and 172 deletions

View File

@ -1,11 +1,16 @@
# v5.0.0-alpha2
- Fix the plug-in installer script builder bug #1067
- Fix Event triggers for Joomla 4 and 5 builds.
# v5.0.0-alpha1 # v5.0.0-alpha1
- First alpha release of Component Builder towards Joomla 5 (very unstable...) - First alpha release of Component Builder towards Joomla 5 (very unstable...)
# v4.0.0-alpha1 # v4.0.0-alpha2
- First alpha release of Component Builder towards Joomla 4 (very unstable...) - Fix the plug-in installer script builder bug #1067
# v3.2.0-beta4 # v3.2.0-beta6
- Add Preferred Joomla Version to Components - Fix the plug-in installer script builder bug #1068

View File

@ -3140,7 +3140,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface
echo '<div style="background-color: #fff;" class="alert alert-info"><a target="_blank" href="https://dev.vdm.io" title="Component Builder"> echo '<div style="background-color: #fff;" class="alert alert-info"><a target="_blank" href="https://dev.vdm.io" title="Component Builder">
<img src="components/com_componentbuilder/assets/images/vdm-component.jpg"/> <img src="components/com_componentbuilder/assets/images/vdm-component.jpg"/>
</a> </a>
<h3>Upgrade to Version 5.0.0-alpha1 Was Successful! Let us know if anything is not working as expected.</h3></div>'; <h3>Upgrade to Version 5.0.0-alpha2 Was Successful! Let us know if anything is not working as expected.</h3></div>';
// Add/Update component in the action logs extensions table. // Add/Update component in the action logs extensions table.
$this->setActionLogsExtensions(); $this->setActionLogsExtensions();

View File

@ -1,7 +1,7 @@
# Joomla Component Builder ([JCB](https://www.joomlacomponentbuilder.com)) # Joomla Component Builder ([JCB](https://www.joomlacomponentbuilder.com))
This is a [Joomla 3.x](https://extensions.joomla.org/extension/component-builder/) component. [__See In Action__](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) This is a [Joomla 5.x](https://extensions.joomla.org/extension/component-builder/) component. [__See In Action__](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
![Component Builder image](https://git.vdm.dev/joomla/Component-Builder/raw/branch/master/admin/assets/images/jcb-banner.jpg "The Component Builder") ![Component Builder image](https://git.vdm.dev/joomla/Component-Builder/raw/branch/master/admin/assets/images/jcb-banner.jpg "The Component Builder")
@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have! Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (5.0.0-alpha1) with **ALL** its features and **ALL** concepts totally open-source and free! You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (5.0.0-alpha2) with **ALL** its features and **ALL** concepts totally open-source and free!
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -144,14 +144,14 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 9th March, 2024 + *Last Build*: 11th March, 2024
+ *Version*: 5.0.0-alpha1 + *Version*: 5.0.0-alpha2
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt + *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **707644** + *Line count*: **725286**
+ *Field count*: **1690** + *Field count*: **2078**
+ *File count*: **4985** + *File count*: **5117**
+ *Folder count*: **453** + *Folder count*: **518**
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com). > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io) > Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)

View File

@ -1,7 +1,7 @@
# Joomla Component Builder ([JCB](https://www.joomlacomponentbuilder.com)) # Joomla Component Builder ([JCB](https://www.joomlacomponentbuilder.com))
This is a [Joomla 3.x](https://extensions.joomla.org/extension/component-builder/) component. [__See In Action__](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) This is a [Joomla 5.x](https://extensions.joomla.org/extension/component-builder/) component. [__See In Action__](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
![Component Builder image](https://git.vdm.dev/joomla/Component-Builder/raw/branch/master/admin/assets/images/jcb-banner.jpg "The Component Builder") ![Component Builder image](https://git.vdm.dev/joomla/Component-Builder/raw/branch/master/admin/assets/images/jcb-banner.jpg "The Component Builder")
@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have! Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (5.0.0-alpha1) with **ALL** its features and **ALL** concepts totally open-source and free! You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (5.0.0-alpha2) with **ALL** its features and **ALL** concepts totally open-source and free!
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -144,14 +144,14 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 9th March, 2024 + *Last Build*: 11th March, 2024
+ *Version*: 5.0.0-alpha1 + *Version*: 5.0.0-alpha2
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt + *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **707644** + *Line count*: **725286**
+ *Field count*: **1690** + *Field count*: **2078**
+ *File count*: **4985** + *File count*: **5117**
+ *Folder count*: **453** + *Folder count*: **518**
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com). > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io) > Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Controller; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Controller;
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\CMS\Application\CMSApplication; use Joomla\CMS\Application\CMSApplication;

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Model; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Model;
###AJAX_ADMIN_MODEL_HEADER### ###AJAX_ADMIN_MODEL_HEADER###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Controller; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Controller;
use Joomla\CMS\MVC\Controller\BaseController; use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\Utilities\ArrayHelper; use Joomla\Utilities\ArrayHelper;

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Extension; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Extension;
use Joomla\CMS\Association\AssociationServiceInterface; use Joomla\CMS\Association\AssociationServiceInterface;
use Joomla\CMS\Association\AssociationServiceTrait; use Joomla\CMS\Association\AssociationServiceTrait;
@ -31,7 +31,7 @@ use Joomla\CMS\Language\Text;
use Joomla\CMS\Tag\TagServiceInterface; use Joomla\CMS\Tag\TagServiceInterface;
use Joomla\CMS\Tag\TagServiceTrait; use Joomla\CMS\Tag\TagServiceTrait;
use Joomla\CMS\User\UserFactoryInterface; use Joomla\CMS\User\UserFactoryInterface;
// (soon) use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Service\HTML\AdministratorService; // (soon) use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Service\HTML\AdministratorService;
use Psr\Container\ContainerInterface; use Psr\Container\ContainerInterface;
// No direct access to this file // No direct access to this file

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Helper; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper;
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\CMS\Document\Document; use Joomla\CMS\Document\Document;

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Helper; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper;
###ADMIN_POWER_HELPER### ###ADMIN_POWER_HELPER###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Controller; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Controller;
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\CMS\MVC\Controller\BaseController; use Joomla\CMS\MVC\Controller\BaseController;

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Helper; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper;
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Component\ComponentHelper;

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Controller; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Controller;
###IMPORT_CONTROLLER_HEADER### ###IMPORT_CONTROLLER_HEADER###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Controller; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Controller;
###IMPORT_CUSTOM_CONTROLLER_HEADER### ###IMPORT_CUSTOM_CONTROLLER_HEADER###

View File

@ -13,13 +13,13 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\View\Import; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\View\Import;
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text; use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\CMS\Toolbar\ToolbarHelper;
use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Helper\###Component###Helper; use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper\###Component###Helper;
// No direct access to this file // No direct access to this file
\defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### \defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\View\###View###Import; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\View\###View###Import;
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text; use Joomla\CMS\Language\Text;
@ -22,7 +22,7 @@ use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\HTML\HTMLHelper as Html;
use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Helper\###Component###Helper; use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper\###Component###Helper;
// No direct access to this file // No direct access to this file
\defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### \defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Model; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Model;
###IMPORT_MODEL_HEADER### ###IMPORT_MODEL_HEADER###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Model; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Model;
###IMPORT_CUSTOM_MODEL_HEADER### ###IMPORT_CUSTOM_MODEL_HEADER###

View File

@ -27,8 +27,8 @@ use Joomla\CMS\Extension\Service\Provider\MVCFactory;
use Joomla\CMS\Extension\Service\Provider\RouterFactory; use Joomla\CMS\Extension\Service\Provider\RouterFactory;
use Joomla\CMS\HTML\Registry; use Joomla\CMS\HTML\Registry;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Extension\###Component###Component; use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Extension\###Component###Component;
// (soon) use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Helper\AssociationsHelper; // (soon) use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper\AssociationsHelper;
use Joomla\DI\Container; use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface; use Joomla\DI\ServiceProviderInterface;

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Controller; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Controller;
###ADMIN_VIEWS_CONTROLLER_HEADER### ###ADMIN_VIEWS_CONTROLLER_HEADER###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\View\###Views###; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\View\###Views###;
###ADMIN_VIEWS_HTML_HEADER### ###ADMIN_VIEWS_HTML_HEADER###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Model; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Model;
###ADMIN_VIEWS_MODEL_HEADER### ###ADMIN_VIEWS_MODEL_HEADER###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Controller; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Controller;
###ADMIN_VIEW_CONTROLLER_HEADER### ###ADMIN_VIEW_CONTROLLER_HEADER###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\View\###View###; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\View\###View###;
###ADMIN_VIEW_HTML_HEADER### ###ADMIN_VIEW_HTML_HEADER###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Model; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Model;
###ADMIN_VIEW_MODEL_HEADER### ###ADMIN_VIEW_MODEL_HEADER###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Table; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Table;
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\CMS\Table\Table; use Joomla\CMS\Table\Table;
@ -33,7 +33,7 @@ use Joomla\Database\DatabaseDriver;
use Joomla\Event\DispatcherInterface; use Joomla\Event\DispatcherInterface;
use Joomla\String\StringHelper; use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper; use Joomla\Utilities\ArrayHelper;
use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Helper\###Component###Helper; use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper\###Component###Helper;
// No direct access to this file // No direct access to this file
\defined('_JEXEC') or die; \defined('_JEXEC') or die;

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Controller; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Controller;
###CUSTOM_ADMIN_VIEWS_CONTROLLER_HEADER### ###CUSTOM_ADMIN_VIEWS_CONTROLLER_HEADER###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\View\###SViews###; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\View\###SViews###;
###CUSTOM_ADMIN_VIEWS_HTML_HEADER######CUSTOM_ADMIN_GET_MODULE_JIMPORT### ###CUSTOM_ADMIN_VIEWS_HTML_HEADER######CUSTOM_ADMIN_GET_MODULE_JIMPORT###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Model; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Model;
###CUSTOM_ADMIN_VIEWS_MODEL_HEADER### ###CUSTOM_ADMIN_VIEWS_MODEL_HEADER###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Controller; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Controller;
###CUSTOM_ADMIN_VIEW_CONTROLLER_HEADER### ###CUSTOM_ADMIN_VIEW_CONTROLLER_HEADER###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\View\###SView###; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\View\###SView###;
###CUSTOM_ADMIN_VIEW_HTML_HEADER######CUSTOM_ADMIN_GET_MODULE_JIMPORT### ###CUSTOM_ADMIN_VIEW_HTML_HEADER######CUSTOM_ADMIN_GET_MODULE_JIMPORT###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Model; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Model;
###CUSTOM_ADMIN_VIEW_MODEL_HEADER### ###CUSTOM_ADMIN_VIEW_MODEL_HEADER###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Controller; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Controller;
###DASH_CONTROLLER_HEADER### ###DASH_CONTROLLER_HEADER###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Model; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Model;
###DASH_MODEL_HEADER### ###DASH_MODEL_HEADER###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\View\###Component###; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\View\###Component###;
###DASH_VIEW_HTML_HEADER### ###DASH_VIEW_HTML_HEADER###

View File

@ -13,14 +13,14 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Field; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Field;
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\CMS\Form\Field\CheckboxesField; use Joomla\CMS\Form\Field\CheckboxesField;
use Joomla\CMS\Language\Text; use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Component\ComponentHelper;
use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Helper\###Component###Helper; use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper\###Component###Helper;
// No direct access to this file // No direct access to this file
\defined('_JEXEC') or die; \defined('_JEXEC') or die;

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Field; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Field;
###FORM_CUSTOM_FIELD_HEADER### ###FORM_CUSTOM_FIELD_HEADER###

View File

@ -13,14 +13,14 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Field; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Field;
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\CMS\Form\Field\ListField; use Joomla\CMS\Form\Field\ListField;
use Joomla\CMS\Language\Text; use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Component\ComponentHelper;
use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Helper\###Component###Helper; use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper\###Component###Helper;
// No direct access to this file // No direct access to this file
\defined('_JEXEC') or die; \defined('_JEXEC') or die;

View File

@ -13,14 +13,14 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Field; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Field;
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\CMS\Form\Field\RadioField; use Joomla\CMS\Form\Field\RadioField;
use Joomla\CMS\Language\Text; use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Component\ComponentHelper;
use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Helper\###Component###Helper; use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper\###Component###Helper;
// No direct access to this file // No direct access to this file
\defined('_JEXEC') or die; \defined('_JEXEC') or die;

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Rule; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Rule;
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text; use Joomla\CMS\Language\Text;
@ -22,7 +22,7 @@ use Joomla\CMS\Form\FormRule;
use Joomla\Registry\Registry; use Joomla\Registry\Registry;
use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Component\ComponentHelper;
use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Helper\###Component###Helper; use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper\###Component###Helper;
// No direct access to this file // No direct access to this file
\defined('JPATH_PLATFORM') or die; \defined('JPATH_PLATFORM') or die;

View File

@ -13,14 +13,14 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Field; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Field;
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\CMS\Form\Field\UserField; use Joomla\CMS\Form\Field\UserField;
use Joomla\CMS\Language\Text; use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Component\ComponentHelper;
use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Helper\###Component###Helper; use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper\###Component###Helper;
// No direct access to this file // No direct access to this file
\defined('_JEXEC') or die; \defined('_JEXEC') or die;

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Controller; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Controller;
###SITE_ADMIN_VIEW_CONTROLLER_HEADER### ###SITE_ADMIN_VIEW_CONTROLLER_HEADER###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\View\###View###; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\View\###View###;
###SITE_ADMIN_VIEW_HTML_HEADER### ###SITE_ADMIN_VIEW_HTML_HEADER###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Model; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Model;
###SITE_ADMIN_VIEW_MODEL_HEADER### ###SITE_ADMIN_VIEW_MODEL_HEADER###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Controller; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Controller;
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\CMS\Application\CMSApplication; use Joomla\CMS\Application\CMSApplication;

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Model; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Model;
###AJAX_SITE_MODEL_HEADER### ###AJAX_SITE_MODEL_HEADER###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Dispatcher; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Dispatcher;
use Joomla\CMS\Dispatcher\ComponentDispatcher; use Joomla\CMS\Dispatcher\ComponentDispatcher;

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Controller; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Controller;
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\CMS\MVC\Controller\BaseController; use Joomla\CMS\MVC\Controller\BaseController;

View File

@ -13,14 +13,14 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Field; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Field;
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\CMS\Form\Field\CheckboxesField; use Joomla\CMS\Form\Field\CheckboxesField;
use Joomla\CMS\Language\Text; use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Component\ComponentHelper;
use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Helper\###Component###Helper; use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Helper\###Component###Helper;
// No direct access to this file // No direct access to this file
\defined('_JEXEC') or die; \defined('_JEXEC') or die;

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Field; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Field;
###SITE_FORM_CUSTOM_FIELD_HEADER### ###SITE_FORM_CUSTOM_FIELD_HEADER###

View File

@ -13,14 +13,14 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Field; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Field;
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\CMS\Form\Field\ListField; use Joomla\CMS\Form\Field\ListField;
use Joomla\CMS\Language\Text; use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Component\ComponentHelper;
use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Helper\###Component###Helper; use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Helper\###Component###Helper;
// No direct access to this file // No direct access to this file
\defined('_JEXEC') or die; \defined('_JEXEC') or die;

View File

@ -13,14 +13,14 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Field; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Field;
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\CMS\Form\Field\RadioField; use Joomla\CMS\Form\Field\RadioField;
use Joomla\CMS\Language\Text; use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Component\ComponentHelper;
use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Helper\###Component###Helper; use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Helper\###Component###Helper;
// No direct access to this file // No direct access to this file
\defined('_JEXEC') or die; \defined('_JEXEC') or die;

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Rule; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Rule;
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text; use Joomla\CMS\Language\Text;
@ -22,7 +22,7 @@ use Joomla\CMS\Form\FormRule;
use Joomla\Registry\Registry; use Joomla\Registry\Registry;
use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Component\ComponentHelper;
use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Helper\###Component###Helper; use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Helper\###Component###Helper;
// No direct access to this file // No direct access to this file
\defined('JPATH_PLATFORM') or die; \defined('JPATH_PLATFORM') or die;

View File

@ -13,14 +13,14 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Field; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Field;
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\CMS\Form\Field\UserField; use Joomla\CMS\Form\Field\UserField;
use Joomla\CMS\Language\Text; use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Component\ComponentHelper;
use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Helper\###Component###Helper; use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Helper\###Component###Helper;
// No direct access to this file // No direct access to this file
\defined('_JEXEC') or die; \defined('_JEXEC') or die;

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Helper; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Helper;
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\CMS\Document\Document; use Joomla\CMS\Document\Document;

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Helper; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Helper;
###SITE_POWER_HELPER### ###SITE_POWER_HELPER###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Controller; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Controller;
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\CMS\MVC\Controller\BaseController; use Joomla\CMS\MVC\Controller\BaseController;

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Service; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Service;
###SITE_ROUTER_HEADER### ###SITE_ROUTER_HEADER###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Helper; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Helper;
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text; use Joomla\CMS\Language\Text;

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\View\###SViews###; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\View\###SViews###;
###SITE_VIEWS_HTML_HEADER######SITE_GET_MODULE_JIMPORT### ###SITE_VIEWS_HTML_HEADER######SITE_GET_MODULE_JIMPORT###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Model; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Model;
###SITE_VIEWS_MODEL_HEADER### ###SITE_VIEWS_MODEL_HEADER###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Controller; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Controller;
###SITE_VIEW_CONTROLLER_HEADER### ###SITE_VIEW_CONTROLLER_HEADER###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\View\###SView###; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\View\###SView###;
###SITE_VIEW_HTML_HEADER######SITE_GET_MODULE_JIMPORT### ###SITE_VIEW_HTML_HEADER######SITE_GET_MODULE_JIMPORT###

View File

@ -13,7 +13,7 @@
defined('_JCB_TEMPLATE') or die; defined('_JCB_TEMPLATE') or die;
?> ?>
###BOM### ###BOM###
namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\Model; namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Model;
###SITE_VIEW_MODEL_HEADER### ###SITE_VIEW_MODEL_HEADER###

View File

@ -14,7 +14,7 @@
<p>###DESCRIPTION###</p> <p>###DESCRIPTION###</p>
<p>Created by <a href="###AUTHORWEBSITE###" target="_blank">###AUTHOR###</a><br /><small>Development started ###CREATIONDATE###</small></p> <p>Created by <a href="###AUTHORWEBSITE###" target="_blank">###AUTHOR###</a><br /><small>Development started ###CREATIONDATE###</small></p>
]]></description> ]]></description>
<namespace path="src">###NAMESPACEPREFIX###\Component\###ComponentNameSpace###</namespace> <namespace path="src">###NAMESPACEPREFIX###\Component\###ComponentNamespace###</namespace>
<!-- Runs on install --> <!-- Runs on install -->
<install> <install>

View File

@ -17,7 +17,7 @@ defined('_JCB_TEMPLATE') or die;
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text; use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\HTML\HTMLHelper as Html;
use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Helper\###Component###Helper; use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper\###Component###Helper;
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED###

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<form <form
addruleprefix="###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Rule" addruleprefix="###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Rule"
addfieldprefix="###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Field" addfieldprefix="###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Field"
> >
###FIELDFILTERSETS### ###FIELDFILTERSETS###

View File

@ -17,7 +17,7 @@ defined('_JCB_TEMPLATE') or die;
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text; use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\HTML\HTMLHelper as Html;
use ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Helper\###Component###Helper; use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper\###Component###Helper;
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die; defined('_JEXEC') or die;

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<form <form
addruleprefix="###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Rule" addruleprefix="###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Rule"
addfieldprefix="###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Administrator\Field" addfieldprefix="###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Field"
> >
<config> <config>
<inlinehelp button="show"/> <inlinehelp button="show"/>

View File

@ -0,0 +1 @@

View File

@ -0,0 +1,148 @@
<?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
*/
namespace VDM\Component\Componentbuilder\Administrator\Field;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Field\ListField;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Component\ComponentHelper;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
// No direct access to this file
\defined('_JEXEC') or die;
/**
* Adminlistvieworderfields Form Field class for the Componentbuilder component
*
* @since 1.6
*/
class AdminlistvieworderfieldsField extends ListField
{
/**
* The adminlistvieworderfields field type.
*
* @var string
*/
public $type = 'Adminlistvieworderfields';
/**
* Method to get a list of options for a list input.
*
* @return array An array of Html options.
* @since 1.6
*/
protected function getOptions()
{
// load the db object
$db = Factory::getDBO();
// get the input from url
$jinput = Factory::getApplication()->input;
// get the id
$adminView = $jinput->getInt('id', 0);
// set the field trackers
$fieldIds = array();
$sortIds = array();
// check if we have an admin view
if (is_numeric($adminView) && $adminView >= 1)
{
// get all the fields linked to the admin view
if ($addFields = ComponentbuilderHelper::getVar('admin_fields', (int) $adminView, 'admin_view', 'addfields'))
{
if (ComponentbuilderHelper::checkJson($addFields))
{
$addFields = json_decode($addFields, true);
if (ComponentbuilderHelper::checkArray($addFields))
{
foreach($addFields as $addField)
{
// admin list view and ordering
if (isset($addField['field']) && isset($addField['list']) && ($addField['list'] == 1 || $addField['list'] == 3)
&& isset($addField['sort']) && $addField['sort'])
{
$fieldIds[(int) $addField['field']] = (int) $addField['field'];
}
// do track all fields set as sorted
if (isset($addField['field']) && isset($addField['sort']) && $addField['sort'])
{
$sortIds[(int) $addField['field']] = (int) $addField['field'];
}
}
}
}
}
// get all the fields that are also having a relationship on the list view as sorted
if ($addFields = ComponentbuilderHelper::getVar('admin_fields_relations', (int) $adminView, 'admin_view', 'addrelations'))
{
if (ComponentbuilderHelper::checkJson($addFields))
{
$addFields = json_decode($addFields, true);
if (ComponentbuilderHelper::checkArray($addFields))
{
foreach($addFields as $addField)
{
// admin list view and ordering
if (isset($addField['joinfields']) && ComponentbuilderHelper::checkArray($addField['joinfields']))
{
foreach($addField['joinfields'] as $joinfield)
{
if (isset($sortIds[$joinfield]))
{
$fieldIds[(int) $joinfield] = (int) $joinfield;
}
}
}
}
}
}
}
// filter by fields linked
if (ComponentbuilderHelper::checkArray($fieldIds))
{
$query = $db->getQuery(true);
$query->select($db->quoteName(array('a.id','a.name', 'a.xml', 'b.name'),array('id','name', 'xml', 'type')));
$query->from($db->quoteName('#__componentbuilder_field', 'a'));
$query->join('LEFT', '#__componentbuilder_fieldtype AS b ON b.id = a.fieldtype');
$query->where($db->quoteName('a.published') . ' >= 1');
// only load these fields
$query->where($db->quoteName('a.id') . ' IN (' . implode(',', $fieldIds) . ')');
$query->order('a.name ASC');
$db->setQuery((string)$query);
$items = $db->loadObjectList();
$options = array();
if ($items)
{
$options[] = Html::_('select.option', '', Text::_('PLG_CONTENT_COMPONENTBUILDERFIELDORDERINGTABS_SELECT_AN_OPTION'));
$options[] = Html::_('select.option', -1, Text::_('PLG_CONTENT_COMPONENTBUILDERFIELDORDERINGTABS_ID'). ' [ id - text ]');
$options[] = Html::_('select.option', -2, Text::_('PLG_CONTENT_COMPONENTBUILDERFIELDORDERINGTABS_ORDERING'). ' [ ordering - number ]');
$options[] = Html::_('select.option', -3, Text::_('PLG_CONTENT_COMPONENTBUILDERFIELDORDERINGTABS_STATUS'). ' [ published - list ]');
foreach($items as $item)
{
// get the field name (TODO this could slow down the system so we will need to improve on this)
if (isset($item->xml) && ComponentbuilderHelper::checkJson($item->xml))
{
$field_xml = json_decode($item->xml);
$field_name = ComponentbuilderHelper::getBetween($field_xml,'name="','"');
$field_name = ComponentbuilderHelper::safeFieldName($field_name);
$options[] = Html::_('select.option', $item->id, $item->name . ' [ ' . $field_name . ' - ' . $item->type . ' ]');
}
else
{
$options[] = Html::_('select.option', $item->id, $item->name . ' [ empty - ' . $item->type . ' ]');
}
}
}
return $options;
}
}
return false;
}
}

View File

@ -0,0 +1,185 @@
<?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
*/
namespace VDM\Component\Componentbuilder\Administrator\Field;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Field\ListField;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Component\ComponentHelper;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
// No direct access to this file
\defined('_JEXEC') or die;
/**
* Excludedlanguages Form Field class for the Componentbuilder component
*
* @since 1.6
*/
class ExcludedlanguagesField extends ListField
{
/**
* The excludedlanguages field type.
*
* @var string
*/
public $type = 'Excludedlanguages';
/**
* Override to add new button
*
* @return string The field input markup.
*
* @since 3.2
*/
protected function getInput()
{
// see if we should add buttons
$set_button = $this->getAttribute('button');
// get html
$html = parent::getInput();
// if true set button
if ($set_button === 'true')
{
$button = array();
$script = array();
$button_code_name = $this->getAttribute('name');
// get the input from url
$app = Factory::getApplication();
$jinput = $app->input;
// get the view name & id
$values = $jinput->getArray(array(
'id' => 'int',
'view' => 'word'
));
// check if new item
$ref = '';
$refJ = '';
if (!is_null($values['id']) && strlen($values['view']))
{
// only load referral if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
// get the return value.
$_uri = (string) \Joomla\CMS\Uri\Uri::getInstance();
$_return = urlencode(base64_encode($_uri));
// load return value.
$ref .= '&amp;return=' . $_return;
$refJ .= '&return=' . $_return;
}
// get button label
$button_label = trim($button_code_name);
$button_label = preg_replace('/_+/', ' ', $button_label);
$button_label = preg_replace('/\s+/', ' ', $button_label);
$button_label = preg_replace("/[^A-Za-z ]/", '', $button_label);
$button_label = ucfirst(strtolower($button_label));
// get user object
$user = Factory::getApplication()->getIdentity();
// only add if user allowed to create language
if ($user->authorise('language.create', 'com_componentbuilder') && $app->isClient('administrator')) // TODO for now only in admin area.
{
// build Create button
$button[] = '<a id="'.$button_code_name.'Create" class="btn btn-small btn-success hasTooltip" title="'.Text::sprintf('PLG_CONTENT_COMPONENTBUILDERLANGUAGETABS_CREATE_NEW_S', $button_label).'" style="border-radius: 0px 4px 4px 0px;"
href="index.php?option=com_componentbuilder&amp;view=language&amp;layout=edit'.$ref.'" >
<span class="icon-new icon-white"></span></a>';
}
// only add if user allowed to edit language
if ($user->authorise('language.edit', 'com_componentbuilder') && $app->isClient('administrator')) // TODO for now only in admin area.
{
// build edit button
$button[] = '<a id="'.$button_code_name.'Edit" class="btn btn-small hasTooltip" title="'.Text::sprintf('PLG_CONTENT_COMPONENTBUILDERLANGUAGETABS_EDIT_S', $button_label).'" style="display: none; border-radius: 0px 4px 4px 0px;" href="#" >
<span class="icon-edit"></span></a>';
// build script
$script[] = "
document.addEventListener('DOMContentLoaded', function() {
document.getElementById('jform_".$button_code_name."').addEventListener('change', function(e) {
e.preventDefault();
let ".$button_code_name."Value = this.value;
".$button_code_name."Button(".$button_code_name."Value);
});
let ".$button_code_name."Value = document.getElementById('jform_".$button_code_name."').value;
".$button_code_name."Button(".$button_code_name."Value);
});
function ".$button_code_name."Button(value) {
var createButton = document.getElementById('".$button_code_name."Create');
var editButton = document.getElementById('".$button_code_name."Edit');
if (value > 0) {
// hide the create button
createButton.style.display = 'none';
// show edit button
editButton.style.display = 'block';
let url = 'index.php?option=com_componentbuilder&view=languages&task=language.edit&id='+value+'".$refJ."';
editButton.setAttribute('href', url);
} else {
// show the create button
createButton.style.display = 'block';
// hide edit button
editButton.style.display = 'none';
}
}";
}
// check if button was created for language field.
if (is_array($button) && count($button) > 0)
{
// Load the needed script.
$document = Factory::getApplication()->getDocument();
$document->addScriptDeclaration(implode(' ',$script));
// return the button attached to input field.
return '<div class="input-group">' .$html . implode('',$button).'</div>';
}
}
return $html;
}
/**
* Method to get a list of options for a list input.
*
* @return array An array of Html options.
* @since 1.6
*/
protected function getOptions()
{
$db = Factory::getDBO();
$query = $db->getQuery(true);
$query->select($db->quoteName(array('a.langtag','a.name'),array('langtag','languages_name')));
$query->from($db->quoteName('#__componentbuilder_language', 'a'));
$query->where($db->quoteName('a.published') . ' >= 1');
$query->order('a.langtag ASC');
$db->setQuery((string)$query);
$items = $db->loadObjectList();
// add the main language
$main_lang = trim(ComponentHelper::getParams('com_componentbuilder')->get('language', 'en-GB'));
// check if any language was added
$wasAdded = false;
$options = array();
if ($items)
{
$options[] = Html::_('select.option', '', 'Select an option');
foreach($items as $item)
{
$item->langtag = trim($item->langtag);
// do not add main language
if ($main_lang !== $item->langtag)
{
$options[] = Html::_('select.option', $item->langtag, $item->languages_name . ' (' .$item->langtag.')');
$wasAdded = true;
}
}
}
// now if none was added give notice
if (!$wasAdded)
{
$options[] = Html::_('select.option', '', 'Add languages to select');
}
return $options;
}
}

View File

@ -42,7 +42,7 @@ class JoomlacomponentsField extends ListField
*/ */
protected function getOptions() protected function getOptions()
{ {
$db = Factory::getDBO(); $db = Factory::getDBO();
$query = $db->getQuery(true); $query = $db->getQuery(true);
$query->select($db->quoteName(array('a.id','a.system_name'),array('id','components_system_name'))); $query->select($db->quoteName(array('a.id','a.system_name'),array('id','components_system_name')));
$query->from($db->quoteName('#__componentbuilder_joomla_component', 'a')); $query->from($db->quoteName('#__componentbuilder_joomla_component', 'a'));

View File

@ -34,6 +34,112 @@ class JoomlapluginsField extends ListField
*/ */
public $type = 'Joomlaplugins'; public $type = 'Joomlaplugins';
/**
* Override to add new button
*
* @return string The field input markup.
*
* @since 3.2
*/
protected function getInput()
{
// see if we should add buttons
$set_button = $this->getAttribute('button');
// get html
$html = parent::getInput();
// if true set button
if ($set_button === 'true')
{
$button = array();
$script = array();
$button_code_name = $this->getAttribute('name');
// get the input from url
$app = Factory::getApplication();
$jinput = $app->input;
// get the view name & id
$values = $jinput->getArray(array(
'id' => 'int',
'view' => 'word'
));
// check if new item
$ref = '';
$refJ = '';
if (!is_null($values['id']) && strlen($values['view']))
{
// only load referral if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
// get the return value.
$_uri = (string) \Joomla\CMS\Uri\Uri::getInstance();
$_return = urlencode(base64_encode($_uri));
// load return value.
$ref .= '&amp;return=' . $_return;
$refJ .= '&return=' . $_return;
}
// get button label
$button_label = trim($button_code_name);
$button_label = preg_replace('/_+/', ' ', $button_label);
$button_label = preg_replace('/\s+/', ' ', $button_label);
$button_label = preg_replace("/[^A-Za-z ]/", '', $button_label);
$button_label = ucfirst(strtolower($button_label));
// get user object
$user = Factory::getApplication()->getIdentity();
// only add if user allowed to create joomla_plugin
if ($user->authorise('joomla_plugin.create', 'com_componentbuilder') && $app->isClient('administrator')) // TODO for now only in admin area.
{
// build Create button
$button[] = '<a id="'.$button_code_name.'Create" class="btn btn-small btn-success hasTooltip" title="'.Text::sprintf('PLG_EXTENSION_COMPONENTBUILDERPOWERSAUTOLOADERCOMPILER_CREATE_NEW_S', $button_label).'" style="border-radius: 0px 4px 4px 0px;"
href="index.php?option=com_componentbuilder&amp;view=joomla_plugin&amp;layout=edit'.$ref.'" >
<span class="icon-new icon-white"></span></a>';
}
// only add if user allowed to edit joomla_plugin
if ($user->authorise('joomla_plugin.edit', 'com_componentbuilder') && $app->isClient('administrator')) // TODO for now only in admin area.
{
// build edit button
$button[] = '<a id="'.$button_code_name.'Edit" class="btn btn-small hasTooltip" title="'.Text::sprintf('PLG_EXTENSION_COMPONENTBUILDERPOWERSAUTOLOADERCOMPILER_EDIT_S', $button_label).'" style="display: none; border-radius: 0px 4px 4px 0px;" href="#" >
<span class="icon-edit"></span></a>';
// build script
$script[] = "
document.addEventListener('DOMContentLoaded', function() {
document.getElementById('jform_".$button_code_name."').addEventListener('change', function(e) {
e.preventDefault();
let ".$button_code_name."Value = this.value;
".$button_code_name."Button(".$button_code_name."Value);
});
let ".$button_code_name."Value = document.getElementById('jform_".$button_code_name."').value;
".$button_code_name."Button(".$button_code_name."Value);
});
function ".$button_code_name."Button(value) {
var createButton = document.getElementById('".$button_code_name."Create');
var editButton = document.getElementById('".$button_code_name."Edit');
if (value > 0) {
// hide the create button
createButton.style.display = 'none';
// show edit button
editButton.style.display = 'block';
let url = 'index.php?option=com_componentbuilder&view=joomla_plugins&task=joomla_plugin.edit&id='+value+'".$refJ."';
editButton.setAttribute('href', url);
} else {
// show the create button
createButton.style.display = 'block';
// hide edit button
editButton.style.display = 'none';
}
}";
}
// check if button was created for joomla_plugin field.
if (is_array($button) && count($button) > 0)
{
// Load the needed script.
$document = Factory::getApplication()->getDocument();
$document->addScriptDeclaration(implode(' ',$script));
// return the button attached to input field.
return '<div class="input-group">' .$html . implode('',$button).'</div>';
}
}
return $html;
}
/** /**
* Method to get a list of options for a list input. * Method to get a list of options for a list input.
* *

View File

@ -0,0 +1,115 @@
<?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
*/
namespace VDM\Component\Componentbuilder\Administrator\Field;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Field\ListField;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Component\ComponentHelper;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
// No direct access to this file
\defined('_JEXEC') or die;
/**
* Linkedviewsorderfields Form Field class for the Componentbuilder component
*
* @since 1.6
*/
class LinkedviewsorderfieldsField extends ListField
{
/**
* The linkedviewsorderfields field type.
*
* @var string
*/
public $type = 'Linkedviewsorderfields';
/**
* Method to get a list of options for a list input.
*
* @return array An array of Html options.
* @since 1.6
*/
protected function getOptions()
{
// load the db object
$db = Factory::getDBO();
// get the input from url
$jinput = Factory::getApplication()->input;
// get the id
$adminView = $jinput->getInt('id', 0);
// check if we have an admin view
if (is_numeric($adminView) && $adminView >= 1)
{
// get all the fields linked to the admin view
if ($addFields = ComponentbuilderHelper::getVar('admin_fields', (int) $adminView, 'admin_view', 'addfields'))
{
if (ComponentbuilderHelper::checkJson($addFields))
{
$addFields = json_decode($addFields, true);
if (ComponentbuilderHelper::checkArray($addFields))
{
foreach($addFields as $addField)
{
// linked list views and ordering
if (isset($addField['field']) && isset($addField['list']) && ($addField['list'] == 1 || $addField['list'] == 4)
&& isset($addField['sort']) && $addField['sort'])
{
$fieldIds[] = (int) $addField['field'];
}
}
}
}
}
// filter by fields linked
if (ComponentbuilderHelper::checkArray($fieldIds))
{
$query = $db->getQuery(true);
$query->select($db->quoteName(array('a.id','a.name', 'a.xml', 'b.name'),array('id','name', 'xml', 'type')));
$query->from($db->quoteName('#__componentbuilder_field', 'a'));
$query->join('LEFT', '#__componentbuilder_fieldtype AS b ON b.id = a.fieldtype');
$query->where($db->quoteName('a.published') . ' >= 1');
// only load these fields
$query->where($db->quoteName('a.id') . ' IN (' . implode(',', $fieldIds) . ')');
$query->order('a.name ASC');
$db->setQuery((string)$query);
$items = $db->loadObjectList();
$options = array();
if ($items)
{
$options[] = Html::_('select.option', '', Text::_('PLG_CONTENT_COMPONENTBUILDERFIELDORDERINGTABS_SELECT_AN_OPTION'));
$options[] = Html::_('select.option', -1, Text::_('PLG_CONTENT_COMPONENTBUILDERFIELDORDERINGTABS_ID'). ' [ id - text ]');
$options[] = Html::_('select.option', -2, Text::_('PLG_CONTENT_COMPONENTBUILDERFIELDORDERINGTABS_ORDERING'). ' [ ordering - number ]');
$options[] = Html::_('select.option', -3, Text::_('PLG_CONTENT_COMPONENTBUILDERFIELDORDERINGTABS_STATUS'). ' [ published - list ]');
foreach($items as $item)
{
// get the field name (TODO this could slow down the system so we will need to improve on this)
if (isset($item->xml) && ComponentbuilderHelper::checkJson($item->xml))
{
$field_xml = json_decode($item->xml);
$field_name = ComponentbuilderHelper::getBetween($field_xml,'name="','"');
$field_name = ComponentbuilderHelper::safeFieldName($field_name);
$options[] = Html::_('select.option', $item->id, $item->name . ' [ ' . $field_name . ' - ' . $item->type . ' ]');
}
else
{
$options[] = Html::_('select.option', $item->id, $item->name . ' [ empty - ' . $item->type . ' ]');
}
}
}
return $options;
}
}
return false;
}
}

View File

@ -0,0 +1,87 @@
<?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
*/
namespace VDM\Component\Componentbuilder\Administrator\Field;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Field\ListField;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Component\ComponentHelper;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
// No direct access to this file
\defined('_JEXEC') or die;
/**
* Powers Form Field class for the Componentbuilder component
*
* @since 1.6
*/
class PowersField extends ListField
{
/**
* The powers field type.
*
* @var string
*/
public $type = 'Powers';
/**
* Method to get a list of options for a list input.
*
* @return array An array of Html options.
* @since 1.6
*/
protected function getOptions()
{
// Get the user object.
$user = Factory::getApplication()->getIdentity();
// Get the databse object.
$db = Factory::getDBO();
$query = $db->getQuery(true);
$query->select($db->quoteName(array('a.guid','a.system_name','a.namespace','a.type','a.power_version'),array('guid','power_system_name','namespace','type','version')));
$query->from($db->quoteName('#__componentbuilder_power', 'a'));
$query->where($db->quoteName('a.published') . ' >= 1');
$query->order('a.system_name ASC');
$query->order('a.type ASC');
// Implement View Level Access (if set in table)
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$columns = $db->getTableColumns('#__componentbuilder_power');
if(isset($columns['access']))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
}
$db->setQuery((string)$query);
$items = $db->loadObjectList();
$options = array();
// if none was found, we add this to set an alternative to set custom
if (!$items)
{
$options[] = Html::_('select.option', '', 'None found');
}
if ($items)
{
if ($this->multiple === false)
{
$options[] = Html::_('select.option', '', 'Select an option');
}
foreach($items as $item)
{
$options[] = Html::_('select.option', $item->guid, str_replace('.','\\', $item->namespace) . ' [' . $item->power_system_name . '] (v' . $item->version . ' - ' . $item->type . ')');
}
}
return $options;
}
}

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="5.0" method="upgrade"> <extension type="component" version="5.0" method="upgrade">
<name>COM_COMPONENTBUILDER</name> <name>COM_COMPONENTBUILDER</name>
<creationDate>9th March, 2024</creationDate> <creationDate>11th March, 2024</creationDate>
<author>Llewellyn van der Merwe</author> <author>Llewellyn van der Merwe</author>
<authorEmail>joomla@vdm.io</authorEmail> <authorEmail>joomla@vdm.io</authorEmail>
<authorUrl>https://dev.vdm.io</authorUrl> <authorUrl>https://dev.vdm.io</authorUrl>
<copyright>Copyright (C) 2015 Vast Development Method. All rights reserved.</copyright> <copyright>Copyright (C) 2015 Vast Development Method. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license> <license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<version>5.0.0-alpha1</version> <version>5.0.0-alpha2</version>
<description><![CDATA[ <description><![CDATA[
<h1>Component Builder (v.5.0.0-alpha1)</h1> <h1>Component Builder (v.5.0.0-alpha2)</h1>
<div style="clear: both;"></div> <div style="clear: both;"></div>
<p>The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time. <p>The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time.

View File

@ -5,10 +5,10 @@
<element>pkg_component_builder</element> <element>pkg_component_builder</element>
<type>package</type> <type>package</type>
<client>site</client> <client>site</client>
<version>3.2.0-beta4</version> <version>3.2.0-beta6</version>
<infourl title="Component Builder!">https://dev.vdm.io</infourl> <infourl title="Component Builder!">https://dev.vdm.io</infourl>
<downloads> <downloads>
<downloadurl type="full" format="zip">https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.2.0-beta4.zip</downloadurl> <downloadurl type="full" format="zip">https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.2.0-beta6.zip</downloadurl>
</downloads> </downloads>
<tags> <tags>
<tag>beta</tag> <tag>beta</tag>
@ -23,10 +23,10 @@
<element>pkg_component_builder</element> <element>pkg_component_builder</element>
<type>package</type> <type>package</type>
<client>site</client> <client>site</client>
<version>4.0.0-alpha1</version> <version>4.0.0-alpha2</version>
<infourl title="Component Builder!">https://dev.vdm.io</infourl> <infourl title="Component Builder!">https://dev.vdm.io</infourl>
<downloads> <downloads>
<downloadurl type="full" format="zip">https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v5.0.0-alpha1.zip</downloadurl> <downloadurl type="full" format="zip">https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v4.0.0-alpha2.zip</downloadurl>
</downloads> </downloads>
<tags> <tags>
<tag>stable</tag> <tag>stable</tag>
@ -53,4 +53,22 @@
<maintainerurl>https://dev.vdm.io</maintainerurl> <maintainerurl>https://dev.vdm.io</maintainerurl>
<targetplatform name="joomla" version="5\.[01]"/> <targetplatform name="joomla" version="5\.[01]"/>
</update> </update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>pkg_component_builder</element>
<type>package</type>
<client>site</client>
<version>5.0.0-alpha2</version>
<infourl title="Component Builder!">https://dev.vdm.io</infourl>
<downloads>
<downloadurl type="full" format="zip">https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v5.0.0-alpha1.zip</downloadurl>
</downloads>
<tags>
<tag>beta</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>https://dev.vdm.io</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
</updates> </updates>

View File

@ -17,6 +17,7 @@ use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Utilities\GetHelper; use VDM\Joomla\Utilities\GetHelper;
use VDM\Joomla\Utilities\JsonHelper; use VDM\Joomla\Utilities\JsonHelper;
use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\String\NamespaceHelper;
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
use VDM\Joomla\Componentbuilder\Compiler\Config; use VDM\Joomla\Componentbuilder\Compiler\Config;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
@ -117,6 +118,12 @@ final class Placeholder implements PlaceholderInterface
$bucket[Placefix::_('COMPONENT')] = $bucket[Placefix::_h('COMPONENT')]; $bucket[Placefix::_('COMPONENT')] = $bucket[Placefix::_h('COMPONENT')];
$bucket[Placefix::_h('LANG_PREFIX')] = $config->lang_prefix; $bucket[Placefix::_h('LANG_PREFIX')] = $config->lang_prefix;
$bucket[Placefix::_('LANG_PREFIX')] = $bucket[Placefix::_h('LANG_PREFIX')]; $bucket[Placefix::_('LANG_PREFIX')] = $bucket[Placefix::_h('LANG_PREFIX')];
$bucket[Placefix::_h('ComponentNamespace')] = NamespaceHelper::safeSegment(StringHelper::safe($config->component_code_name, 'F'));
$bucket[Placefix::_('ComponentNamespace')] = $bucket[Placefix::_h('ComponentNamespace')];
$bucket[Placefix::_h('NamespacePrefix')] = $config->namespace_prefix;
$bucket[Placefix::_('NamespacePrefix')] = $config->namespace_prefix;
$bucket[Placefix::_h('NAMESPACEPREFIX')] = $config->namespace_prefix;
$bucket[Placefix::_('NAMESPACEPREFIX')] = $config->namespace_prefix;
// get the current components overrides // get the current components overrides
if (($_placeholders = GetHelper::var( if (($_placeholders = GetHelper::var(

View File

@ -125,6 +125,9 @@ final class InstallScript implements GetScriptInterface
*/ */
public function get(object $extension): string public function get(object $extension): string
{ {
// purge the object
$this->rest();
// loop over methods and types // loop over methods and types
foreach ($this->methods as $method) foreach ($this->methods as $method)
{ {
@ -160,6 +163,24 @@ final class InstallScript implements GetScriptInterface
return $this->build(); return $this->build();
} }
/**
* Reset all bucket at the start of each build
*
* @return void
* @since 3.2.0
*/
protected function rest(): void
{
$this->construct = [];
$this->install = [];
$this->update = [];
$this->uninstall = [];
$this->preflightActive = false;
$this->preflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []];
$this->postflightActive = false;
$this->postflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []];
}
/** /**
* build the install class * build the install class
* *

View File

@ -125,6 +125,9 @@ final class InstallScript implements GetScriptInterface
*/ */
public function get(object $extension): string public function get(object $extension): string
{ {
// purge the object
$this->rest();
// loop over methods and types // loop over methods and types
foreach ($this->methods as $method) foreach ($this->methods as $method)
{ {
@ -160,6 +163,24 @@ final class InstallScript implements GetScriptInterface
return $this->build(); return $this->build();
} }
/**
* Reset all bucket at the start of each build
*
* @return void
* @since 3.2.0
*/
protected function rest(): void
{
$this->construct = [];
$this->install = [];
$this->update = [];
$this->uninstall = [];
$this->preflightActive = false;
$this->preflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []];
$this->postflightActive = false;
$this->postflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []];
}
/** /**
* build the install class * build the install class
* *

View File

@ -125,6 +125,9 @@ final class InstallScript implements GetScriptInterface
*/ */
public function get(object $extension): string public function get(object $extension): string
{ {
// purge the object
$this->rest();
// loop over methods and types // loop over methods and types
foreach ($this->methods as $method) foreach ($this->methods as $method)
{ {
@ -160,6 +163,24 @@ final class InstallScript implements GetScriptInterface
return $this->build(); return $this->build();
} }
/**
* Reset all bucket at the start of each build
*
* @return void
* @since 3.2.0
*/
protected function rest(): void
{
$this->construct = [];
$this->install = [];
$this->update = [];
$this->uninstall = [];
$this->preflightActive = false;
$this->preflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []];
$this->postflightActive = false;
$this->postflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []];
}
/** /**
* build the install class * build the install class
* *

View File

@ -101,9 +101,9 @@ class Infusion extends Interpretation
CFactory::_('Placeholder')->get('component') CFactory::_('Placeholder')->get('component')
); );
// ComponentNameSpace // ComponentNamespace
CFactory::_('Compiler.Builder.Content.One')->set('ComponentNameSpace', CFactory::_('Compiler.Builder.Content.One')->set('ComponentNamespace',
NamespaceHelper::safeSegment(CFactory::_('Placeholder')->get('Component')) CFactory::_('Placeholder')->get('ComponentNamespace')
); );
// COMPANYNAME // COMPANYNAME
@ -197,7 +197,7 @@ class Infusion extends Interpretation
// set the namespace prefix // set the namespace prefix
CFactory::_('Compiler.Builder.Content.One')->set('NAMESPACEPREFIX', CFactory::_('Compiler.Builder.Content.One')->set('NAMESPACEPREFIX',
CFactory::_('Config')->namespace_prefix CFactory::_('Placeholder')->get('NAMESPACEPREFIX')
); );
// set the global version in case // set the global version in case

View File

@ -2274,11 +2274,11 @@ class Interpretation extends Fields
{ {
$xml .= PHP_EOL . Indent::_(3) $xml .= PHP_EOL . Indent::_(3)
. 'addruleprefix="' . CFactory::_('Config')->namespace_prefix . 'addruleprefix="' . CFactory::_('Config')->namespace_prefix
. '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNameSpace') . '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNamespace')
. '\\'. $target_area . '\Rule"'; . '\\'. $target_area . '\Rule"';
$xml .= PHP_EOL . Indent::_(3) $xml .= PHP_EOL . Indent::_(3)
. 'addfieldprefix="' . CFactory::_('Config')->namespace_prefix . 'addfieldprefix="' . CFactory::_('Config')->namespace_prefix
. '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNameSpace') . '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNamespace')
. '\\'. $target_area . '\Field">'; . '\\'. $target_area . '\Field">';
} }
@ -2331,11 +2331,11 @@ class Interpretation extends Fields
{ {
$xml .= PHP_EOL . Indent::_(3) $xml .= PHP_EOL . Indent::_(3)
. 'addruleprefix="' . CFactory::_('Config')->namespace_prefix . 'addruleprefix="' . CFactory::_('Config')->namespace_prefix
. '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNameSpace') . '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNamespace')
. '\\'. $target_area . '\Rule"'; . '\\'. $target_area . '\Rule"';
$xml .= PHP_EOL . Indent::_(3) $xml .= PHP_EOL . Indent::_(3)
. 'addfieldprefix="' . CFactory::_('Config')->namespace_prefix . 'addfieldprefix="' . CFactory::_('Config')->namespace_prefix
. '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNameSpace') . '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNamespace')
. '\\'. $target_area . '\Field">'; . '\\'. $target_area . '\Field">';
} }
$xml .= implode(Indent::_(3), $params); $xml .= implode(Indent::_(3), $params);
@ -8918,7 +8918,7 @@ class Interpretation extends Fields
// set the table // set the table
$array['table'] = '{"special": {"dbtable": "#__' . $component . '_' $array['table'] = '{"special": {"dbtable": "#__' . $component . '_'
. $view . '","key": "id","type": "' . $View . 'Table","prefix": "' . CFactory::_('Config')->namespace_prefix . $view . '","key": "id","type": "' . $View . 'Table","prefix": "' . CFactory::_('Config')->namespace_prefix
. '\\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNameSpace') . '\\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNamespace')
. '\\Administrator\\Table"}}'; . '\\Administrator\\Table"}}';
// set rules field // set rules field
@ -23182,11 +23182,11 @@ class Interpretation extends Fields
{ {
$xml .= PHP_EOL . Indent::_(3) $xml .= PHP_EOL . Indent::_(3)
. 'addruleprefix="' . CFactory::_('Config')->namespace_prefix . 'addruleprefix="' . CFactory::_('Config')->namespace_prefix
. '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNameSpace') . '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNamespace')
. '\Administrator\Rule"'; . '\Administrator\Rule"';
$xml .= PHP_EOL . Indent::_(3) $xml .= PHP_EOL . Indent::_(3)
. 'addfieldprefix="' . CFactory::_('Config')->namespace_prefix . 'addfieldprefix="' . CFactory::_('Config')->namespace_prefix
. '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNameSpace') . '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNamespace')
. '\Administrator\Field">'; . '\Administrator\Field">';
} }
$xml .= PHP_EOL . Indent::_(1) . '>'; $xml .= PHP_EOL . Indent::_(1) . '>';
@ -23585,11 +23585,11 @@ class Interpretation extends Fields
{ {
$xml .= PHP_EOL . Indent::_(3) $xml .= PHP_EOL . Indent::_(3)
. 'addruleprefix="' . CFactory::_('Config')->namespace_prefix . 'addruleprefix="' . CFactory::_('Config')->namespace_prefix
. '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNameSpace') . '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNamespace')
. '\Administrator\Rule"'; . '\Administrator\Rule"';
$xml .= PHP_EOL . Indent::_(3) $xml .= PHP_EOL . Indent::_(3)
. 'addfieldprefix="' . CFactory::_('Config')->namespace_prefix . 'addfieldprefix="' . CFactory::_('Config')->namespace_prefix
. '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNameSpace') . '\Component\\' . CFactory::_('Compiler.Builder.Content.One')->get('ComponentNamespace')
. '\Administrator\Field">'; . '\Administrator\Field">';
} }
$xml .= PHP_EOL . Indent::_(1) . '>'; $xml .= PHP_EOL . Indent::_(1) . '>';

View File

@ -26,13 +26,20 @@ use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface;
class Event implements EventInterface class Event implements EventInterface
{ {
/** /**
* event plugin trigger switch * event plug-in trigger switch
* *
* @var boolean * @var boolean
* @since 3.2.0 * @since 3.2.0
*/ */
protected $activePlugins = false; protected $activePlugins = false;
/**
* The application to trigger and event TODO
*
* @since 3.2.0
*/
protected $dispatcher;
/** /**
* Constructor * Constructor
* *
@ -60,6 +67,8 @@ class Event implements EventInterface
} }
} }
} }
$this->dispatcher = Factory::getApplication();
} }
/** /**
@ -77,22 +86,14 @@ class Event implements EventInterface
// only execute if plugins were loaded (active) // only execute if plugins were loaded (active)
if ($this->activePlugins) if ($this->activePlugins)
{ {
// Get the dispatcher. try
$dispatcher = \JEventDispatcher::getInstance();
// Trigger this compiler event.
$results = $dispatcher->trigger($event, $data);
// Check for errors encountered while trigger the event
if (count((array) $results) && in_array(false, $results, true))
{ {
// Get the last error. // Trigger this compiler event.
$error = $dispatcher->getError(); $results = $this->dispatcher->triggerEvent($event, $data ?? []);
}
if (!($error instanceof \Exception)) catch (\Exception $e)
{ {
throw new \Exception($error); throw new \Exception("Error processing event '$event': " . $e->getMessage());
}
} }
} }
} }

View File

@ -22,7 +22,6 @@ use VDM\Joomla\Componentbuilder\Compiler\Builder\Category;
use VDM\Joomla\Componentbuilder\Compiler\Builder\AccessSwitchList; use VDM\Joomla\Componentbuilder\Compiler\Builder\AccessSwitchList;
use VDM\Joomla\Componentbuilder\Compiler\Builder\Filter; use VDM\Joomla\Componentbuilder\Compiler\Builder\Filter;
use VDM\Joomla\Componentbuilder\Compiler\Builder\Tags; use VDM\Joomla\Componentbuilder\Compiler\Builder\Tags;
use VDM\Joomla\Utilities\String\NamespaceHelper;
use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper; use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HeaderInterface; use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HeaderInterface;
@ -145,7 +144,7 @@ final class Header implements HeaderInterface
* @var string * @var string
* @since 3.2.0 * @since 3.2.0
*/ */
protected string $ComponentNameSpace; protected string $ComponentNamespace;
/** /**
* Constructor. * Constructor.
@ -181,9 +180,9 @@ final class Header implements HeaderInterface
$this->tags = $tags; $this->tags = $tags;
// set some global values // set some global values
$this->NamespacePrefix = $this->config->get('namespace_prefix'); $this->NamespacePrefix = $this->placeholder->get('NamespacePrefix');
$this->ComponentName = $this->placeholder->get('Component'); $this->ComponentName = $this->placeholder->get('Component');
$this->ComponentNameSpace = NamespaceHelper::safeSegment($this->ComponentName); $this->ComponentNamespace = $this->placeholder->get('ComponentNamespace');
} }
/** /**
@ -209,7 +208,7 @@ final class Header implements HeaderInterface
$target = 'Site'; $target = 'Site';
} }
$headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\{$target}\\Helper\\{$this->ComponentName}Helper;"; $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNamespace}\\{$target}\\Helper\\{$this->ComponentName}Helper;";
// we will add more as needed // we will add more as needed
switch ($context) switch ($context)
@ -218,7 +217,7 @@ final class Header implements HeaderInterface
case 'site.views.model': case 'site.views.model':
case 'site.view.html': case 'site.view.html':
case 'site.views.html': case 'site.views.html':
$headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\Site\\Helper\\RouteHelper;"; $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNamespace}\\Site\\Helper\\RouteHelper;";
break; break;
default: default:
@ -387,7 +386,7 @@ final class Header implements HeaderInterface
$headers[] = 'use Joomla\CMS\Plugin\PluginHelper;'; $headers[] = 'use Joomla\CMS\Plugin\PluginHelper;';
$headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;'; $headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;';
$headers[] = 'use Joomla\CMS\Document\Document;'; $headers[] = 'use Joomla\CMS\Document\Document;';
$headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\Site\\Helper\\HeaderCheck;"; $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNamespace}\\Site\\Helper\\HeaderCheck;";
break; break;
case 'custom.admin.view.html': case 'custom.admin.view.html':
@ -404,7 +403,7 @@ final class Header implements HeaderInterface
$headers[] = 'use Joomla\CMS\Plugin\PluginHelper;'; $headers[] = 'use Joomla\CMS\Plugin\PluginHelper;';
$headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;'; $headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;';
$headers[] = 'use Joomla\CMS\Document\Document;'; $headers[] = 'use Joomla\CMS\Document\Document;';
$headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\{$target}\\Helper\\HeaderCheck;"; $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNamespace}\\{$target}\\Helper\\HeaderCheck;";
break; break;
case 'admin.view.model': case 'admin.view.model':

View File

@ -12,6 +12,7 @@
namespace VDM\Joomla\Componentbuilder\Compiler\JoomlaFour; namespace VDM\Joomla\Componentbuilder\Compiler\JoomlaFour;
use Joomla\CMS\Factory;
use Joomla\Registry\Registry; use Joomla\Registry\Registry;
use Joomla\CMS\Plugin\PluginHelper; use Joomla\CMS\Plugin\PluginHelper;
use VDM\Joomla\Utilities\Component\Helper; use VDM\Joomla\Utilities\Component\Helper;
@ -26,13 +27,20 @@ use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface;
final class Event implements EventInterface final class Event implements EventInterface
{ {
/** /**
* event plugin trigger switch * event plug-in trigger switch
* *
* @var boolean * @var boolean
* @since 3.2.0 * @since 3.2.0
*/ */
protected $activePlugins = false; protected $activePlugins = false;
/**
* The application to trigger and event TODO
*
* @since 3.2.0
*/
protected $dispatcher;
/** /**
* Constructor * Constructor
* *
@ -60,6 +68,8 @@ final class Event implements EventInterface
} }
} }
} }
$this->dispatcher = Factory::getApplication();
} }
/** /**
@ -77,22 +87,14 @@ final class Event implements EventInterface
// only execute if plugins were loaded (active) // only execute if plugins were loaded (active)
if ($this->activePlugins) if ($this->activePlugins)
{ {
// Get the dispatcher. try
$dispatcher = \JEventDispatcher::getInstance();
// Trigger this compiler event.
$results = $dispatcher->trigger($event, $data);
// Check for errors encountered while trigger the event
if (count((array) $results) && in_array(false, $results, true))
{ {
// Get the last error. // Trigger this compiler event.
$error = $dispatcher->getError(); $results = $this->dispatcher->triggerEvent($event, $data ?? []);
}
if (!($error instanceof \Exception)) catch (\Exception $e)
{ {
throw new \Exception($error); throw new \Exception("Error processing event '$event': " . $e->getMessage());
}
} }
} }
} }

View File

@ -22,7 +22,6 @@ use VDM\Joomla\Componentbuilder\Compiler\Builder\Category;
use VDM\Joomla\Componentbuilder\Compiler\Builder\AccessSwitchList; use VDM\Joomla\Componentbuilder\Compiler\Builder\AccessSwitchList;
use VDM\Joomla\Componentbuilder\Compiler\Builder\Filter; use VDM\Joomla\Componentbuilder\Compiler\Builder\Filter;
use VDM\Joomla\Componentbuilder\Compiler\Builder\Tags; use VDM\Joomla\Componentbuilder\Compiler\Builder\Tags;
use VDM\Joomla\Utilities\String\NamespaceHelper;
use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper; use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HeaderInterface; use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HeaderInterface;
@ -145,7 +144,7 @@ final class Header implements HeaderInterface
* @var string * @var string
* @since 3.2.0 * @since 3.2.0
*/ */
protected string $ComponentNameSpace; protected string $ComponentNamespace;
/** /**
* Constructor. * Constructor.
@ -181,9 +180,9 @@ final class Header implements HeaderInterface
$this->tags = $tags; $this->tags = $tags;
// set some global values // set some global values
$this->NamespacePrefix = $this->config->get('namespace_prefix'); $this->NamespacePrefix = $this->placeholder->get('NamespacePrefix');
$this->ComponentName = $this->placeholder->get('Component'); $this->ComponentName = $this->placeholder->get('Component');
$this->ComponentNameSpace = NamespaceHelper::safeSegment($this->ComponentName); $this->ComponentNamespace = $this->placeholder->get('ComponentNamespace');
} }
/** /**
@ -209,7 +208,7 @@ final class Header implements HeaderInterface
$target = 'Site'; $target = 'Site';
} }
$headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\{$target}\\Helper\\{$this->ComponentName}Helper;"; $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNamespace}\\{$target}\\Helper\\{$this->ComponentName}Helper;";
// we will add more as needed // we will add more as needed
switch ($context) switch ($context)
@ -218,7 +217,7 @@ final class Header implements HeaderInterface
case 'site.views.model': case 'site.views.model':
case 'site.view.html': case 'site.view.html':
case 'site.views.html': case 'site.views.html':
$headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\Site\\Helper\\RouteHelper;"; $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNamespace}\\Site\\Helper\\RouteHelper;";
break; break;
default: default:
@ -387,7 +386,7 @@ final class Header implements HeaderInterface
$headers[] = 'use Joomla\CMS\Plugin\PluginHelper;'; $headers[] = 'use Joomla\CMS\Plugin\PluginHelper;';
$headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;'; $headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;';
$headers[] = 'use Joomla\CMS\Document\Document;'; $headers[] = 'use Joomla\CMS\Document\Document;';
$headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\Site\\Helper\\HeaderCheck;"; $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNamespace}\\Site\\Helper\\HeaderCheck;";
break; break;
case 'custom.admin.view.html': case 'custom.admin.view.html':
@ -404,7 +403,7 @@ final class Header implements HeaderInterface
$headers[] = 'use Joomla\CMS\Plugin\PluginHelper;'; $headers[] = 'use Joomla\CMS\Plugin\PluginHelper;';
$headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;'; $headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;';
$headers[] = 'use Joomla\CMS\Document\Document;'; $headers[] = 'use Joomla\CMS\Document\Document;';
$headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\{$target}\\Helper\\HeaderCheck;"; $headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNamespace}\\{$target}\\Helper\\HeaderCheck;";
break; break;
case 'admin.view.model': case 'admin.view.model':