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