<?php

$menu = &$conf['sys_menus'];

if (IS_POST)
{
    foreach ($conf['sys_menus'] as $k => $v)
    {
        $conf['sys_menus'][$k]['order'] = intval($_POST['order'][$k]);
        $conf['sys_menus'][$k]['show'] = is_array($_POST['show_menu'][$k]) ? $_POST['show_menu'][$k] :
            array();
    }

    $arr = array();
    foreach ($conf['sys_menus'] as $k => $v)
    {
        $arr[$v['order']][$k] = $v;
    }
    ksort($arr);
    $conf['sys_menus'] = array();
    foreach ($arr as $v)
    {
        foreach ($v as $key => $val)
        {
            $conf['sys_menus'][$key] = $val;
        }
    }
    set_conf('sys_menus', $conf['sys_menus']);
    yun_succeed('提交成功', url(RPGM . 'menu/'));
}

?>