printing.lib.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. /* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
  3. * Copyright (C) 2018 Frédéric France <frederic.france@netlogic.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/printing/lib/printing.lib.php
  20. * \ingroup printing
  21. * \brief Library for printing functions
  22. */
  23. /**
  24. * Define head array for tabs of printing tools setup pages
  25. *
  26. * @param string $mode Mode
  27. * @return array Array of head
  28. */
  29. function printingAdminPrepareHead($mode)
  30. {
  31. global $langs, $conf;
  32. $h = 0;
  33. $head = array();
  34. $head[$h][0] = DOL_URL_ROOT."/printing/admin/printing.php?mode=config";
  35. $head[$h][1] = $langs->trans("ListDrivers");
  36. $head[$h][2] = 'config';
  37. $h++;
  38. if ($mode == 'setup') {
  39. $head[$h][0] = DOL_URL_ROOT."/printing/admin/printing.php?mode=setup&driver=".GETPOST('driver', 'alpha');
  40. $head[$h][1] = $langs->trans("SetupDriver");
  41. $head[$h][2] = 'setup';
  42. $h++;
  43. }
  44. if ($mode == 'test') {
  45. $head[$h][0] = DOL_URL_ROOT."/printing/admin/printing.php?mode=test&driver=".GETPOST('driver', 'alpha');
  46. $head[$h][1] = $langs->trans("TargetedPrinter");
  47. $head[$h][2] = 'test';
  48. $h++;
  49. }
  50. /** TODO This feature seem to be not ready yet.
  51. $head[$h][0] = DOL_URL_ROOT."/printing/admin/printing.php?mode=userconf";
  52. $head[$h][1] = $langs->trans("UserConf");
  53. $head[$h][2] = 'userconf';
  54. $h++;
  55. */
  56. //$object=new stdClass();
  57. // Show more tabs from modules
  58. // Entries must be declared in modules descriptor with line
  59. // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
  60. // $this->tabs = array('entity:-tabname); to remove a tab
  61. //complete_head_from_modules($conf,$langs,$object,$head,$h,'printingadmin');
  62. //complete_head_from_modules($conf,$langs,$object,$head,$h,'printing','remove');
  63. return $head;
  64. }