diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ad531624..ef056d548 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,6 @@ -# v5.1.1-alpha2 +# v5.1.1-alpha3 -- Adds the ModalSelect fieldtype to Joomla Component Builder - J5 -- Adds the Data Import Function to the Demo Component. -- Adds new country related tables and fields to the Demo Component. -- Resolves the Database Updating issue in the compiler. #1212,#1209 -- Adds the Component Commands Plugin to the CLI for Import of spreadsheet data-sets. +- Add edit and create options to the ModalSelect Field (in Joomla 5) # v5.1.1-alpha @@ -12,7 +8,12 @@ - Adds library phpspreadsheet to JCB. - Adds import item example to demo component. - Updates the Superpower class with the GetRemote class in the plugin. -- Ensures the super power autoloader triggers the correct repositories. +- Ensures the super power autoloader triggers the correct repositories. +- Adds the ModalSelect fieldtype to Joomla Component Builder - J5 +- Adds the Data Import Function to the Demo Component. +- Adds new country related tables and fields to the Demo Component. +- Resolves the Database Updating issue in the compiler. #1212,#1209 +- Adds the Component Commands Plugin to the CLI for Import of spreadsheet data-sets. # v5.1.0 diff --git a/ComponentbuilderInstallerScript.php b/ComponentbuilderInstallerScript.php index 685ff2eb9..fad35e484 100644 --- a/ComponentbuilderInstallerScript.php +++ b/ComponentbuilderInstallerScript.php @@ -3292,7 +3292,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface echo '
-

Upgrade to Version 5.1.1-alpha2 Was Successful! Let us know if anything is not working as expected.

'; +

Upgrade to Version 5.1.1-alpha3 Was Successful! Let us know if anything is not working as expected.

