Release of v5.1.1-beta4

Fix the FieldXML interface mismatch. #1228. Adds Initialize, Reset, and Push functionality to the Repository entities.
This commit is contained in:
2025-06-25 10:16:52 +00:00
parent dbebb5663c
commit af4b12a82b
69 changed files with 1721 additions and 577 deletions

View File

@@ -9,7 +9,7 @@ This is a professional-grade [Joomla 5.x](https://extensions.joomla.org/extensio
JCB generates native Joomla components, plugins, and modules for Joomla 3.x, 4.x, and 5.x — and is already prepared for Joomla 6. Every compiled project is tailored for the specific version without needing backward compatibility plugins. With integrated version-aware compiling, smart boilerplating, and Git-powered project syncing, JCB is much more than a code generator—it's a **full-stack development pipeline for Joomla extensions**.
You can install this component easily. The latest release (**5.1.1-beta3**) is available on [Releases](https://git.vdm.dev/joomla/pkg-component-builder/releases) and updated frequently with full source access.
You can install this component easily. The latest release (**5.1.1-beta4**) is available on [Releases](https://git.vdm.dev/joomla/pkg-component-builder/releases) and updated frequently with full source access.
Upgrades are seamless through Joomlas built-in extension update mechanism.
@@ -229,9 +229,9 @@ JCB is developed by developers for developers. Its purpose is to democratize hig
* **Company:** [Vast Development Method](https://dev.vdm.io)
* **Author:** [Llewellyn van der Merwe](mailto:joomla@vdm.io)
* **Component:** [Component Builder](https://git.vdm.dev/joomla/Component-Builder)
* **Created:** 30th April, 2015 · **Last Build:** 23rd June, 2025 · **Version:** 5.1.1-beta3
* **Created:** 30th April, 2015 · **Last Build:** 25th June, 2025 · **Version:** 5.1.1-beta4
* **License:** GNU General Public License version 2 or later; see LICENSE.txt · **Copyright:** Copyright (C) 2015 Vast Development Method. All rights reserved.
* **Lines:** 1090382 · **Fields:** 2096 · **Files:** 7450 · **Folders:** 725
* **Lines:** 1093361 · **Fields:** 2096 · **Files:** 7498 · **Folders:** 728
> Generated with [JCB](https://www.joomlacomponentbuilder.com) — The Smartest Way to Build Joomla Extensions.

View File

@@ -521,6 +521,9 @@
<action name="repository.edit.state" title="COM_COMPONENTBUILDER_REPOSITORIES_EDIT_STATE" description="COM_COMPONENTBUILDER_REPOSITORIES_EDIT_STATE_DESC" />
<action name="repository.version" title="COM_COMPONENTBUILDER_REPOSITORIES_EDIT_VERSION" description="COM_COMPONENTBUILDER_REPOSITORIES_EDIT_VERSION_DESC" />
<action name="repository.submenu" title="COM_COMPONENTBUILDER_REPOSITORIES_SUBMENU" description="COM_COMPONENTBUILDER_REPOSITORIES_SUBMENU_DESC" />
<action name="repository.init" title="COM_COMPONENTBUILDER_REPOSITORY_INIT_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_REPOSITORY_INIT_BUTTON_ACCESS_DESC" />
<action name="repository.push" title="COM_COMPONENTBUILDER_REPOSITORY_PUSH_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_REPOSITORY_PUSH_BUTTON_ACCESS_DESC" />
<action name="repository.reset" title="COM_COMPONENTBUILDER_REPOSITORY_RESET_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_REPOSITORY_RESET_BUTTON_ACCESS_DESC" />
<action name="search.access" title="COM_COMPONENTBUILDER_SEARCH_ACCESS" description="COM_COMPONENTBUILDER_SEARCH_ACCESS_DESC" />
<action name="search.compiler" title="COM_COMPONENTBUILDER_SEARCH_COMPILER_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_SEARCH_COMPILER_BUTTON_ACCESS_DESC" />
<action name="search.dashboard_list" title="COM_COMPONENTBUILDER_SEARCH_DASHBOARD_LIST" description="COM_COMPONENTBUILDER_SEARCH_DASHBOARD_LIST_DESC" />

View File

@@ -166,6 +166,7 @@ class InitializationManager {
const powers = [
'Joomla.Fieldtype',
'Joomla.Power',
'Repository',
'Power'
];

View File

@@ -155,15 +155,17 @@
<option value="">
COM_COMPONENTBUILDER_REPOSITORY_SELECT_AN_OPTION</option>
<option value="4">
COM_COMPONENTBUILDER_REPOSITORY_JCB_PACKAGES</option>
COM_COMPONENTBUILDER_REPOSITORY_PACKAGES</option>
<option value="3">
COM_COMPONENTBUILDER_REPOSITORY_JOOMLA_FIELD_TYPES</option>
COM_COMPONENTBUILDER_REPOSITORY_FIELD_TYPES</option>
<option value="2">
COM_COMPONENTBUILDER_REPOSITORY_JOOMLA_POWER</option>
<option value="5">
COM_COMPONENTBUILDER_REPOSITORY_SNIPPETS</option>
<option value="1">
COM_COMPONENTBUILDER_REPOSITORY_SUPER_POWER</option>
<option value="6">
COM_COMPONENTBUILDER_REPOSITORY_REPOSITORIES</option>
</field>
<!-- Type Field. Type: List. (joomla) -->
<field

View File

@@ -5467,6 +5467,7 @@ COM_COMPONENTBUILDER_INITIALIZE_MODULES="Initialize Modules"
COM_COMPONENTBUILDER_INITIALIZE_PLACEHOLDERS="Initialize Placeholders"
COM_COMPONENTBUILDER_INITIALIZE_PLUGINS="Initialize Plugins"
COM_COMPONENTBUILDER_INITIALIZE_POWERS="Initialize Powers"
COM_COMPONENTBUILDER_INITIALIZE_REPOSITORIES="Initialize Repositories"
COM_COMPONENTBUILDER_INITIALIZE_SELECTED_S_ITEMS="Initialize selected [%s] items"
COM_COMPONENTBUILDER_INITIALIZE_SITE_VIEWS="Initialize Site Views"
COM_COMPONENTBUILDER_INITIALIZE_SNIPPETS="Initialize Snippets"
@@ -7959,6 +7960,7 @@ COM_COMPONENTBUILDER_POWER_YES="Yes"
COM_COMPONENTBUILDER_PPACKAGEB_REPOSITORY_AT_BSSB_GAVE_THE_FOLLOWING_ERRORBR_SP="<p>Package</b> repository at <b>%s/%s</b> gave the following error!<br />%s</p>"
COM_COMPONENTBUILDER_PPACKAGECONTENTB_REPOSITORY_AT_BSSB_GAVE_THE_FOLLOWING_ERRORBR_SP="<p>Package:content</b> repository at <b>%s/%s</b> gave the following error!<br />%s</p>"
COM_COMPONENTBUILDER_PPOWER_BGUIDSB_NOT_FOUNDP="<p>Power <b>guid:%s</b> not found!</p>"
COM_COMPONENTBUILDER_PREPOSITORYB_ENTITY_AT_BSSB_GAVE_THE_FOLLOWING_ERRORBR_SP="<p>Repository</b> entity at <b>%s/%s</b> gave the following error!<br />%s</p>"
COM_COMPONENTBUILDER_PRE_RELEASE="Pre Release"
COM_COMPONENTBUILDER_PROPERTIESBR_SMALLHERE_YOU_CAN_SET_THE_PROPERTIES_FOR_THIS_FIELDSMALL="Properties<br /><small>Here you can set the properties for this field.</small>"
COM_COMPONENTBUILDER_PROPERTY="Property"
@@ -8058,6 +8060,7 @@ COM_COMPONENTBUILDER_REPOSITORY_DETAILS="Details"
COM_COMPONENTBUILDER_REPOSITORY_EDIT="Editing the Repository"
COM_COMPONENTBUILDER_REPOSITORY_ERROR_UNIQUE_ALIAS="Another Repository has the same alias."
COM_COMPONENTBUILDER_REPOSITORY_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Repository has the same alias ."
COM_COMPONENTBUILDER_REPOSITORY_FIELD_TYPES="Field Types"
COM_COMPONENTBUILDER_REPOSITORY_GITEA="Gitea"
COM_COMPONENTBUILDER_REPOSITORY_GITHUB="Github"
COM_COMPONENTBUILDER_REPOSITORY_GLOBAL="Global"
@@ -8065,8 +8068,8 @@ COM_COMPONENTBUILDER_REPOSITORY_GUID_DESCRIPTION="Globally Unique Identifier"
COM_COMPONENTBUILDER_REPOSITORY_GUID_HINT="Auto Generated"
COM_COMPONENTBUILDER_REPOSITORY_GUID_LABEL="GUID"
COM_COMPONENTBUILDER_REPOSITORY_ID="Id"
COM_COMPONENTBUILDER_REPOSITORY_JCB_PACKAGES="JCB Packages"
COM_COMPONENTBUILDER_REPOSITORY_JOOMLA_FIELD_TYPES="Joomla Field Types"
COM_COMPONENTBUILDER_REPOSITORY_INIT_BUTTON_ACCESS="Repository Init Button Access"
COM_COMPONENTBUILDER_REPOSITORY_INIT_BUTTON_ACCESS_DESC="Allows the users in this group to access the init button."
COM_COMPONENTBUILDER_REPOSITORY_JOOMLA_POWER="Joomla Power"
COM_COMPONENTBUILDER_REPOSITORY_MODIFIED_BY_DESC="The last user that modified this Repository."
COM_COMPONENTBUILDER_REPOSITORY_MODIFIED_BY_LABEL="Modified By"
@@ -8079,17 +8082,23 @@ COM_COMPONENTBUILDER_REPOSITORY_ORGANISATION_HINT="[org]"
COM_COMPONENTBUILDER_REPOSITORY_ORGANISATION_LABEL="Organisation"
COM_COMPONENTBUILDER_REPOSITORY_ORGANISATION_MESSAGE="Error! Please add organisation here."
COM_COMPONENTBUILDER_REPOSITORY_OVERRIDE="Override"
COM_COMPONENTBUILDER_REPOSITORY_PACKAGES="Packages"
COM_COMPONENTBUILDER_REPOSITORY_PERMISSION="Permissions"
COM_COMPONENTBUILDER_REPOSITORY_PLACEHOLDERS="Placeholders"
COM_COMPONENTBUILDER_REPOSITORY_PLACEHOLDER_NOTE_DESCRIPTION="<p>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 <b>push</b> powers from the powers area to this repository, we require <b>placeholders</b> that are specific to this repository.</p><p>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.</p>"
COM_COMPONENTBUILDER_REPOSITORY_PLACEHOLDER_NOTE_LABEL="The Repository Placeholders"
COM_COMPONENTBUILDER_REPOSITORY_PUBLISHING="Publishing"
COM_COMPONENTBUILDER_REPOSITORY_PUSH_BUTTON_ACCESS="Repository Push Button Access"
COM_COMPONENTBUILDER_REPOSITORY_PUSH_BUTTON_ACCESS_DESC="Allows the users in this group to access the push button."
COM_COMPONENTBUILDER_REPOSITORY_READ_BRANCH_DESCRIPTION="The read branch to use in the API calls."
COM_COMPONENTBUILDER_REPOSITORY_READ_BRANCH_HINT="[master]"
COM_COMPONENTBUILDER_REPOSITORY_READ_BRANCH_LABEL="Read Branch"
COM_COMPONENTBUILDER_REPOSITORY_READ_BRANCH_MESSAGE="Error! Please add read branch here."
COM_COMPONENTBUILDER_REPOSITORY_REPOSITORIES="Repositories"
COM_COMPONENTBUILDER_REPOSITORY_REPOSITORY_HINT="[repo]"
COM_COMPONENTBUILDER_REPOSITORY_REPOSITORY_LABEL="Repository"
COM_COMPONENTBUILDER_REPOSITORY_RESET_BUTTON_ACCESS="Repository Reset Button Access"
COM_COMPONENTBUILDER_REPOSITORY_RESET_BUTTON_ACCESS_DESC="Allows the users in this group to access the reset button."
COM_COMPONENTBUILDER_REPOSITORY_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Repository to customise the alias."
COM_COMPONENTBUILDER_REPOSITORY_SELECT_AN_OPTION="Select an option"
COM_COMPONENTBUILDER_REPOSITORY_SNIPPETS="Snippets"
@@ -9190,6 +9199,8 @@ COM_COMPONENTBUILDER_THESE_PLACEHOLDERS_HAVE_SUCCESSFULLY_BEEN_PUSHED="These Pla
COM_COMPONENTBUILDER_THESE_PLACEHOLDERS_HAVE_SUCCESSFULLY_BEEN_RESET="These Placeholders have successfully been reset."
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_THESE_REPOSITORIES_HAVE_SUCCESSFULLY_BEEN_PUSHED="These Repositories have successfully been pushed."
COM_COMPONENTBUILDER_THESE_REPOSITORIES_HAVE_SUCCESSFULLY_BEEN_RESET="These Repositories have successfully been reset."
COM_COMPONENTBUILDER_THESE_SITE_VIEWS_HAVE_SUCCESSFULLY_BEEN_PUSHED="These Site Views have successfully been pushed."
COM_COMPONENTBUILDER_THESE_SITE_VIEWS_HAVE_SUCCESSFULLY_BEEN_RESET="These Site Views have successfully been reset."
COM_COMPONENTBUILDER_THESE_SNIPPETS_HAVE_SUCCESSFULLY_BEEN_PUSHED="These Snippets have successfully been pushed."
@@ -9291,6 +9302,7 @@ COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVE
COM_COMPONENTBUILDER_THE_PUSH_OF_THESE_JOOMLA_FIELD_TYPES_COULD_NOT_BE_COMPLETED="The push of these Joomla Field Types could not be completed."
COM_COMPONENTBUILDER_THE_PUSH_OF_THESE_JOOMLA_POWERS_COULD_NOT_BE_COMPLETED="The push of these Joomla Powers could not be completed."
COM_COMPONENTBUILDER_THE_PUSH_OF_THESE_POWERS_COULD_NOT_BE_COMPLETED="The push of these Powers could not be completed."
COM_COMPONENTBUILDER_THE_PUSH_OF_THESE_REPOSITORIES_COULD_NOT_BE_COMPLETED="The push of these Repositories could not be completed."
COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_ADMIN_VIEWS_HAS_FAILED="The push of this Admin Views has failed."
COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_ADMIN_VIEWS_HAS_NOT_BEEN_SUCCESSFUL="The push of this Admin Views has not been successful."
COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_ADMIN_VIEW_HAS_FAILED="The push of this Admin View has failed."
@@ -9356,6 +9368,9 @@ COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_PLACEHOLDER_HAS_NOT_BEEN_SUCCESSFUL="The p
COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_POWERS_HAS_FAILED="The push of this Powers has failed."
COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_POWER_COULD_NOT_BE_COMPLETED="The push of this power could not be completed."
COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_POWER_HAS_FAILED="The push of this power has failed."
COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_REPOSITORIES_HAS_FAILED="The push of this Repositories has failed."
COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_REPOSITORY_COULD_NOT_BE_COMPLETED="The push of this Repository could not be completed."
COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_REPOSITORY_HAS_FAILED="The push of this Repository has failed."
COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_SITE_VIEWS_HAS_FAILED="The push of this Site Views has failed."
COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_SITE_VIEWS_HAS_NOT_BEEN_SUCCESSFUL="The push of this Site Views has not been successful."
COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_SITE_VIEW_HAS_FAILED="The push of this Site View has failed."
@@ -9370,6 +9385,8 @@ COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_TEMPLATE_HAS_FAILED="The push of this Temp
COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_TEMPLATE_HAS_NOT_BEEN_SUCCESSFUL="The push of this Template has not been successful."
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_REPOSITORY_HAS_SUCCESSFULLY_BEEN_PUSHED="The Repository has successfully been pushed."
COM_COMPONENTBUILDER_THE_REPOSITORY_HAS_SUCCESSFULLY_BEEN_RESET="The Repository has successfully been reset."
COM_COMPONENTBUILDER_THE_REPO_INDEX_FAILED_TO_LOAD_PLEASE_TRY_AGAIN="The repo index failed to load, please try again."
COM_COMPONENTBUILDER_THE_RESET_OF_THESE_ADMIN_VIEWS_HAS_FAILED="The reset of these Admin Views has failed."
COM_COMPONENTBUILDER_THE_RESET_OF_THESE_CLASS_EXTENDINGS_HAS_FAILED="The reset of these Class Extendings has failed."
@@ -9388,6 +9405,7 @@ COM_COMPONENTBUILDER_THE_RESET_OF_THESE_LAYOUTS_HAS_FAILED="The reset of these L
COM_COMPONENTBUILDER_THE_RESET_OF_THESE_LIBRARIES_HAS_FAILED="The reset of these Libraries has failed."
COM_COMPONENTBUILDER_THE_RESET_OF_THESE_PLACEHOLDERS_HAS_FAILED="The reset of these Placeholders has failed."
COM_COMPONENTBUILDER_THE_RESET_OF_THESE_POWERS_HAS_FAILED="The reset of these Powers has failed."
COM_COMPONENTBUILDER_THE_RESET_OF_THESE_REPOSITORIES_HAS_FAILED="The reset of these Repositories has failed."
COM_COMPONENTBUILDER_THE_RESET_OF_THESE_SITE_VIEWS_HAS_FAILED="The reset of these Site Views has failed."
COM_COMPONENTBUILDER_THE_RESET_OF_THESE_SNIPPETS_HAS_FAILED="The reset of these Snippets has failed."
COM_COMPONENTBUILDER_THE_RESET_OF_THESE_TEMPLATES_HAS_FAILED="The reset of these Templates has failed."
@@ -9436,6 +9454,7 @@ COM_COMPONENTBUILDER_THE_RESET_OF_THIS_PLACEHOLDERS_HAS_NOT_BEEN_SUCCESSFUL="The
COM_COMPONENTBUILDER_THE_RESET_OF_THIS_PLACEHOLDER_HAS_FAILED="The reset of this Placeholder has failed."
COM_COMPONENTBUILDER_THE_RESET_OF_THIS_PLACEHOLDER_HAS_NOT_BEEN_SUCCESSFUL="The Reset of this Placeholder has not been successful."
COM_COMPONENTBUILDER_THE_RESET_OF_THIS_POWER_HAS_FAILED="The reset of this power has failed."
COM_COMPONENTBUILDER_THE_RESET_OF_THIS_REPOSITORY_HAS_FAILED="The reset of this Repository has failed."
COM_COMPONENTBUILDER_THE_RESET_OF_THIS_SITE_VIEWS_HAS_NOT_BEEN_SUCCESSFUL="The reset of this Site Views has not been successful."
COM_COMPONENTBUILDER_THE_RESET_OF_THIS_SITE_VIEW_HAS_FAILED="The reset of this Site View has failed."
COM_COMPONENTBUILDER_THE_RESET_OF_THIS_SITE_VIEW_HAS_NOT_BEEN_SUCCESSFUL="The Reset of this Site View has not been successful."
@@ -9693,6 +9712,7 @@ COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_LAYOUTS="You do no
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_LIBRARIES="You do not have permission to initialize Libraries"
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_PLACEHOLDERS="You do not have permission to initialize Placeholders"
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_POWERS="You do not have permission to initialize Powers"
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_REPOSITORIES="You do not have permission to initialize Repositories"
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_SITE_VIEWS="You do not have permission to initialize Site Views"
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_SNIPPETS="You do not have permission to initialize Snippets"
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_TEMPLATES="You do not have permission to initialize Templates"
@@ -9717,6 +9737,7 @@ COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_LAYOUT="You do not
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_LIBRARY="You do not have permission to push this Library"
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_PLACEHOLDER="You do not have permission to push this Placeholder"
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_PUSH_THIS_REPOSITORY="You do not have permission to push this Repository"
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_SITE_VIEW="You do not have permission to push this Site View"
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_SNIPPET="You do not have permission to push this Snippet"
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_TEMPLATE="You do not have permission to push this Template"
@@ -9737,6 +9758,7 @@ COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_LAYOUT="You do not
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_LIBRARY="You do not have permission to reset this Library"
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_PLACEHOLDER="You do not have permission to reset this Placeholder"
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_RESET_THIS_REPOSITORY="You do not have permission to reset this Repository"
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_SITE_VIEW="You do not have permission to reset this Site View"
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_SNIPPET="You do not have permission to reset this Snippet"
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_TEMPLATE="You do not have permission to reset this Template"
@@ -9764,6 +9786,7 @@ COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_LAYOUT_BEFORE_YOU_CAN_USE_THIS_FEAT
COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_LIBRARY_BEFORE_YOU_CAN_USE_THIS_FEATURE="You must first save the Library, before you can use this feature."
COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_PLACEHOLDER_BEFORE_YOU_CAN_USE_THIS_FEATURE="You must first save the Placeholder, before you can use this feature."
COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_POWER_BEFORE_YOU_CAN_USE_THIS_FEATURE="You must first save the power, before you can use this feature."
COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_REPOSITORY_BEFORE_YOU_CAN_USE_THIS_FEATURE="You must first save the Repository, before you can use this feature."
COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_SITE_VIEW_BEFORE_YOU_CAN_USE_THIS_FEATURE="You must first save the Site View, before you can use this feature."
COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_SNIPPET_BEFORE_YOU_CAN_USE_THIS_FEATURE="You must first save the Snippet, before you can use this feature."
COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_TEMPLATE_BEFORE_YOU_CAN_USE_THIS_FEATURE="You must first save the Template, before you can use this feature."

View File

@@ -1072,6 +1072,12 @@ COM_COMPONENTBUILDER_REPOSITORIES_EDIT_VERSION="Repositories Edit Version"
COM_COMPONENTBUILDER_REPOSITORIES_EDIT_VERSION_DESC="Allows the users in this group to edit versions of version repositories"
COM_COMPONENTBUILDER_REPOSITORIES_SUBMENU="Repositories Submenu"
COM_COMPONENTBUILDER_REPOSITORIES_SUBMENU_DESC="Allows the users in this group to submenu of repository"
COM_COMPONENTBUILDER_REPOSITORY_INIT_BUTTON_ACCESS="Repository Init Button Access"
COM_COMPONENTBUILDER_REPOSITORY_INIT_BUTTON_ACCESS_DESC="Allows the users in this group to access the init button."
COM_COMPONENTBUILDER_REPOSITORY_PUSH_BUTTON_ACCESS="Repository Push Button Access"
COM_COMPONENTBUILDER_REPOSITORY_PUSH_BUTTON_ACCESS_DESC="Allows the users in this group to access the push button."
COM_COMPONENTBUILDER_REPOSITORY_RESET_BUTTON_ACCESS="Repository Reset Button Access"
COM_COMPONENTBUILDER_REPOSITORY_RESET_BUTTON_ACCESS_DESC="Allows the users in this group to access the reset button."
COM_COMPONENTBUILDER_SEARCH_ACCESS="Search Access"
COM_COMPONENTBUILDER_SEARCH_ACCESS_DESC="Allows the users in this group to access search."
COM_COMPONENTBUILDER_SEARCH_COMPILER_BUTTON_ACCESS="Search Compiler Button Access"

View File

@@ -22,9 +22,16 @@ defined('JPATH_BASE') or die;
$base = $displayData['repo']->base ?? null;
$path = $displayData['repo']->path ?? null;
$type = $displayData['repo']->type ?? 0;
$url = "#";
if (!empty($base) && !empty($path))
{
// if the type is GitHub = 2
if ($type == 2)
{
$base = 'https://github.com';
}
$url = "{$base}/{$path}";
}
$name = $displayData['name'] ?? 'error';

View File

@@ -2824,7 +2824,7 @@ INSERT INTO `#__componentbuilder_field` (`id`, `add_css_view`, `add_css_views`,
(3413, '', '', '', '', '', '', '', '', '', '', 'TEXT', '', '', '', 'Allowed Media Formats', 'NULL', '', 'dd2e1f4b-f5db-45e8-85fa-efd27bae7b6a', '\"<field\\n\\ttype=\\\"allowedmediaformats\\\"\\n\\tname=\\\"media_formats\\\"\\n\\tlabel=\\\"Allowed Media Formats\\\"\\n\\tclass=\\\"list_class\\\"\\n\\tlayout=\\\"joomla.form.field.list-fancy-select\\\"\\n\\tmultiple=\\\"true\\\"\\n\\tshowon=\\\"type:3\\\"\\n\\textends=\\\"list\\\"\\n\\ttype_php_1=\\\"__.o0=base64=Oo.__W0NVU1RPTUNPREU9Z2V0RmlsZUV4dGVuc2lvbnNPcHRpb25zK21lZGlhXQ==\\\"\\n\\/>\"', 1, '2020-09-08 00:08:13', '2024-09-15 22:56:57', 10, '', 1072, 'fd936809-37c1-4016-a4ee-a4d016343725', '', '', '', '', ''),
(3414, '', '', '', '', '', '', '', '', '', '', 'TEXT', '', '', '', 'Allowed File Formats', 'NULL', '', 'dd2e1f4b-f5db-45e8-85fa-efd27bae7b6a', '\"<field\\n\\ttype=\\\"allowedfileformats\\\"\\n\\tname=\\\"file_formats\\\"\\n\\tlabel=\\\"Allowed File Formats\\\"\\n\\tclass=\\\"list_class\\\"\\n\\tlayout=\\\"joomla.form.field.list-fancy-select\\\"\\n\\tmultiple=\\\"true\\\"\\n\\tshowon=\\\"type:4\\\"\\n\\textends=\\\"list\\\"\\n\\ttype_php_1=\\\"__.o0=base64=Oo.__W0NVU1RPTUNPREU9Z2V0RmlsZUV4dGVuc2lvbnNPcHRpb25zK2ZpbGVd\\\"\\n\\/>\"', 1, '2020-09-08 00:09:04', '2024-09-15 22:55:34', 8, '', 1072, 'ca8f38cb-f930-4976-a76b-c1d6cd18652d', '', '', '', '', ''),
(3415, '', '', '', '', '', '', '', '', '', '', 'TEXT', '', '', '', 'More Details', 'NULL', 6, '7139f2c8-a70a-46a6-bbe3-4eefe54ca515', '\"<field\\n\\ttype=\\\"subform\\\"\\n\\tname=\\\"details\\\"\\n\\tlabel=\\\"More Details\\\"\\n\\tlayout=\\\"joomla.form.field.subform.repeatable-table\\\"\\n\\tmultiple=\\\"true\\\"\\n\\tbuttons=\\\"add,remove,move\\\"\\n\\tfields=\\\"fb3115a1-e579-401a-9b53-9469cd4739e4,976f7e2d-68e3-497e-b4d1-6326d5b95078,f40974bd-a946-4bc4-9be1-fedec2d09c24,c8cc2a22-f2e4-4dcc-9088-ed1d78416228,6c3a6983-d1bf-4e5e-9e99-deea00b0cefd,8a64b899-6cb9-4ba3-bed1-559675f8d20b\\\"\\n\\tdescription=\\\"Add some more details here.\\\"\\n\\ticon=\\\"list\\\"\\n\\tmax=\\\"10\\\"\\n\\tmin=\\\"0\\\"\\n\\tfilter=\\\"STRING\\\"\\n\\/>\"', 1, '2020-09-08 00:26:48', '2024-09-19 22:00:03', 11, '', 1073, 'd763ecd7-8d72-418e-8010-706c0785baab', 'W1tbZmllbGRdXV0gPSBTdXBlcl9fXzlkNzZiOGRjXzM4ODNfNDc1NV9iMTFjXzEzMWQxOWNhOGE1M19fX1Bvd2VyOjpfKCdEYXRhLlN1YmZvcm0nKS0+dGFibGUoJ2RldGFpbCcpLT5nZXQoJGl0ZW0tPmd1aWQgPz8gJycgLCdlbnRpdHknLCAnbW9yZScsIFsnZ3VpZCcsJ2VtYWlsJywnbW9iaWxlX3Bob25lJywnZGF0ZW9mYmlydGgnLCd3ZWJzaXRlJywnZW50aXR5X3R5cGUnXSk7', 'U3VwZXJfX185ZDc2YjhkY18zODgzXzQ3NTVfYjExY18xMzFkMTljYThhNTNfX19Qb3dlcjo6XygnRGF0YS5TdWJmb3JtJyktPnRhYmxlKCdkZXRhaWwnKS0+c2V0KFtbW2ZpZWxkXV1dID8/IFtdLCAnZ3VpZCcsICdlbnRpdHknLCAkZGF0YVsnZ3VpZCddID8/ICcnKTs=', '', '', ''),
(3416, '', '', '', '', '', '', '', '', '', '', 'TEXT', '', '', '', 'Look Groups', 'NULL', '', 'e2f31181-fbb3-4c3a-859d-72b6b0cff308', '\"<field\\n\\ttype=\\\"usergrouplist\\\"\\n\\tname=\\\"look_groups\\\"\\n\\tlabel=\\\"Look Groups\\\"\\n\\tdescription=\\\"Select a look\\\"\\n\\trequired=\\\"true\\\"\\n\\tchecksuperusergroup=\\\"1\\\"\\n\\tmultiple=\\\"true\\\"\\n\\/>\"', 1, '2020-09-08 02:37:42', '2024-09-07 02:40:32', 3, '', 1074, '104f8410-a07e-4cf8-aad5-2b4db7c6864c', '', '', '', '', ''),
(3416, '', '', '', '', '', '', '', '', '', '', 'TEXT', '', '', '', 'Look Groups', 'NULL', '', 'e2f31181-fbb3-4c3a-859d-72b6b0cff308', '\"<field\\n\\ttype=\\\"usergrouplist\\\"\\n\\tname=\\\"look_groups\\\"\\n\\tlabel=\\\"Look Groups\\\"\\n\\tdescription=\\\"Select a user group\\\"\\n\\tlayout=\\\"joomla.form.field.list-fancy-select\\\"\\n\\trequired=\\\"true\\\"\\n\\tchecksuperusergroup=\\\"1\\\"\\n\\tmultiple=\\\"true\\\"\\n\\/>\"', 1, '2020-09-08 02:37:42', '2025-06-24 08:42:29', 4, '', 1074, '104f8410-a07e-4cf8-aad5-2b4db7c6864c', '', '', '', '', ''),
(3417, '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'Note VDM File Uploader', 'NOT NULL', '', 'f9ecacd0-8481-4157-8c71-d7aaefc2b7c3', '\"<field\\n\\ttype=\\\"note\\\"\\n\\tname=\\\"note_file_vdm_uploader\\\"\\n\\tdescription=\\\"<div id=\'file_vdm_uploader\' class=\'vdm-uikit-uploader uk-placeholder uk-text-center\'\\r\\n data-type-id=\'jform_file_type\'\\r\\n data-progressbar-id=\'file_vdm_progressbar\'\\r\\n data-display-id=\'file_vdm_display\'\\r\\n data-success-id=\'file_vdm_success\'\\r\\n data-error-id=\'file_vdm_error\'\\r\\n data-allowed-format-id=\'file_vdm_allowed_format\'\\r\\n data-file-type-id=\'file_vdm_file_type\'\\r\\n>\\r\\n <span uk-icon=\'icon: cloud-upload\'><\\/span>\\r\\n <span class=\'uk-text-middle\'>Attach <span id=\'file_vdm_file_type\'>file<\\/span> by dropping them here or<\\/span>\\r\\n <div uk-form-custom>\\r\\n <input type=\'file\' multiple>\\r\\n <span class=\'uk-link\'>selecting one<\\/span> <span id=\'file_vdm_allowed_format\'><\\/span>\\r\\n <\\/div>\\r\\n<\\/div>\\r\\n\\r\\n<progress id=\'file_vdm_progressbar\' class=\'uk-progress\' value=\'0\' max=\'100\' hidden><\\/progress>\\\"\\n\\tshowon=\\\"file_type!:\\\"\\n\\/>\"', 1, '2020-09-07 22:41:51', '2024-09-17 22:49:08', 9, '', 1075, '47a3db14-de87-4cc2-8724-17f437a77d93', '', '', '', '', ''),
(3418, '', '', '', '', '', '', '', '', 1, '', 'TINYINT', 2, '', '', 'Crop Image', 'NULL', '', 'b868ed59-4208-4206-8504-95a35a74a11c', '\"<field\\n\\ttype=\\\"radio\\\"\\n\\tname=\\\"crop\\\"\\n\\tlabel=\\\"Crop Image\\\"\\n\\tdescription=\\\"Set if images that are added should be cropped\\\"\\n\\tclass=\\\"btn-group btn-group-yesno\\\"\\n\\toption=\\\"1|Yes,0|No\\\"\\n\\tdefault=\\\"0\\\"\\n\\tshowon=\\\"type:1\\\"\\n\\/>\"', 1, '2020-09-07 23:53:41', '2024-09-16 23:47:41', 6, '', 1076, 'a778cf30-3fa9-4099-8a3a-0479f734069f', '', '', '', '', ''),
(3419, '', '', '', '', '', '', '', '', '', '', 'TEXT', '', '', '', 'Crop Details', 'NULL', '', '7139f2c8-a70a-46a6-bbe3-4eefe54ca515', '\"<field\\n\\ttype=\\\"subform\\\"\\n\\tname=\\\"crop\\\"\\n\\tlabel=\\\"Crop Details\\\"\\n\\tlayout=\\\"joomla.form.field.subform.repeatable-table\\\"\\n\\tmultiple=\\\"true\\\"\\n\\tbuttons=\\\"add,remove\\\"\\n\\tfields=\\\"5d3d34dd-4876-4c6a-86ab-b4e162f22c08,ab0d3b92-bd90-4957-ab71-cbc7a5fabeb3,1616608c-5307-4496-89e2-36a326a84716\\\"\\n\\tdescription=\\\"Set the crop details for the image here\\\"\\n\\ticon=\\\"list\\\"\\n\\tmax=\\\"10\\\"\\n\\tmin=\\\"0\\\"\\n\\tfilter=\\\"STRING\\\"\\n\\tshowon=\\\"type:1\\\"\\n\\/>\"', 1, '2020-09-07 23:57:52', '2024-09-16 23:49:27', 12, '', 1077, '6f327030-dcdf-4d80-b3d9-293d4bbe39f7', '', '', '', '', ''),
@@ -3022,8 +3022,12 @@ INSERT INTO `#__componentbuilder_repository` (`id`, `system_name`, `organisation
(17, 'Openai (codeberg - mirror)', 'joomla', 'openai', 1, 1, 'https://codeberg.org', 'c625381a-7795-4b9f-8b4e-997c9291e3fc', 'master', 1, 17, 1, '2025-06-17 21:47:49', '2024-06-10 11:03:19', '', '{}'),
(18, 'Joomla Powers (codeberg - mirror)', 'joomla', 'joomla-powers', 2, 1, 'https://codeberg.org', '8ac595d4-0b1d-4877-ba3e-2b815c1c7e3c', 'master', 1, 18, 1, '2025-06-17 21:47:22', '2024-07-08 14:07:31', '', '{}'),
(19, 'Joomla Field Types (codeberg - mirror)', 'joomla', 'joomla-fieldtypes', 3, 1, 'https://codeberg.org', 'bf4a1d77-e3a4-4aa8-a07f-2b01872bf7e9', 'master', 1, 19, 1, '2025-06-17 21:48:25', '2024-08-23 16:21:35', '', '{}'),
(20, 'Official Packages (github - mirror)', 'joomengine', 'packages', 4, 2, 'https://api.github.com', '562624ab-48bf-4979-9a14-6b10cf3635de', 'master', 1, 20, 1, '2025-06-23 16:46:09', '2025-05-31 08:47:01', '', '{}'),
(21, 'Official Packages (github - mirror)', 'joomengine', 'snippets', 5, 2, 'https://api.github.com', '70e85588-bc28-4459-9b29-858f68faae8f', 'master', 1, 21, 1, '2025-06-23 16:46:13', '2025-06-18 10:35:14', '', '{}');
(20, 'Packages (github - mirror)', 'joomengine', 'packages', 4, 2, 'https://api.github.com', '562624ab-48bf-4979-9a14-6b10cf3635de', 'master', 1, 20, 1, '2025-06-24 19:43:43', '2025-05-31 08:47:01', '', '{}'),
(21, 'Snippets (github - mirror)', 'joomengine', 'snippets', 5, 2, 'https://api.github.com', '70e85588-bc28-4459-9b29-858f68faae8f', 'master', 1, 21, 1, '2025-06-24 15:11:19', '2025-06-18 10:35:14', '', '{}'),
(22, 'Repositories (github - mirror)', 'joomengine', 'repoindex', 6, 2, 'https://api.github.com', '8f156882-f299-4be2-ad13-fdb2c40bb207', 'master', 1, 22, 1, '2025-06-25 09:26:32', '2025-06-18 18:43:05', '', '{}'),
(23, 'Packages (codeberg - mirror)', 'joomla', 'packages', 4, 1, 'https://codeberg.org', '11298fc6-11a4-4075-bdcb-622ef4f3054d', 'master', 1, 21, 1, '2025-06-24 19:09:18', '2025-06-18 18:43:47', '', '{}'),
(24, 'Snippets (codeberg - mirror)', 'joomla', 'snippets', 5, 1, 'https://codeberg.org', '70a9b44b-0802-4b94-9132-e5f360d0215e', 'master', 1, 22, 1, '2025-06-24 19:09:14', '2025-06-24 15:10:05', '', '{}'),
(25, 'Repositories (codeberg - mirror)', 'joomla', 'repoindex', 6, 1, 'https://codeberg.org', 'a8701724-b77c-4e5a-9efc-61701341e8e5', 'master', 1, 21, 1, '2025-06-24 19:09:09', '2025-06-24 15:10:09', '', '{}');
--
-- Dumping data for table `#__componentbuilder_help_document`

View File

@@ -17,6 +17,7 @@ use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Componentbuilder\Repository\Factory as RepositoryFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -51,4 +52,246 @@ class RepositoriesController extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
/**
* Redirect the request to the Initialization selection page.
*
* @return bool True on successful initialization, false on failure.
* @since 5.1.1
*/
public function initPowers()
{
// Check for request forgeries
Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
// check if user has the right
$user = $this->app->getIdentity();
// set default error message
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . '</h1>';
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_REPOSITORIES') . '</p>';
$status = 'error';
$success = false;
if($user->authorise('repository.init', 'com_componentbuilder'))
{
// set success message
$message = null;
$status = null;
$success = true;
// set redirect
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=initialization_selection&power=Repository&target=Repositories', false);
}
else
{
// set redirect
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=repositories', false);
}
$this->setRedirect($redirect_url, $message, $status);
return $success;
}
/**
* Resets the selected Repositories.
*
* 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 reset the selected Repositories.
* 6. If the user is authorized and powers are selected, it attempts to reset the selected Repositories.
* 7. Depending on the result of the reset 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 reset, false on failure.
* @since 5.1.1
*/
public function resetPowers()
{
// 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 = '<h1>' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . '</h1>';
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '</p>';
// set redirect
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=repositories', false);
$this->setRedirect($redirect_url, $message, 'error');
return false;
}
$status = 'error';
$success = false;
// check if user has the right
$user = $this->app->getIdentity();
if($user->authorise('repository.reset', 'com_componentbuilder'))
{
// get the guid field of this entity
$key_field = RepositoryFactory::_('Repository.Remote.Get')->getGuidField();
$guids = RepositoryFactory::_('Load')->values([$key_field], ['repository'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
try {
if (RepositoryFactory::_('Repository.Remote.Get')->reset($guids))
{
// set success message
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . '</h1>';
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_THESE_REPOSITORIES_HAVE_SUCCESSFULLY_BEEN_RESET') . '</p>';
$status = 'success';
$success = true;
}
else
{
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . '</h1>';
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THESE_REPOSITORIES_HAS_FAILED') . '</p>';
}
} catch (\Exception $e) {
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . '</h1>';
$message .= '<p>' . \htmlspecialchars($e->getMessage()) . '</p>';
}
// set redirect
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=repositories', false);
$this->setRedirect($redirect_url, $message, $status);
return $success;
}
// set redirect
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=repositories', false);
$this->setRedirect($redirect_url);
return $success;
}
/**
* Pushes the selected Repositories.
*
* 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 Repositories.
* 6. If the user is authorized and powers are selected, it attempts to push the selected Repositories.
* 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.
* @since 5.1.1
*/
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 = '<h1>' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . '</h1>';
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '</p>';
// set redirect
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=repositories', false);
$this->setRedirect($redirect_url, $message, 'error');
return false;
}
$status = 'error';
$success = false;
$message_bus = ['warning', 'error'];
// check if user has the right
$user = $this->app->getIdentity();
if($user->authorise('repository.push', 'com_componentbuilder'))
{
// get the guid field of this entity
$key_field = RepositoryFactory::_('Repository.Remote.Set')->getGuidField();
$guids = RepositoryFactory::_('Load')->values([$key_field], ['repository'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
try {
if (RepositoryFactory::_('Repository.Remote.Set')->items($guids))
{
// set success message
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . '</h1>';
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_THESE_REPOSITORIES_HAVE_SUCCESSFULLY_BEEN_PUSHED') . '</p>';
$status = 'success';
$success = true;
}
else
{
// Load any messages from the message bus
$message_bucket = [];
foreach ($message_bus as $message_key)
{
if (($messages = RepositoryFactory::_('Power.Message')->get($message_key, null)) !== null)
{
$message_bucket[$message_key] = $messages;
}
}
// Initialize base values
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . '</h1>';
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_REPOSITORIES_HAS_FAILED') . '</p>';
$status = 'error';
// Handle both error and warning
if (isset($message_bucket['error'], $message_bucket['warning']))
{
$message .= '<p>' . implode('<br>', $message_bucket['error']) . '</p>';
foreach ($message_bucket['warning'] as $warning)
{
$this->app->enqueueMessage($warning, 'warning');
}
}
elseif (isset($message_bucket['error']))
{
$message .= '<p>' . implode('<br>', $message_bucket['error']) . '</p>';
}
elseif (isset($message_bucket['warning']))
{
$status = 'warning';
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_PUSH_WAS_UNSUCCESSFUL') . '</h1>';
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THESE_REPOSITORIES_COULD_NOT_BE_COMPLETED') . '</p>';
$message .= '<p>' . implode('<br>', $message_bucket['warning']) . '</p>';
}
}
} catch (\Exception $e) {
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . '</h1>';
$message .= '<p>' . \htmlspecialchars($e->getMessage()) . '</p>';
}
// set redirect
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=repositories', false);
$this->setRedirect($redirect_url, $message, $status);
return $success;
}
// set redirect
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=repositories', false);
$this->setRedirect($redirect_url);
return $success;
}
}

View File

@@ -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\Componentbuilder\Repository\Factory as RepositoryFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -78,6 +79,202 @@ class RepositoryController extends FormController
*/
protected int $refid;
/**
* Resets the specified Repository.
*
* 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 reset the Repository.
* 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 reset the specified Repository.
* 6. Depending on the result of the reset 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 reset, false on failure.
* @since 5.1.1
*/
public function resetPowers()
{
// 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 = $this->app->getIdentity();
// set default error message
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . '</h1>';
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_REPOSITORY') . '</p>';
$status = 'error';
$success = false;
// get the guid field of this entity
$key_field = RepositoryFactory::_('Repository.Remote.Get')->getGuidField();
// load the ID
$id = $item['id'] ?? null;
$guid = $item[$key_field] ?? null;
// check if there is any selections
if ($id === null || $guid === null)
{
// set error message
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_NOT_SAVED') . '</h1>';
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_REPOSITORY_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '</p>';
}
elseif($user->authorise('repository.reset', 'com_componentbuilder'))
{
try {
if (RepositoryFactory::_('Repository.Remote.Get')->reset([$guid]))
{
// set success message
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . '</h1>';
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_THE_REPOSITORY_HAS_SUCCESSFULLY_BEEN_RESET') . '</p>';
$status = 'success';
$success = true;
}
else
{
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . '</h1>';
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_REPOSITORY_HAS_FAILED') . '</p>';
}
} catch (\Exception $e) {
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . '</h1>';
$message .= '<p>' . \htmlspecialchars($e->getMessage()) . '</p>';
}
}
// set redirect
$redirect_url = Route::_(
'index.php?option=com_componentbuilder&view=repository'
. $this->getRedirectToItemAppend($id), false
);
$this->setRedirect($redirect_url, $message, $status);
return $success;
}
/**
* Pushes the specified Repository.
*
* 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 Repository.
* 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 Repository.
* 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.
* @since 5.1.1
*/
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 = $this->app->getIdentity();
// set default error message
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . '</h1>';
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_REPOSITORY') . '</p>';
$status = 'error';
$success = false;
// get the guid field of this entity
$key_field = RepositoryFactory::_('Repository.Remote.Set')->getGuidField();
// load the ID
$id = $item['id'] ?? null;
$guid = $item[$key_field] ?? null;
$message_bus = ['warning', 'error'];
// check if there is any selections
if ($id === null || $guid === null)
{
// set error message
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_NOT_SAVED') . '</h1>';
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_REPOSITORY_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '</p>';
}
elseif($user->authorise('repository.push', 'com_componentbuilder'))
{
try {
if (RepositoryFactory::_('Repository.Remote.Set')->items([$guid]))
{
// set success message
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . '</h1>';
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_THE_REPOSITORY_HAS_SUCCESSFULLY_BEEN_PUSHED') . '</p>';
$status = 'success';
$success = true;
}
else
{
// Load any messages from the message bus
$message_bucket = [];
foreach ($message_bus as $message_key)
{
if (($messages = RepositoryFactory::_('Power.Message')->get($message_key, null)) !== null)
{
$message_bucket[$message_key] = $messages;
}
}
// Initialize base values
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . '</h1>';
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_REPOSITORY_HAS_FAILED') . '</p>';
$status = 'error';
// Handle both error and warning
if (isset($message_bucket['error'], $message_bucket['warning']))
{
$message .= '<p>' . implode('<br>', $message_bucket['error']) . '</p>';
foreach ($message_bucket['warning'] as $warning)
{
$this->app->enqueueMessage($warning, 'warning');
}
}
elseif (isset($message_bucket['error']))
{
$message .= '<p>' . implode('<br>', $message_bucket['error']) . '</p>';
}
elseif (isset($message_bucket['warning']))
{
$status = 'warning';
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_PUSH_WAS_UNSUCCESSFUL') . '</h1>';
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_REPOSITORY_COULD_NOT_BE_COMPLETED') . '</p>';
$message .= '<p>' . implode('<br>', $message_bucket['warning']) . '</p>';
}
}
} catch (\Exception $e) {
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . '</h1>';
$message .= '<p>' . \htmlspecialchars($e->getMessage()) . '</p>';
}
}
// set redirect
$redirect_url = Route::_(
'index.php?option=com_componentbuilder&view=repository'
. $this->getRedirectToItemAppend($id), false
);
$this->setRedirect($redirect_url, $message, $status);
return $success;
}
/**
* Method override to check if you can add a new record.
*

View File

@@ -47,6 +47,7 @@ use VDM\Joomla\Componentbuilder\Fieldtype\Factory as FieldtypeFactory;
use VDM\Joomla\Componentbuilder\JoomlaPower\Factory as JoomlaPowerFactory;
use VDM\Joomla\Componentbuilder\Power\Factory as PowerFactory;
use VDM\Joomla\Componentbuilder\Snippet\Factory as SnippetFactory;
use VDM\Joomla\Componentbuilder\Repository\Factory as RepositoryFactory;
use Joomla\CMS\Form\FormHelper as FormFormHelper;
// No direct access to this file
@@ -5341,7 +5342,8 @@ class AjaxModel extends ListModel
'ClassExtends' => 'PackageFactory',
'ClassProperty' => 'PackageFactory',
'ClassMethod' => 'PackageFactory',
'Placeholder' => 'PackageFactory'
'Placeholder' => 'PackageFactory',
'Repository' => 'RepositoryFactory'
];
/**
@@ -5361,6 +5363,7 @@ class AjaxModel extends ListModel
'FieldtypeFactory' => FieldtypeFactory::_($getClass),
'SnippetFactory' => SnippetFactory::_($getClass),
'PackageFactory' => PackageFactory::_($getClass),
'RepositoryFactory' => RepositoryFactory::_($getClass),
default => null,
};
}

View File

@@ -30,6 +30,7 @@ use VDM\Joomla\Componentbuilder\Fieldtype\Factory as FieldtypeFactory;
use VDM\Joomla\Componentbuilder\JoomlaPower\Factory as JoomlaPowerFactory;
use VDM\Joomla\Componentbuilder\Power\Factory as PowerFactory;
use VDM\Joomla\Componentbuilder\Snippet\Factory as SnippetFactory;
use VDM\Joomla\Componentbuilder\Repository\Factory as RepositoryFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -389,7 +390,8 @@ class Initialization_selectionModel extends ItemModel
'ClassExtends' => 'PackageFactory',
'ClassProperty' => 'PackageFactory',
'ClassMethod' => 'PackageFactory',
'Placeholder' => 'PackageFactory'
'Placeholder' => 'PackageFactory',
'Repository' => 'RepositoryFactory'
];
/**
@@ -409,6 +411,7 @@ class Initialization_selectionModel extends ItemModel
'FieldtypeFactory' => FieldtypeFactory::_($getClass),
'SnippetFactory' => SnippetFactory::_($getClass),
'PackageFactory' => PackageFactory::_($getClass),
'RepositoryFactory' => RepositoryFactory::_($getClass),
default => null,
};
}

View File

@@ -248,11 +248,12 @@ class RepositoriesModel extends ListModel
{
$targetArray = array(
0 => 'COM_COMPONENTBUILDER_REPOSITORY_SELECT_AN_OPTION',
4 => 'COM_COMPONENTBUILDER_REPOSITORY_JCB_PACKAGES',
3 => 'COM_COMPONENTBUILDER_REPOSITORY_JOOMLA_FIELD_TYPES',
4 => 'COM_COMPONENTBUILDER_REPOSITORY_PACKAGES',
3 => 'COM_COMPONENTBUILDER_REPOSITORY_FIELD_TYPES',
2 => 'COM_COMPONENTBUILDER_REPOSITORY_JOOMLA_POWER',
5 => 'COM_COMPONENTBUILDER_REPOSITORY_SNIPPETS',
1 => 'COM_COMPONENTBUILDER_REPOSITORY_SUPER_POWER'
1 => 'COM_COMPONENTBUILDER_REPOSITORY_SUPER_POWER',
6 => 'COM_COMPONENTBUILDER_REPOSITORY_REPOSITORIES'
);
// Now check if value is found in this array
if (isset($targetArray[$value]) && StringHelper::check($targetArray[$value]))

View File

@@ -218,6 +218,21 @@ class HtmlView extends BaseHtmlView
ToolbarHelper::trash('repositories.trash');
}
}
if ($this->user->authorise('repository.init', 'com_componentbuilder'))
{
// add Init button.
ToolbarHelper::custom('repositories.initPowers', 'health custom-button-initpowers', '', 'COM_COMPONENTBUILDER_INIT', false);
}
if ($this->user->authorise('repository.reset', 'com_componentbuilder'))
{
// add Reset button.
ToolbarHelper::custom('repositories.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
}
if ($this->user->authorise('repository.push', 'com_componentbuilder'))
{
// add Push button.
ToolbarHelper::custom('repositories.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
}
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('repositories');

View File

@@ -281,6 +281,16 @@ class HtmlView extends BaseHtmlView
{
ToolbarHelper::custom('repository.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
if ($this->canDo->get('repository.reset'))
{
// add Reset button.
ToolbarHelper::custom('repository.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
}
if ($this->canDo->get('repository.push'))
{
// add Push button.
ToolbarHelper::custom('repository.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
}
ToolbarHelper::cancel('repository.cancel', 'JTOOLBAR_CLOSE');
}
}
@@ -354,6 +364,16 @@ class HtmlView extends BaseHtmlView
ToolbarHelper::apply('repository.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('repository.save', 'JTOOLBAR_SAVE');
}
if ($this->canDo->get('repository.reset'))
{
// add Reset button.
ToolbarHelper::custom('repository.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
}
if ($this->canDo->get('repository.push'))
{
// add Push button.
ToolbarHelper::custom('repository.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
}
ToolbarHelper::cancel('repository.cancel', 'JTOOLBAR_CLOSE');
}
}

View File

@@ -36,7 +36,8 @@ $headers = [
'ClassExtends' => 'COM_COMPONENTBUILDER_INITIALIZE_CLASS_EXTENDS',
'ClassProperty' => 'COM_COMPONENTBUILDER_INITIALIZE_CLASS_PROPERTIES',
'ClassMethod' => 'COM_COMPONENTBUILDER_INITIALIZE_CLASS_METHODS',
'Placeholder' => 'COM_COMPONENTBUILDER_INITIALIZE_PLACEHOLDERS'
'Placeholder' => 'COM_COMPONENTBUILDER_INITIALIZE_PLACEHOLDERS',
'Repository' => 'COM_COMPONENTBUILDER_INITIALIZE_REPOSITORIES'
];
// Fetch and translate header if area is defined and mapped