mirror of
https://github.com/optim-enterprises-bv/control-pane.git
synced 2025-10-30 01:22:24 +00:00
* Code cleanup
This commit is contained in:
@@ -94,8 +94,9 @@ class ClonOS {
|
||||
//echo $this->realpath_page;
|
||||
}else if($_SERVER['REQUEST_URI']){
|
||||
//$this->realpath_page=$this->realpath_public.'pages/'.trim($_SERVER['REQUEST_URI'],'/').'/';
|
||||
if(isset($this->uri_chunks[0]))
|
||||
if(isset($this->uri_chunks[0])){
|
||||
$this->realpath_page=$this->realpath_public.'pages/'.$this->uri_chunks[0].'/';
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($this->_vars['hash'])) $this->url_hash=preg_replace('/^#/','',$this->_vars['hash']);
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
class Locale
|
||||
{
|
||||
public $language='en';
|
||||
public $translate_arr=array();
|
||||
private $language='en';
|
||||
private $translate_arr=array();
|
||||
|
||||
function __construct($realpath_public)
|
||||
{
|
||||
@@ -18,14 +18,8 @@ class Locale
|
||||
return $this->language;
|
||||
}
|
||||
|
||||
public function get_available_languages()
|
||||
{
|
||||
return Config::$languages;
|
||||
}
|
||||
|
||||
public function translate($phrase)
|
||||
{
|
||||
if(isset($this->translate_arr[$phrase])) return $this->translate_arr[$phrase];
|
||||
return $phrase;
|
||||
return (isset($this->translate_arr[$phrase])) ? $this->translate_arr[$phrase] : $phrase;
|
||||
}
|
||||
}
|
||||
@@ -165,8 +165,7 @@ echo $menu->html;
|
||||
<li><a name="">
|
||||
<select id="lng-sel">
|
||||
<?php
|
||||
$_languages=$locale->get_available_languages();
|
||||
foreach($_languages as $lng=>$lngname){
|
||||
foreach(Config::$languages as $lng=>$lngname){
|
||||
$sel = ($lang==$lng) ? ' selected="selected"' : '';
|
||||
echo ' <option value="'.$lng.'"'.$sel.'>'.$lngname.'</option>'.PHP_EOL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user