diff --git a/CHANGELOG.md b/CHANGELOG.md index 71b8dc8ba..f46a6d58f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,9 @@ -# v4.0.1-alpha6 +# v4.0.1-alpha7 -- Add new subform classes -- Fix registry class methods return type -- Update all list and custom fields to use the new layouts +- Add push options to Joomla Power +- Complete the Joomla Power Init and Reset features +- Fix Gitea Contents class functions +- Last Alpha release (feature block) # v4.0.1-alpha @@ -14,7 +15,10 @@ - Update the Schema class to also update null mismatching if needed - Add repositories for better integration with gitea - Refactored the Data classes -- Add new Data classes +- Add new Data classes +- Add new subform classes +- Fix registry class methods return type +- Update all list and custom fields to use the new layouts # v4.0.0 diff --git a/ComponentbuilderInstallerScript.php b/ComponentbuilderInstallerScript.php index 10dc94576..7e77c8ccc 100644 --- a/ComponentbuilderInstallerScript.php +++ b/ComponentbuilderInstallerScript.php @@ -1516,7 +1516,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface // Fix the assets table rules column size. - $this->setDatabaseAssetsRulesFix(96000, "MEDIUMTEXT"); + $this->setDatabaseAssetsRulesFix(96160, "MEDIUMTEXT"); // Install the global extension params. $this->setExtensionsParams( '{"autorName":"Llewellyn van der Merwe","autorEmail":"joomla@vdm.io","subform_layouts":"default","editor":"none","manage_jcb_package_directories":"2","set_browser_storage":"1","storage_time_to_live":"global","super_powers_documentation":"0","powers_repository":"0","super_powers_repositories":"0","builder_gif_size":"480-272","compiler_plugin":["componentbuilderactionlogcompiler","componentbuilderfieldorderingcompiler","componentbuilderheaderscompiler","componentbuilderpowersautoloadercompiler","componentbuilderprivacycompiler"],"add_menu_prefix":"1","menu_prefix":"ยป","namespace_prefix":"JCB","minify":"0","language":"en-GB","percentagelanguageadd":"30","assets_table_fix":"2","compiler_field_builder_type":"2","field_name_builder":"1","type_name_builder":"1","import_guid_only":"1","export_language_strings":"1","development_method":"1","expansion":"0","return_options_build":"2","cronjob_backup_type":"1","cronjob_backup_server":"0","backup_package_name":"JCB_Backup_[YEAR]_[MONTH]_[DAY]","export_license":"GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html","export_copyright":"Copyright (C) 2015. All Rights Reserved","check_in":"-1 day","save_history":"1","history_limit":"10","add_jquery_framework":"1","uikit_load":"1","uikit_min":"","uikit_style":""}' @@ -3266,7 +3266,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface echo '
File at %s/%s gave the following error!
%s
Joomla Power repository at %s/%s gave the following error!
%s
Joomla Power guid:%s not found!
" COM_COMPONENTBUILDER_PJOOMLA_POWER_BGUIDSB_WAS_FOUND_BUT_MISSING_A_NAMESPACE_VALUE_FOR_JOOMLA_SP="Joomla Power guid:%s was found, but missing a namespace value for Joomla %s!
" COM_COMPONENTBUILDER_PLACEHOLDER="Placeholder" @@ -7946,6 +7949,8 @@ COM_COMPONENTBUILDER_PS_NAMING_MISMATCH_ERROR_SPPTHE_S_NAME_IS_BSB_AND_THE_ENDIN COM_COMPONENTBUILDER_PUBLIC_ACCESS="Public Access" COM_COMPONENTBUILDER_PUBLISHED="Published" COM_COMPONENTBUILDER_PUBLISHING="Publishing" +COM_COMPONENTBUILDER_PUSH="Push" +COM_COMPONENTBUILDER_PUSH_FAILED="Push Failed!" COM_COMPONENTBUILDER_READY_TO_COMPILE_A_COMPONENT="Ready to compile a component" COM_COMPONENTBUILDER_REFRESH="Refresh" COM_COMPONENTBUILDER_REGEX_SEARCH="Regex Search" @@ -9070,6 +9075,7 @@ COM_COMPONENTBUILDER_THERE_WAS_AN_ERROR_GETTING_THE_PACKAGE_INFO="There was an e COM_COMPONENTBUILDER_THERE_WAS_A_PROBLEM_BNO_VIEW_OR_ID_FOUND_IN_SESSION_OR_VIEW_NOT_ALLOWED_TO_ACCESS_AREAB_WE_COULD_NOT_LOAD_ANY_LINKED_TO_VALUES_PLEASE_INFORM_YOUR_SYSTEM_ADMINISTRATOR="There was a problem, no view or id found in session or view not allowed to access area, we could not load any linked to values. Please inform your system administrator!" COM_COMPONENTBUILDER_THESE_ARE_THE_SAME_PACKAGES_FOUND_ON_A_S_GITHUBA_AND_CAN_BE_IMPORTED_BY_SIMPLY_MAKING_A_SELECTION_AND_THEN_CLICKING_THE_BGET_PACKAGEB_BUTTONBR_SOME_OF_THESE_PACKAGES_WOULD_REQUIRE_A_KEY_SINCE_THEY_ARE_NOT_FREE="These are the same packages found on gitHub and can be imported by simply making a selection and then clicking the [Get Package] button.'.Text::_('COM_COMPONENTBUILDER_THE_JOOMLA_POWER_HAS_SUCCESSFULLY_BEEN_RESET').'
'; - $status = 'success'; - $success = true; - } - else - { + try { + if (JoomlaPowerFactory::_('Joomlapower')->reset([$guid])) + { + // set success message + $message = ''.Text::_('COM_COMPONENTBUILDER_THE_JOOMLA_POWER_HAS_SUCCESSFULLY_BEEN_RESET').'
'; + $status = 'success'; + $success = true; + } + else + { + $message = '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_JOOMLA_POWER_HAS_FAILED') . '
'; + } + } catch (\Exception $e) { $message = '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_JOOMLA_POWER_HAS_FAILED') . '
'; + $message .= '' . \htmlspecialchars($e->getMessage()) . '
'; + } + } + + // set redirect + $redirect_url = Route::_( + 'index.php?option=com_componentbuilder&view=joomla_power' + . $this->getRedirectToItemAppend($id), $success + ); + + $this->setRedirect($redirect_url, $message, $status); + + return $success; + } + + /** + * Pushes the specified Joomla 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 Joomla 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_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_JOOMLA_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_YOU_MUST_FIRST_SAVE_THE_JOOMLA_POWER_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
'; + } + elseif($user->authorise('power.push', 'com_componentbuilder')) + { + try { + if (JoomlaPowerFactory::_('Joomla.Power.Repository')->set([$guid])) + { + // set success message + $message = ''.Text::_('COM_COMPONENTBUILDER_THE_JOOMLA_POWER_HAS_SUCCESSFULLY_BEEN_PUSHED').'
'; + $status = 'success'; + $success = true; + } + else + { + $message = '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_JOOMLA_POWER_HAS_FAILED') . '
'; + } + } catch (\Exception $e) { + $message = '' . \htmlspecialchars($e->getMessage()) . '
'; } } diff --git a/admin/src/Controller/Joomla_powersController.php b/admin/src/Controller/Joomla_powersController.php index 80322c7d0..0439178cb 100644 --- a/admin/src/Controller/Joomla_powersController.php +++ b/admin/src/Controller/Joomla_powersController.php @@ -54,6 +54,18 @@ class Joomla_powersController extends AdminController return parent::getModel($name, $prefix, $config); } + /** + * Initializes all remote Joomla powers and syncs them with the local database. + * + * This function performs several checks and operations: + * 1. It verifies the authenticity of the request to prevent request forgery. + * 2. It checks whether the current user has the necessary permissions to initialize the Joomla powers. + * 3. If the user is authorized, it attempts to initialize the remote Joomla powers. + * 4. Depending on the result of the initialization operation, it sets the appropriate success or error message. + * 5. It redirects the user to a specified URL with the result message and status. + * + * @return bool True on successful initialization, false on failure. + */ public function initPowers() { // Check for request forgeries @@ -70,19 +82,24 @@ class Joomla_powersController extends AdminController if($user->authorise('power.init', 'com_componentbuilder')) { - if (JoomlaPowerFactory::_('Joomlapower')->init()) - { - // set success message - $message = '' . Text::_('COM_COMPONENTBUILDER_THE_LOCAL_DATABASE_JOOMLA_POWERS_HAS_SUCCESSFULLY_BEEN_SYNCED_WITH_THE_REMOTE_REPOSITORIES') . '
'; + try { + if (JoomlaPowerFactory::_('Joomlapower')->init()) + { + // set success message + $message = '' . Text::_('COM_COMPONENTBUILDER_THE_LOCAL_DATABASE_JOOMLA_POWERS_HAS_SUCCESSFULLY_BEEN_SYNCED_WITH_THE_REMOTE_REPOSITORIES') . '
'; - $status = 'success'; - $success = true; - } - else - { + $status = 'success'; + $success = true; + } + else + { + $message = '' . Text::_('COM_COMPONENTBUILDER_THE_INITIALIZATION_OF_THIS_JOOMLA_POWERS_HAS_FAILED') . '
'; + } + } catch (\Exception $e) { $message = '' . Text::_('COM_COMPONENTBUILDER_THE_INITIALIZATION_OF_THIS_JOOMLA_POWERS_HAS_FAILED') . '
'; + $message .= '' . \htmlspecialchars($e->getMessage()) . '
'; } } @@ -93,6 +110,21 @@ class Joomla_powersController extends AdminController return $success; } + /** + * Resets the selected Joomla 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 reset the selected Joomla powers. + * 6. If the user is authorized and powers are selected, it attempts to reset the selected Joomla powers. + * 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. + */ public function resetPowers() { // Check for request forgeries @@ -125,18 +157,102 @@ class Joomla_powersController extends AdminController { $guids = GetHelper::vars('joomla_power', $pks, 'id', 'guid'); - if (JoomlaPowerFactory::_('Joomlapower')->reset($guids)) - { - // set success message - $message = ''.Text::_('COM_COMPONENTBUILDER_THESE_JOOMLA_POWERS_HAVE_SUCCESSFULLY_BEEN_RESET').'
'; - $status = 'success'; - $success = true; - } - else - { + try { + if (JoomlaPowerFactory::_('Joomlapower')->reset($guids)) + { + // set success message + $message = ''.Text::_('COM_COMPONENTBUILDER_THESE_JOOMLA_POWERS_HAVE_SUCCESSFULLY_BEEN_RESET').'
'; + $status = 'success'; + $success = true; + } + else + { + $message = '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THESE_JOOMLA_POWERS_HAS_FAILED') . '
'; + } + } catch (\Exception $e) { $message = '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THESE_JOOMLA_POWERS_HAS_FAILED') . '
'; + $message .= '' . \htmlspecialchars($e->getMessage()) . '
'; + } + + // set redirect + $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_powers', $success); + $this->setRedirect($redirect_url, $message, $status); + + return $success; + } + + // set redirect + $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_powers', false); + $this->setRedirect($redirect_url); + return $success; + } + + /** + * Pushes the selected Joomla 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 Joomla powers. + * 6. If the user is authorized and powers are selected, it attempts to push the selected Joomla 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_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST').'
'; + // set redirect + $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_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('joomla_power', $pks, 'id', 'guid'); + + try { + if (JoomlaPowerFactory::_('Joomla.Power.Repository')->set($guids)) + { + // set success message + $message = ''.Text::_('COM_COMPONENTBUILDER_THESE_JOOMLA_POWERS_HAVE_SUCCESSFULLY_BEEN_PUSHED').'
'; + $status = 'success'; + $success = true; + } + else + { + $message = '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THESE_JOOMLA_POWERS_HAS_FAILED') . '
'; + } + } catch (\Exception $e) { + $message = '' . \htmlspecialchars($e->getMessage()) . '
'; } // set redirect diff --git a/admin/src/Controller/PowerController.php b/admin/src/Controller/PowerController.php index 4ca682822..e5f2c00dd 100644 --- a/admin/src/Controller/PowerController.php +++ b/admin/src/Controller/PowerController.php @@ -63,6 +63,20 @@ class PowerController extends FormController */ protected $view_list = 'powers'; + /** + * Resets 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 reset 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 reset the specified power. + * 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. + */ public function resetPowers() { // Check for request forgeries diff --git a/admin/src/Controller/PowersController.php b/admin/src/Controller/PowersController.php index 6786e552f..947e7f5de 100644 --- a/admin/src/Controller/PowersController.php +++ b/admin/src/Controller/PowersController.php @@ -58,27 +58,40 @@ class PowersController extends AdminController /** - * Run the Expansion + * Runs the expansion module. * - * @return void + * This function performs several checks and operations: + * 1. It verifies the authenticity of the request to prevent request forgery. + * 2. It checks whether the current user has the necessary permissions to run the expansion module. + * 3. If the user is authorized, it attempts to run the expansion via an API call. + * 4. Depending on the result of the expansion operation, it sets the appropriate success or error message. + * 5. It redirects the user to a specified URL with the result message and status. + * + * @return bool True on successful expansion, false on failure. */ public function runExpansion() { // Check for request forgeries - Session::checkToken() or \jexit(Text::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); + // check if user has the right $user = Factory::getUser(); + // set page redirect $redirect_url = Route::_('index.php?option=com_componentbuilder&view=powers', false); + // set massage $message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE'); + // check if this user has the right to run expansion if($user->authorise('powers.run_expansion', 'com_componentbuilder')) { // set massage $message = Text::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB'); + // run expansion via API $result = ComponentbuilderHelper::getFileContents(Uri::root() . 'index.php?option=com_componentbuilder&task=api.expand'); + // is there a message returned if (!is_numeric($result) && StringHelper::check($result)) { @@ -92,10 +105,23 @@ class PowersController extends AdminController return true; } } + $this->setRedirect($redirect_url, $message, 'error'); return false; } + /** + * Initializes all remote powers and syncs them with the local database. + * + * This function performs several checks and operations: + * 1. It verifies the authenticity of the request to prevent request forgery. + * 2. It checks whether the current user has the necessary permissions to initialize the powers. + * 3. If the user is authorized, it attempts to initialize the remote powers. + * 4. Depending on the result of the initialization operation, it sets the appropriate success or error message. + * 5. It redirects the user to a specified URL with the result message and status. + * + * @return bool True on successful initialization, false on failure. + */ public function initPowers() { // Check for request forgeries @@ -135,6 +161,21 @@ class PowersController extends AdminController return $success; } + /** + * Resets 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 reset the selected powers. + * 6. If the user is authorized and powers are selected, it attempts to reset the selected powers. + * 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. + */ public function resetPowers() { // Check for request forgeries diff --git a/admin/src/Controller/Validation_rulesController.php b/admin/src/Controller/Validation_rulesController.php index 2103958ad..e6a5eecec 100644 --- a/admin/src/Controller/Validation_rulesController.php +++ b/admin/src/Controller/Validation_rulesController.php @@ -56,27 +56,40 @@ class Validation_rulesController extends AdminController /** - * Run the Expansion + * Runs the expansion module. * - * @return void + * This function performs several checks and operations: + * 1. It verifies the authenticity of the request to prevent request forgery. + * 2. It checks whether the current user has the necessary permissions to run the expansion module. + * 3. If the user is authorized, it attempts to run the expansion via an API call. + * 4. Depending on the result of the expansion operation, it sets the appropriate success or error message. + * 5. It redirects the user to a specified URL with the result message and status. + * + * @return bool True on successful expansion, false on failure. */ public function runExpansion() { // Check for request forgeries - Session::checkToken() or \jexit(Text::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); + // check if user has the right $user = Factory::getUser(); + // set page redirect $redirect_url = Route::_('index.php?option=com_componentbuilder&view=validation_rules', false); + // set massage $message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE'); + // check if this user has the right to run expansion if($user->authorise('validation_rules.run_expansion', 'com_componentbuilder')) { // set massage $message = Text::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB'); + // run expansion via API $result = ComponentbuilderHelper::getFileContents(Uri::root() . 'index.php?option=com_componentbuilder&task=api.expand'); + // is there a message returned if (!is_numeric($result) && StringHelper::check($result)) { @@ -90,6 +103,7 @@ class Validation_rulesController extends AdminController return true; } } + $this->setRedirect($redirect_url, $message, 'error'); return false; } diff --git a/admin/src/Model/Admin_fields_relationsModel.php b/admin/src/Model/Admin_fields_relationsModel.php index b75f6304a..ae6ae7937 100644 --- a/admin/src/Model/Admin_fields_relationsModel.php +++ b/admin/src/Model/Admin_fields_relationsModel.php @@ -119,10 +119,18 @@ class Admin_fields_relationsModel extends AdminModel /** - * get VDM internal session key + * Retrieves or generates a Vast Development Method (VDM) key for the current item. * - * @return string the session key + * This function performs the following operations: + * 1. Checks if the VDM key is already set. If not, it proceeds to generate or retrieve one. + * 2. Determines the item ID based on the presence of a specific argument. + * 3. Attempts to retrieve an existing VDM key from a helper method using the item ID. + * 4. If a VDM key is not found, it generates a new random VDM key. + * 5. Stores the VDM key and associates it with the item ID in a helper method. + * 6. Optionally, stores return and GUID values if available. + * 7. Returns the VDM key. * + * @return string The VDM key for the current item. */ public function getVDM() { diff --git a/admin/src/Model/Admin_viewModel.php b/admin/src/Model/Admin_viewModel.php index 778e88d72..42258ed88 100644 --- a/admin/src/Model/Admin_viewModel.php +++ b/admin/src/Model/Admin_viewModel.php @@ -268,10 +268,18 @@ class Admin_viewModel extends AdminModel /** - * get VDM internal session key + * Retrieves or generates a Vast Development Method (VDM) key for the current item. * - * @return string the session key + * This function performs the following operations: + * 1. Checks if the VDM key is already set. If not, it proceeds to generate or retrieve one. + * 2. Determines the item ID based on the presence of a specific argument. + * 3. Attempts to retrieve an existing VDM key from a helper method using the item ID. + * 4. If a VDM key is not found, it generates a new random VDM key. + * 5. Stores the VDM key and associates it with the item ID in a helper method. + * 6. Optionally, stores return and GUID values if available. + * 7. Returns the VDM key. * + * @return string The VDM key for the current item. */ public function getVDM() { diff --git a/admin/src/Model/Class_extendsModel.php b/admin/src/Model/Class_extendsModel.php index 57c8b8bca..bf66a7dcf 100644 --- a/admin/src/Model/Class_extendsModel.php +++ b/admin/src/Model/Class_extendsModel.php @@ -123,10 +123,18 @@ class Class_extendsModel extends AdminModel /** - * get VDM internal session key + * Retrieves or generates a Vast Development Method (VDM) key for the current item. * - * @return string the session key + * This function performs the following operations: + * 1. Checks if the VDM key is already set. If not, it proceeds to generate or retrieve one. + * 2. Determines the item ID based on the presence of a specific argument. + * 3. Attempts to retrieve an existing VDM key from a helper method using the item ID. + * 4. If a VDM key is not found, it generates a new random VDM key. + * 5. Stores the VDM key and associates it with the item ID in a helper method. + * 6. Optionally, stores return and GUID values if available. + * 7. Returns the VDM key. * + * @return string The VDM key for the current item. */ public function getVDM() { diff --git a/admin/src/Model/Class_methodModel.php b/admin/src/Model/Class_methodModel.php index 40a839e4f..e2fd9a17e 100644 --- a/admin/src/Model/Class_methodModel.php +++ b/admin/src/Model/Class_methodModel.php @@ -127,10 +127,18 @@ class Class_methodModel extends AdminModel /** - * get VDM internal session key + * Retrieves or generates a Vast Development Method (VDM) key for the current item. * - * @return string the session key + * This function performs the following operations: + * 1. Checks if the VDM key is already set. If not, it proceeds to generate or retrieve one. + * 2. Determines the item ID based on the presence of a specific argument. + * 3. Attempts to retrieve an existing VDM key from a helper method using the item ID. + * 4. If a VDM key is not found, it generates a new random VDM key. + * 5. Stores the VDM key and associates it with the item ID in a helper method. + * 6. Optionally, stores return and GUID values if available. + * 7. Returns the VDM key. * + * @return string The VDM key for the current item. */ public function getVDM() { diff --git a/admin/src/Model/Class_propertyModel.php b/admin/src/Model/Class_propertyModel.php index 1a6bcde83..03aa78f0c 100644 --- a/admin/src/Model/Class_propertyModel.php +++ b/admin/src/Model/Class_propertyModel.php @@ -124,10 +124,18 @@ class Class_propertyModel extends AdminModel /** - * get VDM internal session key + * Retrieves or generates a Vast Development Method (VDM) key for the current item. * - * @return string the session key + * This function performs the following operations: + * 1. Checks if the VDM key is already set. If not, it proceeds to generate or retrieve one. + * 2. Determines the item ID based on the presence of a specific argument. + * 3. Attempts to retrieve an existing VDM key from a helper method using the item ID. + * 4. If a VDM key is not found, it generates a new random VDM key. + * 5. Stores the VDM key and associates it with the item ID in a helper method. + * 6. Optionally, stores return and GUID values if available. + * 7. Returns the VDM key. * + * @return string The VDM key for the current item. */ public function getVDM() { diff --git a/admin/src/Model/Component_dashboardModel.php b/admin/src/Model/Component_dashboardModel.php index 1176feaed..e51810ea2 100644 --- a/admin/src/Model/Component_dashboardModel.php +++ b/admin/src/Model/Component_dashboardModel.php @@ -127,10 +127,18 @@ class Component_dashboardModel extends AdminModel /** - * get VDM internal session key + * Retrieves or generates a Vast Development Method (VDM) key for the current item. * - * @return string the session key + * This function performs the following operations: + * 1. Checks if the VDM key is already set. If not, it proceeds to generate or retrieve one. + * 2. Determines the item ID based on the presence of a specific argument. + * 3. Attempts to retrieve an existing VDM key from a helper method using the item ID. + * 4. If a VDM key is not found, it generates a new random VDM key. + * 5. Stores the VDM key and associates it with the item ID in a helper method. + * 6. Optionally, stores return and GUID values if available. + * 7. Returns the VDM key. * + * @return string The VDM key for the current item. */ public function getVDM() { diff --git a/admin/src/Model/Component_routerModel.php b/admin/src/Model/Component_routerModel.php index 1f6b78edc..d22a015d7 100644 --- a/admin/src/Model/Component_routerModel.php +++ b/admin/src/Model/Component_routerModel.php @@ -128,10 +128,18 @@ class Component_routerModel extends AdminModel /** - * get VDM internal session key + * Retrieves or generates a Vast Development Method (VDM) key for the current item. * - * @return string the session key + * This function performs the following operations: + * 1. Checks if the VDM key is already set. If not, it proceeds to generate or retrieve one. + * 2. Determines the item ID based on the presence of a specific argument. + * 3. Attempts to retrieve an existing VDM key from a helper method using the item ID. + * 4. If a VDM key is not found, it generates a new random VDM key. + * 5. Stores the VDM key and associates it with the item ID in a helper method. + * 6. Optionally, stores return and GUID values if available. + * 7. Returns the VDM key. * + * @return string The VDM key for the current item. */ public function getVDM() { diff --git a/admin/src/Model/Custom_admin_viewModel.php b/admin/src/Model/Custom_admin_viewModel.php index e9eb36e39..356b680d4 100644 --- a/admin/src/Model/Custom_admin_viewModel.php +++ b/admin/src/Model/Custom_admin_viewModel.php @@ -185,10 +185,18 @@ class Custom_admin_viewModel extends AdminModel /** - * get VDM internal session key + * Retrieves or generates a Vast Development Method (VDM) key for the current item. * - * @return string the session key + * This function performs the following operations: + * 1. Checks if the VDM key is already set. If not, it proceeds to generate or retrieve one. + * 2. Determines the item ID based on the presence of a specific argument. + * 3. Attempts to retrieve an existing VDM key from a helper method using the item ID. + * 4. If a VDM key is not found, it generates a new random VDM key. + * 5. Stores the VDM key and associates it with the item ID in a helper method. + * 6. Optionally, stores return and GUID values if available. + * 7. Returns the VDM key. * + * @return string The VDM key for the current item. */ public function getVDM() { diff --git a/admin/src/Model/Custom_codeModel.php b/admin/src/Model/Custom_codeModel.php index 750772959..1bc07f18a 100644 --- a/admin/src/Model/Custom_codeModel.php +++ b/admin/src/Model/Custom_codeModel.php @@ -139,10 +139,18 @@ class Custom_codeModel extends AdminModel /** - * get VDM internal session key + * Retrieves or generates a Vast Development Method (VDM) key for the current item. * - * @return string the session key + * This function performs the following operations: + * 1. Checks if the VDM key is already set. If not, it proceeds to generate or retrieve one. + * 2. Determines the item ID based on the presence of a specific argument. + * 3. Attempts to retrieve an existing VDM key from a helper method using the item ID. + * 4. If a VDM key is not found, it generates a new random VDM key. + * 5. Stores the VDM key and associates it with the item ID in a helper method. + * 6. Optionally, stores return and GUID values if available. + * 7. Returns the VDM key. * + * @return string The VDM key for the current item. */ public function getVDM() { diff --git a/admin/src/Model/Dynamic_getModel.php b/admin/src/Model/Dynamic_getModel.php index e374197b1..a6553e854 100644 --- a/admin/src/Model/Dynamic_getModel.php +++ b/admin/src/Model/Dynamic_getModel.php @@ -179,10 +179,18 @@ class Dynamic_getModel extends AdminModel /** - * get VDM internal session key + * Retrieves or generates a Vast Development Method (VDM) key for the current item. * - * @return string the session key + * This function performs the following operations: + * 1. Checks if the VDM key is already set. If not, it proceeds to generate or retrieve one. + * 2. Determines the item ID based on the presence of a specific argument. + * 3. Attempts to retrieve an existing VDM key from a helper method using the item ID. + * 4. If a VDM key is not found, it generates a new random VDM key. + * 5. Stores the VDM key and associates it with the item ID in a helper method. + * 6. Optionally, stores return and GUID values if available. + * 7. Returns the VDM key. * + * @return string The VDM key for the current item. */ public function getVDM() { diff --git a/admin/src/Model/FieldModel.php b/admin/src/Model/FieldModel.php index 0cba29e11..70dacfd9e 100644 --- a/admin/src/Model/FieldModel.php +++ b/admin/src/Model/FieldModel.php @@ -172,10 +172,18 @@ class FieldModel extends AdminModel /** - * get VDM internal session key + * Retrieves or generates a Vast Development Method (VDM) key for the current item. * - * @return string the session key + * This function performs the following operations: + * 1. Checks if the VDM key is already set. If not, it proceeds to generate or retrieve one. + * 2. Determines the item ID based on the presence of a specific argument. + * 3. Attempts to retrieve an existing VDM key from a helper method using the item ID. + * 4. If a VDM key is not found, it generates a new random VDM key. + * 5. Stores the VDM key and associates it with the item ID in a helper method. + * 6. Optionally, stores return and GUID values if available. + * 7. Returns the VDM key. * + * @return string The VDM key for the current item. */ public function getVDM() { diff --git a/admin/src/Model/FieldtypeModel.php b/admin/src/Model/FieldtypeModel.php index 756982865..fe2c761e3 100644 --- a/admin/src/Model/FieldtypeModel.php +++ b/admin/src/Model/FieldtypeModel.php @@ -146,10 +146,18 @@ class FieldtypeModel extends AdminModel /** - * get VDM internal session key + * Retrieves or generates a Vast Development Method (VDM) key for the current item. * - * @return string the session key + * This function performs the following operations: + * 1. Checks if the VDM key is already set. If not, it proceeds to generate or retrieve one. + * 2. Determines the item ID based on the presence of a specific argument. + * 3. Attempts to retrieve an existing VDM key from a helper method using the item ID. + * 4. If a VDM key is not found, it generates a new random VDM key. + * 5. Stores the VDM key and associates it with the item ID in a helper method. + * 6. Optionally, stores return and GUID values if available. + * 7. Returns the VDM key. * + * @return string The VDM key for the current item. */ public function getVDM() { diff --git a/admin/src/Model/Joomla_componentModel.php b/admin/src/Model/Joomla_componentModel.php index 48736fb4f..82910d9f4 100644 --- a/admin/src/Model/Joomla_componentModel.php +++ b/admin/src/Model/Joomla_componentModel.php @@ -303,10 +303,18 @@ class Joomla_componentModel extends AdminModel /** - * get VDM internal session key + * Retrieves or generates a Vast Development Method (VDM) key for the current item. * - * @return string the session key + * This function performs the following operations: + * 1. Checks if the VDM key is already set. If not, it proceeds to generate or retrieve one. + * 2. Determines the item ID based on the presence of a specific argument. + * 3. Attempts to retrieve an existing VDM key from a helper method using the item ID. + * 4. If a VDM key is not found, it generates a new random VDM key. + * 5. Stores the VDM key and associates it with the item ID in a helper method. + * 6. Optionally, stores return and GUID values if available. + * 7. Returns the VDM key. * + * @return string The VDM key for the current item. */ public function getVDM() { diff --git a/admin/src/Model/Joomla_moduleModel.php b/admin/src/Model/Joomla_moduleModel.php index 78a6ed22b..8994451aa 100644 --- a/admin/src/Model/Joomla_moduleModel.php +++ b/admin/src/Model/Joomla_moduleModel.php @@ -209,10 +209,18 @@ class Joomla_moduleModel extends AdminModel /** - * get VDM internal session key + * Retrieves or generates a Vast Development Method (VDM) key for the current item. * - * @return string the session key + * This function performs the following operations: + * 1. Checks if the VDM key is already set. If not, it proceeds to generate or retrieve one. + * 2. Determines the item ID based on the presence of a specific argument. + * 3. Attempts to retrieve an existing VDM key from a helper method using the item ID. + * 4. If a VDM key is not found, it generates a new random VDM key. + * 5. Stores the VDM key and associates it with the item ID in a helper method. + * 6. Optionally, stores return and GUID values if available. + * 7. Returns the VDM key. * + * @return string The VDM key for the current item. */ public function getVDM() { diff --git a/admin/src/Model/Joomla_pluginModel.php b/admin/src/Model/Joomla_pluginModel.php index d421704f0..f61a2c306 100644 --- a/admin/src/Model/Joomla_pluginModel.php +++ b/admin/src/Model/Joomla_pluginModel.php @@ -186,10 +186,18 @@ class Joomla_pluginModel extends AdminModel /** - * get VDM internal session key + * Retrieves or generates a Vast Development Method (VDM) key for the current item. * - * @return string the session key + * This function performs the following operations: + * 1. Checks if the VDM key is already set. If not, it proceeds to generate or retrieve one. + * 2. Determines the item ID based on the presence of a specific argument. + * 3. Attempts to retrieve an existing VDM key from a helper method using the item ID. + * 4. If a VDM key is not found, it generates a new random VDM key. + * 5. Stores the VDM key and associates it with the item ID in a helper method. + * 6. Optionally, stores return and GUID values if available. + * 7. Returns the VDM key. * + * @return string The VDM key for the current item. */ public function getVDM() { diff --git a/admin/src/Model/Language_translationModel.php b/admin/src/Model/Language_translationModel.php index 2b2b33c40..9c610d9cb 100644 --- a/admin/src/Model/Language_translationModel.php +++ b/admin/src/Model/Language_translationModel.php @@ -119,10 +119,18 @@ class Language_translationModel extends AdminModel /** - * get VDM internal session key + * Retrieves or generates a Vast Development Method (VDM) key for the current item. * - * @return string the session key + * This function performs the following operations: + * 1. Checks if the VDM key is already set. If not, it proceeds to generate or retrieve one. + * 2. Determines the item ID based on the presence of a specific argument. + * 3. Attempts to retrieve an existing VDM key from a helper method using the item ID. + * 4. If a VDM key is not found, it generates a new random VDM key. + * 5. Stores the VDM key and associates it with the item ID in a helper method. + * 6. Optionally, stores return and GUID values if available. + * 7. Returns the VDM key. * + * @return string The VDM key for the current item. */ public function getVDM() { diff --git a/admin/src/Model/LayoutModel.php b/admin/src/Model/LayoutModel.php index 0806e78a9..36e6f6bcd 100644 --- a/admin/src/Model/LayoutModel.php +++ b/admin/src/Model/LayoutModel.php @@ -141,10 +141,18 @@ class LayoutModel extends AdminModel /** - * get VDM internal session key + * Retrieves or generates a Vast Development Method (VDM) key for the current item. * - * @return string the session key + * This function performs the following operations: + * 1. Checks if the VDM key is already set. If not, it proceeds to generate or retrieve one. + * 2. Determines the item ID based on the presence of a specific argument. + * 3. Attempts to retrieve an existing VDM key from a helper method using the item ID. + * 4. If a VDM key is not found, it generates a new random VDM key. + * 5. Stores the VDM key and associates it with the item ID in a helper method. + * 6. Optionally, stores return and GUID values if available. + * 7. Returns the VDM key. * + * @return string The VDM key for the current item. */ public function getVDM() { diff --git a/admin/src/Model/LibraryModel.php b/admin/src/Model/LibraryModel.php index abfa27bb1..d897c9621 100644 --- a/admin/src/Model/LibraryModel.php +++ b/admin/src/Model/LibraryModel.php @@ -157,10 +157,18 @@ class LibraryModel extends AdminModel /** - * get VDM internal session key + * Retrieves or generates a Vast Development Method (VDM) key for the current item. * - * @return string the session key + * This function performs the following operations: + * 1. Checks if the VDM key is already set. If not, it proceeds to generate or retrieve one. + * 2. Determines the item ID based on the presence of a specific argument. + * 3. Attempts to retrieve an existing VDM key from a helper method using the item ID. + * 4. If a VDM key is not found, it generates a new random VDM key. + * 5. Stores the VDM key and associates it with the item ID in a helper method. + * 6. Optionally, stores return and GUID values if available. + * 7. Returns the VDM key. * + * @return string The VDM key for the current item. */ public function getVDM() { diff --git a/admin/src/Model/PlaceholderModel.php b/admin/src/Model/PlaceholderModel.php index 7935aa1da..d0f0eaac8 100644 --- a/admin/src/Model/PlaceholderModel.php +++ b/admin/src/Model/PlaceholderModel.php @@ -121,10 +121,18 @@ class PlaceholderModel extends AdminModel /** - * get VDM internal session key + * Retrieves or generates a Vast Development Method (VDM) key for the current item. * - * @return string the session key + * This function performs the following operations: + * 1. Checks if the VDM key is already set. If not, it proceeds to generate or retrieve one. + * 2. Determines the item ID based on the presence of a specific argument. + * 3. Attempts to retrieve an existing VDM key from a helper method using the item ID. + * 4. If a VDM key is not found, it generates a new random VDM key. + * 5. Stores the VDM key and associates it with the item ID in a helper method. + * 6. Optionally, stores return and GUID values if available. + * 7. Returns the VDM key. * + * @return string The VDM key for the current item. */ public function getVDM() { diff --git a/admin/src/Model/PowerModel.php b/admin/src/Model/PowerModel.php index 63b4e1357..6770eaded 100644 --- a/admin/src/Model/PowerModel.php +++ b/admin/src/Model/PowerModel.php @@ -167,10 +167,18 @@ class PowerModel extends AdminModel /** - * get VDM internal session key + * Retrieves or generates a Vast Development Method (VDM) key for the current item. * - * @return string the session key + * This function performs the following operations: + * 1. Checks if the VDM key is already set. If not, it proceeds to generate or retrieve one. + * 2. Determines the item ID based on the presence of a specific argument. + * 3. Attempts to retrieve an existing VDM key from a helper method using the item ID. + * 4. If a VDM key is not found, it generates a new random VDM key. + * 5. Stores the VDM key and associates it with the item ID in a helper method. + * 6. Optionally, stores return and GUID values if available. + * 7. Returns the VDM key. * + * @return string The VDM key for the current item. */ public function getVDM() { diff --git a/admin/src/Model/Site_viewModel.php b/admin/src/Model/Site_viewModel.php index 1d3975efc..dce6b252a 100644 --- a/admin/src/Model/Site_viewModel.php +++ b/admin/src/Model/Site_viewModel.php @@ -188,10 +188,18 @@ class Site_viewModel extends AdminModel /** - * get VDM internal session key + * Retrieves or generates a Vast Development Method (VDM) key for the current item. * - * @return string the session key + * This function performs the following operations: + * 1. Checks if the VDM key is already set. If not, it proceeds to generate or retrieve one. + * 2. Determines the item ID based on the presence of a specific argument. + * 3. Attempts to retrieve an existing VDM key from a helper method using the item ID. + * 4. If a VDM key is not found, it generates a new random VDM key. + * 5. Stores the VDM key and associates it with the item ID in a helper method. + * 6. Optionally, stores return and GUID values if available. + * 7. Returns the VDM key. * + * @return string The VDM key for the current item. */ public function getVDM() { diff --git a/admin/src/Model/TemplateModel.php b/admin/src/Model/TemplateModel.php index 2b508da24..3a77a53c1 100644 --- a/admin/src/Model/TemplateModel.php +++ b/admin/src/Model/TemplateModel.php @@ -141,10 +141,18 @@ class TemplateModel extends AdminModel /** - * get VDM internal session key + * Retrieves or generates a Vast Development Method (VDM) key for the current item. * - * @return string the session key + * This function performs the following operations: + * 1. Checks if the VDM key is already set. If not, it proceeds to generate or retrieve one. + * 2. Determines the item ID based on the presence of a specific argument. + * 3. Attempts to retrieve an existing VDM key from a helper method using the item ID. + * 4. If a VDM key is not found, it generates a new random VDM key. + * 5. Stores the VDM key and associates it with the item ID in a helper method. + * 6. Optionally, stores return and GUID values if available. + * 7. Returns the VDM key. * + * @return string The VDM key for the current item. */ public function getVDM() { diff --git a/admin/src/Model/Validation_ruleModel.php b/admin/src/Model/Validation_ruleModel.php index 068a4f7a8..75ce0428e 100644 --- a/admin/src/Model/Validation_ruleModel.php +++ b/admin/src/Model/Validation_ruleModel.php @@ -124,10 +124,18 @@ class Validation_ruleModel extends AdminModel /** - * get VDM internal session key + * Retrieves or generates a Vast Development Method (VDM) key for the current item. * - * @return string the session key + * This function performs the following operations: + * 1. Checks if the VDM key is already set. If not, it proceeds to generate or retrieve one. + * 2. Determines the item ID based on the presence of a specific argument. + * 3. Attempts to retrieve an existing VDM key from a helper method using the item ID. + * 4. If a VDM key is not found, it generates a new random VDM key. + * 5. Stores the VDM key and associates it with the item ID in a helper method. + * 6. Optionally, stores return and GUID values if available. + * 7. Returns the VDM key. * + * @return string The VDM key for the current item. */ public function getVDM() { diff --git a/admin/src/View/Joomla_power/HtmlView.php b/admin/src/View/Joomla_power/HtmlView.php index e10455238..49a7b5480 100644 --- a/admin/src/View/Joomla_power/HtmlView.php +++ b/admin/src/View/Joomla_power/HtmlView.php @@ -177,6 +177,11 @@ class HtmlView extends BaseHtmlView // add Reset button. ToolbarHelper::custom('joomla_power.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false); } + if ($this->canDo->get('joomla_power.push')) + { + // add Push button. + ToolbarHelper::custom('joomla_power.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false); + } ToolbarHelper::cancel('joomla_power.cancel', 'JTOOLBAR_CLOSE'); } } diff --git a/admin/src/View/Joomla_powers/HtmlView.php b/admin/src/View/Joomla_powers/HtmlView.php index 3e9bebd3a..819e74528 100644 --- a/admin/src/View/Joomla_powers/HtmlView.php +++ b/admin/src/View/Joomla_powers/HtmlView.php @@ -151,6 +151,11 @@ class HtmlView extends BaseHtmlView // add Reset button. ToolbarHelper::custom('joomla_powers.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false); } + if ($this->user->authorise('joomla_power.push', 'com_componentbuilder')) + { + // add Push button. + ToolbarHelper::custom('joomla_powers.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false); + } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('joomla_powers'); diff --git a/componentbuilder.xml b/componentbuilder.xml index 1803bcac9..2751359fc 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,15 +1,15 @@The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time.
diff --git a/componentbuilder_update_server.xml b/componentbuilder_update_server.xml
index 72d52ba2c..a97f07fe4 100644
--- a/componentbuilder_update_server.xml
+++ b/componentbuilder_update_server.xml
@@ -44,7 +44,7 @@