mirror of
https://github.com/joomla-extensions/weblinks.git
synced 2024-09-23 02:29:07 +00:00
Improve smart search plugin, make it works in the same way with other core plugins
This commit is contained in:
parent
3f15c60950
commit
53578a124a
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
defined('JPATH_BASE') or die;
|
defined('JPATH_BASE') or die;
|
||||||
|
|
||||||
|
use Joomla\CMS\Categories\Categories;
|
||||||
use Joomla\CMS\Component\ComponentHelper;
|
use Joomla\CMS\Component\ComponentHelper;
|
||||||
use Joomla\Component\Finder\Administrator\Indexer\Adapter;
|
use Joomla\Component\Finder\Administrator\Indexer\Adapter;
|
||||||
use Joomla\Component\Finder\Administrator\Indexer\Helper;
|
use Joomla\Component\Finder\Administrator\Indexer\Helper;
|
||||||
@ -255,13 +256,8 @@ class PlgFinderWeblinks extends Adapter
|
|||||||
$item->setLanguage();
|
$item->setLanguage();
|
||||||
|
|
||||||
// Initialise the item parameters.
|
// Initialise the item parameters.
|
||||||
$registry = new Registry;
|
$item->params = new Registry($item->params);
|
||||||
$registry->loadString($item->params);
|
$item->metadata = new Registry($item->metadata);
|
||||||
$item->params = $registry;
|
|
||||||
|
|
||||||
$registry = new Registry;
|
|
||||||
$registry->loadString($item->metadata);
|
|
||||||
$item->metadata = $registry;
|
|
||||||
|
|
||||||
// Build the necessary route and path information.
|
// Build the necessary route and path information.
|
||||||
$item->url = $this->getURL($item->id, $this->extension, $this->layout);
|
$item->url = $this->getURL($item->id, $this->extension, $this->layout);
|
||||||
@ -289,7 +285,16 @@ class PlgFinderWeblinks extends Adapter
|
|||||||
$item->addTaxonomy('Type', 'Web Link');
|
$item->addTaxonomy('Type', 'Web Link');
|
||||||
|
|
||||||
// Add the category taxonomy data.
|
// Add the category taxonomy data.
|
||||||
$item->addTaxonomy('Category', $item->category, $this->translateState($item->cat_state), $item->cat_access);
|
$categories = Categories::getInstance('com_weblinks', ['published' => false, 'access' => false]);
|
||||||
|
$category = $categories->get($item->catid);
|
||||||
|
|
||||||
|
// Category does not exist, stop here
|
||||||
|
if (!$category)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$item->addNestedTaxonomy('Category', $category, $this->translateState($category->published), $category->access, $category->language);
|
||||||
|
|
||||||
// Add the language taxonomy data.
|
// Add the language taxonomy data.
|
||||||
$item->addTaxonomy('Language', $item->language);
|
$item->addTaxonomy('Language', $item->language);
|
||||||
|
Loading…
Reference in New Issue
Block a user