Exemplo n.º 1
0
function vam_output_generated_category_path($id, $from = 'category')
{
    $calculated_category_path_string = '';
    $calculated_category_path = vam_generate_category_path($id, $from);
    for ($i = 0, $n = sizeof($calculated_category_path); $i < $n; $i++) {
        for ($j = 0, $k = sizeof($calculated_category_path[$i]); $j < $k; $j++) {
            $calculated_category_path_string .= $calculated_category_path[$i][$j]['text'] . '&nbsp;&gt;&nbsp;';
        }
        $calculated_category_path_string = substr($calculated_category_path_string, 0, -16) . '<br>';
    }
    $calculated_category_path_string = substr($calculated_category_path_string, 0, -4);
    if (strlen($calculated_category_path_string) < 1) {
        $calculated_category_path_string = TEXT_TOP;
    }
    return $calculated_category_path_string;
}
Exemplo n.º 2
0
         $cInfo_array = vam_array_merge($category, $category_childs, $category_products);
         $cInfo = new objectInfo($cInfo_array);
         $contents[] = array('text' => '<tr><td style="border-bottom: 1px solid Black; margin-bottom: 10px;" class="infoBoxContent"><b>' . $cInfo->categories_name . '</b></td></tr>');
         if ($cInfo->childs_count > 0) {
             $contents[] = array('text' => '<tr><td class="infoBoxContent">' . sprintf(TEXT_DELETE_WARNING_CHILDS, $cInfo->childs_count) . '</td></tr>');
         }
         if ($cInfo->products_count > 0) {
             $contents[] = array('text' => '<tr><td class="infoBoxContent">' . sprintf(TEXT_DELETE_WARNING_PRODUCTS, $cInfo->products_count) . '</td></tr>');
         }
     }
 }
 if (is_array($_POST['multi_products'])) {
     foreach ($_POST['multi_products'] as $multi_product) {
         $contents[] = array('text' => '<tr><td style="border-bottom: 1px solid Black; margin-bottom: 10px;" class="infoBoxContent"><b>' . vam_get_products_name($multi_product) . '</b></td></tr>');
         $product_categories_string = '';
         $product_categories = vam_generate_category_path($multi_product, 'product');
         for ($i = 0, $n = sizeof($product_categories); $i < $n; $i++) {
             $category_path = '';
             for ($j = 0, $k = sizeof($product_categories[$i]); $j < $k; $j++) {
                 $category_path .= $product_categories[$i][$j]['text'] . '&nbsp;&gt;&nbsp;';
             }
             $category_path = substr($category_path, 0, -16);
             $product_categories_string .= vam_draw_checkbox_field('multi_products_categories[' . $multi_product . '][]', $product_categories[$i][sizeof($product_categories[$i]) - 1]['id'], true) . '&nbsp;' . $category_path . '<br />';
         }
         $product_categories_string = substr($product_categories_string, 0, -4);
         $product_categories_string = '<tr><td class="infoBoxContent">' . $product_categories_string . '</td></tr>';
         $contents[] = array('text' => $product_categories_string);
     }
 }
 //close list table
 $contents[] = array('text' => '</table>');