Эх сурвалжийг харах

Update menu_restore_default.php

FusionPBX 5 жил өмнө
parent
commit
ac0f587aae

+ 9 - 8
core/menu/menu_restore_default.php

@@ -17,7 +17,7 @@
 
 	The Initial Developer of the Original Code is
 	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2014
+	Portions created by the Initial Developer are Copyright (C) 2008-2019
 	the Initial Developer. All Rights Reserved.
 
 	Contributor(s):
@@ -56,19 +56,20 @@
 	$menu->menu_language = $menu_language;
 	$menu->delete();
 	$menu->restore();
+	unset($menu);
 
-//unset the menu session variable
-	$_SESSION["menu"] = "";
-
-//unset the default template
-	$_SESSION["template_content"] = '';
+//get the menu array and save it to the session
+	$menu = new menu;
+	$menu->menu_uuid = $_SESSION['domain']['menu']['uuid'];
+	$_SESSION['menu']['array'] = $menu->menu_array();
+	unset($menu);
 
 //redirect
 	if (!$included) {
 		//show a message to the user
 		message::add($text['message-restore']);
-		header("Location: ".PROJECT_PATH."/core/menu/menu_edit.php?id=".$menu_uuid);
+		header("Location: ".PROJECT_PATH."/core/menu/menu_edit.php?id=".urlencode($menu_uuid));
 		return;
 	}
 
-?>
+?>