$contents[] = array('align' => 'center', 'text' => HTML_BR . olc_image_submit('button_delete.gif', IMAGE_DELETE) . BLANK . HTML_A_START . olc_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id) . '">' . olc_image_button('button_cancel.gif', IMAGE_CANCEL) . HTML_A_END); break; case 'move_category': $heading[] = array('text' => HTML_B_START . TEXT_INFO_HEADING_MOVE_CATEGORY . HTML_B_END); $contents = array('form' => olc_draw_form('categories', FILENAME_CATEGORIES, 'action=move_category_confirm') . olc_draw_hidden_field('categories_id', $cInfo->categories_id)); $contents[] = array('text' => sprintf(TEXT_MOVE_CATEGORIES_INTRO, $cInfo->categories_name)); $contents[] = array('text' => HTML_BR . sprintf(TEXT_MOVE, $cInfo->categories_name) . HTML_BR . olc_draw_pull_down_menu('move_to_category_id', olc_get_category_tree('0', EMPTY_STRING, $cInfo->categories_id), $current_category_id)); $contents[] = array('align' => 'center', 'text' => HTML_BR . olc_image_submit('button_move.gif', IMAGE_MOVE) . BLANK . HTML_A_START . olc_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id) . '">' . olc_image_button('button_cancel.gif', IMAGE_CANCEL) . HTML_A_END); break; case 'delete_product': $heading[] = array('text' => HTML_B_START . TEXT_INFO_HEADING_DELETE_PRODUCT . HTML_B_END); $contents = array('form' => olc_draw_form('products', FILENAME_CATEGORIES, 'action=delete_product_confirm&cPath=' . $cPath) . olc_draw_hidden_field('products_id', $pInfo->products_id)); $contents[] = array('text' => TEXT_DELETE_PRODUCT_INTRO); $contents[] = array('text' => '<br/><b>' . $pInfo->products_name . HTML_B_END); $product_categories_string = EMPTY_STRING; $product_categories = olc_generate_category_path($pInfo->products_id, 'product'); for ($i = 0, $n = sizeof($product_categories); $i < $n; $i++) { $category_path = EMPTY_STRING; for ($j = 0, $k = sizeof($product_categories[$i]); $j < $k; $j++) { if ($category_path) { $category_path .= ' > '; } $category_path .= $product_categories[$i][$j]['text']; } if ($product_categories_string) { $product_categories_string .= HTML_BR; } $product_categories_string .= olc_draw_checkbox_field('product_categories[]', $product_categories[$i][sizeof($product_categories[$i]) - 1]['id'], true) . HTML_NBSP . $category_path; } $contents[] = array('text' => HTML_BR . $product_categories_string); $contents[] = array('align' => 'center', 'text' => HTML_BR . olc_image_submit('button_delete.gif', IMAGE_DELETE) . BLANK . HTML_A_START . olc_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id) . '">' . olc_image_button('button_cancel.gif', IMAGE_CANCEL) . HTML_A_END);
function olc_output_generated_category_path($id, $from = 'category') { $calculated_category_path_string = EMPTY_STRING; $calculated_category_path = olc_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) . HTML_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; }