1<?php
2// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project
3//
4// All Rights Reserved. See copyright.txt for details and a complete list of authors.
5// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
6// $Id$
7
8class Search_GlobalSource_UrlSource implements Search_GlobalSource_Interface
9{
10	function __construct()
11	{
12		$smarty = TikiLib::lib('smarty');
13		$smarty->loadPlugin('smarty_modifier_sefurl');
14	}
15
16	function getData($objectType, $objectId, Search_Type_Factory_Interface $typeFactory, array $data = [])
17	{
18		if (isset($data['url'])) {
19			return false;
20		}
21
22		$url = smarty_modifier_sefurl($objectId, $objectType);
23		return [
24			'url' => $typeFactory->identifier($url),
25		];
26	}
27
28	function getProvidedFields()
29	{
30		return [
31			'url',
32		];
33	}
34
35	function getGlobalFields()
36	{
37		return [
38		];
39	}
40}
41