예제 #1
0
        $menu = MenuService::load($id_post);
        $menu->set_title($menu_name);
    } else {
        $menu = new ContentMenu($menu_name);
    }
    if (!of_class($menu, CONTENT_MENU__CLASS)) {
        redirect('menus.php');
    }
    $menu->enabled(retrieve(POST, 'activ', MENU_NOT_ENABLED));
    if ($menu->is_enabled()) {
        $menu->set_block(retrieve(POST, 'location', BLOCK_POSITION__NOT_ENABLED));
    }
    $menu->set_auth(Authorizations::build_auth_array_from_form(AUTH_MENUS));
    $menu->set_display_title(retrieve(POST, 'display_title', false));
    $menu->set_content((string) $_POST['contents']);
    MenuService::save($menu);
    MenuService::generate_cache();
    redirect('menus.php#m' . $id_post);
}
$edit = !empty($id);
include 'lateral_menu.php';
lateral_menu();
$tpl = new Template('admin/menus/content.tpl');
$tpl->assign_vars(array('KERNEL_EDITOR' => display_editor(), 'L_REQUIRE_TITLE' => to_js_string($LANG['require_title']), 'L_REQUIRE_TEXT' => to_js_string($LANG['require_text']), 'L_NAME' => $LANG['name'], 'L_STATUS' => $LANG['status'], 'L_AUTHS' => $LANG['auths'], 'L_ENABLED' => $LANG['enabled'], 'L_DISABLED' => $LANG['disabled'], 'L_ACTIVATION' => $LANG['activation'], 'L_GUEST' => $LANG['guest'], 'L_USER' => $LANG['member'], 'L_MODO' => $LANG['modo'], 'L_ADMIN' => $LANG['admin'], 'L_LOCATION' => $LANG['location'], 'L_ACTION_MENUS' => $edit ? $LANG['menus_edit'] : $LANG['add'], 'L_ACTION' => $edit ? $LANG['update'] : $LANG['submit'], 'L_RESET' => $LANG['reset'], 'ACTION' => 'save', 'L_DISPLAY_TITLE' => $LANG['display_title']));
$block = BLOCK_POSITION__HEADER;
$array_location = array(BLOCK_POSITION__HEADER => $LANG['menu_header'], BLOCK_POSITION__SUB_HEADER => $LANG['menu_subheader'], BLOCK_POSITION__LEFT => $LANG['menu_left'], BLOCK_POSITION__TOP_CENTRAL => $LANG['menu_top_central'], BLOCK_POSITION__BOTTOM_CENTRAL => $LANG['menu_bottom_central'], BLOCK_POSITION__RIGHT => $LANG['menu_right'], BLOCK_POSITION__TOP_FOOTER => $LANG['menu_top_footer'], BLOCK_POSITION__FOOTER => $LANG['menu_footer']);
if ($edit) {
    $menu = MenuService::load($id);
    if (!of_class($menu, CONTENT_MENU__CLASS)) {
        redirect('menus.php');
    }
예제 #2
0
     include '../kernel/framework/core/cache.class.php';
     include '../lang/' . $lang . '/main.php';
     $Cache = new Cache();
     import('modules/packages_manager');
     foreach ($DISTRIBUTION_MODULES as $module_name) {
         $Cache->load('modules', RELOAD_CACHE);
         PackagesManager::install_module($module_name, true, DO_NOT_GENERATE_CACHE_AFTER_THE_OPERATION);
     }
     $Cache->generate_file('modules');
     $Cache->load('modules', RELOAD_CACHE);
     import('core/menu_service');
     MenuService::enable_all(true);
     $modules_menu = MenuService::website_modules(VERTICAL_MENU);
     MenuService::move($modules_menu, BLOCK_POSITION__LEFT, false);
     MenuService::change_position($modules_menu, -$modules_menu->get_block_position());
     MenuService::save($modules_menu);
     $Cache->generate_all_files();
     $Cache->load('themes', RELOAD_CACHE);
     $Cache->Generate_file('css');
     $Sql->close();
     redirect(HOST . FILE . add_lang('?step=' . (STEP_SITE_CONFIG + 1), true));
 }
 $template->assign_vars(array('C_SITE_CONFIG' => true, 'SITE_URL' => $server_name, 'SITE_PATH' => $server_path));
 $site_timezone = number_round(date('Z') / 3600, 0) - (int) date('I');
 for ($i = -12; $i <= 14; $i++) {
     $timezone_name = '';
     if ($i === 0) {
         $timezone_name = 'GMT';
     } elseif ($i > 0) {
         $timezone_name = 'GMT + ' . $i;
     } else {
예제 #3
0
 function add_mini_module($module, $generate_cache = true)
 {
     $info_module = load_ini_file(PATH_TO_ROOT . '/' . $module . '/lang/', get_ulang());
     if (empty($info_module) || empty($info_module['mini_module'])) {
         return false;
     }
     $mini_modules_menus = parse_ini_array($info_module['mini_module']);
     if (empty($mini_modules_menus)) {
         return false;
     }
     $installed = false;
     foreach ($mini_modules_menus as $filename => $location) {
         if (file_exists(PATH_TO_ROOT . '/' . $module . '/' . $filename)) {
             $file = explode('.', $filename, 2);
             if (!is_array($file) || count($file) < 1) {
                 continue;
             }
             include_once PATH_TO_ROOT . '/' . $module . '/' . $filename;
             if (!function_exists($file[0])) {
                 continue;
             }
             $menu = new ModuleMiniMenu($module, $file[0]);
             $menu->enabled(false);
             $menu->set_auth(array('r1' => MENU_AUTH_BIT, 'r0' => MENU_AUTH_BIT, 'r-1' => MENU_AUTH_BIT));
             $menu->set_block(MenuService::str_to_location($location));
             MenuService::save($menu);
             if ($generate_cache) {
                 MenuService::generate_cache();
             }
             $installed = true;
         }
     }
     return $installed;
 }