mirror of
https://github.com/joomla-extensions/weblinks.git
synced 2025-01-27 06:18:29 +00:00
JArrayHelper => ArrayHelper (#221)
* cs and arrayhelper * cs and arrayhelper
This commit is contained in:
parent
3514f29bda
commit
0af518e0f3
@ -9,6 +9,8 @@
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Weblink controller class.
|
||||
*
|
||||
@ -27,14 +29,13 @@ class WeblinksControllerWeblink extends JControllerForm
|
||||
*/
|
||||
protected function allowAdd($data = array())
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
$categoryId = JArrayHelper::getValue($data, 'catid', $this->input->getInt('filter_category_id'), 'int');
|
||||
$categoryId = ArrayHelper::getValue($data, 'catid', $this->input->getInt('filter_category_id'), 'int');
|
||||
$allow = null;
|
||||
|
||||
if ($categoryId)
|
||||
{
|
||||
// If the category has been passed in the URL check it.
|
||||
$allow = $user->authorise('core.create', $this->option . '.category.' . $categoryId);
|
||||
$allow = JFactory::getUser()->authorise('core.create', $this->option . '.category.' . $categoryId);
|
||||
}
|
||||
|
||||
if ($allow !== null)
|
||||
@ -104,9 +105,9 @@ class WeblinksControllerWeblink extends JControllerForm
|
||||
* @param JModelLegacy $model The data model object.
|
||||
* @param array $validData The validated data.
|
||||
*
|
||||
* @return void
|
||||
* @return void
|
||||
*
|
||||
* @since 1.6
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function postSaveHook(JModelLegacy $model, $validData = array())
|
||||
{
|
||||
|
@ -69,7 +69,7 @@ class WeblinksControllerWeblink extends JControllerForm
|
||||
*/
|
||||
protected function allowAdd($data = array())
|
||||
{
|
||||
$categoryId = ArrayHelper::getValue($data, 'catid', $this->input->getInt('id'), 'int');
|
||||
$categoryId = ArrayHelper::getValue($data, 'catid', $this->input->getInt('id'), 'int');
|
||||
$allow = null;
|
||||
|
||||
if ($categoryId)
|
||||
@ -180,8 +180,8 @@ class WeblinksControllerWeblink extends JControllerForm
|
||||
protected function getRedirectToItemAppend($recordId = null, $urlVar = null)
|
||||
{
|
||||
$append = parent::getRedirectToItemAppend($recordId, $urlVar);
|
||||
$itemId = $this->input->getInt('Itemid');
|
||||
$return = $this->getReturnPage();
|
||||
$itemId = $this->input->getInt('Itemid');
|
||||
$return = $this->getReturnPage();
|
||||
|
||||
if ($itemId)
|
||||
{
|
||||
@ -264,7 +264,7 @@ class WeblinksControllerWeblink extends JControllerForm
|
||||
}
|
||||
|
||||
// Check whether item access level allows access.
|
||||
$groups = JFactory::getUser()->getAuthorisedViewLevels();
|
||||
$groups = JFactory::getUser()->getAuthorisedViewLevels();
|
||||
|
||||
if (!in_array($link->access, $groups))
|
||||
{
|
||||
|
@ -9,6 +9,8 @@
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . '/tables');
|
||||
|
||||
/**
|
||||
@ -34,11 +36,11 @@ class WeblinksModelWeblink extends JModelItem
|
||||
*/
|
||||
protected function populateState()
|
||||
{
|
||||
$app = JFactory::getApplication();
|
||||
$params = $app->getParams();
|
||||
$app = JFactory::getApplication();
|
||||
$params = $app->getParams();
|
||||
|
||||
// Load the object state.
|
||||
$id = $app->input->getInt('id');
|
||||
$id = $app->input->getInt('id');
|
||||
$this->setState('weblink.id', $id);
|
||||
|
||||
// Load the parameters.
|
||||
@ -79,8 +81,8 @@ class WeblinksModelWeblink extends JModelItem
|
||||
}
|
||||
|
||||
// Convert the JTable to a clean JObject.
|
||||
$properties = $table->getProperties(1);
|
||||
$this->_item = JArrayHelper::toObject($properties, 'JObject');
|
||||
$properties = $table->getProperties(1);
|
||||
$this->_item = ArrayHelper::toObject($properties, 'JObject');
|
||||
}
|
||||
elseif ($error = $table->getError())
|
||||
{
|
||||
@ -94,13 +96,13 @@ class WeblinksModelWeblink extends JModelItem
|
||||
/**
|
||||
* Returns a reference to the a Table object, always creating it.
|
||||
*
|
||||
* @param type The table type to instantiate
|
||||
* @param string A prefix for the table class name. Optional.
|
||||
* @param array Configuration array for model. Optional.
|
||||
* @param type The table type to instantiate
|
||||
* @param string A prefix for the table class name. Optional.
|
||||
* @param array Configuration array for model. Optional.
|
||||
*
|
||||
* @return JTable A database object
|
||||
* @return JTable A database object
|
||||
*
|
||||
* @since 1.6
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getTable($type = 'Weblink', $prefix = 'WeblinksTable', $config = array())
|
||||
{
|
||||
@ -121,8 +123,6 @@ class WeblinksModelWeblink extends JModelItem
|
||||
$id = $this->getState('weblink.id');
|
||||
}
|
||||
|
||||
$weblink = $this->getTable('Weblink', 'WeblinksTable');
|
||||
|
||||
return $weblink->hit($id);
|
||||
return $this->getTable('Weblink', 'WeblinksTable')->hit($id);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user