DolMessagesCollector.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /* Copyright (C) 2023 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 htdocs/debugbar/class/DataCollector/DolMessagesCollector.php
  19. * \brief Class for debugbar collection
  20. * \ingroup debugbar
  21. */
  22. use DebugBar\DataCollector\MessagesCollector;
  23. /**
  24. * DolMessagesCollector class
  25. */
  26. class DolMessagesCollector extends MessagesCollector
  27. {
  28. /**
  29. * Return widget settings
  30. *
  31. * @return array Array
  32. */
  33. public function getWidgets()
  34. {
  35. global $langs;
  36. $title = $langs->transnoentities('Messages');
  37. $name = $this->getName();
  38. return array(
  39. "$title" => array(
  40. "icon" => "list-alt",
  41. "widget" => "PhpDebugBar.Widgets.MessagesWidget",
  42. "map" => "$name.messages",
  43. "default" => "[]"
  44. ),
  45. "$title:badge" => array(
  46. "map" => "$name.count",
  47. "default" => "null"
  48. )
  49. );
  50. }
  51. }