Repair mobile menu (icons not shown yet).
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Tue, 22 Jun 2021 20:42:12 +0000 (22:42 +0200)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Tue, 22 Jun 2021 20:42:12 +0000 (22:42 +0200)
wrreport_body.php

index fbc9ed3d9fcfe0ef23b59134a1cf2d3fc425610c..c5669096b0224b03e57cefdcfa3b648922ebb4b9 100644 (file)
@@ -1138,11 +1138,11 @@ class WrReport {
        }
 
 
-       public static function MobileMenuHook($name, \MediaWiki\Minerva\MenuBuilder &$menu) {
+       public static function MobileMenuHook($name, \MediaWiki\Minerva\Menu\Group &$menu) {
                if ($name === 'discovery') {
                        // delete "Random page". As a removeEntry function is missing,
                        // a new menu is built here without the random page.
-                       $new_menu = new \MediaWiki\Minerva\MenuBuilder();
+                       $new_menu = new \MediaWiki\Minerva\Menu\Group($menu->getId());
                        foreach ($menu->getEntries() as $menuEntryRepresentation) {
                                $new_entry_name = $menuEntryRepresentation['name'];
                                if ($new_entry_name == 'random') continue;
@@ -1159,12 +1159,12 @@ class WrReport {
                        $menu = $new_menu;
 
                        // add region menu entry
-                       $icon = MobileUI::iconClass('', 'before', 'mw-ui-icon-wr-regions');
+                       $icon = MinervaUI::iconClass('', 'before', 'mw-ui-icon-wr-regions');
                        $title = Title::newFromText('Region', NS_CATEGORY);
                        $menu->insert('region')->addComponent('Regionen', $title->getLocalURL(), $icon);
 
                        // add "new reports" entry
-                       $icon = MobileUI::iconClass('', 'before', 'mw-ui-icon-wr-new-reports');
+                       $icon = MinervaUI::iconClass('', 'before', 'mw-ui-icon-wr-new-reports');
                        $title = Title::newFromText('Bahnberichte', NS_SPECIAL);
                        $menu->insert('wrreportnew')->addComponent('Neue Bahnberichte', $title->getLocalURL(), $icon);