diff --git a/php/db.php b/php/db.php index bbd3e27f..30e1461e 100644 --- a/php/db.php +++ b/php/db.php @@ -130,7 +130,6 @@ class Db { } # TODO once tested $values can have a default value of an empty array - # TODO both selects were assoc function select($sql, $values, $single = false){ try { $query = $this->_pdo->prepare($sql); @@ -173,7 +172,7 @@ class Db { $i++; } $query->execute(); - $query->commit(); + $this->_pdo->commit(); } catch(PDOException $e) { return array('error'=>true,'info'=>$e->getMessage()); } @@ -194,7 +193,7 @@ class Db { } $query->execute(); $rowCount=$query->rowCount(); - $query->commit(); + $this->_pdo->commit(); } catch(PDOException $e) { return false;//$e->getMessage(); } diff --git a/php/locale.php b/php/locale.php index 161ab080..cbaabcc4 100644 --- a/php/locale.php +++ b/php/locale.php @@ -1,14 +1,14 @@ language=$_COOKIE['lang']; - (!array_key_exists($this->language, Config::languages)) $this->language='en'; + (isset($_COOKIE['lang'])) AND $this->language=$_COOKIE['lang']; + (!array_key_exists($this->language, Config::$languages)) AND $this->language='en'; include($realpath_public.'/lang/'.$this->language.'.php'); $this->translate_arr=$lang; } @@ -20,7 +20,7 @@ class Locale() public function get_available_languages() { - return Config::languages; + return Config::$languages; } public function translate($phrase) diff --git a/php/menu.php b/php/menu.php index d623ffb1..3b99b655 100644 --- a/php/menu.php +++ b/php/menu.php @@ -36,7 +36,7 @@ class Menu { $realpath_public=$_REALPATH.'/public/'; # /usr/home/web/cp/clonos/public/ $lang = new Locale($realpath_public); - $menu_config = Config::menu; + $menu_config = Config::$menu; if(!empty($menu_config)){ reset($menu_config); $this->first_key=key($menu_config); @@ -95,7 +95,7 @@ class Menu $this->html.=''; if($this->title=='Error'){ - $other_titles = Config::other_titles; + $other_titles = Config::$other_titles; if(isset($other_titles[$qstr])) $this->title=$lang->translate($other_titles[$qstr]); } diff --git a/php/utils.php b/php/utils.php index 70d1d918..0b7608df 100644 --- a/php/utils.php +++ b/php/utils.php @@ -2,7 +2,7 @@ class Utils { - public static gen_uri_chunks($uri) + public static function gen_uri_chunks($uri) { $uri_chunks = []; if(!empty($uri)){ diff --git a/public/index.php b/public/index.php index d02ca98e..10f94f1d 100644 --- a/public/index.php +++ b/public/index.php @@ -10,7 +10,7 @@ $uri=trim($_SERVER['REQUEST_URI'],'/'); include($_REALPATH.'/php/clonos.php'); include($_REALPATH.'/php/menu.php'); $clonos=new ClonOS($_REALPATH,$uri); -$menu=new Menu($this, $uri); +$menu=new Menu($_REALPATH, $uri); $realpath_public=$_REALPATH.'/public/'; # /usr/home/web/cp/clonos/public/ $locale = new Locale($realpath_public); //echo json_encode($clonos->config->os_types);exit;