code/CMSMenu.php
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;
    }
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;
    }
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 ; }
Get all menu entries.

@return array
Get all menu entries .