$contents[] = array('text' => '<br>' . sprintf(TEXT_MOVE, $cInfo->news_categories_name) . '<br>' . tep_draw_pull_down_menu('move_to_news_categories_id', tep_get_news_categories_tree(), $current_news_categories_id)); $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_move.gif', IMAGE_MOVE) . ' <a href="' . tep_href_link(FILENAME_NEWS, 'cPath=' . $cPath . '&cID=' . $cInfo->news_categories_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'); break; case 'delete_news': $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_NEWS . '</b>'); $contents = array('form' => tep_draw_form('news', FILENAME_NEWS, 'action=delete_news_confirm&cPath=' . $cPath) . tep_draw_hidden_field('news_id', $nInfo->news_id)); $contents[] = array('text' => TEXT_DELETE_NEWS_INTRO); $contents[] = array('text' => '<br><b>' . $nInfo->news_title . '</b>'); $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_NEWS, 'cPath=' . $cPath . '&nID=' . $nInfo->news_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'); break; case 'move_news': $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_MOVE_NEWS . '</b>'); $contents = array('form' => tep_draw_form('news', FILENAME_NEWS, 'action=move_news_confirm&cPath=' . $cPath) . tep_draw_hidden_field('news_id', $nInfo->news_id)); $contents[] = array('text' => sprintf(TEXT_MOVE_NEWS_INTRO, $nInfo->news_title)); $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENT_NEWS_CATEGORIES . '<br><b>' . tep_output_generated_news_categories_path($nInfo->news_id, 'news') . '</b>'); $contents[] = array('text' => '<br>' . sprintf(TEXT_MOVE, $nInfo->news_title) . '<br>' . tep_draw_pull_down_menu('move_to_news_categories_id', tep_get_news_categories_tree(), $current_news_categories_id)); $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_move.gif', IMAGE_MOVE) . ' <a href="' . tep_href_link(FILENAME_NEWS, 'cPath=' . $cPath . '&nID=' . $nInfo->news_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'); break; // 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; // case 'copy_to': // $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_COPY_TO . '</b>'); //
function tep_get_news_categories_tree($parent_id = '0', $spacing = '', $exclude = '', $category_tree_array = '', $include_itself = false) { if (!is_array($category_tree_array)) { $category_tree_array = array(); } if (sizeof($category_tree_array) < 1 && $exclude != '0') { $category_tree_array[] = array('id' => '0', 'text' => TEXT_TOP); } if ($include_itself) { $category_query = tep_db_query("select nc.news_categories_name from " . TABLE_NEWS_CATEGORIES . " nc where nc.news_categories_id = '" . (int) $parent_id . "'"); $category = tep_db_fetch_array($category_query); $category_tree_array[] = array('id' => $parent_id, 'text' => $category['news_categories_name']); } $categories_query = tep_db_query("select nc.news_categories_id, nc.news_categories_name, nc.parent_id from " . TABLE_NEWS_CATEGORIES . " nc where nc.parent_id = '" . (int) $parent_id . "' order by nc.sort_order, nc.news_categories_name"); while ($categories = tep_db_fetch_array($categories_query)) { if ($exclude != $categories['news_categories_id']) { $category_tree_array[] = array('id' => $categories['news_categories_id'], 'text' => $spacing . $categories['news_categories_name']); } $category_tree_array = tep_get_news_categories_tree($categories['news_categories_id'], $spacing . ' ', $exclude, $category_tree_array); } return $category_tree_array; }