blockedlog.lib.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /* Copyright (C) 2017 ATM Consulting <contact@atm-consulting.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 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 htdocs/blockedlog/lib/blockedlog.lib.php
  19. * \ingroup system
  20. * \brief Library for common blockedlog functions
  21. */
  22. /**
  23. * Define head array for tabs of blockedlog tools setup pages
  24. *
  25. * @return Array of head
  26. */
  27. function blockedlogadmin_prepare_head()
  28. {
  29. global $db, $langs, $conf;
  30. $h = 0;
  31. $head = array();
  32. $head[$h][0] = DOL_URL_ROOT."/blockedlog/admin/blockedlog.php?withtab=1";
  33. $head[$h][1] = $langs->trans("Setup");
  34. $head[$h][2] = 'blockedlog';
  35. $h++;
  36. $langs->load("blockedlog");
  37. $head[$h][0] = DOL_URL_ROOT."/blockedlog/admin/blockedlog_list.php?withtab=1";
  38. $head[$h][1] = $langs->trans("BrowseBlockedLog");
  39. require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php';
  40. $b = new BlockedLog($db);
  41. if ($b->alreadyUsed()) {
  42. $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '<span class="badge marginleftonlyshort">...</span>' : '');
  43. }
  44. $head[$h][2] = 'fingerprints';
  45. $h++;
  46. $object = new stdClass();
  47. // Show more tabs from modules
  48. // Entries must be declared in modules descriptor with line
  49. // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
  50. // $this->tabs = array('entity:-tabname); to remove a tab
  51. complete_head_from_modules($conf, $langs, $object, $head, $h, 'blockedlog');
  52. complete_head_from_modules($conf, $langs, $object, $head, $h, 'blockedlog', 'remove');
  53. return $head;
  54. }