瀏覽代碼

Change the code in the menu to return immediately if the database object is not ready in this case its not ready until the install.php is finished.

markjcrane 9 年之前
父節點
當前提交
68bd19f6f6
共有 2 個文件被更改,包括 10 次插入15 次删除
  1. 0 3
      core/install/install.php
  2. 10 12
      resources/classes/menu.php

+ 0 - 3
core/install/install.php

@@ -204,9 +204,6 @@
 		include "resources/page_parts/install_select_language.php";
 		include "resources/page_parts/install_select_language.php";
 		echo "	<input type='hidden' name='return_install_step' value='select_language'/>\n";
 		echo "	<input type='hidden' name='return_install_step' value='select_language'/>\n";
 		echo "	<input type='hidden' name='install_step' value='detect_config'/>\n";
 		echo "	<input type='hidden' name='install_step' value='detect_config'/>\n";
-		echo "	<div style='text-align:right'>\n";
-		echo "    <input type='submit' class='btn' id='next' value='".$text['button-next']."'>\n";
-		echo "	</div>\n";
 		echo "</form>\n";
 		echo "</form>\n";
 	} elseif($install_step == 'detect_config'){
 	} elseif($install_step == 'detect_config'){
 		if(!($event_host == '' || $event_host == 'localhost' || $event_host == '::1' || $event_host == '127.0.0.1' )){
 		if(!($event_host == '' || $event_host == 'localhost' || $event_host == '::1' || $event_host == '127.0.0.1' )){

+ 10 - 12
resources/classes/menu.php

@@ -386,12 +386,11 @@
 		//create the menu array
 		//create the menu array
 			function menu_array($sql, $menu_item_level) {
 			function menu_array($sql, $menu_item_level) {
 
 
-				//get the database connnection return immediately if it doesn't exist
-					if ($this->db) {
-						$db = $this->db;
-					}else {
-						return;
-					}
+				//get the database connnection
+					$db = $this->db;
+
+				//database ojbect does not exist return immediately
+					if (!$db) { return; }
 
 
 				//if there are no groups then set the public group
 				//if there are no groups then set the public group
 					if (!isset($_SESSION['groups'])) {
 					if (!isset($_SESSION['groups'])) {
@@ -460,12 +459,11 @@
 		//create the sub menus
 		//create the sub menus
 			function menu_child_array($menu_item_level, $menu_item_uuid) {
 			function menu_child_array($menu_item_level, $menu_item_uuid) {
 
 
-				//get the database connnection return immediately if it doesn't exist
-					if ($this->db) {
-						$db = $this->db;
-					}else {
-						return;
-					}
+				//get the database connnection
+					$db = $this->db;
+
+				//database ojbect does not exist return immediately
+					if (!$db) { return; }
 
 
 				//set the level
 				//set the level
 					$menu_item_level = $menu_item_level+1;
 					$menu_item_level = $menu_item_level+1;