Ejemplo n.º 1
0
 }
 if ($selected_section == 'categories') {
     // [Categoties banners]
     $all_categories_list = fn_get_plain_categories_tree(0, false);
     $view->assign('all_categories_list', $all_categories_list);
     $banners['categories'] = fn_get_aff_banners($_REQUEST['banner_type'], 'C', true);
     // [/Categoties banners]
 }
 if ($selected_section == 'products') {
     // [Products banners]
     $banners['products'] = fn_get_aff_banners($_REQUEST['banner_type'], 'P', true);
     // [/Products banners]
 }
 if ($selected_section == 'url') {
     // [Products banners]
     $banners['url'] = fn_get_aff_banners($_REQUEST['banner_type'], 'U', true);
     // [/Products banners]
 }
 $js_banners = array();
 foreach ($banners as $_key => $bans) {
     if (!empty($bans)) {
         foreach ($bans as $__key => $ban) {
             $js_banners[$ban['banner_id']]['example'] = fn_get_aff_banner_html('js', $ban);
             $js_banners[$ban['banner_id']]['code'] = fn_get_aff_banner_html('js', $ban, '', $auth['user_id']);
             if ($_REQUEST['banner_type'] == 'G') {
                 $image_data = fn_get_aff_banner_image_data($ban['banner_id'], 'icon');
                 if (!empty($image_data)) {
                     $banners[$_key][$__key] = fn_array_merge($ban, $image_data);
                 }
             }
             if ($_REQUEST['banner_type'] != 'P') {
Ejemplo n.º 2
0
    $link_to = empty($_REQUEST['link_to']) ? 'G' : $_REQUEST['link_to'];
    if ($link_to == 'G') {
        $view->assign('all_groups_list', fn_get_groups_list('Y', DESCR_SL));
    }
    fn_add_breadcrumb(fn_get_lang_var('banners'), "banners_manager.manage?banner_type={$banner_type}&link_to={$link_to}");
    $view->assign('banner_type', $banner_type);
    $view->assign('link_to', $link_to);
} elseif ($mode == 'manage') {
    $banner_type = empty($_REQUEST['banner_type']) ? 'T' : $_REQUEST['banner_type'];
    $link_to = empty($_REQUEST['link_to']) ? $banner_type == 'P' ? 'U' : 'G' : $_REQUEST['link_to'];
    // [Page sections]
    if ($banner_type != 'P') {
        Registry::set('navigation.tabs', array('G' => array('title' => fn_get_lang_var('product_groups'), 'href' => "banners_manager.manage?banner_type={$banner_type}&link_to=G", 'ajax' => true), 'C' => array('title' => fn_get_lang_var('categories'), 'href' => "banners_manager.manage?banner_type={$banner_type}&link_to=C", 'ajax' => true), 'P' => array('title' => fn_get_lang_var('products'), 'href' => "banners_manager.manage?banner_type={$banner_type}&link_to=P", 'ajax' => true), 'U' => array('title' => fn_get_lang_var('url'), 'href' => "banners_manager.manage?banner_type={$banner_type}&link_to=U", 'ajax' => true)));
    }
    // [/Page sections]
    $banners = fn_get_aff_banners($banner_type, $link_to, false, DESCR_SL);
    // FIXME
    $view->assign('banners', $banners);
    $view->assign('link_to', $link_to);
    $view->assign('banner_type', $banner_type);
    if ($link_to == 'G') {
        $all_groups_list = fn_get_groups_list('Y', DESCR_SL);
        $view->assign('all_groups_list', $all_groups_list);
    }
    Registry::set('navigation.dynamic.sections', array('T' => array('title' => fn_get_lang_var('text_banners'), 'href' => "banners_manager.manage?banner_type=T"), 'G' => array('title' => fn_get_lang_var('graphic_banners'), 'href' => "banners_manager.manage?banner_type=G"), 'P' => array('title' => fn_get_lang_var('product_banners'), 'href' => "banners_manager.manage?banner_type=P")));
    Registry::set('navigation.dynamic.active_section', $banner_type);
} elseif ($mode == 'delete') {
    if (!empty($_REQUEST['banner_id'])) {
        fn_delete_banner($_REQUEST['banner_id']);
        fn_set_notification('N', fn_get_lang_var('information'), fn_get_lang_var('banner_deleted'));
    } else {