Stable release of v3.2.0-beta1
Move beta to main repo. Fix #1053 so that the right and left tabs display correctly in Joomla 4&5.
This commit is contained in:
@ -12,8 +12,14 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\MVC\Controller\FormController;
|
||||
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\CMS\Session\Session;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
|
||||
/**
|
||||
* Component_files_folders Form Controller
|
||||
@ -36,13 +42,13 @@ class ComponentbuilderControllerComponent_files_folders extends FormController
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function __construct($config = array())
|
||||
public function __construct($config = [])
|
||||
{
|
||||
$this->view_list = 'Components_files_folders'; // safeguard for setting the return view listing to the main view.
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Method override to check if you can add a new record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
@ -51,10 +57,10 @@ class ComponentbuilderControllerComponent_files_folders extends FormController
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowAdd($data = array())
|
||||
protected function allowAdd($data = [])
|
||||
{
|
||||
// Get user object.
|
||||
$user = JFactory::getUser();
|
||||
$user = Factory::getUser();
|
||||
// Access check.
|
||||
$access = $user->authorise('component_files_folders.access', 'com_componentbuilder');
|
||||
if (!$access)
|
||||
@ -76,10 +82,10 @@ class ComponentbuilderControllerComponent_files_folders extends FormController
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowEdit($data = array(), $key = 'id')
|
||||
protected function allowEdit($data = [], $key = 'id')
|
||||
{
|
||||
// get user object.
|
||||
$user = JFactory::getUser();
|
||||
$user = Factory::getUser();
|
||||
// get record id.
|
||||
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
|
||||
|
||||
@ -150,12 +156,12 @@ class ComponentbuilderControllerComponent_files_folders extends FormController
|
||||
|
||||
// set the referral options
|
||||
if ($refid && $ref)
|
||||
{
|
||||
$append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append;
|
||||
{
|
||||
$append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append;
|
||||
}
|
||||
elseif ($ref)
|
||||
{
|
||||
$append = '&ref='. (string)$ref . $append;
|
||||
$append = '&ref='. (string) $ref . $append;
|
||||
}
|
||||
|
||||
return $append;
|
||||
@ -172,13 +178,13 @@ class ComponentbuilderControllerComponent_files_folders extends FormController
|
||||
*/
|
||||
public function batch($model = null)
|
||||
{
|
||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
||||
Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
|
||||
|
||||
// Set the model
|
||||
$model = $this->getModel('Component_files_folders', '', array());
|
||||
$model = $this->getModel('Component_files_folders', '', []);
|
||||
|
||||
// Preset the redirect
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=components_files_folders' . $this->getRedirectToListAppend(), false));
|
||||
$this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=components_files_folders' . $this->getRedirectToListAppend(), false));
|
||||
|
||||
return parent::batch($model);
|
||||
}
|
||||
@ -203,13 +209,13 @@ class ComponentbuilderControllerComponent_files_folders extends FormController
|
||||
|
||||
$cancel = parent::cancel($key);
|
||||
|
||||
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
|
||||
if (!is_null($return) && Uri::isInternal(base64_decode($return)))
|
||||
{
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
Route::_(
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
@ -220,7 +226,7 @@ class ComponentbuilderControllerComponent_files_folders extends FormController
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
Route::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
@ -231,7 +237,7 @@ class ComponentbuilderControllerComponent_files_folders extends FormController
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
Route::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
@ -257,7 +263,7 @@ class ComponentbuilderControllerComponent_files_folders extends FormController
|
||||
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
$canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return)));
|
||||
$canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return)));
|
||||
|
||||
if ($this->ref || $this->refid || $canReturn)
|
||||
{
|
||||
@ -275,29 +281,29 @@ class ComponentbuilderControllerComponent_files_folders extends FormController
|
||||
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
Route::_(
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
||||
$redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
Route::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref;
|
||||
$redirect = '&view=' . (string) $this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
Route::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
@ -309,16 +315,15 @@ class ComponentbuilderControllerComponent_files_folders extends FormController
|
||||
* Function that allows child controller access to model data
|
||||
* after the data has been saved.
|
||||
*
|
||||
* @param JModel &$model The data model object.
|
||||
* @param array $validData The validated data.
|
||||
* @param BaseDatabaseModel &$model The data model object.
|
||||
* @param array $validData The validated data.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 11.1
|
||||
*/
|
||||
protected function postSaveHook(JModelLegacy $model, $validData = array())
|
||||
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user