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:
parent
3514f29bda
commit
0af518e0f3
@ -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)
|
||||||
|
@ -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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user