takepos.lib.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. /* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
  3. * Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. * or see https://www.gnu.org/
  18. */
  19. /**
  20. * \file htdocs/core/lib/takepos.lib.php
  21. * \brief Library file with function for TakePOS module
  22. */
  23. /**
  24. * Prepare array with list of tabs
  25. *
  26. * @return array Array of tabs
  27. */
  28. function takepos_admin_prepare_head()
  29. {
  30. global $langs, $conf;
  31. $h = 0;
  32. $head = array();
  33. $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/setup.php';
  34. $head[$h][1] = $langs->trans("Parameters");
  35. $head[$h][2] = 'setup';
  36. $h++;
  37. $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/appearance.php';
  38. $head[$h][1] = $langs->trans("Appearance");
  39. $head[$h][2] = 'appearance';
  40. $h++;
  41. $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/receipt.php';
  42. $head[$h][1] = $langs->trans("Printers").' / '.$langs->trans("Receipt");
  43. $head[$h][2] = 'receipt';
  44. $h++;
  45. $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/bar.php';
  46. $head[$h][1] = $langs->trans("BarRestaurant");
  47. $head[$h][2] = 'bar';
  48. $h++;
  49. $numterminals = max(1, getDolGlobalInt('TAKEPOS_NUM_TERMINALS', 1));
  50. for ($i = 1; $i <= $numterminals; $i++) {
  51. $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/terminal.php?terminal='.$i;
  52. $head[$h][1] = getDolGlobalString('TAKEPOS_TERMINAL_NAME_'.$i, $langs->trans("TerminalName", $i));
  53. $head[$h][2] = 'terminal'.$i;
  54. $h++;
  55. }
  56. $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/other.php';
  57. $head[$h][1] = $langs->trans("About");
  58. $head[$h][2] = 'other';
  59. $h++;
  60. complete_head_from_modules($conf, $langs, null, $head, $h, 'takepos_admin');
  61. complete_head_from_modules($conf, $langs, null, $head, $h, 'takepos_admin', 'remove');
  62. return $head;
  63. }