// Just include the sledrun(s) if the condition is fulfilled.
//
+use MobileFrontend\MenuBuilder;
+
// Constants
// ---------
public static function MobileMenuHook($name, \MobileFrontend\MenuBuilder &$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 MenuBuilder();
+ foreach ($menu->getEntries() as $menuEntryRepresentation) {
+ $new_entry_name = $menuEntryRepresentation['name'];
+ if ($new_entry_name == 'random') continue;
+ $new_entry_components = $menuEntryRepresentation['components'];
+ $new_entry_isjsonly = isset($menuEntryRepresentation['class']) and $menuEntryRepresentation['class'] === 'jsonly';
+ $new_entry = $new_menu->insert($new_entry_name, $new_entry_isjsonly);
+ foreach ($new_entry_components as $new_entry_component) {
+ $label = $new_entry_component['text'];
+ $url = $new_entry_component['href'];
+ $className = $new_entry_component['class'];
+ $new_entry->addComponent($label, $url, $className, $new_entry_components);
+ }
+ }
+ $menu = $new_menu;
+
+ // add region menu entry
$icon = MobileUI::iconClass('random', 'before');
$title = Title::newFromText('Region', NS_CATEGORY);
$menu->insert('region')->addComponent('Regionen', $title->getLocalURL(), $icon, array('id' => 'regionButton', 'data-event-name' => 'region'));