Upgrade: Restored Menu Defaults functionality.

This commit is contained in:
Nate Jones
2015-01-17 03:27:10 +00:00
parent 4c2225828b
commit 5fe93ad01a
+26 -18
View File
@@ -25,26 +25,32 @@
*/ */
//check permissions //check permissions
include "root.php"; if (!$included) {
require_once "resources/require.php"; include "root.php";
require_once "resources/check_auth.php"; require_once "resources/require.php";
if (permission_exists('menu_restore')) { require_once "resources/check_auth.php";
//access granted if (permission_exists('menu_restore')) {
} //access granted
else { }
echo "access denied"; else {
return; echo "access denied";
return;
}
} }
//add multi-lingual support //add multi-lingual support
require_once "app_languages.php"; if (!$included) {
foreach($text as $key => $value) { require_once "app_languages.php";
$text[$key] = $value[$_SESSION['domain']['language']['code']]; foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
} }
//get the http value and set as a php variable //get the http value and set as a php variable
$menu_uuid = check_str($_REQUEST["menu_uuid"]); if (!$included) {
$menu_language = check_str($_REQUEST["menu_language"]); $menu_uuid = check_str($_REQUEST["menu_uuid"]);
$menu_language = check_str($_REQUEST["menu_language"]);
}
//menu restore default //menu restore default
require_once "resources/classes/menu.php"; require_once "resources/classes/menu.php";
@@ -62,9 +68,11 @@
$_SESSION["template_content"] = ''; $_SESSION["template_content"] = '';
//redirect //redirect
//show a message to the user if (!$included) {
$_SESSION["message"] = $text['message-restore']; //show a message to the user
header("Location: ".PROJECT_PATH."/core/menu/menu_edit.php?id=".$menu_uuid); $_SESSION["message"] = $text['message-restore'];
return; header("Location: ".PROJECT_PATH."/core/menu/menu_edit.php?id=".$menu_uuid);
return;
}
?> ?>