Gets the user's default menu

@return string
552300
public function get_default(): ?string
  {
    if (
      ($id_opt = $this->from_path('default')) &&
      ($all = $this->pref->get_all($id_opt))
    ){
      $id = false;
      foreach ( $all as $a ){
        if ( !empty($a['id_user']) ){
          $id = $a['id_alias'];
          break;
        }
        else if ( !empty($a['id_group']) ){
          $id = $a['id_alias'];
          break;
        }
        else if ( !empty($a['public']) ){
          $id = $a['id_alias'];
          break;
        }
      }
      return $id;
    }
	return null;
  }
148662
protected function getDefault()
    {
        $current_url = $this->url->get();

        return array(
            'id' => uniqid(),
            'status' => true,
            'title' => '',
            'url' => '',
            'total' => 0,
            'errors' => 0,
            'done' => 0,
            'inserted' => 0,
            'updated' => 0,
            'context' => array(
                'offset' => 0,
                'line' => 1,
            ),
            'data' => array(),
            'message' => array(
                'start' => $this->translation->text('Starting...'),
                'finish' => $this->translation->text('Finished'),
                'process' => $this->translation->text('Processing...')
            ),
            'redirect' => array(
                'finish' => $current_url,
                'errors' => $current_url,
                'no_results' => $current_url
            ),
            'redirect_message' => array(
                'finish' => '',
                'errors' => '',
                'no_results' => ''
            ),
            'log' => array(
                'errors' => ''
            )
        );
    }
322515
public function getMenu()
    {
        $this->buildMenu();
        $this->applyEdits();
        $this->applyRemoves();
        $this->applyRenames();
        $this->applyOrdering();
        return $this->menu;
    }
863500
private function getDefaultBrowser()
    {
        $browsers = ['xdg-open', 'gnome-open', 'start'];
        if (OsUtil::isOsX()) {
            $browsers = ['open'];
        }

        foreach ($browsers as $browser) {
            if ($this->shell->commandExists($browser)) {
                return $browser;
            }
        }

        return false;
    }
1174386
public function getDefaultActions()
    {
        /** @var ActiveController $owner */
        $owner = $this->owner;

        $defaultActions = $owner->actions();
        // set default indexes to avoid many isset() calls later
        $actions = [
            'index' => false,
            'view' => false,
            'print' => false,
            'update' => false,
            'delete' => false,
            'toggle' => false,
            'history' => false,
            'help' => false,
            'state' => false,
        ];
        $availableActions = array_merge($actions, $defaultActions);
        foreach ($availableActions as $action => $enabled) {
            $availableActions[$action] = $enabled && in_array($action, $this->buttons);
        }
        return $availableActions;
    }
1013451
protected function getActiveMenuRoute()
    {
        if (is_null($this->activeMenuRoute)) {
            $this->activeMenuRoute = Registry::get('active_menu_route');
        }
        return $this->activeMenuRoute;
    }
205259
protected function getDefaultOptions()
    {
        if (!isset($this->defaultOptions['replacements']['APP_NAME'])) {
            $this->defaultOptions['replacements']['APP_NAME'] = $this->env('APP_NAME');
        }

        return $this->defaultOptions;
    }
428783
protected function getMenuList()
    {
        $links = $this->menu->getMenuList();

        $links->addParameterSources($this->request, $this->menu->getParameterSource());
        $links->addCurrentParent($this->_('Cancel'));

        if ($this->menuShowSiblings) {
            $links->addCurrentSiblings();
        }

        if ($this->menuShowChildren) {
            $links->addCurrentChildren();
        }

        return $links;
    }
1367768
public function get_defaultsetting() {
        $adminroot =  admin_get_root(false, false);
        if (!empty($adminroot->custom_defaults)) {
            $plugin = is_null($this->plugin) ? 'moodle' : $this->plugin;
            if (isset($adminroot->custom_defaults[$plugin])) {
                if (array_key_exists($this->name, $adminroot->custom_defaults[$plugin])) { // null is valid value here ;-)
                    return $adminroot->custom_defaults[$plugin][$this->name];
                }
            }
        }
        return $this->defaultsetting;
    }
