other.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <?php
  2. /* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
  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 2 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 <http://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."/lib/admin.lib.php");
  24. $langs->load("users");
  25. $langs->load("admin");
  26. $langs->load("other");
  27. if (!$user->admin) accessforbidden();
  28. /*
  29. * Actions
  30. */
  31. if ($_GET["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. else if ($_GET["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. if ($_GET["action"] == 'activate_layoutmenu')
  44. {
  45. dolibarr_set_const($db, "MAIN_MENU_USE_JQUERY_LAYOUT", '1','chaine',0,'',$conf->entity);
  46. Header("Location: ".$_SERVER["PHP_SELF"]);
  47. exit;
  48. }
  49. else if ($_GET["action"] == 'disable_layoutmenu')
  50. {
  51. dolibarr_del_const($db, "MAIN_MENU_USE_JQUERY_LAYOUT",$conf->entity);
  52. Header("Location: ".$_SERVER["PHP_SELF"]);
  53. exit;
  54. }
  55. /*
  56. * View
  57. */
  58. llxHeader('',$langs->trans("Setup"));
  59. print_fiche_titre($langs->trans("Menus"),'','setup');
  60. print "<br>\n";
  61. $h = 0;
  62. $head[$h][0] = DOL_URL_ROOT."/admin/menus.php";
  63. $head[$h][1] = $langs->trans("MenuHandlers");
  64. $head[$h][2] = 'handler';
  65. $h++;
  66. $head[$h][0] = DOL_URL_ROOT."/admin/menus/index.php";
  67. $head[$h][1] = $langs->trans("MenuAdmin");
  68. $head[$h][2] = 'editor';
  69. $h++;
  70. $head[$h][0] = DOL_URL_ROOT."/admin/menus/other.php";
  71. $head[$h][1] = $langs->trans("Miscellanous");
  72. $head[$h][2] = 'misc';
  73. $h++;
  74. dol_fiche_head($head, 'misc', $langs->trans("Menus"));
  75. // Other Options
  76. $var=true;
  77. print '<table class="noborder" width="100%">';
  78. print '<tr class="liste_titre">';
  79. print '<td colspan="3">'.$langs->trans("Parameters").'</td>';
  80. print '<td align="center" width="80">'.$langs->trans("Status").'</td>';
  81. print '</tr>';
  82. // hide unauthorized menu
  83. $var=!$var;
  84. print "<tr ".$bc[$var].">";
  85. print '<td colspan="3">'.$langs->trans("HideUnauthorizedMenu").'</td>';
  86. print '<td align="center">';
  87. if ($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED == 0)
  88. {
  89. print '<a href="'.$_SERVER["PHP_SELF"].'?action=activate_hidemenu">'.img_picto($langs->trans("Disabled"),'off').'</a>';
  90. }
  91. if($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED == 1)
  92. {
  93. print '<a href="'.$_SERVER["PHP_SELF"].'?action=disable_hidemenu">'.img_picto($langs->trans("Enabled"),'on').'</a>';
  94. }
  95. print "</td>";
  96. print '</tr>';
  97. // hide unauthorized menu
  98. if ($conf->global->MAIN_FEATURES_LEVEL > 0)
  99. {
  100. $var=!$var;
  101. print "<tr ".$bc[$var].">";
  102. print '<td colspan="3">'.$langs->trans("MenuUseLayout").'</td>';
  103. print '<td align="center">';
  104. if ($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT == 0)
  105. {
  106. print '<a href="'.$_SERVER["PHP_SELF"].'?action=activate_layoutmenu">'.img_picto($langs->trans("Disabled"),'off').'</a>';
  107. }
  108. if($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT == 1)
  109. {
  110. print '<a href="'.$_SERVER["PHP_SELF"].'?action=disable_layoutmenu">'.img_picto($langs->trans("Enabled"),'on').'</a>';
  111. }
  112. print "</td>";
  113. print '</tr>';
  114. }
  115. print '</table>';
  116. $db->close();
  117. llxFooter();
  118. ?>