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 8function smarty_function_service($params, $smarty) 9{ 10 $servicelib = TikiLib::lib('service'); 11 $smarty->loadPlugin('smarty_modifier_escape'); 12 13 if (! isset($params['controller'])) { 14 return 'missing-controller'; 15 } 16 17 if (isset($params['_params'])) { 18 $params += $params['_params']; 19 unset($params['_params']); 20 } 21 22 $url = $servicelib->getUrl($params); 23 return smarty_modifier_escape($url); 24} 25