NodeEvent.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * Functionality for the navigation tree
  4. */
  5. declare(strict_types=1);
  6. namespace PhpMyAdmin\Navigation\Nodes;
  7. use PhpMyAdmin\Html\Generator;
  8. use PhpMyAdmin\Url;
  9. /**
  10. * Represents a event node in the navigation tree
  11. */
  12. class NodeEvent extends NodeDatabaseChild
  13. {
  14. /**
  15. * Initialises the class
  16. *
  17. * @param string $name An identifier for the new node
  18. * @param int $type Type of node, may be one of CONTAINER or OBJECT
  19. * @param bool $isGroup Whether this object has been created
  20. * while grouping nodes
  21. */
  22. public function __construct($name, $type = Node::OBJECT, $isGroup = false)
  23. {
  24. parent::__construct($name, $type, $isGroup);
  25. $this->icon = Generator::getImage('b_events');
  26. $this->links = [
  27. 'text' => Url::getFromRoute('/database/events', [
  28. 'server' => $GLOBALS['server'],
  29. 'edit_item' => 1,
  30. ]) . '&amp;db=%2$s&amp;item_name=%1$s',
  31. 'icon' => Url::getFromRoute('/database/events', [
  32. 'server' => $GLOBALS['server'],
  33. 'export_item' => 1,
  34. ]) . '&amp;db=%2$s&amp;item_name=%1$s',
  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. }