} else {
                 $messageStack->add_session('Copy type not specified.', 'error');
             }
         }
     }
     unset($_SESSION['copied']);
 }
 //copy multi_products
 if (is_array($_POST['multi_products']) && (is_array($_POST['dest_cat_ids']) || vam_not_null($_POST['dest_category_id']))) {
     foreach ($_POST['multi_products'] as $product_id) {
         $product_id = vam_db_prepare_input($product_id);
         if (is_array($_POST['dest_cat_ids'])) {
             foreach ($_POST['dest_cat_ids'] as $dest_category_id) {
                 $dest_category_id = vam_db_prepare_input($dest_category_id);
                 if ($_POST['copy_as'] == 'link') {
                     $catfunc->link_product($product_id, $dest_category_id);
                 } elseif ($_POST['copy_as'] == 'duplicate') {
                     $catfunc->duplicate_product($product_id, $dest_category_id);
                 } else {
                     $messageStack->add_session('Copy type not specified.', 'error');
                 }
             }
         } elseif (vam_not_null($_POST['dest_category_id'])) {
             $dest_category_id = vam_db_prepare_input($_POST['dest_category_id']);
             if ($_POST['copy_as'] == 'link') {
                 $catfunc->link_product($product_id, $dest_category_id);
             } elseif ($_POST['copy_as'] == 'duplicate') {
                 $catfunc->duplicate_product($product_id, $dest_category_id);
             } else {
                 $messageStack->add_session('Copy type not specified.', 'error');
             }
         }
     }
     if ($_GET['pID']) {
         xtc_redirect(xtc_href_link(FILENAME_CATEGORIES, 'cPath=' . $_GET['cPath'] . '&pID=' . $_GET['pID'] . $catfunc->page_parameter));
     } else {
         xtc_redirect(xtc_href_link(FILENAME_CATEGORIES, 'cPath=' . $_GET['cPath'] . '&cID=' . $_GET['cID'] . $catfunc->page_parameter));
     }
     break;
     //EOB setpflag
 //EOB setpflag
 case 'setsflag':
     if ($_GET['flag'] == '0' || $_GET['flag'] == '1') {
         if ($_GET['pID']) {
             $catfunc->set_product_startpage($_GET['pID'], $_GET['flag']);
             if ($_GET['flag'] == '1') {
                 $catfunc->link_product($_GET['pID'], 0);
             }
             //BOF - Dokuman - 2009-11-12 - BUGFIX #0000351: When products disable display on startpage, should update table products_to_categories
             $catfunc->set_product_remove_startpage_sql($_GET['pID'], $_GET['flag']);
             //if ($_GET['flag'] == '0') xtc_redirect(xtc_href_link(FILENAME_CATEGORIES));
             //EOF - Dokuman - 2009-11-12 - BUGFIX #0000351: When products disable display on startpage, should update table products_to_categories
         }
     }
     if ($_GET['pID']) {
         xtc_redirect(xtc_href_link(FILENAME_CATEGORIES, 'cPath=' . $_GET['cPath'] . '&pID=' . $_GET['pID'] . $catfunc->page_parameter));
     } else {
         xtc_redirect(xtc_href_link(FILENAME_CATEGORIES, 'cPath=' . $_GET['cPath'] . '&cID=' . $_GET['cID'] . $catfunc->page_parameter));
     }
     break;
     //EOB setsflag
 //EOB setsflag