32
1
mirror of https://github.com/joomla-extensions/weblinks.git synced 2024-12-25 01:45:59 +00:00

Show tags in details view

This commit is contained in:
Tuan Pham Ngoc 2021-08-16 12:40:29 +07:00
parent 72c7f9b072
commit 8dff15ff93
2 changed files with 10 additions and 0 deletions

View File

@ -12,6 +12,7 @@ namespace Joomla\Component\Weblinks\Site\Model;
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Helper\TagsHelper;
use Joomla\CMS\Language\Multilanguage;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Model\ItemModel;
@ -163,6 +164,13 @@ class WeblinkModel extends ItemModel
$data->params = new Registry($data->params);
$data->metadata = new Registry($data->metadata);
// Some contexts may not use tags data at all, so we allow callers to disable loading tag data
if ($this->getState('load_tags', true))
{
$data->tags = new TagsHelper;
$data->tags->getItemTags('com_weblinks.weblink', $data->id);
}
// Compute access permissions.
if ($access = $this->getState('filter.access'))
{
@ -185,6 +193,7 @@ class WeblinkModel extends ItemModel
}
}
return $this->_item[$pk];
}

View File

@ -11,6 +11,7 @@ defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\String\PunycodeHelper;
$weblinkUrl = PunycodeHelper::urlToUTF8($this->item->url);