Exemplo n.º 1
0
 //      case 'copy_to':
 //        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_COPY_TO . '</b>');
 //
 //        $contents = array('form' => tep_draw_form('copy_to', FILENAME_NEWS, 'action=copy_to_confirm&cPath=' . $cPath) . tep_draw_hidden_field('news_id', $pInfo->news_id));
 //        $contents[] = array('text' => TEXT_INFO_COPY_TO_INTRO);
 //        $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENT_news . '<br><b>' . tep_output_generated_news_path($pInfo->news_id, 'product') . '</b>');
 //        $contents[] = array('text' => '<br>' . TEXT_news . '<br>' . tep_draw_pull_down_menu('news_id', tep_get_news_tree(), $current_news_id));
 //        $contents[] = array('text' => '<br>' . TEXT_HOW_TO_COPY . '<br>' . tep_draw_radio_field('copy_as', 'link', true) . ' ' . TEXT_COPY_AS_LINK . '<br>' . tep_draw_radio_field('copy_as', 'duplicate') . ' ' . TEXT_COPY_AS_DUPLICATE);
 //        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_copy.gif', IMAGE_COPY) . ' <a href="' . tep_href_link(FILENAME_NEWS, 'cPath=' . $cPath . '&nID=' . $pInfo->news_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
 //        break;
 default:
     if ($rows > 0) {
         if (isset($cInfo) && is_object($cInfo)) {
             // news info box contents
             $news_categories_path_string = '';
             $news_categories_path = tep_generate_news_categories_path($cInfo->news_categories_id);
             for ($i = sizeof($news_categories_path[0]) - 1; $i > 0; $i--) {
                 $news_categories_path_string .= $news_categories_path[0][$i]['id'] . '_';
             }
             $news_categories_path_string = substr($news_categories_path_string, 0, -1);
             $heading[] = array('text' => '<b>' . $cInfo->news_categories_name . '</b>');
             $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_NEWS, 'cPath=' . $news_categories_path_string . '&cID=' . $cInfo->news_categories_id . '&action=edit_news_categories') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_NEWS, 'cPath=' . $news_categories_path_string . '&cID=' . $cInfo->news_categories_id . '&action=delete_news_categories') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_NEWS, 'cPath=' . $news_categories_path_string . '&cID=' . $cInfo->news_categories_id . '&action=move_news_categories') . '">' . tep_image_button('button_move.gif', IMAGE_MOVE) . '</a>');
             $contents[] = array('text' => '<br>' . TEXT_DATE_ADDED . ' ' . tep_date_short($cInfo->date_added));
             $contents[] = array('text' => '<br>' . TEXT_SUBNEWSCATEGORIES . ' ' . $cInfo->childs_count . '<br>' . TEXT_NEWS . ' ' . $cInfo->news_count);
         } elseif (isset($nInfo) && is_object($nInfo)) {
             // product info box contents
             $heading[] = array('text' => '<b>' . tep_get_news_title($nInfo->news_id) . '</b>');
             $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_NEWS, 'cPath=' . $cPath . '&nID=' . $nInfo->news_id . '&action=new_news') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_NEWS, 'cPath=' . $cPath . '&nID=' . $nInfo->news_id . '&action=delete_news') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_NEWS, 'cPath=' . $cPath . '&nID=' . $nInfo->news_id . '&action=move_news') . '">');
             $contents[] = array('text' => '<br>' . TEXT_DATE_ADDED . ' ' . tep_date_short($nInfo->date_added));
         }
     } else {
Exemplo n.º 2
0
function tep_get_generated_news_categories_path_ids($id, $from = 'news')
{
    $calculated_category_path_string = '';
    $calculated_category_path = tep_generate_news_categories_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]['id'] . '_';
        }
        $calculated_category_path_string = substr($calculated_category_path_string, 0, -1) . '<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;
}