32
1
mirror of https://github.com/joomla-extensions/weblinks.git synced 2025-01-29 15:28:27 +00:00

JArrayHelper => ArrayHelper (#221)

* cs and arrayhelper

* cs and arrayhelper
This commit is contained in:
zero-24 2016-06-25 23:23:16 +02:00 committed by Chris Davenport
parent 3514f29bda
commit 0af518e0f3
3 changed files with 23 additions and 22 deletions

View File

@ -9,6 +9,8 @@
defined('_JEXEC') or die; defined('_JEXEC') or die;
use Joomla\Utilities\ArrayHelper;
/** /**
* Weblink controller class. * Weblink controller class.
* *
@ -27,14 +29,13 @@ class WeblinksControllerWeblink extends JControllerForm
*/ */
protected function allowAdd($data = array()) protected function allowAdd($data = array())
{ {
$user = JFactory::getUser(); $categoryId = ArrayHelper::getValue($data, 'catid', $this->input->getInt('filter_category_id'), 'int');
$categoryId = JArrayHelper::getValue($data, 'catid', $this->input->getInt('filter_category_id'), 'int');
$allow = null; $allow = null;
if ($categoryId) if ($categoryId)
{ {
// If the category has been passed in the URL check it. // 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) if ($allow !== null)

View File

@ -9,6 +9,8 @@
defined('_JEXEC') or die; defined('_JEXEC') or die;
use Joomla\Utilities\ArrayHelper;
JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . '/tables'); JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . '/tables');
/** /**
@ -80,7 +82,7 @@ class WeblinksModelWeblink extends JModelItem
// Convert the JTable to a clean JObject. // Convert the JTable to a clean JObject.
$properties = $table->getProperties(1); $properties = $table->getProperties(1);
$this->_item = JArrayHelper::toObject($properties, 'JObject'); $this->_item = ArrayHelper::toObject($properties, 'JObject');
} }
elseif ($error = $table->getError()) elseif ($error = $table->getError())
{ {
@ -121,8 +123,6 @@ class WeblinksModelWeblink extends JModelItem
$id = $this->getState('weblink.id'); $id = $this->getState('weblink.id');
} }
$weblink = $this->getTable('Weblink', 'WeblinksTable'); return $this->getTable('Weblink', 'WeblinksTable')->hit($id);
return $weblink->hit($id);
} }
} }