From 4bed7a52da16d926d527b1eb1de3c2ce13999dd3 Mon Sep 17 00:00:00 2001 From: aB0t Date: Tue, 20 Aug 2024 22:32:57 +0200 Subject: [PATCH] Release of v3.2.4-alpha1 Add push option to powers area. --- CHANGELOG.md | 4 + README.md | 14 +- admin/README.txt | 14 +- admin/access.xml | 1 + admin/compiler/joomla_3/AdminModel.php | 2 +- admin/controllers/joomla_power.php | 4 +- admin/controllers/joomla_powers.php | 6 +- admin/controllers/power.php | 75 ++ admin/controllers/powers.php | 79 ++ .../en-GB/en-GB.com_componentbuilder.ini | 18 + .../en-GB/en-GB.com_componentbuilder.sys.ini | 2 + .../repository/placeholders_fullwidth.php | 45 + admin/models/admin_custom_tabs.php | 2 +- admin/models/admin_fields.php | 2 +- admin/models/admin_fields_conditions.php | 2 +- admin/models/admin_fields_relations.php | 2 +- admin/models/admin_view.php | 2 +- admin/models/class_extends.php | 2 +- admin/models/class_method.php | 2 +- admin/models/class_property.php | 2 +- admin/models/component_admin_views.php | 2 +- admin/models/component_config.php | 2 +- admin/models/component_custom_admin_menus.php | 2 +- admin/models/component_custom_admin_views.php | 2 +- admin/models/component_dashboard.php | 2 +- admin/models/component_files_folders.php | 2 +- admin/models/component_modules.php | 2 +- admin/models/component_mysql_tweaks.php | 2 +- admin/models/component_placeholders.php | 2 +- admin/models/component_plugins.php | 2 +- admin/models/component_router.php | 2 +- admin/models/component_site_views.php | 2 +- admin/models/component_updates.php | 2 +- admin/models/custom_admin_view.php | 2 +- admin/models/custom_code.php | 2 +- admin/models/dynamic_get.php | 2 +- admin/models/field.php | 2 +- admin/models/fieldtype.php | 2 +- admin/models/forms/repository.xml | 45 + admin/models/help_document.php | 2 +- admin/models/joomla_component.php | 2 +- admin/models/joomla_module.php | 2 +- .../joomla_module_files_folders_urls.php | 2 +- admin/models/joomla_module_updates.php | 2 +- admin/models/joomla_plugin.php | 2 +- .../joomla_plugin_files_folders_urls.php | 2 +- admin/models/joomla_plugin_group.php | 2 +- admin/models/joomla_plugin_updates.php | 2 +- admin/models/joomla_power.php | 2 +- admin/models/language.php | 2 +- admin/models/language_translation.php | 2 +- admin/models/layout.php | 2 +- admin/models/library.php | 2 +- admin/models/library_config.php | 2 +- admin/models/library_files_folders_urls.php | 2 +- admin/models/placeholder.php | 2 +- admin/models/power.php | 2 +- admin/models/repository.php | 29 +- admin/models/server.php | 2 +- admin/models/site_view.php | 2 +- admin/models/snippet.php | 2 +- admin/models/snippet_type.php | 2 +- admin/models/template.php | 2 +- admin/models/validation_rule.php | 2 +- admin/sql/install.mysql.utf8.sql | 5 +- admin/sql/updates/mysql/3.2.3.sql | 1 + admin/views/power/view.html.php | 5 + admin/views/powers/view.html.php | 5 + admin/views/repository/tmpl/edit.php | 10 + componentbuilder.xml | 6 +- componentbuilder_update_server.xml | 18 + .../VDM.Joomla/src/Abstraction/Remote/Set.php | 159 ++-- .../src/Componentbuilder/Power/Grep.php | 54 ++ .../src/Componentbuilder/Power/Remote/Set.php | 794 ++++++++++++++++++ .../Componentbuilder/Power/Service/Power.php | 78 ++ .../VDM.Joomla/src/Componentbuilder/Table.php | 16 + .../Componentbuilder/Utilities/RepoHelper.php | 33 + .../VDM.Joomla/src/Utilities/ObjectHelper.php | 60 +- script.php | 4 +- 79 files changed, 1530 insertions(+), 156 deletions(-) create mode 100644 admin/layouts/repository/placeholders_fullwidth.php create mode 100644 admin/sql/updates/mysql/3.2.3.sql create mode 100644 libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Power/Remote/Set.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 8898cc1c7..15076348f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# v3.2.4-alpha1 + +- Add push option to powers area + # v3.2.3 - Fix site view form missing classes in J4+ diff --git a/README.md b/README.md index 9c2e9262d..b5de2c1a0 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,13 @@ This is a [Joomla 3.x](https://extensions.joomla.org/extension/component-builder/) component. [__See In Action__](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) - ![Component Builder image](https://git.vdm.dev/joomla/Component-Builder/raw/branch/master/admin/assets/images/jcb-banner.jpg "The Component Builder") + ![Component Builder image](https://git.vdm.dev/joomla/Component-Builder/raw/branch/5.x/admin/assets/images/jcb-banner.jpg "The Component Builder") 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. 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 (3.2.3) 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 (3.2.4-alpha1) 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*: 16th August, 2024 -+ *Version*: 3.2.3 ++ *Last Build*: 20th August, 2024 ++ *Version*: 3.2.4-alpha1 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **831771** -+ *Field count*: **2094** -+ *File count*: **5670** ++ *Line count*: **835568** ++ *Field count*: **2098** ++ *File count*: **5677** + *Folder count*: **496** > 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 9c2e9262d..b5de2c1a0 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -3,13 +3,13 @@ This is a [Joomla 3.x](https://extensions.joomla.org/extension/component-builder/) component. [__See In Action__](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) - ![Component Builder image](https://git.vdm.dev/joomla/Component-Builder/raw/branch/master/admin/assets/images/jcb-banner.jpg "The Component Builder") + ![Component Builder image](https://git.vdm.dev/joomla/Component-Builder/raw/branch/5.x/admin/assets/images/jcb-banner.jpg "The Component Builder") 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. 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 (3.2.3) 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 (3.2.4-alpha1) 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*: 16th August, 2024 -+ *Version*: 3.2.3 ++ *Last Build*: 20th August, 2024 ++ *Version*: 3.2.4-alpha1 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **831771** -+ *Field count*: **2094** -+ *File count*: **5670** ++ *Line count*: **835568** ++ *Field count*: **2098** ++ *File count*: **5677** + *Folder count*: **496** > 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/access.xml b/admin/access.xml index 189b82e14..e2e564188 100644 --- a/admin/access.xml +++ b/admin/access.xml @@ -501,6 +501,7 @@ + diff --git a/admin/compiler/joomla_3/AdminModel.php b/admin/compiler/joomla_3/AdminModel.php index a41ce196a..5800af979 100644 --- a/admin/compiler/joomla_3/AdminModel.php +++ b/admin/compiler/joomla_3/AdminModel.php @@ -426,7 +426,7 @@ class ###Component###Model###View### extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { // set field value unique $table = $this->getTable(); diff --git a/admin/controllers/joomla_power.php b/admin/controllers/joomla_power.php index 7c52f8e4c..ee5a8f33b 100644 --- a/admin/controllers/joomla_power.php +++ b/admin/controllers/joomla_power.php @@ -91,7 +91,7 @@ class ComponentbuilderControllerJoomla_power extends FormController $message = '

