Пример #1
0
    // [Page sections]
    if (!empty($locations)) {
        foreach ($locations as $location => $_location) {
            Registry::set("navigation.tabs.{$location}", array('title' => fn_get_lang_var($location), 'href' => "block_manager.manage?selected_section={$location}"));
        }
    }
    // [/Page sections]
    $selected_section = empty($_REQUEST['selected_section']) ? 'all_pages' : $_REQUEST['selected_section'];
    $view->assign('locations', $locations);
    list($blocks, $object_id) = fn_get_blocks(array('location' => $selected_section, 'all' => true), false, DESCR_SL);
    if ($selected_section !== 'all_pages') {
        list($all_blocks) = fn_get_blocks(array('location' => 'all_pages', 'all' => true, 'block_properties_location' => $selected_section), false);
        $blocks = fn_array_merge($blocks, $all_blocks, true);
    }
    $blocks = fn_sort_blocks($object_id, $selected_section, $blocks);
    $blocks = fn_check_blocks_availability($blocks, $view->get_var('block_settings'));
    $view->assign('avail_positions', fn_get_available_group($selected_section, 0, DESCR_SL));
    $view->assign('specific_settings', fn_process_specific_settings(fn_get_block_specific_settings()));
    $view->assign('location', $selected_section);
    $view->assign('blocks', $blocks);
} elseif ($mode == 'manage_items') {
    $view->assign('location', $_REQUEST['location']);
    $view->assign('block', fn_get_block_data($_REQUEST['block_id'], CART_LANGUAGE, false, $_REQUEST['location']));
    $object_id = empty($_REQUEST['object_id']) ? '' : $_REQUEST['object_id'];
    $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');
Пример #2
0
    $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");
    $product_ids = $_SESSION['product_ids'];
    $selected_fields = $_SESSION['selected_fields'];
    $field_groups = array('A' => array('product' => 'products_data', 'product_code' => 'products_data', 'page_title' => 'products_data'), 'B' => array('price' => 'products_data', 'list_price' => 'products_data', 'amount' => 'products_data', 'min_qty' => 'products_data', 'max_qty' => 'products_data', 'weight' => 'products_data', 'shipping_freight' => 'products_data', 'qty_step' => 'products_data', 'list_qty_count' => 'products_data', 'popularity' => 'products_data'), 'C' => array('is_edp' => 'products_data', 'edp_shipping' => 'products_data', 'free_shipping' => 'products_data', 'feature_comparison' => 'products_data', 'buy_in_advance' => 'products_data'), 'D' => array('short_description' => 'products_data', 'full_description' => 'products_data', 'meta_keywords' => 'products_data', 'meta_description' => 'products_data', 'search_words' => 'products_data'), 'T' => array('timestamp' => 'products_data', 'avail_since' => 'products_data'), 'S' => array('status' => array('name' => 'products_data', 'variants' => array('A' => 'active', 'D' => 'disabled', 'H' => 'hidden')), 'tracking' => array('name' => 'products_data', 'variants' => array('O' => 'track_with_options', 'B' => 'track_without_options', 'D' => 'dont_track')), 'zero_price_action' => array('name' => 'products_data', 'variants' => array('R' => 'zpa_refuse', 'P' => 'zpa_permit', 'A' => 'zpa_ask_price'))), 'E' => array('main_category' => 'products_data', 'add_categories' => 'products_data'), 'L' => array('localization' => array('name' => 'localization')), 'W' => array('details_layout' => 'products_data'));