Ejemplo n.º 1
0
     $contents[] = array('align' => 'center', 'text' => '<br />' . oos_image_swap_submits('delete', 'delete_off.gif', IMAGE_DELETE) . ' <a href="' . oos_href_link_admin($aFilename['categories'], 'categories=' . $categories . '&cID=' . $cInfo->categories_id) . '">' . oos_image_swap_button('cancel', 'cancel_off.gif', IMAGE_CANCEL) . '</a>');
     break;
 case 'move_category':
     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_MOVE_CATEGORY . '</b>');
     $contents = array('form' => oos_draw_form('categories', $aFilename['categories'], 'action=move_category_confirm') . oos_draw_hidden_field('categories_id', $cInfo->categories_id));
     $contents[] = array('text' => sprintf(TEXT_MOVE_CATEGORIES_INTRO, $cInfo->categories_name));
     $contents[] = array('text' => '<br />' . sprintf(TEXT_MOVE, $cInfo->categories_name) . '<br />' . oos_draw_pull_down_menu('move_to_category_id', oos_get_category_tree('0', '', $cInfo->categories_id), $current_category_id));
     $contents[] = array('align' => 'center', 'text' => '<br />' . oos_image_swap_submits('move', 'move_off.gif', IMAGE_MOVE) . ' <a href="' . oos_href_link_admin($aFilename['categories'], 'categories=' . $categories . '&cID=' . $cInfo->categories_id) . '">' . oos_image_swap_button('cancel', 'cancel_off.gif', IMAGE_CANCEL) . '</a>');
     break;
 case 'delete_product':
     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_PRODUCT . '</b>');
     $contents = array('form' => oos_draw_form('products', $aFilename['categories'], 'action=delete_product_confirm&categories=' . $categories) . oos_draw_hidden_field('products_id', $pInfo->products_id));
     $contents[] = array('text' => TEXT_DELETE_PRODUCT_INTRO);
     $contents[] = array('text' => '<br /><b>' . $pInfo->products_name . '</b>');
     $product_categories_string = '';
     $product_categories = oos_generate_category_path($pInfo->products_id, 'product');
     for ($i = 0, $n = count($product_categories); $i < $n; $i++) {
         $category_path = '';
         for ($j = 0, $k = count($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 .= oos_draw_checkbox_field('product_categories[]', $product_categories[$i][count($product_categories[$i]) - 1]['id'], true) . '&nbsp;' . $category_path . '<br />';
     }
     $product_categories_string = substr($product_categories_string, 0, -4);
     $contents[] = array('text' => '<br />' . $product_categories_string);
     $contents[] = array('align' => 'center', 'text' => '<br />' . oos_image_swap_submits('delete', 'delete_off.gif', IMAGE_DELETE) . ' <a href="' . oos_href_link_admin($aFilename['categories'], 'categories=' . $categories . '&pID=' . $pInfo->products_id) . '">' . oos_image_swap_button('cancel', 'cancel_off.gif', IMAGE_CANCEL) . '</a>');
     break;
 case 'move_product':
     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_MOVE_PRODUCT . '</b>');
     $contents = array('form' => oos_draw_form('products', $aFilename['categories'], 'action=move_product_confirm&categories=' . $categories) . oos_draw_hidden_field('products_id', $pInfo->products_id));
function oos_output_generated_category_path($id, $from = 'category')
{
    $calculated_category_path_string = '';
    $calculated_category_path = oos_generate_category_path($id, $from);
    for ($i = 0, $n = count($calculated_category_path); $i < $n; $i++) {
        for ($j = 0, $k = count($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;
}