$cInfo_array = xtc_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>' . xtc_get_products_name($multi_product) . '</b></td></tr>'); $product_categories_string = ''; $product_categories = xtc_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'] . ' > '; } $category_path = substr($category_path, 0, -16); $product_categories_string .= xtc_draw_checkbox_field('multi_products_categories[' . $multi_product . '][]', $product_categories[$i][sizeof($product_categories[$i]) - 1]['id'], true) . ' ' . $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>');
/** * xtc_output_generated_category_path() * * @param mixed $id * @param string $from * @return */ function xtc_output_generated_category_path($id, $from = 'category') { $calculated_category_path_string = ''; $calculated_category_path = xtc_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'] . ' > '; } $calculated_category_path_string = substr($calculated_category_path_string, 0, -16) . '<br />'; } $calculated_category_path_string = substr($calculated_category_path_string, 0, -6); //DokuMan - remove <br /> from description if (strlen($calculated_category_path_string) < 1) { $calculated_category_path_string = TEXT_TOP; } return $calculated_category_path_string; }