diff --git a/libraries/classes/Navigation/NodeFactory.php b/libraries/classes/Navigation/NodeFactory.php index c45de602adaa..80eece17b0ad 100644 --- a/libraries/classes/Navigation/NodeFactory.php +++ b/libraries/classes/Navigation/NodeFactory.php @@ -94,14 +94,17 @@ public static function getInstance( * Instantiates a Node object that will be used only for "New db/table/etc.." objects * * @param string $name An identifier for the new node + * @param string $classes Extra CSS classes for the node * * @return Node */ public static function getInstanceForNewNode( - string $name + string $name, + string $classes ): Node { $node = new Node($name, Node::OBJECT, false); $node->isNew = true; + $node->classes = $classes; return $node; } } diff --git a/libraries/classes/Navigation/Nodes/NodeColumnContainer.php b/libraries/classes/Navigation/Nodes/NodeColumnContainer.php index df22d9b9977a..3ef6cf838e77 100644 --- a/libraries/classes/Navigation/Nodes/NodeColumnContainer.php +++ b/libraries/classes/Navigation/Nodes/NodeColumnContainer.php @@ -42,7 +42,8 @@ public function __construct() $newLabel = _pgettext('Create new column', 'New'); $new = NodeFactory::getInstanceForNewNode( - $newLabel + $newLabel, + 'new_column italics' ); $new->icon = Generator::getImage('b_column_add', $newLabel); $new->links = [ @@ -57,7 +58,6 @@ public function __construct() 'after_field' => '', ]) . '&db=%3$s&table=%2$s', ]; - $new->classes = 'new_column italics'; $this->addChild($new); } } diff --git a/libraries/classes/Navigation/Nodes/NodeDatabaseContainer.php b/libraries/classes/Navigation/Nodes/NodeDatabaseContainer.php index b024c90912c7..d94dcab334d3 100644 --- a/libraries/classes/Navigation/Nodes/NodeDatabaseContainer.php +++ b/libraries/classes/Navigation/Nodes/NodeDatabaseContainer.php @@ -36,14 +36,14 @@ public function __construct($name) && $GLOBALS['cfg']['ShowCreateDb'] !== false ) { $new = NodeFactory::getInstanceForNewNode( - _pgettext('Create new database', 'New') + _pgettext('Create new database', 'New'), + 'new_database italics' ); $new->icon = Generator::getImage('b_newdb', ''); $new->links = [ 'text' => Url::getFromRoute('/server/databases', ['server' => $GLOBALS['server']]), 'icon' => Url::getFromRoute('/server/databases', ['server' => $GLOBALS['server']]), ]; - $new->classes = 'new_database italics'; $this->addChild($new); } } diff --git a/libraries/classes/Navigation/Nodes/NodeEventContainer.php b/libraries/classes/Navigation/Nodes/NodeEventContainer.php index 66f3abea99b3..75b550a62ecd 100644 --- a/libraries/classes/Navigation/Nodes/NodeEventContainer.php +++ b/libraries/classes/Navigation/Nodes/NodeEventContainer.php @@ -37,7 +37,8 @@ public function __construct() $this->realName = 'events'; $new = NodeFactory::getInstanceForNewNode( - _pgettext('Create new event', 'New') + _pgettext('Create new event', 'New'), + 'new_event italics' ); $new->icon = Generator::getImage('b_event_add', ''); $new->links = [ @@ -50,7 +51,6 @@ public function __construct() 'add_item' => 1, ]) . '&db=%2$s', ]; - $new->classes = 'new_event italics'; $this->addChild($new); } } diff --git a/libraries/classes/Navigation/Nodes/NodeFunctionContainer.php b/libraries/classes/Navigation/Nodes/NodeFunctionContainer.php index be2010fb4b75..5d6295e1dd9b 100644 --- a/libraries/classes/Navigation/Nodes/NodeFunctionContainer.php +++ b/libraries/classes/Navigation/Nodes/NodeFunctionContainer.php @@ -40,7 +40,8 @@ public function __construct() $newLabel = _pgettext('Create new function', 'New'); $new = NodeFactory::getInstanceForNewNode( - $newLabel + $newLabel, + 'new_function italics' ); $new->icon = Generator::getImage('b_routine_add', $newLabel); $new->links = [ @@ -55,7 +56,6 @@ public function __construct() 'add_item' => 1, ]) . '&db=%2$s', ]; - $new->classes = 'new_function italics'; $this->addChild($new); } } diff --git a/libraries/classes/Navigation/Nodes/NodeIndexContainer.php b/libraries/classes/Navigation/Nodes/NodeIndexContainer.php index da5a16e29091..768dbe4dab88 100644 --- a/libraries/classes/Navigation/Nodes/NodeIndexContainer.php +++ b/libraries/classes/Navigation/Nodes/NodeIndexContainer.php @@ -42,7 +42,8 @@ public function __construct() $newLabel = _pgettext('Create new index', 'New'); $new = NodeFactory::getInstanceForNewNode( - $newLabel + $newLabel, + 'new_index italics' ); $new->icon = Generator::getImage('b_index_add', $newLabel); $new->links = [ @@ -57,7 +58,6 @@ public function __construct() 'added_fields' => 2, ]) . '&db=%3$s&table=%2$s', ]; - $new->classes = 'new_index italics'; $this->addChild($new); } } diff --git a/libraries/classes/Navigation/Nodes/NodeProcedureContainer.php b/libraries/classes/Navigation/Nodes/NodeProcedureContainer.php index 2b2181294b7d..62899cafe1d5 100644 --- a/libraries/classes/Navigation/Nodes/NodeProcedureContainer.php +++ b/libraries/classes/Navigation/Nodes/NodeProcedureContainer.php @@ -41,7 +41,7 @@ public function __construct() $newLabel = _pgettext('Create new procedure', 'New'); $new = NodeFactory::getInstanceForNewNode( $newLabel, - $newLabel + 'new_procedure italics' ); $new->icon = Generator::getImage('b_routine_add', $newLabel); $new->links = [ @@ -54,7 +54,6 @@ public function __construct() 'add_item' => 1, ]) . '&db=%2$s', ]; - $new->classes = 'new_procedure italics'; $this->addChild($new); } } diff --git a/libraries/classes/Navigation/Nodes/NodeTableContainer.php b/libraries/classes/Navigation/Nodes/NodeTableContainer.php index e205dd5ad225..23256f484614 100644 --- a/libraries/classes/Navigation/Nodes/NodeTableContainer.php +++ b/libraries/classes/Navigation/Nodes/NodeTableContainer.php @@ -43,7 +43,8 @@ public function __construct() $newLabel = _pgettext('Create new table', 'New'); $new = NodeFactory::getInstanceForNewNode( - $newLabel + $newLabel, + 'new_table italics' ); $new->icon = Generator::getImage('b_table_add', $newLabel); $new->links = [ @@ -54,7 +55,6 @@ public function __construct() 'server' => $GLOBALS['server'], ]) . '&db=%2$s', ]; - $new->classes = 'new_table italics'; $this->addChild($new); } } diff --git a/libraries/classes/Navigation/Nodes/NodeTriggerContainer.php b/libraries/classes/Navigation/Nodes/NodeTriggerContainer.php index 82fdb3797a24..dce43b709ff8 100644 --- a/libraries/classes/Navigation/Nodes/NodeTriggerContainer.php +++ b/libraries/classes/Navigation/Nodes/NodeTriggerContainer.php @@ -37,7 +37,8 @@ public function __construct() $this->realName = 'triggers'; $new = NodeFactory::getInstanceForNewNode( - _pgettext('Create new trigger', 'New') + _pgettext('Create new trigger', 'New'), + 'new_trigger italics' ); $new->icon = Generator::getImage('b_trigger_add', ''); $new->links = [ @@ -50,7 +51,6 @@ public function __construct() 'add_item' => 1, ]) . '&db=%3$s', ]; - $new->classes = 'new_trigger italics'; $this->addChild($new); } } diff --git a/libraries/classes/Navigation/Nodes/NodeViewContainer.php b/libraries/classes/Navigation/Nodes/NodeViewContainer.php index 8aeb63c835bf..1ca26bbf86f5 100644 --- a/libraries/classes/Navigation/Nodes/NodeViewContainer.php +++ b/libraries/classes/Navigation/Nodes/NodeViewContainer.php @@ -43,7 +43,8 @@ public function __construct() $newLabel = _pgettext('Create new view', 'New'); $new = NodeFactory::getInstanceForNewNode( - $newLabel + $newLabel, + 'new_view italics' ); $new->icon = Generator::getImage('b_view_add', $newLabel); $new->links = [ @@ -54,7 +55,6 @@ public function __construct() 'server' => $GLOBALS['server'], ]) . '&db=%2$s', ]; - $new->classes = 'new_view italics'; $this->addChild($new); } }