NodeFunctionContainer.php 1.6 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. namespace PhpMyAdmin\Navigation\Nodes;
  9. use PhpMyAdmin\Navigation\NodeFactory;
  10. use PhpMyAdmin\Util;
  11. /**
  12. * Represents a container for functions nodes in the navigation tree
  13. *
  14. * @package PhpMyAdmin-Navigation
  15. */
  16. class NodeFunctionContainer extends NodeDatabaseChildContainer
  17. {
  18. /**
  19. * Initialises the class
  20. */
  21. public function __construct()
  22. {
  23. parent::__construct(__('Functions'), Node::CONTAINER);
  24. $this->icon = Util::getImage('b_routines', __('Functions'));
  25. $this->links = array(
  26. 'text' => 'db_routines.php?server=' . $GLOBALS['server']
  27. . '&amp;db=%1$s&amp;type=FUNCTION',
  28. 'icon' => 'db_routines.php?server=' . $GLOBALS['server']
  29. . '&amp;db=%1$s&amp;type=FUNCTION',
  30. );
  31. $this->real_name = 'functions';
  32. $new_label = _pgettext('Create new function', 'New');
  33. $new = NodeFactory::getInstance(
  34. 'Node',
  35. $new_label
  36. );
  37. $new->isNew = true;
  38. $new->icon = Util::getImage('b_routine_add', $new_label);
  39. $new->links = array(
  40. 'text' => 'db_routines.php?server=' . $GLOBALS['server']
  41. . '&amp;db=%2$s&add_item=1&amp;item_type=FUNCTION',
  42. 'icon' => 'db_routines.php?server=' . $GLOBALS['server']
  43. . '&amp;db=%2$s&add_item=1&amp;item_type=FUNCTION',
  44. );
  45. $new->classes = 'new_function italics';
  46. $this->addChild($new);
  47. }
  48. }