' . Text::_('COM_COMPONENTBUILDER_NOT_SAVED') . '

'; $message .= '

' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_JOOMLA_POWER_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '

'; } - elseif($user->authorise('power.reset', 'com_componentbuilder')) + elseif($user->authorise('joomla_power.reset', 'com_componentbuilder')) { try { if (JoomlaPowerFactory::_('Joomla.Power.Remote.Get')->reset([$guid])) @@ -166,7 +166,7 @@ class ComponentbuilderControllerJoomla_power extends FormController $message = '

' . Text::_('COM_COMPONENTBUILDER_NOT_SAVED') . '

'; $message .= '

' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_JOOMLA_POWER_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '

'; } - elseif($user->authorise('power.push', 'com_componentbuilder')) + elseif($user->authorise('joomla_power.push', 'com_componentbuilder')) { try { if (JoomlaPowerFactory::_('Joomla.Power.Remote.Set')->items([$guid])) diff --git a/admin/controllers/joomla_powers.php b/admin/controllers/joomla_powers.php index b79a2889e..f75ea6d91 100644 --- a/admin/controllers/joomla_powers.php +++ b/admin/controllers/joomla_powers.php @@ -76,7 +76,7 @@ class ComponentbuilderControllerJoomla_powers extends AdminController $status = 'error'; $success = false; - if($user->authorise('power.init', 'com_componentbuilder')) + if($user->authorise('joomla_power.init', 'com_componentbuilder')) { try { if (JoomlaPowerFactory::_('Joomla.Power.Remote.Get')->init()) @@ -149,7 +149,7 @@ class ComponentbuilderControllerJoomla_powers extends AdminController // check if user has the right $user = Factory::getUser(); - if($user->authorise('power.reset', 'com_componentbuilder')) + if($user->authorise('joomla_power.reset', 'com_componentbuilder')) { $guids = GetHelper::vars('joomla_power', $pks, 'id', 'guid'); @@ -228,7 +228,7 @@ class ComponentbuilderControllerJoomla_powers extends AdminController // check if user has the right $user = Factory::getUser(); - if($user->authorise('power.push', 'com_componentbuilder')) + if($user->authorise('joomla_power.push', 'com_componentbuilder')) { $guids = GetHelper::vars('joomla_power', $pks, 'id', 'guid'); diff --git a/admin/controllers/power.php b/admin/controllers/power.php index 77e4eabae..79a5d5a22 100644 --- a/admin/controllers/power.php +++ b/admin/controllers/power.php @@ -116,6 +116,81 @@ class ComponentbuilderControllerPower extends FormController $this->setRedirect($redirect_url, $message, $status); + return $success; + } + + /** + * Pushes the specified power. + * + * This function performs several checks and operations: + * 1. It verifies the authenticity of the request to prevent request forgery. + * 2. It retrieves the item data posted by the user. + * 3. It checks whether the current user has the necessary permissions to push the power. + * 4. It validates the presence of the necessary item identifiers (ID and GUID). + * 5. If the user is authorized and the identifiers are valid, it attempts to push the specified power. + * 6. Depending on the result of the push operation, it sets the appropriate success or error message. + * 7. It redirects the user to a specified URL with the result message and status. + * + * @return bool True on successful push, false on failure. + */ + public function pushPowers() + { + // Check for request forgeries + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); + + // get Item posted + $item = $this->input->post->get('jform', array(), 'array'); + + // check if user has the right + $user = Factory::getUser(); + + // set default error message + $message = '

' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . '

'; + $message .= '

' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_POWER') . '

'; + $status = 'error'; + $success = false; + + // load the ID + $id = $item['id'] ?? null; + $guid = $item['guid'] ?? null; + + // check if there is any selections + if ($id === null || $guid === null) + { + // set error message + $message = '

' . Text::_('COM_COMPONENTBUILDER_NOT_SAVED') . '

'; + $message .= '

' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_POWER_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '

'; + } + elseif($user->authorise('power.push', 'com_componentbuilder')) + { + try { + if (PowerFactory::_('Power.Remote.Set')->items([$guid])) + { + // set success message + $message = '

'.Text::_('COM_COMPONENTBUILDER_SUCCESS').'

'; + $message .= '

'.Text::_('COM_COMPONENTBUILDER_THE_POWER_HAS_SUCCESSFULLY_BEEN_PUSHED').'

'; + $status = 'success'; + $success = true; + } + else + { + $message = '

' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . '

'; + $message .= '

' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_POWER_HAS_FAILED') . '

'; + } + } catch (\Exception $e) { + $message = '

' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . '

'; + $message .= '

' . \htmlspecialchars($e->getMessage()) . '

'; + } + } + + // set redirect + $redirect_url = Route::_( + 'index.php?option=com_componentbuilder&view=power' + . $this->getRedirectToItemAppend($id), $success + ); + + $this->setRedirect($redirect_url, $message, $status); + return $success; } diff --git a/admin/controllers/powers.php b/admin/controllers/powers.php index bab98eb68..353829c08 100644 --- a/admin/controllers/powers.php +++ b/admin/controllers/powers.php @@ -169,6 +169,85 @@ class ComponentbuilderControllerPowers extends AdminController return $success; } + // set redirect + $redirect_url = Route::_('index.php?option=com_componentbuilder&view=powers', false); + $this->setRedirect($redirect_url); + return $success; + } + + /** + * Pushes the selected powers. + * + * This function performs several checks and operations: + * 1. It verifies the authenticity of the request to prevent request forgery. + * 2. It retrieves the IDs of the selected powers from the user input. + * 3. It sanitizes the input by converting the IDs to integers. + * 4. It checks whether any powers have been selected. + * 5. It checks whether the current user has the necessary permissions to push the selected powers. + * 6. If the user is authorized and powers are selected, it attempts to push the selected powers. + * 7. Depending on the result of the push operation, it sets the appropriate success or error message. + * 8. It redirects the user to a specified URL with the result message and status. + * + * @return bool True on successful push, false on failure. + */ + public function pushPowers() + { + // Check for request forgeries + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); + + // get IDS of the selected powers + $pks = $this->input->post->get('cid', [], 'array'); + + // Sanitize the input + ArrayHelper::toInteger($pks); + + // check if there is any selections + if ($pks === []) + { + // set error message + $message = '

