NodeEvent.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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\Util;
  11. /**
  12. * Represents a event node in the navigation tree
  13. *
  14. * @package PhpMyAdmin-Navigation
  15. */
  16. class NodeEvent extends NodeDatabaseChild
  17. {
  18. /**
  19. * Initialises the class
  20. *
  21. * @param string $name An identifier for the new node
  22. * @param int $type Type of node, may be one of CONTAINER or OBJECT
  23. * @param bool $isGroup Whether this object has been created
  24. * while grouping nodes
  25. */
  26. public function __construct($name, $type = Node::OBJECT, $isGroup = false)
  27. {
  28. parent::__construct($name, $type, $isGroup);
  29. $this->icon = Util::getImage('b_events');
  30. $this->links = [
  31. 'text' => 'db_events.php?server=' . $GLOBALS['server']
  32. . '&amp;db=%2$s&amp;item_name=%1$s&amp;edit_item=1',
  33. 'icon' => 'db_events.php?server=' . $GLOBALS['server']
  34. . '&amp;db=%2$s&amp;item_name=%1$s&amp;export_item=1',
  35. ];
  36. $this->classes = 'event';
  37. }
  38. /**
  39. * Returns the type of the item represented by the node.
  40. *
  41. * @return string type of the item
  42. */
  43. protected function getItemType()
  44. {
  45. return 'event';
  46. }
  47. }