other.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <?php
  2. /* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. */
  17. /**
  18. * \file htdocs/admin/menus/other.php
  19. * \ingroup core
  20. * \brief Menus options setup
  21. */
  22. require '../../main.inc.php';
  23. require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
  24. // Load translation files required by the page
  25. $langs->loadLangs(array("user", "other", "admin"));
  26. if (!$user->admin) accessforbidden();
  27. $action = GETPOST('action', 'alpha');
  28. /*
  29. * Actions
  30. */
  31. if ($action == 'activate_hidemenu')
  32. {
  33. dolibarr_set_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", '1', 'chaine', 0, '', $conf->entity);
  34. header("Location: ".$_SERVER["PHP_SELF"]);
  35. exit;
  36. }
  37. elseif ($action == 'disable_hidemenu')
  38. {
  39. dolibarr_del_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", $conf->entity);
  40. header("Location: ".$_SERVER["PHP_SELF"]);
  41. exit;
  42. }
  43. /*
  44. * View
  45. */
  46. llxHeader('', $langs->trans("Setup"));
  47. print load_fiche_titre($langs->trans("Menus"), '', 'title_setup');
  48. $h = 0;
  49. $head[$h][0] = DOL_URL_ROOT."/admin/menus.php";
  50. $head[$h][1] = $langs->trans("MenuHandlers");
  51. $head[$h][2] = 'handler';
  52. $h++;
  53. $head[$h][0] = DOL_URL_ROOT."/admin/menus/index.php";
  54. $head[$h][1] = $langs->trans("MenuAdmin");
  55. $head[$h][2] = 'editor';
  56. $h++;
  57. $head[$h][0] = DOL_URL_ROOT."/admin/menus/other.php";
  58. $head[$h][1] = $langs->trans("Miscellaneous");
  59. $head[$h][2] = 'misc';
  60. $h++;
  61. dol_fiche_head($head, 'misc', $langs->trans("Menus"), -1);
  62. // Other Options
  63. print '<table class="noborder centpercent">';
  64. print '<tr class="liste_titre">';
  65. print '<td colspan="3">'.$langs->trans("Parameters").'</td>';
  66. print '<td class="center" width="80">'.$langs->trans("Status").'</td>';
  67. print '</tr>';
  68. // Hide unauthorized menu
  69. print '<tr class="oddeven">';
  70. print '<td colspan="3">'.$langs->trans("HideUnauthorizedMenu").'</td>';
  71. print '<td class="center">';
  72. if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED))
  73. {
  74. print '<a href="'.$_SERVER["PHP_SELF"].'?action=activate_hidemenu">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
  75. }
  76. else
  77. {
  78. print '<a href="'.$_SERVER["PHP_SELF"].'?action=disable_hidemenu">'.img_picto($langs->trans("Enabled"), 'switch_on').'</a>';
  79. }
  80. print "</td>";
  81. print '</tr>';
  82. print '</table>';
  83. // End of page
  84. llxFooter();
  85. $db->close();