From dd3de94b17b1c984b79d8c6e63c3ecdcc0d8b4d1 Mon Sep 17 00:00:00 2001 From: Tuan Pham Ngoc Date: Mon, 18 Jun 2018 17:47:41 +0700 Subject: [PATCH] Fix show IP column --- .../com_actionlogs/views/actionlogs/tmpl/default.php | 4 ++-- .../com_actionlogs/views/actionlogs/view.html.php | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/administrator/components/com_actionlogs/views/actionlogs/tmpl/default.php b/administrator/components/com_actionlogs/views/actionlogs/tmpl/default.php index 57e6e067fa9b9..432e207ee4c23 100644 --- a/administrator/components/com_actionlogs/views/actionlogs/tmpl/default.php +++ b/administrator/components/com_actionlogs/views/actionlogs/tmpl/default.php @@ -62,7 +62,7 @@ - ip) : ?> + showIpColumn) : ?> @@ -96,7 +96,7 @@ name; ?> - ip) : ?> + showIpColumn) : ?> escape($item->ip_address)); ?> diff --git a/administrator/components/com_actionlogs/views/actionlogs/view.html.php b/administrator/components/com_actionlogs/views/actionlogs/view.html.php index 4d0a24ae8d315..edd34548b4a35 100644 --- a/administrator/components/com_actionlogs/views/actionlogs/view.html.php +++ b/administrator/components/com_actionlogs/views/actionlogs/view.html.php @@ -9,6 +9,7 @@ defined('_JEXEC') or die; +use Joomla\CMS\Component\ComponentHelper; use Joomla\Registry\Registry; use Joomla\CMS\Plugin\PluginHelper; @@ -66,17 +67,14 @@ class ActionlogsViewActionlogs extends JViewLegacy */ public function display($tpl = null) { - if (PluginHelper::isEnabled('system', 'actionlogs')) - { - $params = new Registry(PluginHelper::getPlugin('system', 'actionlogs')->params); - $this->ip = (bool) $params->get('ip_logging', 0); - } + $params = ComponentHelper::getParams('com_actionlogs'); $this->items = $this->get('Items'); $this->state = $this->get('State'); $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); $this->pagination = $this->get('Pagination'); + $this->showIpColumn = (bool) $params->get('ip_logging', 0); if (count($errors = $this->get('Errors'))) {