menu_reload.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /*
  3. FusionPBX
  4. Version: MPL 1.1
  5. The contents of this file are subject to the Mozilla Public License Version
  6. 1.1 (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.mozilla.org/MPL/
  9. Software distributed under the License is distributed on an "AS IS" basis,
  10. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11. for the specific language governing rights and limitations under the
  12. License.
  13. The Original Code is FusionPBX
  14. The Initial Developer of the Original Code is
  15. Mark J Crane <[email protected]>
  16. Portions created by the Initial Developer are Copyright (C) 2023
  17. the Initial Developer. All Rights Reserved.
  18. Contributor(s):
  19. Mark J Crane <[email protected]>
  20. */
  21. //includes files
  22. require_once dirname(__DIR__, 2) . "/resources/require.php";
  23. require_once "resources/check_auth.php";
  24. //check permissions
  25. if (permission_exists('menu_add') || permission_exists('menu_edit')) {
  26. //access granted
  27. }
  28. else {
  29. echo "access denied";
  30. return;
  31. }
  32. //add multi-lingual support
  33. $language = new text;
  34. $text = $language->get();
  35. //get the http value and set as a php variable
  36. $menu_uuid = $_REQUEST["menu_uuid"];
  37. //unset the sesssion menu array
  38. unset($_SESSION['menu']['array']);
  39. //get the menu array and save it to the session
  40. $menu = new menu;
  41. $menu->menu_uuid = $_SESSION['domain']['menu']['uuid'];
  42. $_SESSION['menu']['array'] = $menu->menu_array();
  43. unset($menu);
  44. //redirect the user
  45. //message::add($text['message-reload']);
  46. header("Location: ".PROJECT_PATH."/core/menu/menu_edit.php?id=".urlencode($menu_uuid));
  47. return;
  48. ?>