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:
2024-03-02 22:10:30 +02:00
parent 3c91a5cdbb
commit d1e1a56671
1786 changed files with 73608 additions and 37437 deletions

View File

@ -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;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
@ -38,13 +44,13 @@ class ComponentbuilderControllerJoomla_module_updates extends FormController
*
* @since 1.6
*/
public function __construct($config = array())
public function __construct($config = [])
{
$this->view_list = 'Joomla_modules_updates'; // 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.
@ -53,10 +59,10 @@ class ComponentbuilderControllerJoomla_module_updates 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('joomla_module_updates.access', 'com_componentbuilder');
if (!$access)
@ -78,10 +84,10 @@ class ComponentbuilderControllerJoomla_module_updates 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;
@ -152,12 +158,12 @@ class ComponentbuilderControllerJoomla_module_updates 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;
@ -174,13 +180,13 @@ class ComponentbuilderControllerJoomla_module_updates 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('Joomla_module_updates', '', array());
$model = $this->getModel('Joomla_module_updates', '', []);
// Preset the redirect
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_modules_updates' . $this->getRedirectToListAppend(), false));
$this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_modules_updates' . $this->getRedirectToListAppend(), false));
return parent::batch($model);
}
@ -205,13 +211,13 @@ class ComponentbuilderControllerJoomla_module_updates 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
)
);
@ -222,7 +228,7 @@ class ComponentbuilderControllerJoomla_module_updates extends FormController
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
Route::_(
'index.php?option=' . $this->option . $redirect, false
)
);
@ -233,7 +239,7 @@ class ComponentbuilderControllerJoomla_module_updates extends FormController
// Redirect to the list screen.
$this->setRedirect(
JRoute::_(
Route::_(
'index.php?option=' . $this->option . $redirect, false
)
);
@ -259,7 +265,7 @@ class ComponentbuilderControllerJoomla_module_updates 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)
{
@ -277,29 +283,29 @@ class ComponentbuilderControllerJoomla_module_updates 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
)
);
@ -311,19 +317,19 @@ class ComponentbuilderControllerJoomla_module_updates 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 = [])
{
// update the component version to match the updated last version
if (isset($validData['joomla_plugin']) && is_numeric($validData['joomla_plugin']) && $validData['joomla_plugin'] > 0)
{
$objectUpdate = new stdClass();
$objectUpdate = new \stdClass();
$objectUpdate->id = (int) $validData['joomla_plugin'];
if (isset($validData['version_update']) && UtilitiesArrayHelper::check($validData['version_update'])
&& ($plugin_version = end($validData['version_update'])['version'])
@ -334,11 +340,10 @@ class ComponentbuilderControllerJoomla_module_updates extends FormController
// be sure to update the table if we have a value
if (isset($objectUpdate->plugin_version))
{
JFactory::getDbo()->updateObject('#__componentbuilder_joomla_plugin', $objectUpdate, 'id');
Factory::getDbo()->updateObject('#__componentbuilder_joomla_plugin', $objectUpdate, 'id');
}
}
return;
}
}