Ejemplo n.º 1
0
 }
 // [/Page sections]
 $banners = array();
 $selected_section = empty($_REQUEST['selected_section']) ? $_REQUEST['banner_type'] == 'P' ? 'url' : 'groups' : $_REQUEST['selected_section'];
 if ($selected_section == 'groups') {
     // [Groups banners]
     $all_groups_list = fn_get_groups_list();
     $view->assign('all_groups_list', $all_groups_list);
     $banners['groups'] = fn_get_aff_banners($_REQUEST['banner_type'], 'G', true);
     if (!empty($banners['groups'])) {
         foreach ($banners['groups'] as $k => $banner) {
             if (empty($banner['group_name'])) {
                 unset($banners['groups'][$k]);
                 continue;
             }
             $banners['groups'][$k]['groups'] = fn_get_group_data($banner['group_id']);
             if ($banners['groups'][$k]['groups']['status'] == 'D') {
                 unset($banners['groups'][$k]);
                 continue;
             }
             if (!empty($banners['groups'][$k]['groups']['product_ids'])) {
                 $banners['groups'][$k]['groups']['products'] = fn_get_product_name($banners['groups'][$k]['groups']['product_ids']);
             }
         }
     }
     // [/Groups banners]
 }
 if ($selected_section == 'categories') {
     // [Categoties banners]
     $all_categories_list = fn_get_plain_categories_tree(0, false);
     $view->assign('all_categories_list', $all_categories_list);
Ejemplo n.º 2
0
    if ($mode == 'delete') {
        if (!empty($_REQUEST['group_ids'])) {
            fn_delete_affiliate_groups($_REQUEST['group_ids']);
        } else {
            fn_set_notification('E', fn_get_lang_var('error'), fn_get_lang_var('error_no_data'));
        }
        $suffix = '.manage';
    }
    if ($mode == 'update') {
        $group_id = fn_update_affiliate_group($_REQUEST['group'], $_REQUEST['group_id'], DESCR_SL);
        $suffix = ".update?group_id={$group_id}";
    }
    return array(CONTROLLER_STATUS_OK, "product_groups{$suffix}");
}
if ($mode == 'update') {
    $group = fn_get_group_data($_REQUEST['group_id'], DESCR_SL);
    if (empty($group)) {
        return array(CONTROLLER_STATUS_NO_PAGE);
    }
    fn_add_breadcrumb(fn_get_lang_var('product_groups'), "product_groups.manage?link_to={$group['link_to']}");
    $view->assign('group', $group);
} elseif ($mode == 'add') {
    $link_to = empty($_REQUEST['link_to']) ? 'C' : $_REQUEST['link_to'];
    fn_add_breadcrumb(fn_get_lang_var('product_groups'), "product_groups.manage?link_to={$link_to}");
    $view->assign('link_to', $link_to);
} elseif ($mode == 'manage') {
    $link_to = empty($_REQUEST['link_to']) ? 'C' : $_REQUEST['link_to'];
    Registry::set('navigation.tabs', array('C' => array('title' => fn_get_lang_var('group_for_category'), 'href' => "product_groups.manage?link_to=C", 'ajax' => true), 'P' => array('title' => fn_get_lang_var('group_for_product'), 'href' => "product_groups.manage?link_to=P", 'ajax' => true), 'U' => array('title' => fn_get_lang_var('url'), 'href' => "product_groups.manage?link_to=U", 'ajax' => true)));
    // [/Page sections]
    $groups = fn_get_groups($link_to, false, @$_REQUEST['page'], DESCR_SL);
    // FIXME
Ejemplo n.º 3
0
             $redirect_url = "checkout.cart";
         } else {
             $redirect_url = "products.view?product_id={$_REQUEST['product_id']}";
         }
     } else {
         $banner_correct = false;
         $banner['type'] = 'T';
         $banner['link_to'] = 'U';
         $banner['url'] = Registry::get('config.http_location');
     }
 }
 if (!empty($banner['link_to']) && $banner['type'] != 'P') {
     $link_to = $banner['link_to'];
     $data =& $banner;
     if ($link_to == 'G' && !empty($banner['group_id'])) {
         $group = fn_get_group_data($banner['group_id'], true);
         if (empty($group) || $group['status'] == 'D') {
             return array(CONTROLLER_STATUS_REDIRECT, Registry::get('config.http_location') . '/' . Registry::get('config.customer_index'));
         }
         $link_to = @$group['link_to'];
         if (!empty($group['product_ids'])) {
             $group['products'] = fn_get_product_name($group['product_ids']);
         }
         $data =& $group;
     } elseif ($link_to == 'G' && empty($banner['group_id'])) {
         return array(CONTROLLER_STATUS_REDIRECT, Registry::get('config.http_location') . '/' . Registry::get('config.customer_index'));
     }
     if ($link_to == 'U') {
         $redirect_url = empty($data['url']) ? '' : $data['url'];
     } elseif ($link_to == 'P') {
         if (empty($data['products'])) {