NodeProcedure.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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\Util;
  11. /**
  12. * Represents a procedure node in the navigation tree
  13. *
  14. * @package PhpMyAdmin-Navigation
  15. */
  16. class NodeProcedure extends NodeDatabaseChild
  17. {
  18. /**
  19. * Initialises the class
  20. *
  21. * @param string $name An identifier for the new node
  22. * @param int $type Type of node, may be one of CONTAINER or OBJECT
  23. * @param bool $isGroup Whether this object has been created
  24. * while grouping nodes
  25. */
  26. public function __construct($name, $type = Node::OBJECT, $isGroup = false)
  27. {
  28. parent::__construct($name, $type, $isGroup);
  29. $this->icon = Util::getImage('b_routines', __('Procedure'));
  30. $this->links = [
  31. 'text' => 'db_routines.php?server=' . $GLOBALS['server']
  32. . '&amp;db=%2$s&amp;item_name=%1$s&amp;item_type=PROCEDURE'
  33. . '&amp;edit_item=1',
  34. 'icon' => 'db_routines.php?server=' . $GLOBALS['server']
  35. . '&amp;db=%2$s&amp;item_name=%1$s&amp;item_type=PROCEDURE'
  36. . '&amp;execute_dialog=1',
  37. ];
  38. $this->classes = 'procedure';
  39. }
  40. /**
  41. * Returns the type of the item represented by the node.
  42. *
  43. * @return string type of the item
  44. */
  45. protected function getItemType()
  46. {
  47. return 'procedure';
  48. }
  49. }