receiptprinter.lib.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
  3. * Copyright (C) 2015 Frederic France <frederic.france@free.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. */
  18. /**
  19. * \file htdocs/core/lib/receiptprinter.lib.php
  20. * \ingroup printing
  21. * \brief Library for receipt printer functions
  22. */
  23. /**
  24. * Define head array for tabs of receipt printer setup pages
  25. *
  26. * @param string $mode Mode
  27. * @return Array of head
  28. */
  29. function receiptprinteradmin_prepare_head($mode)
  30. {
  31. global $langs, $conf;
  32. $h = 0;
  33. $head = array();
  34. $head[$h][0] = DOL_URL_ROOT."/admin/receiptprinter.php?mode=config";
  35. $head[$h][1] = $langs->trans("ListPrinters");
  36. $head[$h][2] = 'config';
  37. $h++;
  38. $head[$h][0] = DOL_URL_ROOT."/admin/receiptprinter.php?mode=template";
  39. $head[$h][1] = $langs->trans("SetupReceiptTemplate");
  40. $head[$h][2] = 'template';
  41. $h++;
  42. if ($mode == 'test') {
  43. $head[$h][0] = DOL_URL_ROOT."/admin/receiptprinter.php?mode=test";
  44. $head[$h][1] = $langs->trans("TargetedPrinter");
  45. $head[$h][2] = 'test';
  46. $h++;
  47. }
  48. //$object=new stdClass();
  49. // Show more tabs from modules
  50. // Entries must be declared in modules descriptor with line
  51. // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
  52. // $this->tabs = array('entity:-tabname); to remove a tab
  53. //complete_head_from_modules($conf,$langs,$object,$head,$h,'printingadmin');
  54. //complete_head_from_modules($conf,$langs,$object,$head,$h,'printing','remove');
  55. return $head;
  56. }