NodeProcedureContainer.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * Functionality for the navigation tree
  4. */
  5. declare(strict_types=1);
  6. namespace PhpMyAdmin\Navigation\Nodes;
  7. use PhpMyAdmin\Html\Generator;
  8. use PhpMyAdmin\Navigation\NodeFactory;
  9. use PhpMyAdmin\Url;
  10. /**
  11. * Represents a container for procedure nodes in the navigation tree
  12. */
  13. class NodeProcedureContainer extends NodeDatabaseChildContainer
  14. {
  15. /**
  16. * Initialises the class
  17. */
  18. public function __construct()
  19. {
  20. parent::__construct(__('Procedures'), Node::CONTAINER);
  21. $this->icon = Generator::getImage('b_routines', __('Procedures'));
  22. $this->links = [
  23. 'text' => Url::getFromRoute('/database/routines', [
  24. 'server' => $GLOBALS['server'],
  25. 'type' => 'PROCEDURE',
  26. ]) . '&amp;db=%1$s',
  27. 'icon' => Url::getFromRoute('/database/routines', [
  28. 'server' => $GLOBALS['server'],
  29. 'type' => 'PROCEDURE',
  30. ]) . '&amp;db=%1$s',
  31. ];
  32. $this->realName = 'procedures';
  33. $newLabel = _pgettext('Create new procedure', 'New');
  34. $new = NodeFactory::getInstanceForNewNode(
  35. $newLabel,
  36. 'new_procedure italics'
  37. );
  38. $new->icon = Generator::getImage('b_routine_add', $newLabel);
  39. $new->links = [
  40. 'text' => Url::getFromRoute('/database/routines', [
  41. 'server' => $GLOBALS['server'],
  42. 'add_item' => 1,
  43. ]) . '&amp;db=%2$s',
  44. 'icon' => Url::getFromRoute('/database/routines', [
  45. 'server' => $GLOBALS['server'],
  46. 'add_item' => 1,
  47. ]) . '&amp;db=%2$s',
  48. ];
  49. $this->addChild($new);
  50. }
  51. }