'.Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED').'

'; + $message .= '

'.Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST').'

'; + // set redirect + $redirect_url = Route::_('index.php?option=com_componentbuilder&view=powers', false); + $this->setRedirect($redirect_url, $message, 'error'); + return false; + } + + $status = 'error'; + $success = false; + + // check if user has the right + $user = Factory::getUser(); + if($user->authorise('power.push', 'com_componentbuilder')) + { + $guids = GetHelper::vars('power', $pks, 'id', 'guid'); + + try { + if (PowerFactory::_('Power.Remote.Set')->items($guids)) + { + // set success message + $message = '

'.Text::_('COM_COMPONENTBUILDER_SUCCESS').'

'; + $message .= '

'.Text::_('COM_COMPONENTBUILDER_THESE_POWERS_HAVE_SUCCESSFULLY_BEEN_PUSHED').'

'; + $status = 'success'; + $success = true; + } + else + { + $message = '

' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . '

'; + $message .= '

' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THESE_POWERS_HAS_FAILED') . '

'; + } + } catch (\Exception $e) { + $message = '

' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . '

'; + $message .= '

' . \htmlspecialchars($e->getMessage()) . '

'; + } + + // set redirect + $redirect_url = Route::_('index.php?option=com_componentbuilder&view=powers', $success); + $this->setRedirect($redirect_url, $message, $status); + + return $success; + } + // set redirect $redirect_url = Route::_('index.php?option=com_componentbuilder&view=powers', false); $this->setRedirect($redirect_url); diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index a7c86d4c5..91d19e305 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -7873,6 +7873,8 @@ COM_COMPONENTBUILDER_POWER_PROPERTY_LABEL="Properties" COM_COMPONENTBUILDER_POWER_PROPERTY_SELECTION_DESCRIPTION="Select properties you want to use in your power." COM_COMPONENTBUILDER_POWER_PROPERTY_SELECTION_LABEL="Property Selection" COM_COMPONENTBUILDER_POWER_PUBLISHING="Publishing" +COM_COMPONENTBUILDER_POWER_PUSH_BUTTON_ACCESS="Power Push Button Access" +COM_COMPONENTBUILDER_POWER_PUSH_BUTTON_ACCESS_DESC="Allows the users in this group to access the push button." COM_COMPONENTBUILDER_POWER_RESET_BUTTON_ACCESS="Power Reset Button Access" COM_COMPONENTBUILDER_POWER_RESET_BUTTON_ACCESS_DESC="Allows the users in this group to access the reset button." COM_COMPONENTBUILDER_POWER_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Power to customise the alias." @@ -7969,6 +7971,8 @@ COM_COMPONENTBUILDER_REPOSITORIES_SUBMENU_DESC="Allows the users in this group t COM_COMPONENTBUILDER_REPOSITORY="Repository" COM_COMPONENTBUILDER_REPOSITORY_ACCESS_REPO_DESCRIPTION="Set the access options to this repository" COM_COMPONENTBUILDER_REPOSITORY_ACCESS_REPO_LABEL="Access" +COM_COMPONENTBUILDER_REPOSITORY_ADDPLACEHOLDERS_DESCRIPTION="Set dnamic placeholders for this component." +COM_COMPONENTBUILDER_REPOSITORY_ADDPLACEHOLDERS_LABEL="Placeholders" COM_COMPONENTBUILDER_REPOSITORY_BASE_DESCRIPTION="Enter Base URL" COM_COMPONENTBUILDER_REPOSITORY_BASE_HINT="https://git.vdm.dev" COM_COMPONENTBUILDER_REPOSITORY_BASE_LABEL="Base URL" @@ -8000,6 +8004,9 @@ COM_COMPONENTBUILDER_REPOSITORY_ORGANISATION_LABEL="Organisation" COM_COMPONENTBUILDER_REPOSITORY_ORGANISATION_MESSAGE="Error! Please add organisation here." COM_COMPONENTBUILDER_REPOSITORY_OVERRIDE="Override" COM_COMPONENTBUILDER_REPOSITORY_PERMISSION="Permissions" +COM_COMPONENTBUILDER_REPOSITORY_PLACEHOLDERS="Placeholders" +COM_COMPONENTBUILDER_REPOSITORY_PLACEHOLDER_NOTE_DESCRIPTION="

When powers are connected to components, we utilize global placeholders. These placeholders are linked to the specific component, allowing for dynamic updates to any placeholders found within the powers. However, when we directly push powers from the powers area to this repository, we require placeholders that are specific to this repository.

