예제 #1
0
            } else {
                MenuService::change_position($menu, MenuService::MOVE_DOWN);
            }
            break;
        default:
            if (!empty($move)) {
                // Move a Menu
                MenuService::move($menu, $move);
            }
            break;
    }
    MenuService::generate_cache();
    AppContext::get_response()->redirect('menus.php' . ($action != 'delete' ? '#m' . $id : ''));
}
// Try to find out new mini-modules and delete old ones
MenuService::update_mini_modules_list(false);
// Retrieves all the menu
$menus_blocks = MenuService::get_menus_map();
function get_block($position)
{
    $blocks = array(Menu::BLOCK_POSITION__HEADER => 'mod_header', Menu::BLOCK_POSITION__SUB_HEADER => 'mod_subheader', Menu::BLOCK_POSITION__TOP_CENTRAL => 'mod_topcentral', Menu::BLOCK_POSITION__NOT_ENABLED => 'mod_central', Menu::BLOCK_POSITION__BOTTOM_CENTRAL => 'mod_bottomcentral', Menu::BLOCK_POSITION__TOP_FOOTER => 'mod_topfooter', Menu::BLOCK_POSITION__FOOTER => 'mod_footer', Menu::BLOCK_POSITION__LEFT => 'mod_left', Menu::BLOCK_POSITION__RIGHT => 'mod_right');
    return $blocks[$position];
}
function save_position($block_position)
{
    $menus = MenuService::get_menu_list();
    $menus_tree = json_decode(TextHelper::html_entity_decode(AppContext::get_request()->get_value('menu_tree_' . get_block($block_position))));
    foreach ($menus_tree as $position => $tree) {
        $id = $tree->id;
        if (array_key_exists($id, $menus)) {
            $menu = $menus[$id];