webhook.lib.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. /* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
  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 webhook/lib/webhook.lib.php
  19. * \ingroup webhook
  20. * \brief Library files with common functions for Webhook
  21. */
  22. /**
  23. * Prepare admin pages header
  24. *
  25. * @return array
  26. */
  27. function webhookAdminPrepareHead()
  28. {
  29. global $langs, $conf;
  30. $h = 0;
  31. $head = array();
  32. $head[$h][0] = dol_buildpath("/admin/webhook.php", 1);
  33. $head[$h][1] = $langs->trans("Miscellaneous");
  34. $head[$h][2] = 'settings';
  35. $h++;
  36. $head[$h][0] = dol_buildpath("/webhook/target_list.php?mode=modulesetup", 1);
  37. $head[$h][1] = $langs->trans("Targets");
  38. $head[$h][2] = 'targets';
  39. $h++;
  40. /*
  41. $head[$h][0] = dol_buildpath("/webhook/admin/myobject_extrafields.php", 1);
  42. $head[$h][1] = $langs->trans("ExtraFields");
  43. $head[$h][2] = 'myobject_extrafields';
  44. $h++;
  45. */
  46. // Show more tabs from modules
  47. // Entries must be declared in modules descriptor with line
  48. //$this->tabs = array(
  49. // 'entity:+tabname:Title:@webhook:/webhook/mypage.php?id=__ID__'
  50. //); // to add new tab
  51. //$this->tabs = array(
  52. // 'entity:-tabname:Title:@webhook:/webhook/mypage.php?id=__ID__'
  53. //); // to remove a tab
  54. complete_head_from_modules($conf, $langs, null, $head, $h, 'webhook');
  55. complete_head_from_modules($conf, $langs, null, $head, $h, 'webhook', 'remove');
  56. return $head;
  57. }