Esempio n. 1
0
    save_position(Menu::BLOCK_POSITION__BOTTOM_CENTRAL);
    save_position(Menu::BLOCK_POSITION__TOP_FOOTER);
    save_position(Menu::BLOCK_POSITION__FOOTER);
    save_position(Menu::BLOCK_POSITION__LEFT);
    save_position(Menu::BLOCK_POSITION__RIGHT);
    save_position(Menu::BLOCK_POSITION__NOT_ENABLED);
    $columns_disabled = new ColumnsDisabled();
    $columns_disabled->set_disable_header(!AppContext::get_request()->get_bool('header_enabled', false));
    $columns_disabled->set_disable_sub_header(!AppContext::get_request()->get_bool('sub_header_enabled', false));
    $columns_disabled->set_disable_top_central(!AppContext::get_request()->get_bool('top_central_enabled', false));
    $columns_disabled->set_disable_bottom_central(!AppContext::get_request()->get_bool('bottom_central_enabled', false));
    $columns_disabled->set_disable_top_footer(!AppContext::get_request()->get_bool('top_footer_enabled', false));
    $columns_disabled->set_disable_footer(!AppContext::get_request()->get_bool('footer_enabled', false));
    $columns_disabled->set_disable_left_columns(!AppContext::get_request()->get_bool('left_column_enabled', false));
    $columns_disabled->set_disable_right_columns(!AppContext::get_request()->get_bool('right_column_enabled', false));
    ThemesManager::change_columns_disabled($theme_post, $columns_disabled);
    MenuService::generate_cache();
    AppContext::get_response()->redirect('menus.php');
}
$tpl = new FileTemplate('admin/menus/menus.tpl');
$menu_template = new FileTemplate('admin/menus/menu.tpl');
$menu_template->put_all(array('L_ENABLED' => LangLoader::get_message('enabled', 'common'), 'L_DISABLED' => LangLoader::get_message('disabled', 'common'), 'I_HEADER' => Menu::BLOCK_POSITION__HEADER, 'I_SUBHEADER' => Menu::BLOCK_POSITION__SUB_HEADER, 'I_TOPCENTRAL' => Menu::BLOCK_POSITION__TOP_CENTRAL, 'I_BOTTOMCENTRAL' => Menu::BLOCK_POSITION__BOTTOM_CENTRAL, 'I_TOPFOOTER' => Menu::BLOCK_POSITION__TOP_FOOTER, 'I_FOOTER' => Menu::BLOCK_POSITION__FOOTER, 'I_LEFT' => Menu::BLOCK_POSITION__LEFT, 'I_RIGHT' => Menu::BLOCK_POSITION__RIGHT, 'U_TOKEN' => AppContext::get_session()->get_token()));
foreach ($menus_blocks as $block_id => $menus) {
    // For each block
    $i = 0;
    $max = count($menus);
    foreach ($menus as $menu) {
        // For each Menu in this block
        $menu_tpl = clone $menu_template;
        $id = $menu->get_id();
        $enabled = $menu->is_enabled();