NodeTableContainer.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. declare(strict_types=1);
  9. namespace PhpMyAdmin\Navigation\Nodes;
  10. use PhpMyAdmin\Navigation\NodeFactory;
  11. use PhpMyAdmin\Util;
  12. /**
  13. * Represents a container for table nodes in the navigation tree
  14. *
  15. * @package PhpMyAdmin-Navigation
  16. */
  17. class NodeTableContainer extends NodeDatabaseChildContainer
  18. {
  19. /**
  20. * Initialises the class
  21. */
  22. public function __construct()
  23. {
  24. parent::__construct(__('Tables'), Node::CONTAINER);
  25. $this->icon = Util::getImage('b_browse', __('Tables'));
  26. $this->links = [
  27. 'text' => 'db_structure.php?server=' . $GLOBALS['server']
  28. . '&amp;db=%1$s&amp;tbl_type=table',
  29. 'icon' => 'db_structure.php?server=' . $GLOBALS['server']
  30. . '&amp;db=%1$s&amp;tbl_type=table',
  31. ];
  32. $this->realName = 'tables';
  33. $this->classes = 'tableContainer subContainer';
  34. $newLabel = _pgettext('Create new table', 'New');
  35. $new = NodeFactory::getInstance(
  36. 'Node',
  37. $newLabel
  38. );
  39. $new->isNew = true;
  40. $new->icon = Util::getImage('b_table_add', $newLabel);
  41. $new->title = $newLabel;
  42. $new->links = [
  43. 'text' => 'tbl_create.php?server=' . $GLOBALS['server']
  44. . '&amp;db=%2$s',
  45. 'icon' => 'tbl_create.php?server=' . $GLOBALS['server']
  46. . '&amp;db=%2$s',
  47. ];
  48. $new->classes = 'new_table italics';
  49. $this->addChild($new);
  50. }
  51. }