diff --git a/core/menu/menu_restore_default.php b/core/menu/menu_restore_default.php index dadcf5c089..fcd7342810 100644 --- a/core/menu/menu_restore_default.php +++ b/core/menu/menu_restore_default.php @@ -25,26 +25,32 @@ */ //check permissions - include "root.php"; - require_once "resources/require.php"; - require_once "resources/check_auth.php"; - if (permission_exists('menu_restore')) { - //access granted - } - else { - echo "access denied"; - return; + if (!$included) { + include "root.php"; + require_once "resources/require.php"; + require_once "resources/check_auth.php"; + if (permission_exists('menu_restore')) { + //access granted + } + else { + echo "access denied"; + return; + } } //add multi-lingual support - require_once "app_languages.php"; - foreach($text as $key => $value) { - $text[$key] = $value[$_SESSION['domain']['language']['code']]; + if (!$included) { + require_once "app_languages.php"; + foreach($text as $key => $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } } //get the http value and set as a php variable - $menu_uuid = check_str($_REQUEST["menu_uuid"]); - $menu_language = check_str($_REQUEST["menu_language"]); + if (!$included) { + $menu_uuid = check_str($_REQUEST["menu_uuid"]); + $menu_language = check_str($_REQUEST["menu_language"]); + } //menu restore default require_once "resources/classes/menu.php"; @@ -62,9 +68,11 @@ $_SESSION["template_content"] = ''; //redirect - //show a message to the user - $_SESSION["message"] = $text['message-restore']; - header("Location: ".PROJECT_PATH."/core/menu/menu_edit.php?id=".$menu_uuid); - return; + if (!$included) { + //show a message to the user + $_SESSION["message"] = $text['message-restore']; + header("Location: ".PROJECT_PATH."/core/menu/menu_edit.php?id=".$menu_uuid); + return; + } ?> \ No newline at end of file