Add menu for users to switch their language
[gitphp.git] / include / smartyplugins / function.scripturl.php
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
<?php
/*
 *  function.scripturl.php
 *  gitphp: A PHP git repository browser
 *  Component: Utility - get running script url
 *
 *  Copyright (C) 2009 Christopher Han <xiphux@gmail.com>
 */
 
function smarty_function_scripturl($params, &$smarty)
{
        if (GitPHP_Config::GetInstance()->HasKey('self'))
                return GitPHP_Config::GetInstance()->GetValue('self');
 
        if (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on'))
                $scriptstr = 'https://';
        else
                $scriptstr = 'http://';
 
        $scriptstr .= $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
 
        return $scriptstr;
}
 
?>
 
comments