NodeIndex.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 index node in the navigation tree
  11. */
  12. class NodeIndex extends Node
  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_index', __('Index'));
  26. $this->links = [
  27. 'text' => Url::getFromRoute('/table/indexes', [
  28. 'server' => $GLOBALS['server'],
  29. ]) . '&amp;db=%3$s&amp;table=%2$s&amp;index=%1$s',
  30. 'icon' => Url::getFromRoute('/table/indexes', [
  31. 'server' => $GLOBALS['server'],
  32. ]) . '&amp;db=%3$s&amp;table=%2$s&amp;index=%1$s',
  33. ];
  34. $this->classes = 'index';
  35. }
  36. }