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:
@ -123,6 +123,84 @@ class Admin_viewController extends FormController
|
||||
}
|
||||
|
||||
return parent::edit($key, $urlVar);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the specified Admin View.
|
||||
*
|
||||
* 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 Admin View.
|
||||
* 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 Admin View.
|
||||
* 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
|
||||
Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
|
||||
|
||||
// get Item posted
|
||||
$item = $this->input->post->get('jform', array(), 'array');
|
||||
|
||||
// load the ID
|
||||
$id = $item['id'] ?? null;
|
||||
|
||||
// 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_VIEW_WITHIN_THIS_JCB_INSTANCE') . '</p>';
|
||||
|
||||
// set redirect
|
||||
$redirect_url = Route::_(
|
||||
'index.php?option=com_componentbuilder&view=admin_view'
|
||||
. $this->getRedirectToItemAppend($id), false
|
||||
);
|
||||
$this->setRedirect($redirect_url, $message, 'success');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pushes the specified Admin View.
|
||||
*
|
||||
* 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 Admin View.
|
||||
* 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 Admin View.
|
||||
* 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');
|
||||
|
||||
// load the ID
|
||||
$id = $item['id'] ?? null;
|
||||
|
||||
// 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_VIEW_FROM_THIS_JCB_INSTANCE_TO_YOUR_CONFIGURED_REPOSITORIES') . '</p>';
|
||||
|
||||
// set redirect
|
||||
$redirect_url = Route::_(
|
||||
'index.php?option=com_componentbuilder&view=admin_view'
|
||||
. $this->getRedirectToItemAppend($id), false
|
||||
);
|
||||
$this->setRedirect($redirect_url, $message, 'success');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user