phpmyadmin/src/Navigation/Nodes/NodeFunctionContainer.php
Kamil Tekiela 1a5d10e66d Create Nodes/Icon
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2025-06-13 02:34:52 +01:00

52 lines
1.4 KiB
PHP

<?php
/**
* Functionality for the navigation tree
*/
declare(strict_types=1);
namespace PhpMyAdmin\Navigation\Nodes;
use PhpMyAdmin\Config;
use function __;
use function _pgettext;
/**
* Represents a container for functions nodes in the navigation tree
*/
class NodeFunctionContainer extends NodeDatabaseChildContainer
{
public function __construct(Config $config)
{
parent::__construct($config, __('Functions'));
$this->icon = new Icon(
'b_routines',
__('Functions'),
'/database/routines',
['type' => 'FUNCTION', 'db' => null],
);
$this->links = [
'text' => ['route' => '/database/routines', 'params' => ['type' => 'FUNCTION', 'db' => null]],
];
$this->realName = 'functions';
$newLabel = _pgettext('Create new function', 'New');
$new = $this->getInstanceForNewNode($newLabel, 'new_function italics');
$new->icon = new Icon(
'b_routine_add',
$newLabel,
'/database/routines',
['item_type' => 'FUNCTION', 'add_item' => 1, 'db' => null],
);
$new->links = [
'text' => [
'route' => '/database/routines',
'params' => ['item_type' => 'FUNCTION', 'add_item' => 1, 'db' => null],
],
];
$this->addChild($new);
}
}