blob: b4bce469342b0f29bf37bf02f877e855ee3e80ca (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
<?php
/**
* Piwik - Open source web analytics
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
* @version $Id$
*
* @package SmartyPlugins
*/
require_once "Url.php";
/**
* Smarty {url} function plugin.
* Generates a piwik URL with the specified parameters modified.
*
* Examples:
* <pre>
* {url module="API"} will rewrite the URL modifying the module GET parameter
* {url module="API" method="getKeywords"} will rewrite the URL modifying the parameters module=API method=getKeywords
* </pre>
*
* @see Piwik_Url::getCurrentQueryStringWithParametersModified()
* @param $name=$value of the parameters to modify in the generated URL
* @return string Something like index.php?module=X&action=Y
*/
function smarty_function_url($params, &$smarty)
{
return Piwik_Url::getCurrentScriptName() . Piwik_Url::getCurrentQueryStringWithParametersModified( $params );
}
|