@@ -50,18 +50,20 @@ public function __construct(
5050 */
5151 public function getDisplay (): string
5252 {
53- $ retval = $ this ->getBreadcrumbs ();
54- $ retval .= $ this ->getMenu ();
55-
56- return $ retval ;
53+ $ breadcrumbs = $ this ->getBreadcrumbs ();
54+ $ menu = $ this ->getMenu ();
55+
56+ return $ this ->template ->render ('menu/main ' , [
57+ 'server ' => $ breadcrumbs ['server ' ],
58+ 'database ' => $ breadcrumbs ['database ' ],
59+ 'table ' => $ breadcrumbs ['table ' ],
60+ 'tabs ' => $ menu ['tabs ' ],
61+ 'url_params ' => $ menu ['url_params ' ],
62+ ]);
5763 }
5864
59- /**
60- * Returns the menu as HTML
61- *
62- * @return string HTML formatted menubar
63- */
64- private function getMenu (): string
65+ /** @return array{tabs: mixed[], url_params: mixed[]} */
66+ private function getMenu (): array
6567 {
6668 $ urlParams = [];
6769
@@ -84,7 +86,7 @@ private function getMenu(): string
8486 // Filter out any tabs that are not allowed
8587 $ tabs = array_intersect_key ($ tabs , $ allowedTabs );
8688
87- return $ this -> template -> render ( ' top_menu ' , ['tabs ' => $ tabs , 'url_params ' => $ urlParams ]) ;
89+ return ['tabs ' => $ tabs , 'url_params ' => $ urlParams ];
8890 }
8991
9092 /**
@@ -135,12 +137,8 @@ private function getAllowedTabs(string $level): array
135137 return $ allowedTabs ;
136138 }
137139
138- /**
139- * Returns the breadcrumbs as HTML
140- *
141- * @return string HTML formatted breadcrumbs
142- */
143- private function getBreadcrumbs (): string
140+ /** @return array{server: mixed[], database: mixed[], table: mixed[]} */
141+ private function getBreadcrumbs (): array
144142 {
145143 $ server = [];
146144 $ database = [];
@@ -171,7 +169,7 @@ private function getBreadcrumbs(): string
171169 }
172170
173171 if (mb_strstr ($ table ['comment ' ], '; InnoDB free ' )) {
174- $ table ['comment ' ] = preg_replace ('@; InnoDB free:.*?$@ ' , '' , $ table ['comment ' ]);
172+ $ table ['comment ' ] = ( string ) preg_replace ('@; InnoDB free:.*?$@ ' , '' , $ table ['comment ' ]);
175173 }
176174 } else {
177175 // no table selected, display database comment if present
@@ -185,11 +183,7 @@ private function getBreadcrumbs(): string
185183 }
186184 }
187185
188- return $ this ->template ->render ('menu/breadcrumbs ' , [
189- 'server ' => $ server ,
190- 'database ' => $ database ,
191- 'table ' => $ table ,
192- ]);
186+ return ['server ' => $ server , 'database ' => $ database , 'table ' => $ table ];
193187 }
194188
195189 /**
0 commit comments