NodeViewContainer.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 view nodes in the navigation tree
  13. *
  14. * @package PhpMyAdmin-Navigation
  15. */
  16. class NodeViewContainer extends NodeDatabaseChildContainer
  17. {
  18. /**
  19. * Initialises the class
  20. */
  21. public function __construct()
  22. {
  23. parent::__construct(__('Views'), Node::CONTAINER);
  24. $this->icon = Util::getImage('b_views', __('Views'));
  25. $this->links = array(
  26. 'text' => 'db_structure.php?server=' . $GLOBALS['server']
  27. . '&amp;db=%1$s&amp;tbl_type=view',
  28. 'icon' => 'db_structure.php?server=' . $GLOBALS['server']
  29. . '&amp;db=%1$s&amp;tbl_type=view',
  30. );
  31. $this->classes = 'viewContainer subContainer';
  32. $this->real_name = 'views';
  33. $new_label = _pgettext('Create new view', 'New');
  34. $new = NodeFactory::getInstance(
  35. 'Node',
  36. $new_label
  37. );
  38. $new->isNew = true;
  39. $new->icon = Util::getImage('b_view_add', $new_label);
  40. $new->links = array(
  41. 'text' => 'view_create.php?server=' . $GLOBALS['server']
  42. . '&amp;db=%2$s',
  43. 'icon' => 'view_create.php?server=' . $GLOBALS['server']
  44. . '&amp;db=%2$s',
  45. );
  46. $new->classes = 'new_view italics';
  47. $this->addChild($new);
  48. }
  49. }