|
10 | 10 | defined('PH7') or exit('Restricted access'); |
11 | 11 |
|
12 | 12 | /** |
13 | | - * @desc Get Browser User Language. |
| 13 | + * @desc Gets Browser User Language. |
14 | 14 | * @return string The first two lowercase letter of the browser language. |
15 | 15 | */ |
16 | 16 | function get_browser_lang() { |
@@ -44,12 +44,32 @@ function parse_var($sContent) { |
44 | 44 | $sContent = str_replace('{site_url}', RELATIVE, $sContent); |
45 | 45 | $sContent = str_replace('{static_url}', STATIC_URL, $sContent); |
46 | 46 | $sContent = str_replace('{tpl_name}', TPL, $sContent); |
| 47 | + $sContent = str_replace('{site_name}', SITE_NAME, $sContent); |
| 48 | + $sContent = str_replace('{page_name}', get_page_name(), $sContent); |
47 | 49 | $sContent = str_replace('{menu_links}', get_links_html(), $sContent); |
48 | 50 | $sContent = str_replace('{menu_langs}', get_langs_html(), $sContent); |
49 | 51 |
|
50 | 52 | return $sContent; |
51 | 53 | } |
52 | 54 |
|
| 55 | +/** |
| 56 | + * @desc Gets the page name. |
| 57 | + * @return string |
| 58 | + */ |
| 59 | +function get_page_name() { |
| 60 | + if(empty($_GET['p'])) |
| 61 | + { |
| 62 | + $sName = SITE_SLOGAN; |
| 63 | + } |
| 64 | + else |
| 65 | + { |
| 66 | + $sPageName = str_replace(array('-','_'), '', $_GET['p']); |
| 67 | + $sName = ucfirst($sPageName); |
| 68 | + } |
| 69 | + |
| 70 | + return $sName; |
| 71 | +} |
| 72 | + |
53 | 73 | /** |
54 | 74 | * @see set_lang() |
55 | 75 | * @return string The language available. |
|
0 commit comments