Release of v5.1.1-alpha5

Refactor initialization flow to accommodate future scalability and integration with all designated areas. Refactor the Creator Builders class. Refactor the FieldString and FieldXML classes.
This commit is contained in:
2025-05-13 13:39:32 +00:00
parent 0b7e68d14e
commit 3b502eb09b
336 changed files with 22863 additions and 20677 deletions

View File

@@ -51,4 +51,85 @@ class Admin_viewsController 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.
*/
public function initPowers()
{
// Check for request forgeries
Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
// set default in development message
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_STILL_IN_DEVELOPMENT') . '</h1>';
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_ONCE_COMPLETED_THIS_FEATURE_WILL_ALLOW_YOU_TO_PULL_BOTH_DEMO_AND_USERCREATED_ADMIN_VIEWS_INTO_THIS_JCB_INSTANCE') . '</p>';
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=admin_views', false);
$this->setRedirect($redirect_url, $message, 'success');
return true;
}
/**
* Resets the selected Admin Views.
*
* 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 Admin Views.
* 6. If the user is authorized and powers are selected, it attempts to reset the selected Admin Views.
* 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
Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
// set default in development message
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_STILL_IN_DEVELOPMENT') . '</h1>';
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_ONCE_COMPLETED_THIS_FEATURE_WILL_ALLOW_YOU_TO_RESET_BOTH_DEMO_AND_USERCREATED_ADMIN_VIEWS_WITHIN_THIS_JCB_INSTANCE') . '</p>';
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=admin_views', false);
$this->setRedirect($redirect_url, $message, 'success');
return true;
}
/**
* Pushes the selected Admin Views.
*
* 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 Admin Views.
* 6. If the user is authorized and powers are selected, it attempts to push the selected Admin Views.
* 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'));
// set default in development message
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_STILL_IN_DEVELOPMENT') . '</h1>';
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_ONCE_COMPLETED_THIS_FEATURE_WILL_ALLOW_YOU_TO_PUSH_USERCREATED_ADMIN_VIEWS_FROM_THIS_JCB_INSTANCE_TO_YOUR_CONFIGURED_REPOSITORIES') . '</p>';
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=admin_views', false);
$this->setRedirect($redirect_url, $message, 'success');
return true;
}
}