NodeDatabaseContainer.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. require_once './libraries/check_user_privileges.inc.php';
  12. /**
  13. * Represents a container for database nodes in the navigation tree
  14. *
  15. * @package PhpMyAdmin-Navigation
  16. */
  17. class NodeDatabaseContainer extends Node
  18. {
  19. /**
  20. * Initialises the class
  21. *
  22. * @param string $name An identifier for the new node
  23. */
  24. public function __construct($name)
  25. {
  26. parent::__construct($name, Node::CONTAINER);
  27. if ($GLOBALS['is_create_db_priv']
  28. && $GLOBALS['cfg']['ShowCreateDb'] !== false
  29. ) {
  30. $new = NodeFactory::getInstance(
  31. 'Node',
  32. _pgettext('Create new database', 'New')
  33. );
  34. $new->isNew = true;
  35. $new->icon = Util::getImage('b_newdb', '');
  36. $new->links = array(
  37. 'text' => 'server_databases.php?server=' . $GLOBALS['server'],
  38. 'icon' => 'server_databases.php?server=' . $GLOBALS['server'],
  39. );
  40. $new->classes = 'new_database italics';
  41. $this->addChild($new);
  42. }
  43. }
  44. }