protected static function menuitem_for_controller($controllerClass)
    {
        $urlBase = AdminRootController::admin_url();
        $urlSegment   = Config::inst()->get($controllerClass, 'url_segment');
        $menuPriority = Config::inst()->get($controllerClass, 'menu_priority');
        $ignoreFromMenu = Config::inst()->get($controllerClass, 'ignore_menuitem');

        // Don't add menu items defined the old way, or for controllers that are set to be ignored
        if (!$urlSegment || $ignoreFromMenu) {
            return null;
        }

        $link = Controller::join_links($urlBase, $urlSegment) . '/';

        // doesn't work if called outside of a controller context (e.g. in _config.php)
        // as the locale won't be detected properly. Use {@link LeftAndMain->MainMenu()} to update
        // titles for existing menu entries
        $menuTitle = LeftAndMain::menu_title($controllerClass);

        return new CMSMenuItem($menuTitle, $link, $controllerClass, $menuPriority);
    }