265407
public function getMenu()
    {
        if ( null === $this->_menu &&
             ! empty( $this->menuId ) )
        {
            $this->_menu = $this->getMenuModel()
                                ->find( $this->menuId );
        }

        return $this->_menu;
    }
1188393
public function sidebarMenu()
    {
        if (get_field('nav_sub_enable', 'option') === false) {
            return '';
        }

        if (get_field('nav_primary_type', 'option') == 'wp' && in_array(get_field('nav_sub_type', 'option'), array('sub', 'wp'))) {
            return $this->sidebarMenuWP();
        } else {
            return $this->sidebarMenuAuto();
        }

        return '';
    }
432267
protected function _getUtilityNavigation()
    {
        $action = $this->_action();

        $utilityNavigation = $action->getConfig('scaffold.utility_navigation');
        if ($utilityNavigation === null) {
            $utilityNavigation = [
                new MenuItem('Account', ['controller' => 'Users', 'action' => 'account']),
                new MenuItem('Log Out', ['controller' => 'Users', 'action' => 'logout']),
            ];
        }

        return $utilityNavigation;
    }
721480
public static function get_menu_items()
    {
        $menuItems = array();

        // Set up default menu items
        if (!self::$menu_is_cleared) {
            $cmsClasses = self::get_cms_classes();
            foreach ($cmsClasses as $cmsClass) {
                $menuItem = self::menuitem_for_controller($cmsClass);
                $menuCode = self::get_menu_code($cmsClass);
                if ($menuItem) {
                    $menuItems[$menuCode] = $menuItem;
                }
            }
        }

        // Apply changes
        foreach (self::$menu_item_changes as $change) {
            switch ($change['type']) {
                case 'add':
                    $menuItems[$change['code']] = $change['item'];
                    break;

                case 'remove':
                    unset($menuItems[$change['code']]);
                    break;

                default:
                    user_error("Bad menu item change type {$change['type']}", E_USER_WARNING);
            }
        }

        // Sort menu items according to priority, then title asc
        $menuPriority = array();
        $menuTitle    = array();
        foreach ($menuItems as $key => $menuItem) {
            $menuPriority[$key] = is_numeric($menuItem->priority) ? $menuItem->priority : 0;
            $menuTitle[$key]    = $menuItem->title;
        }
        array_multisort($menuPriority, SORT_DESC, $menuTitle, SORT_ASC, $menuItems);

        return $menuItems;
    }
1365085
public function adminInit ()
    {
        set_current_screen($this->menuSlug);
        $this->doUserFunc(function (AdminPageMode $mode) {
            return $mode->getInitFunc();
        });
    }
841521
public function get_defaultsetting() {
        $this->load_choices();
        $defaultsetting = parent::get_defaultsetting();
        if (empty($defaultsetting)) {
            return array('$@NONE@$');
        } else if (array_key_exists($defaultsetting, $this->choices)) {
                return $defaultsetting;
            } else {
                return '';
            }
    }
841471
public function getMenuPresence()
    {
        return [
            'id'               => 'models.' . $this->getRouteSlug(),
            'label'            => ucfirst($this->getInformation()->labelPlural(false)),
            'label_translated' => $this->getInformation()->labelPluralTranslationKey(),
            'type'             => MenuPresenceType::ACTION,
            'action'           => $this->routeHelper->getRouteNameForModelClass($this->class, true) . '.index',
            'parameters'       => [
                'home' => true,
            ],
            'permissions'      => [
                "models.{$this->getRouteSlug()}.*",
            ],
        ];
    }
149457
public function getMenuList()
    {
        $result = $this->httpRaw(self::WECHAT_MENU_GET_URL . 'access_token=' . $this->getAccessToken());
        return isset($result['menu']['button']) ? $result['menu']['button'] : false;
    }