Esempio n. 1
0
if (Registry::get('settings.store_mode') == 'closed') {
    if (!empty($_REQUEST['store_access_key'])) {
        $_SESSION['store_access_key'] = $_GET['store_access_key'];
    }
    var_dump($_SESSION['store_access_key']);
    if (empty($_SESSION['store_access_key']) || $_SESSION['store_access_key'] != Registry::get('settings.General.store_access_key')) {
        return array(CONTROLLER_STATUS_REDIRECT, Registry::get('config.current_location') . '/store_closed.html');
    }
}
if (empty($_REQUEST['product_id']) && empty($_REQUEST['category_id'])) {
    unset($_SESSION['current_category_id']);
}
fn_add_breadcrumb(fn_get_lang_var('home'), $index_script);
$request_params = $_REQUEST;
$request_params['location'] = fn_get_blocks_location(CONTROLLER);
list($blocks) = fn_get_blocks($request_params);
$view->assign('blocks', $blocks);
$view->assign('location_data', fn_get_location_data($request_params['location'], true));
// Get quick links
Registry::register_cache('quick_links', array('static_data'), CACHE_LEVEL_LOCALE);
if (Registry::is_exist('quick_links') == false) {
    Registry::set('quick_links', fn_get_static_data_section('N'));
}
// Get top menu
Registry::register_cache('top_menu', array('static_data', 'categories', 'pages'), CACHE_LEVEL_LOCALE_AUTH);
if (Registry::is_exist('top_menu') == false) {
    Registry::set('top_menu', fn_top_menu_form(fn_get_static_data_section('A', true)));
}
$quick_links =& Registry::get('quick_links');
$top_menu =& Registry::get('top_menu');
$top_menu = fn_top_menu_select($top_menu, $controller, $mode, Registry::get('current_url'));
Esempio n. 2
0
    $view->assign('object_id', $object_id);
    $view->assign('redir_url', empty($_REQUEST['redir_url']) ? '' : $_REQUEST['redir_url']);
    $block_items = db_get_field("SELECT item_ids FROM ?:block_links WHERE block_id = ?i AND object_id = ?i", $_REQUEST['block_id'], $object_id);
    if (!empty($block_items)) {
        $items_ids = explode(',', $block_items);
        $page = empty($_REQUEST['page']) ? 1 : $_REQUEST['page'];
        $items_per_page = Registry::get('settings.Appearance.admin_elements_per_page');
        fn_paginate($page, count($items_ids), $items_per_page);
        if (!empty($_SESSION['items_per_page'])) {
            $items_per_page = $_SESSION['items_per_page'];
        }
        $start_pos = ($page - 1) * $items_per_page;
        $view->assign('start_position', $start_pos);
        $view->assign('block_items', array_slice($items_ids, $start_pos, $items_per_page));
    } else {
        list($blocks) = fn_get_blocks(array('location' => $_REQUEST['location']));
        if (!empty($blocks)) {
            $view->assign('block', fn_get_selected_block_data(array('selected_block_id' => $_REQUEST['block_id']), $blocks, $_REQUEST['object_id'], $_REQUEST['location']));
        }
    }
} elseif ($mode == 'specific_settings') {
    $specific_settings = fn_get_block_specific_settings();
    if (!empty($specific_settings[$_REQUEST['type']]) && !empty($specific_settings[$_REQUEST['type']][$_REQUEST['value']])) {
        $specific_settings = fn_process_specific_settings($specific_settings, $_REQUEST['type'], $_REQUEST['value']);
        $view->assign('spec_settings', $specific_settings[$_REQUEST['type']][$_REQUEST['value']]);
    }
    $view->assign('s_set_id', $_REQUEST['block_id'] . $_REQUEST['block_type'] . '_' . $_REQUEST['type']);
} elseif ($mode == 'assign_items') {
    $view->assign('location', $_REQUEST['location']);
    $view->assign('block', fn_get_block_data($_REQUEST['block_id'], CART_LANGUAGE, false, $_REQUEST['location']));
} elseif ($mode == 'update') {
Esempio n. 3
0
} elseif ($mode == 'update') {
    Registry::set('navigation.tabs', array('basic' => array('title' => fn_get_lang_var('general'), 'js' => true), 'blocks' => array('title' => fn_get_lang_var('blocks'), 'js' => true), 'addons' => array('title' => fn_get_lang_var('addons'), 'js' => true)));
    // Get current page data
    $page_data = fn_get_page_data($page_id, DESCR_SL);
    if (!$page_data) {
        return array(CONTROLLER_STATUS_NO_PAGE);
    }
    // [Breadcrumbs]
    fn_add_breadcrumb(fn_get_lang_var('pages'), "pages.manage&get_tree=multi_level");
    // [/Breadcrumbs]
    if ($page_data['page_type'] == PAGE_TYPE_LINK) {
        Registry::set('navigation.selected_tab', 'content');
        Registry::set('navigation.subsection', 'links');
    }
    // [Block manager]
    list($blocks) = fn_get_blocks(array('location' => 'pages', 'block_type' => 'B', 'all' => true));
    if (!empty($blocks)) {
        $view->assign('blocks', $blocks);
        $view->assign('selected_block', fn_get_selected_block_data($_REQUEST, $blocks, $_REQUEST['page_id'], 'pages'));
        $view->assign('block_properties', fn_get_block_properties());
    }
    // [/Block manager]
    list($pages_tree, $params) = fn_get_pages(array('get_tree' => 'plain'));
    $view->assign('all_pages_list', $pages_tree);
    $view->assign('page_type', $page_data['page_type']);
    $view->assign('page_data', $page_data);
    $view->assign('page_type_data', fn_get_page_object_by_type($page_data['page_type']));
    $view->assign('companies', fn_get_short_companies());
    //
    // Delete page
    //
Esempio n. 4
0
    $view->assign('product_options', $product_options);
    $view->assign('global_options', fn_get_product_options(0));
    // If the product is electronnicaly distributed, get the assigned files
    $view->assign('product_files', fn_get_product_files($_REQUEST['product_id']));
    // [Page sections]
    Registry::set('navigation.tabs', array('detailed' => array('title' => fn_get_lang_var('general'), 'js' => true), 'images' => array('title' => fn_get_lang_var('images'), 'js' => true), 'categories' => array('title' => fn_get_lang_var('additional_categories'), 'js' => true), 'options' => array('title' => fn_get_lang_var('options'), 'js' => true), 'qty_discounts' => array('title' => fn_get_lang_var('qty_discounts'), 'js' => true), 'files' => array('title' => fn_get_lang_var('files'), 'js' => true), 'blocks' => array('title' => fn_get_lang_var('blocks'), 'js' => true), 'addons' => array('title' => fn_get_lang_var('addons'), 'js' => true), 'vendors' => array('title' => fn_get_lang_var('vendors'), 'js' => true)));
    // [/Page sections]
    // If we have some additional product fields, lets add a tab for them
    if (!empty($product_data['product_features'])) {
        Registry::set('navigation.tabs.features', array('title' => fn_get_lang_var('features'), 'js' => true));
    }
    // [Block manager]
    $block_settings = fn_get_all_blocks('products');
    $view->assign('block_settings', $block_settings);
    list($blocks, $object_id) = fn_get_blocks(array('location' => 'products', 'all' => true, 'product_id' => $_REQUEST['product_id']), false, DESCR_SL);
    list($all_blocks) = fn_get_blocks(array('location' => 'all_pages', 'all' => true, 'block_properties_location' => 'products'), false);
    $blocks = fn_array_merge($blocks, $all_blocks, true);
    $blocks = fn_sort_blocks($object_id, 'products', $blocks);
    $blocks = fn_check_blocks_availability($blocks, $block_settings);
    $view->assign('location', $selected_section);
    $view->assign('blocks', $blocks);
    $view->assign('avail_positions', fn_get_available_group('products', $_REQUEST['product_id'], DESCR_SL));
    // [/Block manager]
    //
    // 'Mulitple products updating' page
    //
} elseif ($mode == 'm_update') {
    if (empty($_SESSION['product_ids']) || empty($_SESSION['selected_fields']) || empty($_SESSION['selected_fields']['object']) || $_SESSION['selected_fields']['object'] != 'product') {
        return array(CONTROLLER_STATUS_REDIRECT, "products.manage");
    }
    fn_add_breadcrumb(fn_get_lang_var('products'), "products.manage");