Node_Table_Container.class.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. if (! defined('PHPMYADMIN')) {
  9. exit;
  10. }
  11. /**
  12. * Represents a container for table nodes in the navigation tree
  13. *
  14. * @package PhpMyAdmin-Navigation
  15. */
  16. class Node_Table_Container extends Node
  17. {
  18. /**
  19. * Initialises the class
  20. *
  21. * @return Node_Table_Container
  22. */
  23. public function __construct()
  24. {
  25. parent::__construct(__('Tables'), Node::CONTAINER);
  26. $this->icon = PMA_Util::getImage('b_browse.png', __('Tables'));
  27. $this->links = array(
  28. 'text' => 'db_structure.php?server=' . $GLOBALS['server']
  29. . '&amp;db=%1$s&amp;tbl_type=table'
  30. . '&amp;token=' . $GLOBALS['token'],
  31. 'icon' => 'db_structure.php?server=' . $GLOBALS['server']
  32. . '&amp;db=%1$s&amp;tbl_type=table'
  33. . '&amp;token=' . $GLOBALS['token'],
  34. );
  35. if ($GLOBALS['cfg']['NavigationTreeEnableGrouping']) {
  36. $this->separator = $GLOBALS['cfg']['NavigationTreeTableSeparator'];
  37. $this->separator_depth = (int)(
  38. $GLOBALS['cfg']['NavigationTreeTableLevel']
  39. );
  40. }
  41. $this->real_name = 'tables';
  42. $this->classes = 'tableContainer subContainer';
  43. $new_label = _pgettext('Create new table', 'New');
  44. $new = PMA_NodeFactory::getInstance('Node', $new_label);
  45. $new->isNew = true;
  46. $new->icon = PMA_Util::getImage('b_table_add.png', $new_label);
  47. $new->links = array(
  48. 'text' => 'tbl_create.php?server=' . $GLOBALS['server']
  49. . '&amp;db=%2$s&amp;token=' . $GLOBALS['token'],
  50. 'icon' => 'tbl_create.php?server=' . $GLOBALS['server']
  51. . '&amp;db=%2$s&amp;token=' . $GLOBALS['token'],
  52. );
  53. $new->classes = 'new_table italics';
  54. $this->addChild($new);
  55. }
  56. }
  57. ?>