1: <?php
2: /**
3: *
4: * @package Legacy
5: * @version $Id
6: * @copyright Copyright 2005-2007 XOOPS Cube Project <https://github.com/xoopscube/legacy>
7: * @license https://github.com/xoopscube/legacy/blob/master/docs/GPL_V2.txt GNU GENERAL PUBLIC LICENSE Version 2
8: *
9: */
10:
11: /*
12: * Smarty plugin
13: * -------------------------------------------------------------
14: * Type: function
15: * Name: xoops_cooluri
16: * Version: 1.0
17: * Date: May 1, 2010
18: * Author: kilica
19: * Purpose: create uri
20: * Input: string dirname *required
21: * string dataname
22: * int data_id
23: * string action
24: * string query
25: *
26: * Examples: {xoops_cooluri dirname=lenews dataname=story data_id=6 action=edit query='cat_id=3&mode=admin'}
27: * -------------------------------------------------------------
28: */
29:
30: function smarty_function_xoops_cooluri($params, &$smarty)
31: {
32: if(! $params['dirname']) return;
33: $dirname = $params['dirname'];
34: $dataname = isset($params['dataname']) ? $params['dataname'] : null;
35: $dataId = isset($params['data_id']) ? $params['data_id'] : 0;
36: $action = isset($params['action']) ? $params['action'] : null;
37: $query = isset($params['query']) ? $params['query'] : null;
38:
39: echo htmlspecialchars(Legacy_Utils::renderUri($dirname, $dataname, $dataId, $action, $query), ENT_QUOTES);
40: }
41:
42: ?>
43: