NodeIndexContainer.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. namespace PhpMyAdmin\Navigation\Nodes;
  9. use PhpMyAdmin\Navigation\NodeFactory;
  10. use PhpMyAdmin\Util;
  11. /**
  12. * Represents a container for index nodes in the navigation tree
  13. *
  14. * @package PhpMyAdmin-Navigation
  15. */
  16. class NodeIndexContainer extends Node
  17. {
  18. /**
  19. * Initialises the class
  20. */
  21. public function __construct()
  22. {
  23. parent::__construct(__('Indexes'), Node::CONTAINER);
  24. $this->icon = Util::getImage('b_index', __('Indexes'));
  25. $this->links = array(
  26. 'text' => 'tbl_structure.php?server=' . $GLOBALS['server']
  27. . '&amp;db=%2$s&amp;table=%1$s',
  28. 'icon' => 'tbl_structure.php?server=' . $GLOBALS['server']
  29. . '&amp;db=%2$s&amp;table=%1$s',
  30. );
  31. $this->real_name = 'indexes';
  32. $new_label = _pgettext('Create new index', 'New');
  33. $new = NodeFactory::getInstance(
  34. 'Node',
  35. $new_label
  36. );
  37. $new->isNew = true;
  38. $new->icon = Util::getImage('b_index_add', $new_label);
  39. $new->links = array(
  40. 'text' => 'tbl_indexes.php?server=' . $GLOBALS['server']
  41. . '&amp;create_index=1&amp;added_fields=2'
  42. . '&amp;db=%3$s&amp;table=%2$s',
  43. 'icon' => 'tbl_indexes.php?server=' . $GLOBALS['server']
  44. . '&amp;create_index=1&amp;added_fields=2'
  45. . '&amp;db=%3$s&amp;table=%2$s',
  46. );
  47. $new->classes = 'new_index italics';
  48. $this->addChild($new);
  49. }
  50. }