Changed JArrayHelper to use ArrayHelper and added the use namespace to the files needed. Changed JString to use StringHelper and added the use namespace to the files needed. Fixed the spelling mistake of uniqe. Made changes to compiler to accomidate the new pro member feature that added viewsDefaultOrdering options. Fixed the moving of custom fields found in subforms of a plugin or module. Improved the sorting options to correctly map for custom fields and the category field.

This commit is contained in:
2020-05-22 01:38:20 +02:00
parent f314464575
commit 2564b75e5d
236 changed files with 2041 additions and 1594 deletions

View File

@ -18,6 +18,8 @@ defined('_JEXEC') or die('Restricted access');
defined('_JEXEC') or die('Restricted access');
use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;
/**
* ###Component### ###View### Model
@ -303,7 +305,7 @@ class ###Component###Model###View### extends JModelAdmin
{
// Sanitize ids.
$pks = array_unique($pks);
JArrayHelper::toInteger($pks);
ArrayHelper::toInteger($pks);
// Remove any values of zero.
if (array_search(0, $pks, true))
@ -344,7 +346,7 @@ class ###Component###Model###View### extends JModelAdmin
if (!empty($commands['move_copy']))
{
$cmd = JArrayHelper::getValue($commands, 'move_copy', 'c');
$cmd = ArrayHelper::getValue($commands, 'move_copy', 'c');
if ($cmd == 'c')
{
@ -424,7 +426,7 @@ class ###Component###Model###View### extends JModelAdmin
}
/**
* Method to generate a uniqe value.
* Method to generate a unique value.
*
* @param string $field name.
* @param string $value data.
@ -433,15 +435,15 @@ class ###Component###Model###View### extends JModelAdmin
*
* @since 3.0
*/
protected function generateUniqe($field,$value)
protected function generateUnique($field,$value)
{
// set field value uniqe
// set field value unique
$table = $this->getTable();
while ($table->load(array($field => $value)))
{
$value = JString::increment($value);
$value = StringHelper::increment($value);
}
return $value;

View File

@ -18,6 +18,8 @@ defined('_JEXEC') or die('Restricted access');
defined('_JEXEC') or die('Restricted access');
use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;
/**
* ###Component### ###View### Model
@ -303,7 +305,7 @@ class ###Component###Model###View### extends JModelAdmin
{
// Sanitize ids.
$pks = array_unique($pks);
JArrayHelper::toInteger($pks);
ArrayHelper::toInteger($pks);
// Remove any values of zero.
if (array_search(0, $pks, true))
@ -344,7 +346,7 @@ class ###Component###Model###View### extends JModelAdmin
if (!empty($commands['move_copy']))
{
$cmd = JArrayHelper::getValue($commands, 'move_copy', 'c');
$cmd = ArrayHelper::getValue($commands, 'move_copy', 'c');
if ($cmd == 'c')
{
@ -424,7 +426,7 @@ class ###Component###Model###View### extends JModelAdmin
}
/**
* Method to generate a uniqe value.
* Method to generate a unique value.
*
* @param string $field name.
* @param string $value data.
@ -433,15 +435,15 @@ class ###Component###Model###View### extends JModelAdmin
*
* @since 3.0
*/
protected function generateUniqe($field,$value)
protected function generateUnique($field,$value)
{
// set field value uniqe
// set field value unique
$table = $this->getTable();
while ($table->load(array($field => $value)))
{
$value = JString::increment($value);
$value = StringHelper::increment($value);
}
return $value;

View File

@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\Utilities\ArrayHelper;
/**
* ###Views### Model
*/

View File

@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\Utilities\ArrayHelper;
/**
* ###Component### Ajax Model
*/

View File

@ -17,7 +17,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.helper');
use Joomla\Utilities\ArrayHelper;
/**
* ###Component### Ajax Model

View File

@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\Utilities\ArrayHelper;
/**
* ###Component### Model for ###SViews###
*/

View File

@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\Utilities\ArrayHelper;
/**
* ###Component### Model for ###SViews###
*/