NodeView.php 1.3 KB

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