NodeEventContainer.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Functionality for the navigation tree
  5. *
  6. * @package PhpMyAdmin-Navigation
  7. */
  8. declare(strict_types=1);
  9. namespace PhpMyAdmin\Navigation\Nodes;
  10. use PhpMyAdmin\Navigation\NodeFactory;
  11. use PhpMyAdmin\Util;
  12. /**
  13. * Represents a container for events nodes in the navigation tree
  14. *
  15. * @package PhpMyAdmin-Navigation
  16. */
  17. class NodeEventContainer extends NodeDatabaseChildContainer
  18. {
  19. /**
  20. * Initialises the class
  21. */
  22. public function __construct()
  23. {
  24. parent::__construct(__('Events'), Node::CONTAINER);
  25. $this->icon = Util::getImage('b_events', '');
  26. $this->links = [
  27. 'text' => 'db_events.php?server=' . $GLOBALS['server']
  28. . '&amp;db=%1$s',
  29. 'icon' => 'db_events.php?server=' . $GLOBALS['server']
  30. . '&amp;db=%1$s',
  31. ];
  32. $this->realName = 'events';
  33. $newLabel = _pgettext('Create new event', 'New');
  34. $new = NodeFactory::getInstance(
  35. 'Node',
  36. $newLabel
  37. );
  38. $new->isNew = true;
  39. $new->icon = Util::getImage('b_event_add', '');
  40. $new->title = $newLabel;
  41. $new->links = [
  42. 'text' => 'db_events.php?server=' . $GLOBALS['server']
  43. . '&amp;db=%2$s&add_item=1',
  44. 'icon' => 'db_events.php?server=' . $GLOBALS['server']
  45. . '&amp;db=%2$s&add_item=1',
  46. ];
  47. $new->classes = 'new_event italics';
  48. $this->addChild($new);
  49. }
  50. }