'; // Add/Update component in the action logs extensions table. $this->setActionLogsExtensions(); diff --git a/README.md b/README.md index c1cea0c26..6a8280c58 100644 --- a/README.md +++ b/README.md @@ -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! -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.1.1-alpha2) 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.1.1-alpha3) 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) @@ -144,13 +144,13 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 28th March, 2025 -+ *Version*: 5.1.1-alpha2 ++ *Last Build*: 30th March, 2025 ++ *Version*: 5.1.1-alpha3 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **975213** ++ *Line count*: **978935** + *Field count*: **2098** -+ *File count*: **6574** ++ *File count*: **6625** + *Folder count*: **645** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com). diff --git a/admin/README.txt b/admin/README.txt index c1cea0c26..6a8280c58 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -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! -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.1.1-alpha2) 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.1.1-alpha3) 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) @@ -144,13 +144,13 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 28th March, 2025 -+ *Version*: 5.1.1-alpha2 ++ *Last Build*: 30th March, 2025 ++ *Version*: 5.1.1-alpha3 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **975213** ++ *Line count*: **978935** + *Field count*: **2098** -+ *File count*: **6574** ++ *File count*: **6625** + *Folder count*: **645** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com). diff --git a/admin/compiler/joomla_4/ADMIN_VIEW_CONTROLLER.php b/admin/compiler/joomla_4/ADMIN_VIEW_CONTROLLER.php index cb99ae359..bc50c3a5f 100644 --- a/admin/compiler/joomla_4/ADMIN_VIEW_CONTROLLER.php +++ b/admin/compiler/joomla_4/ADMIN_VIEW_CONTROLLER.php @@ -212,6 +212,15 @@ class ###View###Controller extends FormController 'index.php?option=' . $this->option . $redirect, false ) ); + } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); }###JCONTROLLERFORM_AFTERCANCEL### return $cancel; } @@ -294,6 +303,15 @@ class ###View###Controller extends FormController * @since 11.1 */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) - {###POSTSAVEHOOK### + { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('###view###.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + }###POSTSAVEHOOK### } } diff --git a/admin/compiler/joomla_4/ADMIN_VIEW_MODAL_RETURN.php b/admin/compiler/joomla_4/ADMIN_VIEW_MODAL_RETURN.php new file mode 100644 index 000000000..175ff132e --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_VIEW_MODAL_RETURN.php @@ -0,0 +1,52 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +/** @var \###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\View\###View###\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->###SQL_TITLE_KEY### ?? ''; +$title_column = $this->item->###SQL_TITLE_COLUMN### ?? ''; +$data = [ + 'contentType' => 'com_###component###.###view###', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_###component###&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/compiler/joomla_4/SITE_ADMIN_VIEW_MODAL.php b/admin/compiler/joomla_4/SITE_ADMIN_VIEW_MODAL.php new file mode 100644 index 000000000..d1e24a6f6 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_ADMIN_VIEW_MODAL.php @@ -0,0 +1,28 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +/** @var \###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\View\###View###\HtmlView $this */ +?> +
+ getDocument()->getToolbar('toolbar')->render(); ?> +
+
+ setLayout('edit'); ?> + loadTemplate(); ?> +
diff --git a/admin/compiler/joomla_4/SITE_ADMIN_VIEW_MODAL_RETURN.php b/admin/compiler/joomla_4/SITE_ADMIN_VIEW_MODAL_RETURN.php new file mode 100644 index 000000000..efe73fa85 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_ADMIN_VIEW_MODAL_RETURN.php @@ -0,0 +1,52 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +/** @var \###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\View\###View###\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->###SQL_TITLE_KEY### ?? ''; +$title_column = $this->item->###SQL_TITLE_COLUMN### ?? ''; +$data = [ + 'contentType' => 'com_###component###.###view###', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_###component###&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/compiler/joomla_4/settings.json b/admin/compiler/joomla_4/settings.json index 480af9648..56faa4878 100644 --- a/admin/compiler/joomla_4/settings.json +++ b/admin/compiler/joomla_4/settings.json @@ -328,12 +328,6 @@ "newName": "default.php", "type": "single" }, - "ADMIN_VIEW_MODAL.php": { - "path": "c0mp0n3nt/admin/tmpl/[[[name]]]", - "rename": "new", - "newName": "modal.php", - "type": "single" - }, "ADMIN_VIEW_MODEL.php": { "path": "c0mp0n3nt/admin/src/Model", "rename": "new", @@ -392,12 +386,6 @@ "newName": "default.php", "type": "list" }, - "ADMIN_VIEWS_MODAL.php": { - "path": "c0mp0n3nt/admin/tmpl/[[[name]]]", - "rename": "new", - "newName": "modal.php", - "type": "list" - }, "ADMIN_VIEWS_EMPTYSTATE.php": { "path": "c0mp0n3nt/admin/tmpl/[[[name]]]", "rename": "new", @@ -482,6 +470,24 @@ "newName": "ModalSelectField.php", "type": "fieldmodalselect_override" }, + "ADMIN_VIEWS_MODAL.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[name]]]", + "rename": "new", + "newName": "modal.php", + "type": "list_modal" + }, + "ADMIN_VIEW_MODAL.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[name]]]", + "rename": "new", + "newName": "modal.php", + "type": "single_modal" + }, + "ADMIN_VIEW_MODAL_RETURN.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[name]]]", + "rename": "new", + "newName": "modalreturn.php", + "type": "single_modal" + }, "FORM_LIST_FIELD.php": { "path": "c0mp0n3nt/admin/src/Field", "rename": "new", @@ -750,6 +756,18 @@ "newName": "HtmlView.php", "type": "edit" }, + "SITE_ADMIN_VIEW_MODAL.php": { + "path": "c0mp0n3nt/site/tmpl/[[[name]]]", + "rename": "new", + "newName": "modal.php", + "type": "edit_modal" + }, + "SITE_ADMIN_VIEW_MODAL_RETURN.php": { + "path": "c0mp0n3nt/site/tmpl/[[[name]]]", + "rename": "new", + "newName": "modalreturn.php", + "type": "edit_modal" + }, "view_site_edit.css": { "path": "c0mp0n3nt/site/assets/css", "rename": "view_site_edit", diff --git a/admin/forms/admin_fields.xml b/admin/forms/admin_fields.xml index 01706aee4..82e86cd8b 100644 --- a/admin/forms/admin_fields.xml +++ b/admin/forms/admin_fields.xml @@ -129,13 +129,16 @@ label="COM_COMPONENTBUILDER_ADMIN_FIELDS_FIELD_LABEL" sql_title_table="#__componentbuilder_field" sql_title_column="name" + data-key-name="guid" sql_title_key="guid" urlSelect="index.php?option=com_componentbuilder&view=fields&layout=modal&tmpl=component&titleKey=guid" + urlNew="index.php?option=com_componentbuilder&task=field.add&layout=modal&tmpl=component" + urlEdit="index.php?option=com_componentbuilder&task=field.edit&guid={id}&layout=modal&tmpl=component&titleKey=guid" titleSelect="COM_COMPONENTBUILDER_ADMIN_FIELDS_FIELD_TITLESELECT" iconSelect="icon-lamp" select="true" - new="false" - edit="false" + new="true" + edit="true" clear="true" required="true" class="input-large" diff --git a/admin/forms/admin_view.xml b/admin/forms/admin_view.xml index f2c496d95..a92e8274b 100644 --- a/admin/forms/admin_view.xml +++ b/admin/forms/admin_view.xml @@ -712,13 +712,16 @@ label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADMINVIEW_LABEL" sql_title_table="#__componentbuilder_admin_view" sql_title_column="system_name" + data-key-name="guid" sql_title_key="guid" urlSelect="index.php?option=com_componentbuilder&view=admin_views&layout=modal&tmpl=component&titleKey=guid" + urlNew="index.php?option=com_componentbuilder&task=admin_view.add&layout=modal&tmpl=component" + urlEdit="index.php?option=com_componentbuilder&task=admin_view.edit&guid={id}&layout=modal&tmpl=component&titleKey=guid" titleSelect="COM_COMPONENTBUILDER_ADMIN_VIEW_ADMINVIEW_TITLESELECT" iconSelect="icon-stack" select="true" - new="false" - edit="false" + new="true" + edit="true" clear="true" required="true" class="input-large" diff --git a/admin/forms/component_admin_views.xml b/admin/forms/component_admin_views.xml index 132d8b2d8..93bd29416 100644 --- a/admin/forms/component_admin_views.xml +++ b/admin/forms/component_admin_views.xml @@ -142,13 +142,16 @@ label="COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADMINVIEW_LABEL" sql_title_table="#__componentbuilder_admin_view" sql_title_column="system_name" + data-key-name="guid" sql_title_key="guid" urlSelect="index.php?option=com_componentbuilder&view=admin_views&layout=modal&tmpl=component&titleKey=guid" + urlNew="index.php?option=com_componentbuilder&task=admin_view.add&layout=modal&tmpl=component" + urlEdit="index.php?option=com_componentbuilder&task=admin_view.edit&guid={id}&layout=modal&tmpl=component&titleKey=guid" titleSelect="COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADMINVIEW_TITLESELECT" iconSelect="icon-stack" select="true" - new="false" - edit="false" + new="true" + edit="true" clear="true" required="true" class="input-large" diff --git a/admin/forms/component_config.xml b/admin/forms/component_config.xml index 516db2bf9..ca97ab4e9 100644 --- a/admin/forms/component_config.xml +++ b/admin/forms/component_config.xml @@ -141,13 +141,16 @@ label="COM_COMPONENTBUILDER_COMPONENT_CONFIG_FIELD_LABEL" sql_title_table="#__componentbuilder_field" sql_title_column="name" + data-key-name="guid" sql_title_key="guid" urlSelect="index.php?option=com_componentbuilder&view=fields&layout=modal&tmpl=component&titleKey=guid" + urlNew="index.php?option=com_componentbuilder&task=field.add&layout=modal&tmpl=component" + urlEdit="index.php?option=com_componentbuilder&task=field.edit&guid={id}&layout=modal&tmpl=component&titleKey=guid" titleSelect="COM_COMPONENTBUILDER_COMPONENT_CONFIG_FIELD_TITLESELECT" iconSelect="icon-lamp" select="true" - new="false" - edit="false" + new="true" + edit="true" clear="true" required="true" class="input-large" diff --git a/admin/forms/component_custom_admin_views.xml b/admin/forms/component_custom_admin_views.xml index 69fb86c1e..6f2902e0d 100644 --- a/admin/forms/component_custom_admin_views.xml +++ b/admin/forms/component_custom_admin_views.xml @@ -140,13 +140,16 @@ label="COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_CUSTOMADMINVIEW_LABEL" sql_title_table="#__componentbuilder_custom_admin_view" sql_title_column="system_name" + data-key-name="guid" sql_title_key="guid" urlSelect="index.php?option=com_componentbuilder&view=custom_admin_views&layout=modal&tmpl=component&titleKey=guid" + urlNew="index.php?option=com_componentbuilder&task=custom_admin_view.add&layout=modal&tmpl=component" + urlEdit="index.php?option=com_componentbuilder&task=custom_admin_view.edit&guid={id}&layout=modal&tmpl=component&titleKey=guid" titleSelect="COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_CUSTOMADMINVIEW_TITLESELECT" iconSelect="icon-screen" select="true" - new="false" - edit="false" + new="true" + edit="true" clear="true" required="true" class="input-large" diff --git a/admin/forms/component_site_views.xml b/admin/forms/component_site_views.xml index 0eac4e967..205a4d0e6 100644 --- a/admin/forms/component_site_views.xml +++ b/admin/forms/component_site_views.xml @@ -141,13 +141,16 @@ label="COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_SITEVIEW_LABEL" sql_title_table="#__componentbuilder_site_view" sql_title_column="system_name" + data-key-name="guid" sql_title_key="guid" urlSelect="index.php?option=com_componentbuilder&view=site_views&layout=modal&tmpl=component&titleKey=guid" + urlNew="index.php?option=com_componentbuilder&task=site_view.add&layout=modal&tmpl=component" + urlEdit="index.php?option=com_componentbuilder&task=site_view.edit&guid={id}&layout=modal&tmpl=component&titleKey=guid" titleSelect="COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_SITEVIEW_TITLESELECT" iconSelect="icon-palette" select="true" - new="false" - edit="false" + new="true" + edit="true" clear="true" required="true" class="input-large" diff --git a/admin/forms/joomla_module.xml b/admin/forms/joomla_module.xml index 202b44170..e1975316f 100644 --- a/admin/forms/joomla_module.xml +++ b/admin/forms/joomla_module.xml @@ -742,13 +742,16 @@ label="COM_COMPONENTBUILDER_JOOMLA_MODULE_FIELD_LABEL" sql_title_table="#__componentbuilder_field" sql_title_column="name" + data-key-name="guid" sql_title_key="guid" urlSelect="index.php?option=com_componentbuilder&view=fields&layout=modal&tmpl=component&titleKey=guid" + urlNew="index.php?option=com_componentbuilder&task=field.add&layout=modal&tmpl=component" + urlEdit="index.php?option=com_componentbuilder&task=field.edit&guid={id}&layout=modal&tmpl=component&titleKey=guid" titleSelect="COM_COMPONENTBUILDER_JOOMLA_MODULE_FIELD_TITLESELECT" iconSelect="icon-lamp" select="true" - new="false" - edit="false" + new="true" + edit="true" clear="true" required="true" class="input-large" diff --git a/admin/forms/joomla_plugin.xml b/admin/forms/joomla_plugin.xml index 6e192401a..81fb5f87a 100644 --- a/admin/forms/joomla_plugin.xml +++ b/admin/forms/joomla_plugin.xml @@ -617,13 +617,16 @@ label="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FIELD_LABEL" sql_title_table="#__componentbuilder_field" sql_title_column="name" + data-key-name="guid" sql_title_key="guid" urlSelect="index.php?option=com_componentbuilder&view=fields&layout=modal&tmpl=component&titleKey=guid" + urlNew="index.php?option=com_componentbuilder&task=field.add&layout=modal&tmpl=component" + urlEdit="index.php?option=com_componentbuilder&task=field.edit&guid={id}&layout=modal&tmpl=component&titleKey=guid" titleSelect="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FIELD_TITLESELECT" iconSelect="icon-lamp" select="true" - new="false" - edit="false" + new="true" + edit="true" clear="true" required="true" class="input-large" diff --git a/admin/forms/library_config.xml b/admin/forms/library_config.xml index 4482f9d07..71b50637f 100644 --- a/admin/forms/library_config.xml +++ b/admin/forms/library_config.xml @@ -128,13 +128,16 @@ label="COM_COMPONENTBUILDER_LIBRARY_CONFIG_FIELD_LABEL" sql_title_table="#__componentbuilder_field" sql_title_column="name" + data-key-name="guid" sql_title_key="guid" urlSelect="index.php?option=com_componentbuilder&view=fields&layout=modal&tmpl=component&titleKey=guid" + urlNew="index.php?option=com_componentbuilder&task=field.add&layout=modal&tmpl=component" + urlEdit="index.php?option=com_componentbuilder&task=field.edit&guid={id}&layout=modal&tmpl=component&titleKey=guid" titleSelect="COM_COMPONENTBUILDER_LIBRARY_CONFIG_FIELD_TITLESELECT" iconSelect="icon-lamp" select="true" - new="false" - edit="false" + new="true" + edit="true" clear="true" required="true" class="input-large" diff --git a/admin/forms/power.xml b/admin/forms/power.xml index 9b889e0d0..a0b8cca6a 100644 --- a/admin/forms/power.xml +++ b/admin/forms/power.xml @@ -184,13 +184,16 @@ label="COM_COMPONENTBUILDER_POWER_LOAD_LABEL" sql_title_table="#__componentbuilder_power" sql_title_column="system_name" + data-key-name="guid" sql_title_key="guid" urlSelect="index.php?option=com_componentbuilder&view=powers&layout=modal&tmpl=component&titleKey=guid" + urlNew="index.php?option=com_componentbuilder&task=power.add&layout=modal&tmpl=component" + urlEdit="index.php?option=com_componentbuilder&task=power.edit&guid={id}&layout=modal&tmpl=component&titleKey=guid" titleSelect="COM_COMPONENTBUILDER_POWER_LOAD_TITLESELECT" iconSelect="icon-flash" select="true" - new="false" - edit="false" + new="true" + edit="true" clear="true" required="true" class="input-large" @@ -508,13 +511,15 @@ label="COM_COMPONENTBUILDER_POWER_USE_LABEL" sql_title_table="#__componentbuilder_power" sql_title_column="system_name" + data-key-name="guid" sql_title_key="guid" urlSelect="index.php?option=com_componentbuilder&view=powers&layout=modal&tmpl=component&titleKey=guid" + urlNew="index.php?option=com_componentbuilder&task=power.add&layout=modal&tmpl=component" urlEdit="index.php?option=com_componentbuilder&task=power.edit&guid={id}&layout=modal&tmpl=component&titleKey=guid" titleSelect="COM_COMPONENTBUILDER_POWER_USE_TITLESELECT" iconSelect="icon-flash" select="true" - new="false" + new="true" edit="true" clear="true" required="true" diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index 748ae594a..d000f284d 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -2761,7 +2761,7 @@ INSERT INTO `#__componentbuilder_fieldtype` (`id`, `description`, `name`, `prope (45, '', 'Modal Menu', '{\"properties0\":{\"name\":\"type\",\"example\":\"modal_menu\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be modal_menu.\"},\"properties1\":{\"name\":\"name\",\"example\":\"base\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Base Item\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"option\",\"example\":\"Current\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties4\":{\"name\":\"select\",\"example\":\"true\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) show select options\"},\"properties5\":{\"name\":\"new\",\"example\":\"true\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory)\"},\"properties6\":{\"name\":\"edit\",\"example\":\"true\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory)\"},\"properties7\":{\"name\":\"description\",\"example\":\"Select a menu item to always be used as the base for the menu display. You must set the Start Level to the same level or higher than the level of the base item. This will cause the module to be displayed on all assigned pages. If Current is selected the active item is used as the base. This causes the module to only display when the parent menu item is active.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties8\":{\"name\":\"clear\",\"example\":\"true\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory)\"},\"properties9\":{\"name\":\"disable\",\"example\":\"separator,alias,heading,url\",\"adjustable\":\"1\",\"description\":\"(optional)\"},\"properties10\":{\"name\":\"filter\",\"example\":\"integer\",\"adjustable\":\"1\",\"description\":\"(optional) is a regular expression string which is used to filter the list of image files selected for inclusion in the drop-down list. If omitted, all image files in the directory are included. The filter argument expression is applied before the exclude argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.\"},\"properties11\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\\r\\n\"}}', 'Modal Menu', '', 1, 7, '', 15, '715256a4-8cc2-4d66-9d08-31e58ca5b036'), (46, 'The menu form field type provides a drop down list of the available menus from your Joomla! site. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected. ', 'Menu', '{\"properties0\":{\"name\":\"type\",\"example\":\"menu\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be menu.\"},\"properties1\":{\"name\":\"name\",\"example\":\"menutype\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the filed.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Menu to Show\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"Choose which menu should be rendered with this instance of module.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) tooltip for the form field.\"},\"properties4\":{\"name\":\"clientid\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"\"},\"properties5\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default menu. Note that this is the name of the menu shown in the Type column on the Menu Manager screen and not the menu ID number.\"},\"properties6\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties7\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'Menu Type', '', 1, 4, '', 16, '6349f152-8ef5-43bd-a89b-ce18f33ac5e5'), (47, 'Dynamic Checkboxes', 'DynamicCheckboxes@', '{\"properties0\":{\"name\":\"type\",\"example\":\"change_this\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) can be anything, just not the same as any other default Joomla field type. You can also not use the \\\"_\\\" (underscore) or \\\"-\\\" (hyphen) in the type name, and no spaces.\"},\"properties1\":{\"name\":\"name\",\"example\":\"dynamic_checkboxes\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Dynamic Checkboxes\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"The checkbox linked to global subform of the same name\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"option\",\"example\":\"1|Default\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) set the options of this checkboxes. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties5\":{\"name\":\"default\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"required\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties8\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"},\"properties9\":{\"name\":\"extends\",\"example\":\"checkboxes\",\"mandatory\":\"1\",\"description\":\"Must be checkboxes\"},\"properties10\":{\"name\":\"type_phpHEADER_1\",\"example\":\"\\\\JFormHelper::loadFieldClass(\'checkboxes\');\\r\\nuse VDM\\\\Joomla\\\\Utilities\\\\Component\\\\Helper;\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The Header USE options\"},\"properties11\":{\"name\":\"type_php_1\",\"example\":\"\\t\\/**\\r\\n\\t * Method to get the data to be passed to the layout for rendering.\\r\\n\\t *\\r\\n\\t * @return array\\r\\n\\t *\\r\\n\\t * @since 3.5\\r\\n\\t *\\/\\r\\n\\tprotected function getLayoutData()\\r\\n\\t{\\r\\n\\t\\t$data = parent::getLayoutData();\\r\\n\\r\\n\\t\\t\\/\\/ True if the field has \'value\' set. In other words, it has been stored, don\'t use the default values.\\r\\n\\t\\t$hasValue = (isset($this->value) && !empty($this->value));\\r\\n\\r\\n\\t\\t\\/\\/ If a value has been stored, use it. Otherwise, use the defaults.\\r\\n\\t\\t$checkedOptions = $hasValue ? $this->value : $this->checkedOptions;\\r\\n\\r\\n\\t\\t\\/\\/ get the form options\\r\\n\\t\\t$options = $this->getOptions();\\r\\n\\r\\n\\t\\t\\/\\/ get the component params\\r\\n\\t\\t$params = Helper::getParams();\\r\\n\\t\\t$subform = $params->get($this->fieldname);\\r\\n\\r\\n\\t\\t\\/\\/ add the paths found in global settings\\r\\n\\t\\tif (is_array($subform) && $subform !== [])\\r\\n\\t\\t{\\r\\n\\t\\t\\tforeach ($subform as $value)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tif (isset($value->path) && strlen($value->path) > 3)\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$tmp = new \\\\stdClass;\\r\\n\\t\\t\\t\\t\\t$tmp->value = $value->set_me;\\r\\n\\t\\t\\t\\t\\t$tmp->text = $value->set_me;\\r\\n\\t\\t\\t\\t\\t$tmp->checked = false;\\r\\n\\r\\n\\t\\t\\t\\t\\t$options[] = $tmp;\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t$extraData = array(\\r\\n\\t\\t\\t\'checkedOptions\' => is_array($checkedOptions) ? $checkedOptions : explode(\',\', (string) $checkedOptions),\\r\\n\\t\\t\\t\'hasValue\' => $hasValue,\\r\\n\\t\\t\\t\'options\' => $options\\r\\n\\t\\t);\\r\\n\\r\\n\\t\\treturn array_merge($data, $extraData);\\r\\n\\t}\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The php for the getLayoutData method.\"}}', 'Super Power Repository Paths', '', 1, 14, '', 12, '7ed21e79-cbc5-48e3-9ed0-ca72b0f2f1a1'), -(48, 'The ModalSelectField offers an intuitive, user-friendly modal popup interface within Joomla\'s administrator forms. It enables users to select existing records, create new records, edit existing records, or clear selected records directly from within the form. The field retrieves and displays the selected record\'s title dynamically, based on configurable database parameters. It simplifies relational data handling, enhancing the user experience by minimizing page transitions and streamlining record management tasks in Joomla administration interfaces.', 'ModalSelect', '{\"properties0\":{\"name\":\"type\",\"example\":\"ModalSelect\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be ModalSelect.\"},\"properties1\":{\"name\":\"name\",\"example\":\"targetview\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Enter some text\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"sql_title_table\",\"example\":\"#__###component###_targetview\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"Database table (with prefix) used for retrieving title.\"},\"properties4\":{\"name\":\"sql_title_column\",\"example\":\"title\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"Column used for the title display in the modal input field.\"},\"properties5\":{\"name\":\"sql_title_key\",\"example\":\"id\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"Primary key column name of the selected item (usually id).\"},\"properties6\":{\"name\":\"urlSelect\",\"example\":\"index.php?option=com_###component###&view=targetviews&layout=modal&tmpl=component&titleKey=id\",\"adjustable\":\"1\",\"description\":\"URL for opening modal to select an existing record. Important note, the [titleKey] in the url must be equal to [sql_title_key]\"},\"properties7\":{\"name\":\"urlNew\",\"example\":\"index.php?option=com_###component###&task=targetview.add&layout=modal&tmpl=component\",\"adjustable\":\"1\",\"description\":\"URL for opening modal to create a new record.\"},\"properties8\":{\"name\":\"urlEdit\",\"example\":\"index.php?option=com_###component###&task=targetview.edit&id={id}&layout=modal&tmpl=component\",\"adjustable\":\"1\",\"description\":\"URL for editing selected record. {id} dynamically replaced with the [sql_title_key] valiue.\"},\"properties9\":{\"name\":\"titleSelect\",\"example\":\"Select Targetview\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"Modal title for the record selection window.\"},\"properties10\":{\"name\":\"titleNew\",\"example\":\"New Targetview\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"Modal title displayed when creating a new record.\"},\"properties11\":{\"name\":\"titleEdit\",\"example\":\"Edit Targetview\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"Modal title displayed when editing existing record.\"},\"properties12\":{\"name\":\"iconSelect\",\"example\":\"icon-copy\",\"adjustable\":\"1\",\"description\":\"CSS icon class from Icomoon or FontAwesome for select button.\"},\"properties13\":{\"name\":\"select\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"Allow users to select a record (true\\/false). Default: true.\"},\"properties14\":{\"name\":\"new\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"Allow users to create a new record (true\\/false). Default: false.\"},\"properties15\":{\"name\":\"edit\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"Allow editing of selected record (true\\/false). Default: false.\"},\"properties16\":{\"name\":\"clear\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"Allow clearing of the current selection (true\\/false). Default: true.\"},\"properties17\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties18\":{\"name\":\"class\",\"example\":\"input-large\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'input-large\'.\"},\"properties19\":{\"name\":\"description\",\"example\":\"Enter some description\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties20\":{\"name\":\"hint\",\"example\":\"Select a Targetview\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The placeholder to display inside the text box.\"},\"properties21\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value of the field (item ID).\"},\"properties22\":{\"name\":\"readonly\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties23\":{\"name\":\"disabled\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties24\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'Provides a modal popup to select, create, edit, or clear a database record. (J5+ only)', '', 1, 28, '', 17, 'a1cdb0a5-517c-425c-998a-333e92af3e32'); +(48, 'The ModalSelectField offers an intuitive, user-friendly modal popup interface within Joomla\'s administrator forms. It enables users to select existing records, create new records, edit existing records, or clear selected records directly from within the form. The field retrieves and displays the selected record\'s title dynamically, based on configurable database parameters. It simplifies relational data handling, enhancing the user experience by minimizing page transitions and streamlining record management tasks in Joomla administration interfaces.', 'ModalSelect', '{\"properties0\":{\"name\":\"type\",\"example\":\"ModalSelect\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be ModalSelect.\"},\"properties1\":{\"name\":\"name\",\"example\":\"targetview\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Enter some text\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"sql_title_table\",\"example\":\"#__###component###_targetview\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"Database table (with prefix) used for retrieving title.\"},\"properties4\":{\"name\":\"sql_title_column\",\"example\":\"title\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"Column used for the title display in the modal input field.\"},\"properties5\":{\"name\":\"sql_title_key\",\"example\":\"id\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"Primary key column name of the selected item (usually id).\"},\"properties7\":{\"name\":\"urlSelect\",\"example\":\"index.php?option=com_###component###&view=targetviews&layout=modal&tmpl=component&titleKey=id\",\"adjustable\":\"1\",\"description\":\"URL for opening modal to select an existing record. Important note, the [titleKey] in the url must be equal to [sql_title_key]\"},\"properties8\":{\"name\":\"urlNew\",\"example\":\"index.php?option=com_###component###&task=targetview.add&layout=modal&tmpl=component\",\"adjustable\":\"1\",\"description\":\"URL for opening modal to create a new record.\"},\"properties9\":{\"name\":\"urlEdit\",\"example\":\"index.php?option=com_###component###&task=targetview.edit&id={id}&layout=modal&tmpl=component\",\"adjustable\":\"1\",\"description\":\"URL for editing selected record. {id} dynamically replaced with the [sql_title_key] valiue.\"},\"properties10\":{\"name\":\"titleSelect\",\"example\":\"Select Targetview\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"Modal title for the record selection window.\"},\"properties11\":{\"name\":\"titleNew\",\"example\":\"New Targetview\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"Modal title displayed when creating a new record.\"},\"properties12\":{\"name\":\"titleEdit\",\"example\":\"Edit Targetview\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"Modal title displayed when editing existing record.\"},\"properties13\":{\"name\":\"iconSelect\",\"example\":\"icon-copy\",\"adjustable\":\"1\",\"description\":\"CSS icon class from Icomoon or FontAwesome for select button.\"},\"properties14\":{\"name\":\"select\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"Allow users to select a record (true\\/false). Default: true.\"},\"properties15\":{\"name\":\"new\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"Allow users to create a new record (true\\/false). Default: false.\"},\"properties16\":{\"name\":\"edit\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"Allow editing of selected record (true\\/false). Default: false.\"},\"properties17\":{\"name\":\"clear\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"Allow clearing of the current selection (true\\/false). Default: true.\"},\"properties18\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties19\":{\"name\":\"class\",\"example\":\"input-large\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'input-large\'.\"},\"properties20\":{\"name\":\"description\",\"example\":\"Enter some description\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties21\":{\"name\":\"hint\",\"example\":\"Select a Targetview\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The placeholder to display inside the text box.\"},\"properties22\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value of the field (item ID).\"},\"properties23\":{\"name\":\"readonly\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties24\":{\"name\":\"disabled\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties25\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'Provides a modal popup to select, create, edit, or clear a database record. (J5+ only)', '', 1, 30, '', 17, 'a1cdb0a5-517c-425c-998a-333e92af3e32'); -- -- Dumping data for table `#__componentbuilder_language` diff --git a/admin/src/Controller/Admin_custom_tabsController.php b/admin/src/Controller/Admin_custom_tabsController.php index b5f3899ae..d313044f2 100644 --- a/admin/src/Controller/Admin_custom_tabsController.php +++ b/admin/src/Controller/Admin_custom_tabsController.php @@ -281,6 +281,15 @@ class Admin_custom_tabsController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Admin_custom_tabsController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('admin_custom_tabs.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Admin_fieldsController.php b/admin/src/Controller/Admin_fieldsController.php index 76a6198a7..dd856ad01 100644 --- a/admin/src/Controller/Admin_fieldsController.php +++ b/admin/src/Controller/Admin_fieldsController.php @@ -281,6 +281,15 @@ class Admin_fieldsController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Admin_fieldsController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('admin_fields.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Admin_fields_conditionsController.php b/admin/src/Controller/Admin_fields_conditionsController.php index 1d2fad1cc..c28ddc774 100644 --- a/admin/src/Controller/Admin_fields_conditionsController.php +++ b/admin/src/Controller/Admin_fields_conditionsController.php @@ -281,6 +281,15 @@ class Admin_fields_conditionsController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Admin_fields_conditionsController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('admin_fields_conditions.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Admin_fields_relationsController.php b/admin/src/Controller/Admin_fields_relationsController.php index 866fbb591..abaabb6f4 100644 --- a/admin/src/Controller/Admin_fields_relationsController.php +++ b/admin/src/Controller/Admin_fields_relationsController.php @@ -281,6 +281,15 @@ class Admin_fields_relationsController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Admin_fields_relationsController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('admin_fields_relations.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Admin_viewController.php b/admin/src/Controller/Admin_viewController.php index 9ce1f5235..19d052c99 100644 --- a/admin/src/Controller/Admin_viewController.php +++ b/admin/src/Controller/Admin_viewController.php @@ -24,8 +24,8 @@ use Joomla\CMS\Router\Route; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; -use VDM\Joomla\Data\Factory as DataFactory; use VDM\Joomla\Utilities\GuidHelper; +use VDM\Joomla\Data\Factory as DataFactory; // No direct access to this file \defined('_JEXEC') or die; @@ -80,6 +80,51 @@ class Admin_viewController extends FormController */ protected int $refid; + + /** + * Method to edit an existing record. + * + * @param string $key The name of the primary key of the URL variable. + * @param string $urlVar The name of the URL variable if different from the primary key + * (sometimes required to avoid router collisions). + * + * @return boolean True if access level check and checkout passes, false otherwise. + * + * @since 1.6 + */ + public function edit($key = null, $urlVar = null) + { + // for modal title key selection (unique key to do mapping) + $titleKey = $this->input->get('titleKey', 'id', 'word'); + $guid = null; + $value = null; + + // Determine the name of the primary key for the data. + if (empty($key)) + { + $model = $this->getModel(); + $table = $model->getTable(); + $key = $table->getKeyName(); + } + + if ($titleKey === 'guid') + { + $guid = $this->input->get('guid', null, 'string'); + } + + if ($guid !== null && GuidHelper::valid($guid)) + { + $value = GuidHelper::item($guid, 'admin_view', 'a.' . $key, 'componentbuilder'); + } + + if ($value !== null) + { + $this->input->set($key, $value); + } + + return parent::edit($key, $urlVar); + } + /** * Method override to check if you can add a new record. * @@ -283,6 +328,15 @@ class Admin_viewController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -365,6 +419,15 @@ class Admin_viewController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('admin_view.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } // linked tables to update $_tables_array = [ 'admin_fields' => 'admin_view', diff --git a/admin/src/Controller/Class_extendsController.php b/admin/src/Controller/Class_extendsController.php index 550a8c6e4..fb5ed1e80 100644 --- a/admin/src/Controller/Class_extendsController.php +++ b/admin/src/Controller/Class_extendsController.php @@ -281,6 +281,15 @@ class Class_extendsController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Class_extendsController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('class_extends.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Class_methodController.php b/admin/src/Controller/Class_methodController.php index d7bafe77e..31e60137b 100644 --- a/admin/src/Controller/Class_methodController.php +++ b/admin/src/Controller/Class_methodController.php @@ -281,6 +281,15 @@ class Class_methodController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Class_methodController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('class_method.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Class_propertyController.php b/admin/src/Controller/Class_propertyController.php index d7827677c..27017c8bc 100644 --- a/admin/src/Controller/Class_propertyController.php +++ b/admin/src/Controller/Class_propertyController.php @@ -281,6 +281,15 @@ class Class_propertyController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Class_propertyController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('class_property.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Component_admin_viewsController.php b/admin/src/Controller/Component_admin_viewsController.php index e526e3149..454622bb2 100644 --- a/admin/src/Controller/Component_admin_viewsController.php +++ b/admin/src/Controller/Component_admin_viewsController.php @@ -281,6 +281,15 @@ class Component_admin_viewsController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Component_admin_viewsController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('component_admin_views.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Component_configController.php b/admin/src/Controller/Component_configController.php index 5ec9d88b2..74d7524d9 100644 --- a/admin/src/Controller/Component_configController.php +++ b/admin/src/Controller/Component_configController.php @@ -281,6 +281,15 @@ class Component_configController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Component_configController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('component_config.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Component_custom_admin_menusController.php b/admin/src/Controller/Component_custom_admin_menusController.php index c429cd1fe..32b2b082e 100644 --- a/admin/src/Controller/Component_custom_admin_menusController.php +++ b/admin/src/Controller/Component_custom_admin_menusController.php @@ -281,6 +281,15 @@ class Component_custom_admin_menusController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Component_custom_admin_menusController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('component_custom_admin_menus.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Component_custom_admin_viewsController.php b/admin/src/Controller/Component_custom_admin_viewsController.php index 360d25594..854b8ca8c 100644 --- a/admin/src/Controller/Component_custom_admin_viewsController.php +++ b/admin/src/Controller/Component_custom_admin_viewsController.php @@ -281,6 +281,15 @@ class Component_custom_admin_viewsController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Component_custom_admin_viewsController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('component_custom_admin_views.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Component_dashboardController.php b/admin/src/Controller/Component_dashboardController.php index 4377d23ab..683378381 100644 --- a/admin/src/Controller/Component_dashboardController.php +++ b/admin/src/Controller/Component_dashboardController.php @@ -281,6 +281,15 @@ class Component_dashboardController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Component_dashboardController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('component_dashboard.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Component_files_foldersController.php b/admin/src/Controller/Component_files_foldersController.php index 2e47946c0..193141901 100644 --- a/admin/src/Controller/Component_files_foldersController.php +++ b/admin/src/Controller/Component_files_foldersController.php @@ -281,6 +281,15 @@ class Component_files_foldersController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Component_files_foldersController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('component_files_folders.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Component_modulesController.php b/admin/src/Controller/Component_modulesController.php index d87cce7a7..a82d2fa74 100644 --- a/admin/src/Controller/Component_modulesController.php +++ b/admin/src/Controller/Component_modulesController.php @@ -281,6 +281,15 @@ class Component_modulesController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Component_modulesController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('component_modules.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Component_mysql_tweaksController.php b/admin/src/Controller/Component_mysql_tweaksController.php index 1743b0165..a2ceb3f70 100644 --- a/admin/src/Controller/Component_mysql_tweaksController.php +++ b/admin/src/Controller/Component_mysql_tweaksController.php @@ -281,6 +281,15 @@ class Component_mysql_tweaksController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Component_mysql_tweaksController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('component_mysql_tweaks.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Component_placeholdersController.php b/admin/src/Controller/Component_placeholdersController.php index 240190eba..f07c24406 100644 --- a/admin/src/Controller/Component_placeholdersController.php +++ b/admin/src/Controller/Component_placeholdersController.php @@ -281,6 +281,15 @@ class Component_placeholdersController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Component_placeholdersController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('component_placeholders.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Component_pluginsController.php b/admin/src/Controller/Component_pluginsController.php index 1a213eb7d..e3422a342 100644 --- a/admin/src/Controller/Component_pluginsController.php +++ b/admin/src/Controller/Component_pluginsController.php @@ -281,6 +281,15 @@ class Component_pluginsController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Component_pluginsController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('component_plugins.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Component_routerController.php b/admin/src/Controller/Component_routerController.php index a373323f7..2b733656f 100644 --- a/admin/src/Controller/Component_routerController.php +++ b/admin/src/Controller/Component_routerController.php @@ -281,6 +281,15 @@ class Component_routerController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Component_routerController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('component_router.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Component_site_viewsController.php b/admin/src/Controller/Component_site_viewsController.php index d0440411e..a2f4f3cc7 100644 --- a/admin/src/Controller/Component_site_viewsController.php +++ b/admin/src/Controller/Component_site_viewsController.php @@ -281,6 +281,15 @@ class Component_site_viewsController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Component_site_viewsController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('component_site_views.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Component_updatesController.php b/admin/src/Controller/Component_updatesController.php index 88d66337e..1f6d05d9b 100644 --- a/admin/src/Controller/Component_updatesController.php +++ b/admin/src/Controller/Component_updatesController.php @@ -285,6 +285,15 @@ class Component_updatesController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -367,6 +376,15 @@ class Component_updatesController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('component_updates.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } // update the component version to match the updated last version if (isset($validData['joomla_component']) && GuidHelper::valid($validData['joomla_component'])) { diff --git a/admin/src/Controller/Custom_admin_viewController.php b/admin/src/Controller/Custom_admin_viewController.php index 73056e45c..4c7db8b79 100644 --- a/admin/src/Controller/Custom_admin_viewController.php +++ b/admin/src/Controller/Custom_admin_viewController.php @@ -24,6 +24,7 @@ use Joomla\CMS\Router\Route; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; +use VDM\Joomla\Utilities\GuidHelper; // No direct access to this file \defined('_JEXEC') or die; @@ -78,6 +79,51 @@ class Custom_admin_viewController extends FormController */ protected int $refid; + + /** + * Method to edit an existing record. + * + * @param string $key The name of the primary key of the URL variable. + * @param string $urlVar The name of the URL variable if different from the primary key + * (sometimes required to avoid router collisions). + * + * @return boolean True if access level check and checkout passes, false otherwise. + * + * @since 1.6 + */ + public function edit($key = null, $urlVar = null) + { + // for modal title key selection (unique key to do mapping) + $titleKey = $this->input->get('titleKey', 'id', 'word'); + $guid = null; + $value = null; + + // Determine the name of the primary key for the data. + if (empty($key)) + { + $model = $this->getModel(); + $table = $model->getTable(); + $key = $table->getKeyName(); + } + + if ($titleKey === 'guid') + { + $guid = $this->input->get('guid', null, 'string'); + } + + if ($guid !== null && GuidHelper::valid($guid)) + { + $value = GuidHelper::item($guid, 'custom_admin_view', 'a.' . $key, 'componentbuilder'); + } + + if ($value !== null) + { + $this->input->set($key, $value); + } + + return parent::edit($key, $urlVar); + } + /** * Method override to check if you can add a new record. * @@ -281,6 +327,15 @@ class Custom_admin_viewController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +418,15 @@ class Custom_admin_viewController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('custom_admin_view.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Custom_codeController.php b/admin/src/Controller/Custom_codeController.php index 26d1f71bb..e143388d2 100644 --- a/admin/src/Controller/Custom_codeController.php +++ b/admin/src/Controller/Custom_codeController.php @@ -281,6 +281,15 @@ class Custom_codeController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Custom_codeController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('custom_code.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Dynamic_getController.php b/admin/src/Controller/Dynamic_getController.php index 35bb54693..3900d11ad 100644 --- a/admin/src/Controller/Dynamic_getController.php +++ b/admin/src/Controller/Dynamic_getController.php @@ -281,6 +281,15 @@ class Dynamic_getController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Dynamic_getController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('dynamic_get.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/FieldController.php b/admin/src/Controller/FieldController.php index b2f41d87e..d79174211 100644 --- a/admin/src/Controller/FieldController.php +++ b/admin/src/Controller/FieldController.php @@ -24,6 +24,7 @@ use Joomla\CMS\Router\Route; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; +use VDM\Joomla\Utilities\GuidHelper; // No direct access to this file \defined('_JEXEC') or die; @@ -78,6 +79,51 @@ class FieldController extends FormController */ protected int $refid; + + /** + * Method to edit an existing record. + * + * @param string $key The name of the primary key of the URL variable. + * @param string $urlVar The name of the URL variable if different from the primary key + * (sometimes required to avoid router collisions). + * + * @return boolean True if access level check and checkout passes, false otherwise. + * + * @since 1.6 + */ + public function edit($key = null, $urlVar = null) + { + // for modal title key selection (unique key to do mapping) + $titleKey = $this->input->get('titleKey', 'id', 'word'); + $guid = null; + $value = null; + + // Determine the name of the primary key for the data. + if (empty($key)) + { + $model = $this->getModel(); + $table = $model->getTable(); + $key = $table->getKeyName(); + } + + if ($titleKey === 'guid') + { + $guid = $this->input->get('guid', null, 'string'); + } + + if ($guid !== null && GuidHelper::valid($guid)) + { + $value = GuidHelper::item($guid, 'field', 'a.' . $key, 'componentbuilder'); + } + + if ($value !== null) + { + $this->input->set($key, $value); + } + + return parent::edit($key, $urlVar); + } + /** * Method override to check if you can add a new record. * @@ -280,6 +326,15 @@ class FieldController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -362,6 +417,15 @@ class FieldController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('field.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/FieldtypeController.php b/admin/src/Controller/FieldtypeController.php index f9d96f9cd..f8193d52c 100644 --- a/admin/src/Controller/FieldtypeController.php +++ b/admin/src/Controller/FieldtypeController.php @@ -432,6 +432,15 @@ class FieldtypeController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -514,6 +523,15 @@ class FieldtypeController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('fieldtype.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Help_documentController.php b/admin/src/Controller/Help_documentController.php index 051db2abe..cf00ecdb0 100644 --- a/admin/src/Controller/Help_documentController.php +++ b/admin/src/Controller/Help_documentController.php @@ -281,6 +281,15 @@ class Help_documentController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Help_documentController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('help_document.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Joomla_componentController.php b/admin/src/Controller/Joomla_componentController.php index 715d42621..02b955df3 100644 --- a/admin/src/Controller/Joomla_componentController.php +++ b/admin/src/Controller/Joomla_componentController.php @@ -283,6 +283,15 @@ class Joomla_componentController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -365,6 +374,15 @@ class Joomla_componentController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('joomla_component.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } // linked tables to update $_tables_array = [ 'component_admin_views' => 'joomla_component', diff --git a/admin/src/Controller/Joomla_moduleController.php b/admin/src/Controller/Joomla_moduleController.php index 9cbbe0674..da3e5f0d2 100644 --- a/admin/src/Controller/Joomla_moduleController.php +++ b/admin/src/Controller/Joomla_moduleController.php @@ -283,6 +283,15 @@ class Joomla_moduleController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -365,6 +374,15 @@ class Joomla_moduleController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('joomla_module.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } // linked tables to update $_tables_array = [ 'joomla_module_updates' => 'joomla_module', diff --git a/admin/src/Controller/Joomla_module_files_folders_urlsController.php b/admin/src/Controller/Joomla_module_files_folders_urlsController.php index 51730ade8..0f238f0e7 100644 --- a/admin/src/Controller/Joomla_module_files_folders_urlsController.php +++ b/admin/src/Controller/Joomla_module_files_folders_urlsController.php @@ -281,6 +281,15 @@ class Joomla_module_files_folders_urlsController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Joomla_module_files_folders_urlsController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('joomla_module_files_folders_urls.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Joomla_module_updatesController.php b/admin/src/Controller/Joomla_module_updatesController.php index 7c0a9cca8..929cf2f09 100644 --- a/admin/src/Controller/Joomla_module_updatesController.php +++ b/admin/src/Controller/Joomla_module_updatesController.php @@ -284,6 +284,15 @@ class Joomla_module_updatesController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -366,6 +375,15 @@ class Joomla_module_updatesController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('joomla_module_updates.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } // update the component version to match the updated last version if (isset($validData['joomla_plugin']) && GuidHelper::valid($validData['joomla_plugin'])) { diff --git a/admin/src/Controller/Joomla_pluginController.php b/admin/src/Controller/Joomla_pluginController.php index e466decb9..a27f5b090 100644 --- a/admin/src/Controller/Joomla_pluginController.php +++ b/admin/src/Controller/Joomla_pluginController.php @@ -283,6 +283,15 @@ class Joomla_pluginController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -365,6 +374,15 @@ class Joomla_pluginController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('joomla_plugin.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } // linked tables to update $_tables_array = [ 'joomla_plugin_updates' => 'joomla_plugin', diff --git a/admin/src/Controller/Joomla_plugin_files_folders_urlsController.php b/admin/src/Controller/Joomla_plugin_files_folders_urlsController.php index 9c901aa35..5fc35a7a0 100644 --- a/admin/src/Controller/Joomla_plugin_files_folders_urlsController.php +++ b/admin/src/Controller/Joomla_plugin_files_folders_urlsController.php @@ -281,6 +281,15 @@ class Joomla_plugin_files_folders_urlsController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Joomla_plugin_files_folders_urlsController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('joomla_plugin_files_folders_urls.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Joomla_plugin_groupController.php b/admin/src/Controller/Joomla_plugin_groupController.php index e3c99a29e..41fd90fad 100644 --- a/admin/src/Controller/Joomla_plugin_groupController.php +++ b/admin/src/Controller/Joomla_plugin_groupController.php @@ -274,6 +274,15 @@ class Joomla_plugin_groupController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -356,6 +365,15 @@ class Joomla_plugin_groupController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('joomla_plugin_group.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Joomla_plugin_updatesController.php b/admin/src/Controller/Joomla_plugin_updatesController.php index 512cf6043..d399481b8 100644 --- a/admin/src/Controller/Joomla_plugin_updatesController.php +++ b/admin/src/Controller/Joomla_plugin_updatesController.php @@ -283,6 +283,15 @@ class Joomla_plugin_updatesController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -365,6 +374,15 @@ class Joomla_plugin_updatesController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('joomla_plugin_updates.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } // update the component version to match the updated last version if (isset($validData['joomla_plugin']) && is_numeric($validData['joomla_plugin']) && $validData['joomla_plugin'] > 0) { diff --git a/admin/src/Controller/Joomla_powerController.php b/admin/src/Controller/Joomla_powerController.php index 24360152f..18986732c 100644 --- a/admin/src/Controller/Joomla_powerController.php +++ b/admin/src/Controller/Joomla_powerController.php @@ -433,6 +433,15 @@ class Joomla_powerController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -515,6 +524,15 @@ class Joomla_powerController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('joomla_power.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/LanguageController.php b/admin/src/Controller/LanguageController.php index 71a1d938d..583088635 100644 --- a/admin/src/Controller/LanguageController.php +++ b/admin/src/Controller/LanguageController.php @@ -281,6 +281,15 @@ class LanguageController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class LanguageController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('language.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Language_translationController.php b/admin/src/Controller/Language_translationController.php index 9c84dea70..deade91ee 100644 --- a/admin/src/Controller/Language_translationController.php +++ b/admin/src/Controller/Language_translationController.php @@ -281,6 +281,15 @@ class Language_translationController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Language_translationController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('language_translation.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/LayoutController.php b/admin/src/Controller/LayoutController.php index e4797a4ef..7d4f13645 100644 --- a/admin/src/Controller/LayoutController.php +++ b/admin/src/Controller/LayoutController.php @@ -281,6 +281,15 @@ class LayoutController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class LayoutController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('layout.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/LibraryController.php b/admin/src/Controller/LibraryController.php index a456a26e8..1b985bd6b 100644 --- a/admin/src/Controller/LibraryController.php +++ b/admin/src/Controller/LibraryController.php @@ -283,6 +283,15 @@ class LibraryController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -365,6 +374,15 @@ class LibraryController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('library.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } // linked tables to update $_tables_array = [ 'library_config' => 'library', diff --git a/admin/src/Controller/Library_configController.php b/admin/src/Controller/Library_configController.php index 711da70cc..fdd20bd6d 100644 --- a/admin/src/Controller/Library_configController.php +++ b/admin/src/Controller/Library_configController.php @@ -281,6 +281,15 @@ class Library_configController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Library_configController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('library_config.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Library_files_folders_urlsController.php b/admin/src/Controller/Library_files_folders_urlsController.php index dcf8bb9c4..c49b471d8 100644 --- a/admin/src/Controller/Library_files_folders_urlsController.php +++ b/admin/src/Controller/Library_files_folders_urlsController.php @@ -281,6 +281,15 @@ class Library_files_folders_urlsController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Library_files_folders_urlsController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('library_files_folders_urls.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/PlaceholderController.php b/admin/src/Controller/PlaceholderController.php index b23ed8ae5..02e1fed49 100644 --- a/admin/src/Controller/PlaceholderController.php +++ b/admin/src/Controller/PlaceholderController.php @@ -281,6 +281,15 @@ class PlaceholderController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class PlaceholderController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('placeholder.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/PowerController.php b/admin/src/Controller/PowerController.php index 4b7e5c96c..105cfa47a 100644 --- a/admin/src/Controller/PowerController.php +++ b/admin/src/Controller/PowerController.php @@ -478,6 +478,15 @@ class PowerController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -560,6 +569,15 @@ class PowerController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('power.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/RepositoryController.php b/admin/src/Controller/RepositoryController.php index 2f01e58fa..ed8280d3d 100644 --- a/admin/src/Controller/RepositoryController.php +++ b/admin/src/Controller/RepositoryController.php @@ -281,6 +281,15 @@ class RepositoryController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class RepositoryController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('repository.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/ServerController.php b/admin/src/Controller/ServerController.php index 3cc781e4d..25b7e5927 100644 --- a/admin/src/Controller/ServerController.php +++ b/admin/src/Controller/ServerController.php @@ -281,6 +281,15 @@ class ServerController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class ServerController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('server.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Site_viewController.php b/admin/src/Controller/Site_viewController.php index 3279008c9..08d73f4fc 100644 --- a/admin/src/Controller/Site_viewController.php +++ b/admin/src/Controller/Site_viewController.php @@ -24,6 +24,7 @@ use Joomla\CMS\Router\Route; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; +use VDM\Joomla\Utilities\GuidHelper; // No direct access to this file \defined('_JEXEC') or die; @@ -78,6 +79,51 @@ class Site_viewController extends FormController */ protected int $refid; + + /** + * Method to edit an existing record. + * + * @param string $key The name of the primary key of the URL variable. + * @param string $urlVar The name of the URL variable if different from the primary key + * (sometimes required to avoid router collisions). + * + * @return boolean True if access level check and checkout passes, false otherwise. + * + * @since 1.6 + */ + public function edit($key = null, $urlVar = null) + { + // for modal title key selection (unique key to do mapping) + $titleKey = $this->input->get('titleKey', 'id', 'word'); + $guid = null; + $value = null; + + // Determine the name of the primary key for the data. + if (empty($key)) + { + $model = $this->getModel(); + $table = $model->getTable(); + $key = $table->getKeyName(); + } + + if ($titleKey === 'guid') + { + $guid = $this->input->get('guid', null, 'string'); + } + + if ($guid !== null && GuidHelper::valid($guid)) + { + $value = GuidHelper::item($guid, 'site_view', 'a.' . $key, 'componentbuilder'); + } + + if ($value !== null) + { + $this->input->set($key, $value); + } + + return parent::edit($key, $urlVar); + } + /** * Method override to check if you can add a new record. * @@ -281,6 +327,15 @@ class Site_viewController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +418,15 @@ class Site_viewController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('site_view.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/SnippetController.php b/admin/src/Controller/SnippetController.php index e6db90ae5..f8b79df2e 100644 --- a/admin/src/Controller/SnippetController.php +++ b/admin/src/Controller/SnippetController.php @@ -281,6 +281,15 @@ class SnippetController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class SnippetController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('snippet.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Snippet_typeController.php b/admin/src/Controller/Snippet_typeController.php index be39dc5be..7b2df27b4 100644 --- a/admin/src/Controller/Snippet_typeController.php +++ b/admin/src/Controller/Snippet_typeController.php @@ -281,6 +281,15 @@ class Snippet_typeController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Snippet_typeController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('snippet_type.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/TemplateController.php b/admin/src/Controller/TemplateController.php index 85bf33487..14641025c 100644 --- a/admin/src/Controller/TemplateController.php +++ b/admin/src/Controller/TemplateController.php @@ -281,6 +281,15 @@ class TemplateController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class TemplateController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('template.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/src/Controller/Validation_ruleController.php b/admin/src/Controller/Validation_ruleController.php index f4dcb2ed8..a5f58b7ee 100644 --- a/admin/src/Controller/Validation_ruleController.php +++ b/admin/src/Controller/Validation_ruleController.php @@ -281,6 +281,15 @@ class Validation_ruleController extends FormController ) ); } + // When editing in modal then redirect to modalreturn layout + elseif ($cancel && $this->input->get('layout') === 'modal') + { + $id = $this->input->get('id'); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=cancel'; + + $this->setRedirect(Route::_($return, false)); + } return $cancel; } @@ -363,6 +372,15 @@ class Validation_ruleController extends FormController */ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { + if ($this->input->get('layout') === 'modal' && $this->task === 'save') + { + // When editing in modal then redirect to modalreturn layout + $id = $model->getState('validation_rule.id', ''); + $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id) + . '&layout=modalreturn&from-task=save'; + + $this->setRedirect(Route::_($return, false)); + } return; } } diff --git a/admin/tmpl/admin_custom_tabs/modalreturn.php b/admin/tmpl/admin_custom_tabs/modalreturn.php new file mode 100644 index 000000000..0a0bbc122 --- /dev/null +++ b/admin/tmpl/admin_custom_tabs/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Admin_custom_tabs\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.admin_custom_tabs', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/admin_fields/modalreturn.php b/admin/tmpl/admin_fields/modalreturn.php new file mode 100644 index 000000000..33da9d9cc --- /dev/null +++ b/admin/tmpl/admin_fields/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Admin_fields\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.admin_fields', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/admin_fields_conditions/modalreturn.php b/admin/tmpl/admin_fields_conditions/modalreturn.php new file mode 100644 index 000000000..e94472a4e --- /dev/null +++ b/admin/tmpl/admin_fields_conditions/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Admin_fields_conditions\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.admin_fields_conditions', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/admin_fields_relations/modalreturn.php b/admin/tmpl/admin_fields_relations/modalreturn.php new file mode 100644 index 000000000..33c81d623 --- /dev/null +++ b/admin/tmpl/admin_fields_relations/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Admin_fields_relations\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.admin_fields_relations', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/admin_view/modalreturn.php b/admin/tmpl/admin_view/modalreturn.php new file mode 100644 index 000000000..08d555bb3 --- /dev/null +++ b/admin/tmpl/admin_view/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Admin_view\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->guid ?? ''; +$title_column = $this->item->system_name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.admin_view', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/class_extends/modalreturn.php b/admin/tmpl/class_extends/modalreturn.php new file mode 100644 index 000000000..667a55356 --- /dev/null +++ b/admin/tmpl/class_extends/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Class_extends\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.class_extends', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/class_method/modalreturn.php b/admin/tmpl/class_method/modalreturn.php new file mode 100644 index 000000000..cf427d6a1 --- /dev/null +++ b/admin/tmpl/class_method/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Class_method\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.class_method', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/class_property/modalreturn.php b/admin/tmpl/class_property/modalreturn.php new file mode 100644 index 000000000..a65d3b86f --- /dev/null +++ b/admin/tmpl/class_property/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Class_property\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.class_property', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/component_admin_views/modalreturn.php b/admin/tmpl/component_admin_views/modalreturn.php new file mode 100644 index 000000000..2c1d5b0fd --- /dev/null +++ b/admin/tmpl/component_admin_views/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Component_admin_views\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.component_admin_views', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/component_config/modalreturn.php b/admin/tmpl/component_config/modalreturn.php new file mode 100644 index 000000000..538988d35 --- /dev/null +++ b/admin/tmpl/component_config/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Component_config\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.component_config', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/component_custom_admin_menus/modalreturn.php b/admin/tmpl/component_custom_admin_menus/modalreturn.php new file mode 100644 index 000000000..a0fec0fa0 --- /dev/null +++ b/admin/tmpl/component_custom_admin_menus/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Component_custom_admin_menus\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.component_custom_admin_menus', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/component_custom_admin_views/modalreturn.php b/admin/tmpl/component_custom_admin_views/modalreturn.php new file mode 100644 index 000000000..0bf2b6aef --- /dev/null +++ b/admin/tmpl/component_custom_admin_views/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Component_custom_admin_views\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.component_custom_admin_views', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/component_dashboard/modalreturn.php b/admin/tmpl/component_dashboard/modalreturn.php new file mode 100644 index 000000000..90e1dec87 --- /dev/null +++ b/admin/tmpl/component_dashboard/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Component_dashboard\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.component_dashboard', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/component_files_folders/modalreturn.php b/admin/tmpl/component_files_folders/modalreturn.php new file mode 100644 index 000000000..f1f8f6b5b --- /dev/null +++ b/admin/tmpl/component_files_folders/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Component_files_folders\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.component_files_folders', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/component_modules/modalreturn.php b/admin/tmpl/component_modules/modalreturn.php new file mode 100644 index 000000000..70cb2dc6f --- /dev/null +++ b/admin/tmpl/component_modules/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Component_modules\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.component_modules', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/component_mysql_tweaks/modalreturn.php b/admin/tmpl/component_mysql_tweaks/modalreturn.php new file mode 100644 index 000000000..8048df268 --- /dev/null +++ b/admin/tmpl/component_mysql_tweaks/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Component_mysql_tweaks\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.component_mysql_tweaks', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/component_placeholders/modalreturn.php b/admin/tmpl/component_placeholders/modalreturn.php new file mode 100644 index 000000000..87fd70860 --- /dev/null +++ b/admin/tmpl/component_placeholders/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Component_placeholders\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.component_placeholders', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/component_plugins/modalreturn.php b/admin/tmpl/component_plugins/modalreturn.php new file mode 100644 index 000000000..417b24e62 --- /dev/null +++ b/admin/tmpl/component_plugins/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Component_plugins\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.component_plugins', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/component_router/modalreturn.php b/admin/tmpl/component_router/modalreturn.php new file mode 100644 index 000000000..0aa9d29ce --- /dev/null +++ b/admin/tmpl/component_router/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Component_router\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.component_router', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/component_site_views/modalreturn.php b/admin/tmpl/component_site_views/modalreturn.php new file mode 100644 index 000000000..ad31a1f6e --- /dev/null +++ b/admin/tmpl/component_site_views/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Component_site_views\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.component_site_views', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/component_updates/modalreturn.php b/admin/tmpl/component_updates/modalreturn.php new file mode 100644 index 000000000..9b831121d --- /dev/null +++ b/admin/tmpl/component_updates/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Component_updates\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.component_updates', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/custom_admin_view/modalreturn.php b/admin/tmpl/custom_admin_view/modalreturn.php new file mode 100644 index 000000000..d752b2278 --- /dev/null +++ b/admin/tmpl/custom_admin_view/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Custom_admin_view\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->guid ?? ''; +$title_column = $this->item->system_name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.custom_admin_view', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/custom_code/modalreturn.php b/admin/tmpl/custom_code/modalreturn.php new file mode 100644 index 000000000..ab94ca84c --- /dev/null +++ b/admin/tmpl/custom_code/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Custom_code\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.custom_code', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/dynamic_get/modalreturn.php b/admin/tmpl/dynamic_get/modalreturn.php new file mode 100644 index 000000000..d4bf6b397 --- /dev/null +++ b/admin/tmpl/dynamic_get/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Dynamic_get\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.dynamic_get', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/field/modalreturn.php b/admin/tmpl/field/modalreturn.php new file mode 100644 index 000000000..850b5eb76 --- /dev/null +++ b/admin/tmpl/field/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Field\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->guid ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.field', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/fieldtype/modalreturn.php b/admin/tmpl/fieldtype/modalreturn.php new file mode 100644 index 000000000..4c6383ab8 --- /dev/null +++ b/admin/tmpl/fieldtype/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Fieldtype\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.fieldtype', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/help_document/modalreturn.php b/admin/tmpl/help_document/modalreturn.php new file mode 100644 index 000000000..b2a801ff1 --- /dev/null +++ b/admin/tmpl/help_document/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Help_document\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.help_document', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/joomla_component/modalreturn.php b/admin/tmpl/joomla_component/modalreturn.php new file mode 100644 index 000000000..683b26cfe --- /dev/null +++ b/admin/tmpl/joomla_component/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Joomla_component\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.joomla_component', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/joomla_module/modalreturn.php b/admin/tmpl/joomla_module/modalreturn.php new file mode 100644 index 000000000..12da2cf4c --- /dev/null +++ b/admin/tmpl/joomla_module/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Joomla_module\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.joomla_module', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/joomla_module_files_folders_urls/modalreturn.php b/admin/tmpl/joomla_module_files_folders_urls/modalreturn.php new file mode 100644 index 000000000..c3a99d8b7 --- /dev/null +++ b/admin/tmpl/joomla_module_files_folders_urls/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Joomla_module_files_folders_urls\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.joomla_module_files_folders_urls', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/joomla_module_updates/modalreturn.php b/admin/tmpl/joomla_module_updates/modalreturn.php new file mode 100644 index 000000000..4a56d277a --- /dev/null +++ b/admin/tmpl/joomla_module_updates/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Joomla_module_updates\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.joomla_module_updates', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/joomla_plugin/modalreturn.php b/admin/tmpl/joomla_plugin/modalreturn.php new file mode 100644 index 000000000..36ae83620 --- /dev/null +++ b/admin/tmpl/joomla_plugin/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Joomla_plugin\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.joomla_plugin', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/joomla_plugin_files_folders_urls/modalreturn.php b/admin/tmpl/joomla_plugin_files_folders_urls/modalreturn.php new file mode 100644 index 000000000..f09d11521 --- /dev/null +++ b/admin/tmpl/joomla_plugin_files_folders_urls/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Joomla_plugin_files_folders_urls\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.joomla_plugin_files_folders_urls', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/joomla_plugin_group/modalreturn.php b/admin/tmpl/joomla_plugin_group/modalreturn.php new file mode 100644 index 000000000..ee8a4d417 --- /dev/null +++ b/admin/tmpl/joomla_plugin_group/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Joomla_plugin_group\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.joomla_plugin_group', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/joomla_plugin_updates/modalreturn.php b/admin/tmpl/joomla_plugin_updates/modalreturn.php new file mode 100644 index 000000000..e8f2c42ba --- /dev/null +++ b/admin/tmpl/joomla_plugin_updates/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Joomla_plugin_updates\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.joomla_plugin_updates', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/joomla_power/modalreturn.php b/admin/tmpl/joomla_power/modalreturn.php new file mode 100644 index 000000000..e7e678d60 --- /dev/null +++ b/admin/tmpl/joomla_power/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Joomla_power\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.joomla_power', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/language/modalreturn.php b/admin/tmpl/language/modalreturn.php new file mode 100644 index 000000000..2fed293a1 --- /dev/null +++ b/admin/tmpl/language/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Language\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.language', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/language_translation/modalreturn.php b/admin/tmpl/language_translation/modalreturn.php new file mode 100644 index 000000000..1d37d84cc --- /dev/null +++ b/admin/tmpl/language_translation/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Language_translation\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.language_translation', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/layout/modalreturn.php b/admin/tmpl/layout/modalreturn.php new file mode 100644 index 000000000..c1eae7c74 --- /dev/null +++ b/admin/tmpl/layout/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Layout\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.layout', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/library/modalreturn.php b/admin/tmpl/library/modalreturn.php new file mode 100644 index 000000000..5de6178e6 --- /dev/null +++ b/admin/tmpl/library/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Library\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.library', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/library_config/modalreturn.php b/admin/tmpl/library_config/modalreturn.php new file mode 100644 index 000000000..fc9c15c24 --- /dev/null +++ b/admin/tmpl/library_config/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Library_config\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.library_config', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/library_files_folders_urls/modalreturn.php b/admin/tmpl/library_files_folders_urls/modalreturn.php new file mode 100644 index 000000000..fcf5475c8 --- /dev/null +++ b/admin/tmpl/library_files_folders_urls/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Library_files_folders_urls\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.library_files_folders_urls', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/placeholder/modalreturn.php b/admin/tmpl/placeholder/modalreturn.php new file mode 100644 index 000000000..91444ff10 --- /dev/null +++ b/admin/tmpl/placeholder/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Placeholder\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.placeholder', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/power/modalreturn.php b/admin/tmpl/power/modalreturn.php new file mode 100644 index 000000000..23a322be8 --- /dev/null +++ b/admin/tmpl/power/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Power\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->guid ?? ''; +$title_column = $this->item->system_name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.power', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/repository/modalreturn.php b/admin/tmpl/repository/modalreturn.php new file mode 100644 index 000000000..aab115238 --- /dev/null +++ b/admin/tmpl/repository/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Repository\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.repository', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/server/modalreturn.php b/admin/tmpl/server/modalreturn.php new file mode 100644 index 000000000..581ffb7d9 --- /dev/null +++ b/admin/tmpl/server/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Server\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.server', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/site_view/modalreturn.php b/admin/tmpl/site_view/modalreturn.php new file mode 100644 index 000000000..7b6a87c75 --- /dev/null +++ b/admin/tmpl/site_view/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Site_view\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->guid ?? ''; +$title_column = $this->item->system_name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.site_view', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/snippet/modalreturn.php b/admin/tmpl/snippet/modalreturn.php new file mode 100644 index 000000000..6894e5bc0 --- /dev/null +++ b/admin/tmpl/snippet/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Snippet\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.snippet', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/snippet_type/modalreturn.php b/admin/tmpl/snippet_type/modalreturn.php new file mode 100644 index 000000000..64dfcadf1 --- /dev/null +++ b/admin/tmpl/snippet_type/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Snippet_type\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.snippet_type', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/template/modalreturn.php b/admin/tmpl/template/modalreturn.php new file mode 100644 index 000000000..7b7fae095 --- /dev/null +++ b/admin/tmpl/template/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Template\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.template', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/admin/tmpl/validation_rule/modalreturn.php b/admin/tmpl/validation_rule/modalreturn.php new file mode 100644 index 000000000..66ca33e08 --- /dev/null +++ b/admin/tmpl/validation_rule/modalreturn.php @@ -0,0 +1,47 @@ + + * @git 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 + */ + +use Joomla\CMS\Router\Route; + +// No direct access to this file +defined('_JEXEC') or die; + +/** @var \VDM\Component\Componentbuilder\Administrator\View\Validation_rule\HtmlView $this */ + +$icon = 'icon-check'; +$title_key = $this->item->id ?? ''; +$title_column = $this->item->name ?? ''; +$data = [ + 'contentType' => 'com_componentbuilder.validation_rule', + 'id' => $title_key, + 'title' => $title_column, + 'uri' => Route::_('index.php?option=com_componentbuilder&layout=modal&tmpl=component&id='. (int) ($this->item->id ?? 0)) +]; + +// Add Content select script +/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->getDocument()->getWebAssetManager(); +$wa->useScript('modal-content-select'); + +// The data for Content select script +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); + +?> + +
+ +

+
+

+ +

+
+
\ No newline at end of file diff --git a/componentbuilder.xml b/componentbuilder.xml index e71a65506..ab4363f0c 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,15 +1,15 @@ COM_COMPONENTBUILDER - 28th March, 2025 + 30th March, 2025 Llewellyn van der Merwe joomla@vdm.io https://dev.vdm.io Copyright (C) 2015 Vast Development Method. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt - 5.1.1-alpha2 + 5.1.1-alpha3 Component Builder (v.5.1.1-alpha2) +

Component Builder (v.5.1.1-alpha3)

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. diff --git a/componentbuilder_update_server.xml b/componentbuilder_update_server.xml index 667253e5b..9e29123fe 100644 --- a/componentbuilder_update_server.xml +++ b/componentbuilder_update_server.xml @@ -134,7 +134,7 @@ 5.1.1-alpha https://dev.vdm.io - https://github.com/vdm-io/pkg-component-builder/archive/refs/tags/v5.1.1-alpha1.zip + https://github.com/vdm-io/pkg-component-builder/archive/refs/tags/v5.1.1-alpha3.zip alpha @@ -149,10 +149,10 @@ pkg_component_builder package site - 5.1.1-alpha2 + 5.1.1-alpha3 https://dev.vdm.io - https://github.com/vdm-io/pkg-component-builder/archive/refs/tags/v5.1.1-alpha2.zip + https://github.com/vdm-io/pkg-component-builder/archive/refs/tags/v5.1.1-alpha3.zip alpha diff --git a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Component/Structuremultiple.php b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Component/Structuremultiple.php index e2c97785d..7acb97ee4 100644 --- a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Component/Structuremultiple.php +++ b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Component/Structuremultiple.php @@ -12,7 +12,6 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Component; -use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; use VDM\Joomla\Componentbuilder\Compiler\Config; use VDM\Joomla\Componentbuilder\Compiler\Registry; use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Component\SettingsInterface as Settings; @@ -88,30 +87,29 @@ final class Structuremultiple protected Structure $structure; /** - * Constructor + * Constructor. * - * @param Config|null $config The compiler config object. - * @param Registry|null $registry The compiler registry object. - * @param Settings|null $settings The compiler component Joomla version settings object. - * @param Component|null $component The component class. - * @param Createdate|null $createdate The compiler model to get create date class. - * @param Modifieddate|null $modifieddate The compiler model to get modified date class. - * @param Structure|null $structure The compiler structure to build dynamic folder and files class. + * @param Config $config The Config Class. + * @param Registry $registry The Registry Class. + * @param Settings $settings The SettingsInterface Class. + * @param Component $component The Component Class. + * @param Createdate $createdate The Createdate Class. + * @param Modifieddate $modifieddate The Modifieddate Class. + * @param Structure $structure The Structure Class. * * @since 3.2.0 */ - public function __construct(?Config $config = null, ?Registry $registry = null, - ?Settings $settings = null, ?Component $component = null, - ?Createdate $createdate = null, ?Modifieddate $modifieddate = null, - ?Structure $structure = null) + public function __construct(Config $config, Registry $registry, Settings $settings, + Component $component, Createdate $createdate, + Modifieddate $modifieddate, Structure $structure) { - $this->config = $config ?: Compiler::_('Config'); - $this->registry = $registry ?: Compiler::_('Registry'); - $this->settings = $settings ?: Compiler::_('Component.Settings'); - $this->component = $component ?: Compiler::_('Component'); - $this->createdate = $createdate ?: Compiler::_('Model.Createdate'); - $this->modifieddate = $modifieddate ?: Compiler::_('Model.Modifieddate'); - $this->structure = $structure ?: Compiler::_('Utilities.Structure'); + $this->config = $config; + $this->registry = $registry; + $this->settings = $settings; + $this->component = $component; + $this->createdate = $createdate; + $this->modifieddate = $modifieddate; + $this->structure = $structure; } /** @@ -274,6 +272,25 @@ final class Structuremultiple return true; } + /** + * Check if the view has an Modal + * + * @param array $view + * + * @return int + * @since 5.1.1 + */ + private function hasModal(array $view): int + { + // only for Joomla 5 and above + if ($this->config->get('joomla_version', 3) > 4) + { + return 1; + } + + return 0; + } + /** * Check if the view has an API * @@ -336,12 +353,19 @@ final class Structuremultiple */ private function buildAdminView(array $view, array $config) { + $addModal = $this->hasModal($view); + // build the admin edit view if ($view['settings']->name_single != 'null') { $target = ['admin' => $view['settings']->name_single]; $this->structure->build($target, 'single', false, $config); + if ($addModal) + { + $this->structure->build($target, 'single_modal', false, $config); + } + // build the site edit view (of this admin view) if (isset($view['edit_create_site_view']) && is_numeric($view['edit_create_site_view']) @@ -350,6 +374,11 @@ final class Structuremultiple // setup the front site edit-view files $target = ['site' => $view['settings']->name_single]; $this->structure->build($target, 'edit', false, $config); + + if ($addModal) + { + $this->structure->build($target, 'edit_modal', false, $config); + } } } @@ -358,6 +387,11 @@ final class Structuremultiple { $target = ['admin' => $view['settings']->name_list]; $this->structure->build($target, 'list', false, $config); + + if ($addModal) + { + $this->structure->build($target, 'list_modal', false, $config); + } } } diff --git a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Field/Attributes.php b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Field/Attributes.php index 936634b82..e71650e29 100644 --- a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Field/Attributes.php +++ b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Field/Attributes.php @@ -551,6 +551,11 @@ final class Attributes return $this->removeRequired(); } + if ($name === 'sql_title_key' && 'ModalSelect' === $this->typeName) + { + return $this->getSqlTitleKey(); + } + if ($this->viewType == 2 && in_array($name, ['readonly', 'disabled'])) { return $this->setReadonly($name); @@ -967,7 +972,7 @@ final class Attributes { // load the text key $this->attributes['custom']['text'] - = StringHelper::safe( + = FieldHelper::safe( GetHelper::between( $this->settings->xml, 'value_field="', '"' ) @@ -986,7 +991,7 @@ final class Attributes { // load the id key $this->attributes['custom']['id'] - = StringHelper::safe( + = FieldHelper::safe( GetHelper::between( $this->settings->xml, 'key_field="', '"' ) @@ -1045,6 +1050,30 @@ final class Attributes return 'false'; } + /** + * get sql title key value + * and set the [data-key-name] if the key is not an [id] + * + * @return string|null + * @since 5.1.1 + */ + private function getSqlTitleKey(): ?string + { + // load the id key + $key = FieldHelper::safe( + GetHelper::between( + $this->settings->xml, 'sql_title_key="', '"' + ) + ); + + if ($key !== 'id') + { + $this->attributes['data-key-name'] = $key; + } + + return $key; + } + /** * set the readonly switch * diff --git a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Field/ModalSelect.php b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Field/ModalSelect.php index b1bef028a..b07b147d3 100644 --- a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Field/ModalSelect.php +++ b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Field/ModalSelect.php @@ -112,6 +112,7 @@ final class ModalSelect } $sql_title_key = $fieldAttributes['sql_title_key'] ?? 'id'; + $sql_title_column = $fieldAttributes['sql_title_column'] ?? 'id'; // if one field is not id, we add an override to the ModalSelectField as a FIX if (!$this->addedFix && $sql_title_key !== 'id') @@ -130,6 +131,15 @@ final class ModalSelect $this->addedFix = true; } + // make sure we have the target view code name + $view ??= 'error'; + + // add the Title Key for the Modal + $this->contentmulti->set($view . '|SQL_TITLE_KEY', $sql_title_key); + + // add the Title Column for the Modal + $this->contentmulti->set($view . '|SQL_TITLE_COLUMN', $sql_title_column); + return [ 'modal_select' => true, 'urlSelect' => $fieldAttributes['urlSelect'] ?? '', @@ -138,9 +148,9 @@ final class ModalSelect 'iconSelect' => $fieldAttributes['iconSelect'] ?? '', 'table' => $field_target_table, 'id' => $sql_title_key, - 'text' => $fieldAttributes['sql_title_column'] ?? '', + 'text' => $sql_title_column, 'component' => $component ?? 'error', - 'view' => $view ?? 'error', + 'view' => $view, 'views' => $views ?? 'error', 'button' => false, 'extends' => '' diff --git a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Helper/Infusion.php b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Helper/Infusion.php index ae7b75480..56a9eb187 100644 --- a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Helper/Infusion.php +++ b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Helper/Infusion.php @@ -420,6 +420,15 @@ class Infusion extends Interpretation 'jcb_ce_onBeforeBuildAdminEditViewContent', [&$view, &$nameSingleCode, &$nameListCode] ); + // Here we set defaults + // The real values are set in ModalSelect(4fc020dc-3137-478d-8d42-0571a75b77b5) + + // add the Title Key for the Modal + CFactory::_('Compiler.Builder.Content.Multi')->set($nameSingleCode . '|SQL_TITLE_KEY', 'id'); + + // add the Title Column for the Modal + CFactory::_('Compiler.Builder.Content.Multi')->set($nameSingleCode . '|SQL_TITLE_COLUMN', 'name'); + // FIELDSETS <<>> CFactory::_('Compiler.Builder.Content.Multi')->set($nameSingleCode . '|FIELDSETS', CFactory::_('Compiler.Creator.Fieldset')->get( diff --git a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFour/Header.php b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFour/Header.php index 239adff9c..0122573a4 100644 --- a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFour/Header.php +++ b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFour/Header.php @@ -200,7 +200,7 @@ final class Header implements HeaderInterface $headers = $this->getHeaders($context); // add to all except the helper classes - if ('admin.helper' !== $context && 'site.helper' !== $context) + if ('admin.helper' !== $context && 'site.helper' !== $context && 'plugin.extension.header' !== $context && 'plugin.provider.header' !== $context) { $target = 'Administrator'; if ($this->config->get('build_target', 'admin') === 'site')