You can add these repository-specific placeholders here. Please note that these placeholders are only utilized during direct pushes from the powers area and are not considered during the compilation of any component. Although you can use the same placeholders to ensure consistent outcomes, they technically have no direct relationship with the components.

" +COM_COMPONENTBUILDER_REPOSITORY_PLACEHOLDER_NOTE_LABEL="The Repository Placeholders" COM_COMPONENTBUILDER_REPOSITORY_PUBLISHING="Publishing" COM_COMPONENTBUILDER_REPOSITORY_READ_BRANCH_DESCRIPTION="The read branch to use in the API calls." COM_COMPONENTBUILDER_REPOSITORY_READ_BRANCH_HINT="[master]" @@ -8016,7 +8023,9 @@ COM_COMPONENTBUILDER_REPOSITORY_SYSTEM_NAME_HINT="The System Name Here" COM_COMPONENTBUILDER_REPOSITORY_SYSTEM_NAME_LABEL="System Name" COM_COMPONENTBUILDER_REPOSITORY_SYSTEM_NAME_MESSAGE="Error! Please add some text here." COM_COMPONENTBUILDER_REPOSITORY_TARGET_DESCRIPTION="The target content this repository holds." +COM_COMPONENTBUILDER_REPOSITORY_TARGET_HINT="coral" COM_COMPONENTBUILDER_REPOSITORY_TARGET_LABEL="Target Content" +COM_COMPONENTBUILDER_REPOSITORY_TARGET_MESSAGE="Error! That target placeholder text already exist. Please add an unique placeholder target." COM_COMPONENTBUILDER_REPOSITORY_TOKEN_DESCRIPTION="This token is used to access the api." COM_COMPONENTBUILDER_REPOSITORY_TOKEN_HINT="Access Tokens" COM_COMPONENTBUILDER_REPOSITORY_TOKEN_LABEL="Access Token" @@ -8026,6 +8035,10 @@ COM_COMPONENTBUILDER_REPOSITORY_USERNAME_DESCRIPTION="The username to use in the COM_COMPONENTBUILDER_REPOSITORY_USERNAME_HINT="Username" COM_COMPONENTBUILDER_REPOSITORY_USERNAME_LABEL="Username" COM_COMPONENTBUILDER_REPOSITORY_USERNAME_MESSAGE="Error! Please add username here." +COM_COMPONENTBUILDER_REPOSITORY_VALUE_DESCRIPTION="Set the text you would like to set as the replacement value for the targeted placeholder." +COM_COMPONENTBUILDER_REPOSITORY_VALUE_HINT="membersmanager" +COM_COMPONENTBUILDER_REPOSITORY_VALUE_LABEL="Set String Value" +COM_COMPONENTBUILDER_REPOSITORY_VALUE_MESSAGE="Error! Please add some set target value here." COM_COMPONENTBUILDER_REPOSITORY_VERSION_DESC="A count of the number of times this Repository has been revised." COM_COMPONENTBUILDER_REPOSITORY_VERSION_LABEL="Version" COM_COMPONENTBUILDER_REPOSITORY_WRITE_BRANCH_DESCRIPTION="The write branch to use in the API calls. This can be the same as the read branch." @@ -9037,6 +9050,7 @@ COM_COMPONENTBUILDER_THESE_JOOMLA_POWERS_HAVE_SUCCESSFULLY_BEEN_PUSHED="These Jo COM_COMPONENTBUILDER_THESE_JOOMLA_POWERS_HAVE_SUCCESSFULLY_BEEN_RESET="These Joomla powers have successfully been reset." COM_COMPONENTBUILDER_THESE_OPTIONS_ARE_NOT_AVAILABLE_TO_THE_FIELD_IF_BNONE_DBB_OPTION_IS_SELECTED="These options are not available to the field if None DB option is selected." COM_COMPONENTBUILDER_THESE_OPTIONS_ARE_ONLY_AVAILABLE_TO_THE_FIELD_IF_BSHOW_IN_LIST_VIEWB_OPTION_IS_SELECTED="These options are only available to the field if Show in list view option is selected." +COM_COMPONENTBUILDER_THESE_POWERS_HAVE_SUCCESSFULLY_BEEN_PUSHED="These powers have successfully been pushed." COM_COMPONENTBUILDER_THESE_POWERS_HAVE_SUCCESSFULLY_BEEN_RESET="These powers have successfully been reset." COM_COMPONENTBUILDER_THE_ADMIN_CUSTOM_TABS="The admin custom tabs" COM_COMPONENTBUILDER_THE_ADMIN_FIELDS="The admin fields" @@ -9101,12 +9115,15 @@ COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE="The package key is: %s< COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_S="The package key is: %s" COM_COMPONENTBUILDER_THE_PLUGIN_FILES_FOLDERS="The plugin files & folders" COM_COMPONENTBUILDER_THE_PLUGIN_UPDATES="The plugin updates" +COM_COMPONENTBUILDER_THE_POWER_HAS_SUCCESSFULLY_BEEN_PUSHED="The power has successfully been pushed." COM_COMPONENTBUILDER_THE_POWER_HAS_SUCCESSFULLY_BEEN_RESET="The power has successfully been reset." COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FIELD_COULD_NOT_BE_LOADED_FOR_BSB_SERVER="The private key field could not be loaded for %s server!" COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER="The private key file could not be loaded/found for %s server!" COM_COMPONENTBUILDER_THE_PRO_BOARD_IS_LOADING="The pro board is loading" COM_COMPONENTBUILDER_THE_PUSH_OF_THESE_JOOMLA_POWERS_HAS_FAILED="The push of these Joomla powers has failed." +COM_COMPONENTBUILDER_THE_PUSH_OF_THESE_POWERS_HAS_FAILED="The push of these powers has failed." COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_JOOMLA_POWER_HAS_FAILED="The push of this Joomla power has failed." +COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_POWER_HAS_FAILED="The push of this power has failed." COM_COMPONENTBUILDER_THE_README_IS_LOADING="The readme is loading" COM_COMPONENTBUILDER_THE_REPLACE_PROCESS_HAD_AN_ERROR_WITH_TABLE="The replace process had an error with table" COM_COMPONENTBUILDER_THE_RESET_OF_THESE_JOOMLA_POWERS_HAS_FAILED="The reset of these Joomla powers has failed." @@ -9366,6 +9383,7 @@ COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INSTALL_THE_COMPONENT="You do COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INSTALL_THE_MODULE="You do not have permission to install the module!" COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INSTALL_THE_PLUGIN="You do not have permission to install the plugin!" COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_JOOMLA_POWER="You do not have permission to push this Joomla power" +COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_POWER="You do not have permission to push this power" COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_JOOMLA_POWER="You do not have permission to reset this Joomla power" COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_POWER="You do not have permission to reset this power" COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_GET_BOILERPLATE_MODULE="You do not have permission to run the get boilerplate module!" diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini b/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini index 5b44a4203..5a941ffed 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini @@ -1049,6 +1049,8 @@ COM_COMPONENTBUILDER_POWERS_SUBMENU="Powers Submenu" COM_COMPONENTBUILDER_POWERS_SUBMENU_DESC="Allows the users in this group to submenu of power" COM_COMPONENTBUILDER_POWER_INIT_BUTTON_ACCESS="Power Init Button Access" COM_COMPONENTBUILDER_POWER_INIT_BUTTON_ACCESS_DESC="Allows the users in this group to access the init button." +COM_COMPONENTBUILDER_POWER_PUSH_BUTTON_ACCESS="Power Push Button Access" +COM_COMPONENTBUILDER_POWER_PUSH_BUTTON_ACCESS_DESC="Allows the users in this group to access the push button." COM_COMPONENTBUILDER_POWER_RESET_BUTTON_ACCESS="Power Reset Button Access" COM_COMPONENTBUILDER_POWER_RESET_BUTTON_ACCESS_DESC="Allows the users in this group to access the reset button." COM_COMPONENTBUILDER_REPOSITORIES_ACCESS="Repositories Access" diff --git a/admin/layouts/repository/placeholders_fullwidth.php b/admin/layouts/repository/placeholders_fullwidth.php new file mode 100644 index 000000000..483d63d8d --- /dev/null +++ b/admin/layouts/repository/placeholders_fullwidth.php @@ -0,0 +1,45 @@ + + * @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 file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'placeholder_note', + 'addplaceholders' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: []; + +?> + +
+ + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + +
+ diff --git a/admin/models/admin_custom_tabs.php b/admin/models/admin_custom_tabs.php index 7617f0a4d..02f72caf5 100644 --- a/admin/models/admin_custom_tabs.php +++ b/admin/models/admin_custom_tabs.php @@ -868,7 +868,7 @@ class ComponentbuilderModelAdmin_custom_tabs extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { // set field value unique $table = $this->getTable(); diff --git a/admin/models/admin_fields.php b/admin/models/admin_fields.php index 67f51dfbc..d899010b3 100644 --- a/admin/models/admin_fields.php +++ b/admin/models/admin_fields.php @@ -899,7 +899,7 @@ class ComponentbuilderModelAdmin_fields extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { // set field value unique $table = $this->getTable(); diff --git a/admin/models/admin_fields_conditions.php b/admin/models/admin_fields_conditions.php index 39f81cf26..b805efa07 100644 --- a/admin/models/admin_fields_conditions.php +++ b/admin/models/admin_fields_conditions.php @@ -889,7 +889,7 @@ class ComponentbuilderModelAdmin_fields_conditions extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { // set field value unique $table = $this->getTable(); diff --git a/admin/models/admin_fields_relations.php b/admin/models/admin_fields_relations.php index 268b81f87..690362934 100644 --- a/admin/models/admin_fields_relations.php +++ b/admin/models/admin_fields_relations.php @@ -959,7 +959,7 @@ class ComponentbuilderModelAdmin_fields_relations extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { // set field value unique $table = $this->getTable(); diff --git a/admin/models/admin_view.php b/admin/models/admin_view.php index ad09c4062..17661752e 100644 --- a/admin/models/admin_view.php +++ b/admin/models/admin_view.php @@ -1883,7 +1883,7 @@ class ComponentbuilderModelAdmin_view extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { // set field value unique $table = $this->getTable(); diff --git a/admin/models/class_extends.php b/admin/models/class_extends.php index 410963f91..5d71980ff 100644 --- a/admin/models/class_extends.php +++ b/admin/models/class_extends.php @@ -983,7 +983,7 @@ class ComponentbuilderModelClass_extends extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { // set field value unique $table = $this->getTable(); diff --git a/admin/models/class_method.php b/admin/models/class_method.php index 980df2869..94873d00f 100644 --- a/admin/models/class_method.php +++ b/admin/models/class_method.php @@ -1056,7 +1056,7 @@ class ComponentbuilderModelClass_method extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { // set field value unique $table = $this->getTable(); diff --git a/admin/models/class_property.php b/admin/models/class_property.php index 123d1c9cb..adc402f07 100644 --- a/admin/models/class_property.php +++ b/admin/models/class_property.php @@ -1041,7 +1041,7 @@ class ComponentbuilderModelClass_property extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { // set field value unique $table = $this->getTable(); diff --git a/admin/models/component_admin_views.php b/admin/models/component_admin_views.php index ab8ad8fa0..c978ccc40 100644 --- a/admin/models/component_admin_views.php +++ b/admin/models/component_admin_views.php @@ -916,7 +916,7 @@ class ComponentbuilderModelComponent_admin_views extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { // set field value unique $table = $this->getTable(); diff --git a/admin/models/component_config.php b/admin/models/component_config.php index a84beb0cc..b1aaffae7 100644 --- a/admin/models/component_config.php +++ b/admin/models/component_config.php @@ -912,7 +912,7 @@ class ComponentbuilderModelComponent_config extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { // set field value unique $table = $this->getTable(); diff --git a/admin/models/component_custom_admin_menus.php b/admin/models/component_custom_admin_menus.php index c87efced5..1bae7c2f8 100644 --- a/admin/models/component_custom_admin_menus.php +++ b/admin/models/component_custom_admin_menus.php @@ -915,7 +915,7 @@ class ComponentbuilderModelComponent_custom_admin_menus extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { // set field value unique $table = $this->getTable(); diff --git a/admin/models/component_custom_admin_views.php b/admin/models/component_custom_admin_views.php index b27e76ef2..aef053315 100644 --- a/admin/models/component_custom_admin_views.php +++ b/admin/models/component_custom_admin_views.php @@ -916,7 +916,7 @@ class ComponentbuilderModelComponent_custom_admin_views extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { // set field value unique $table = $this->getTable(); diff --git a/admin/models/component_dashboard.php b/admin/models/component_dashboard.php index e87040075..d18a12351 100644 --- a/admin/models/component_dashboard.php +++ b/admin/models/component_dashboard.php @@ -1022,7 +1022,7 @@ class ComponentbuilderModelComponent_dashboard extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { // set field value unique $table = $this->getTable(); diff --git a/admin/models/component_files_folders.php b/admin/models/component_files_folders.php index b859f957c..0af8e9c8b 100644 --- a/admin/models/component_files_folders.php +++ b/admin/models/component_files_folders.php @@ -992,7 +992,7 @@ class ComponentbuilderModelComponent_files_folders extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { // set field value unique $table = $this->getTable(); diff --git a/admin/models/component_modules.php b/admin/models/component_modules.php index 66ca6021b..2e96337bd 100644 --- a/admin/models/component_modules.php +++ b/admin/models/component_modules.php @@ -882,7 +882,7 @@ class ComponentbuilderModelComponent_modules extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { // set field value unique $table = $this->getTable(); diff --git a/admin/models/component_mysql_tweaks.php b/admin/models/component_mysql_tweaks.php index b893371c6..3aca8600e 100644 --- a/admin/models/component_mysql_tweaks.php +++ b/admin/models/component_mysql_tweaks.php @@ -912,7 +912,7 @@ class ComponentbuilderModelComponent_mysql_tweaks extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { // set field value unique $table = $this->getTable(); diff --git a/admin/models/component_placeholders.php b/admin/models/component_placeholders.php index 168fd4ac1..9c532de2c 100644 --- a/admin/models/component_placeholders.php +++ b/admin/models/component_placeholders.php @@ -881,7 +881,7 @@ class ComponentbuilderModelComponent_placeholders extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { // set field value unique $table = $this->getTable(); diff --git a/admin/models/component_plugins.php b/admin/models/component_plugins.php index a89864817..75ba48b0b 100644 --- a/admin/models/component_plugins.php +++ b/admin/models/component_plugins.php @@ -882,7 +882,7 @@ class ComponentbuilderModelComponent_plugins extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { // set field value unique $table = $this->getTable(); diff --git a/admin/models/component_router.php b/admin/models/component_router.php index c582ae9f7..873e90b9e 100644 --- a/admin/models/component_router.php +++ b/admin/models/component_router.php @@ -1021,7 +1021,7 @@ class ComponentbuilderModelComponent_router extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { // set field value unique $table = $this->getTable(); diff --git a/admin/models/component_site_views.php b/admin/models/component_site_views.php index f31cf6990..0f02d1663 100644 --- a/admin/models/component_site_views.php +++ b/admin/models/component_site_views.php @@ -916,7 +916,7 @@ class ComponentbuilderModelComponent_site_views extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { // set field value unique $table = $this->getTable(); diff --git a/admin/models/component_updates.php b/admin/models/component_updates.php index 5a0506612..30733a521 100644 --- a/admin/models/component_updates.php +++ b/admin/models/component_updates.php @@ -915,7 +915,7 @@ class ComponentbuilderModelComponent_updates extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { // set field value unique $table = $this->getTable(); diff --git a/admin/models/custom_admin_view.php b/admin/models/custom_admin_view.php index 63905590a..d87c94af6 100644 --- a/admin/models/custom_admin_view.php +++ b/admin/models/custom_admin_view.php @@ -1314,7 +1314,7 @@ class ComponentbuilderModelCustom_admin_view extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { // set field value unique $table = $this->getTable(); diff --git a/admin/models/custom_code.php b/admin/models/custom_code.php index a82a9e7a1..2c166fd10 100644 --- a/admin/models/custom_code.php +++ b/admin/models/custom_code.php @@ -1055,7 +1055,7 @@ class ComponentbuilderModelCustom_code extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { // set field value unique $table = $this->getTable(); diff --git a/admin/models/dynamic_get.php b/admin/models/dynamic_get.php index 494d8d467..2f98e999d 100644 --- a/admin/models/dynamic_get.php +++ b/admin/models/dynamic_get.php @@ -1365,7 +1365,7 @@ class ComponentbuilderModelDynamic_get extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { // set field value unique $table = $this->getTable(); diff --git a/admin/models/field.php b/admin/models/field.php index 183b42695..5ca3e1068 100644 --- a/admin/models/field.php +++ b/admin/models/field.php @@ -1266,7 +1266,7 @@ class ComponentbuilderModelField extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { // set field value unique $table = $this->getTable(); diff --git a/admin/models/fieldtype.php b/admin/models/fieldtype.php index 660728d53..8b59c067b 100644 --- a/admin/models/fieldtype.php +++ b/admin/models/fieldtype.php @@ -1333,7 +1333,7 @@ class ComponentbuilderModelFieldtype extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { // set field value unique $table = $this->getTable(); diff --git a/admin/models/forms/repository.xml b/admin/models/forms/repository.xml index b788fce12..2ed6d3860 100644 --- a/admin/models/forms/repository.xml +++ b/admin/models/forms/repository.xml @@ -207,6 +207,51 @@ validate="guid" hint="COM_COMPONENTBUILDER_REPOSITORY_GUID_HINT" /> + + +