Node_Database_Container.class.php 1.4 KB

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