NodeTriggerContainer.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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\Navigation\NodeFactory;
  9. use PhpMyAdmin\Url;
  10. /**
  11. * Represents a container for trigger nodes in the navigation tree
  12. */
  13. class NodeTriggerContainer extends Node
  14. {
  15. /**
  16. * Initialises the class
  17. */
  18. public function __construct()
  19. {
  20. parent::__construct(__('Triggers'), Node::CONTAINER);
  21. $this->icon = Generator::getImage('b_triggers');
  22. $this->links = [
  23. 'text' => Url::getFromRoute('/database/triggers', [
  24. 'server' => $GLOBALS['server'],
  25. ]) . '&amp;db=%2$s&amp;table=%1$s',
  26. 'icon' => Url::getFromRoute('/database/triggers', [
  27. 'server' => $GLOBALS['server'],
  28. ]) . '&amp;db=%2$s&amp;table=%1$s',
  29. ];
  30. $this->realName = 'triggers';
  31. $newLabel = _pgettext('Create new trigger', 'New');
  32. $new = NodeFactory::getInstanceForNewNode(
  33. $newLabel,
  34. 'new_trigger italics'
  35. );
  36. $new->icon = Generator::getImage('b_trigger_add', '');
  37. $new->links = [
  38. 'text' => Url::getFromRoute('/database/triggers', [
  39. 'server' => $GLOBALS['server'],
  40. 'add_item' => 1,
  41. ]) . '&amp;db=%3$s',
  42. 'icon' => Url::getFromRoute('/database/triggers', [
  43. 'server' => $GLOBALS['server'],
  44. 'add_item' => 1,
  45. ]) . '&amp;db=%3$s',
  46. ];
  47. $this->addChild($new);
  48. }
  49. }