function zen_get_faq_category_tree($faq_parent_id = '0', $spacing = '', $exclude = '', $faq_category_tree_array = '', $include_itself = false, $faq_category_has_faqs = false, $limit = false) { global $db; if ($limit) { $limit_count = " limit 1"; } else { $limit_count = ''; } if (!is_array($faq_category_tree_array)) { $faq_category_tree_array = array(); } if (sizeof($faq_category_tree_array) < 1 && $exclude != '0') { $faq_category_tree_array[] = array('id' => '0', 'text' => TEXT_TOP); } if ($include_itself) { $faq_category = $db->Execute("select cd.faq_categories_name\n from " . TABLE_FAQ_CATEGORIES_DESCRIPTION . " cd\n where cd.language_id = '" . (int) $_SESSION['languages_id'] . "'\n and cd.faq_categories_id = '" . (int) $faq_parent_id . "'"); $faq_category_tree_array[] = array('id' => $faq_parent_id, 'text' => $faq_category->fields['faq_categories_name']); } $faq_categories = $db->Execute("select c.faq_categories_id, cd.faq_categories_name, c.parent_id\n from " . TABLE_FAQ_CATEGORIES . " c, " . TABLE_FAQ_CATEGORIES_DESCRIPTION . " cd\n where c.faq_categories_id = cd.faq_categories_id\n and cd.language_id = '" . (int) $_SESSION['languages_id'] . "'\n and c.parent_id = '" . (int) $faq_parent_id . "'\n order by c.sort_order, cd.faq_categories_name"); while (!$faq_categories->EOF) { if ($faq_category_has_faqs == true and zen_faqs_in_faq_category_count($faq_categories->fields['faq_categories_id'], '', false, true) >= 1) { $mark = '*'; } else { $mark = ' '; } if ($exclude != $faq_categories->fields['faq_categories_id']) { $faq_category_tree_array[] = array('id' => $faq_categories->fields['faq_categories_id'], 'text' => $spacing . $faq_categories->fields['faq_categories_name'] . $mark); } $faq_category_tree_array = zen_get_faq_category_tree($faq_categories->fields['faq_categories_id'], $spacing . ' ', $exclude, $faq_category_tree_array, '', $faq_category_has_faqs); $faq_categories->MoveNext(); } return $faq_category_tree_array; }
<?php // // +----------------------------------------------------------------------+ // |zen-cart Open Source E-commerce | // +----------------------------------------------------------------------+ // | Copyright (c) 2003 The zen-cart developers | // | | // | http://www.zen-cart.com/index.php | // | | // | Portions Copyright (c) 2003 osCommerce | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the GPL license, | // | that is bundled with this package in the file LICENSE, and is | // | available through the world-wide-web at the following url: | // | http://www.zen-cart.com/license/2_0.txt. | // | If you did not receive a copy of the zen-cart license and are unable | // | to obtain it through the world-wide-web, please send a note to | // | license@zen-cart.com so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // $Id: sidebox_move_faq.php 290 2004-09-15 19:48:26Z wilt $ // $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_MOVE_FAQ . '</b>'); $contents = array('form' => zen_draw_form('faqs', $type_faq_admin_handler, 'action=move_faq_confirm&fcPath=' . $fcPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . zen_draw_hidden_field('faqs_id', $pInfo->faqs_id)); $contents[] = array('text' => sprintf(TEXT_MOVE_FAQS_INTRO, $pInfo->faqs_name)); $contents[] = array('text' => '<br />' . TEXT_INFO_CURRENT_FAQ_CATEGORIES . '<br /><b>' . zen_output_generated_faq_category_path($pInfo->faqs_id, 'faq') . '</b>'); $contents[] = array('text' => '<br />' . sprintf(TEXT_MOVE, $pInfo->faqs_name) . '<br />' . zen_draw_pull_down_menu('move_to_faq_category_id', zen_get_faq_category_tree(), $current_faq_category_id)); $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_move.gif', IMAGE_MOVE) . ' <a href="' . zen_href_link(FILENAME_FAQ_CATEGORIES, 'fcPath=' . $fcPath . '&pID=' . $pInfo->faqs_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
$contents[] = array('text' => sprintf(TEXT_MOVE_FAQS_INTRO, $pInfo->faqs_name)); $contents[] = array('text' => '<br />' . TEXT_INFO_CURRENT_FAQ_CATEGORIES . '<br /><b>' . zen_output_generated_faq_category_path($pInfo->faqs_id, 'faq') . '</b>'); $contents[] = array('text' => '<br />' . sprintf(TEXT_MOVE, $pInfo->faqs_name) . '<br />' . zen_draw_pull_down_menu('move_to_faq_category_id', zen_get_faq_category_tree(), $current_faq_category_id)); $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_move.gif', IMAGE_MOVE) . ' <a href="' . zen_href_link(FILENAME_FAQ_CATEGORIES, 'fcPath=' . $fcPath . '&pID=' . $pInfo->faqs_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'); break; case 'copy_to': $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_COPY_TO . '</b>'); // WebMakers.com Added: Split Page if (empty($pInfo->faqs_id)) { $pInfo->faqs_id = $pID; } $contents = array('form' => zen_draw_form('copy_to', FILENAME_FAQ_CATEGORIES, 'action=copy_to_confirm&fcPath=' . $fcPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . zen_draw_hidden_field('faqs_id', $pInfo->faqs_id)); $contents[] = array('text' => TEXT_INFO_COPY_TO_INTRO); $contents[] = array('text' => '<br />' . TEXT_INFO_CURRENT_FAQ . '<br /><b>' . $pInfo->faqs_name . ' ID#' . $pInfo->faqs_id . '</b>'); $contents[] = array('text' => '<br />' . TEXT_INFO_CURRENT_FAQ_CATEGORIES . '<br /><b>' . zen_output_generated_faq_category_path($pInfo->faqs_id, 'faq') . '</b>'); $contents[] = array('text' => '<br />' . TEXT_FAQ_CATEGORIES . '<br />' . zen_draw_pull_down_menu('faq_categories_id', zen_get_faq_category_tree(), $current_faq_category_id)); $contents[] = array('text' => '<br />' . TEXT_HOW_TO_COPY . '<br />' . zen_draw_radio_field('copy_as', 'link', true) . ' ' . TEXT_COPY_AS_LINK . '<br />' . zen_draw_radio_field('copy_as', 'duplicate') . ' ' . TEXT_COPY_AS_DUPLICATE); $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_copy.gif', IMAGE_COPY) . ' <a href="' . zen_href_link(FILENAME_FAQ_CATEGORIES, 'fcPath=' . $fcPath . '&pID=' . $pInfo->faqs_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'); break; } // switch if (zen_not_null($heading) && zen_not_null($contents)) { echo ' <td valign="top">' . "\n"; $box = new box(); echo $box->infoBox($heading, $contents); echo ' </td>' . "\n"; } ?> </tr> <tr>
echo ENTRY_FAQS_NAME . ' ' . (zen_not_null(ENTRY_FAQS_NAME_TEXT) ? '<span class="red">' . ENTRY_FAQS_NAME_TEXT . '</span>' : ''); ?> </td> <td><?php echo zen_draw_input_field('faqs_name', '', ' class="input_box" chkname="Question Title" chkrule="nnull"'); ?> </td> </tr> <tr> <td><?php echo ENTRY_FAQS_CATEGORY . ' ' . (zen_not_null(ENTRY_FAQS_NAME_TEXT) ? '<span class="red">' . ENTRY_FAQS_NAME_TEXT . '</span>' : ''); ?> </td> <td> <?php echo zen_draw_pull_down_menu('faqs_category', zen_get_faq_category_tree(), $current_faq_category_id, ' chkname="Please Choose faqs category?" chkrule="isselect" style="width: 120px;"'); //if (zen_not_null(ENTRY_FAQS_CATEGORY_TEXT)) echo ' <span class="inputRequirement">' . ENTRY_FAQS_CATEGORY_TEXT; ?> </td> </tr> <tr> <td valign="top"><?php echo ENTRY_FAQS_DESCRIPTION . ' ' . (zen_not_null(ENTRY_FAQS_DESCRIPTION_TEXT) ? '<span class="red">' . ENTRY_FAQS_DESCRIPTION_TEXT . '</span>' : ''); ?> </td> <td><?php echo zen_draw_textarea_field('faqs_description', 25, 5, '', ' class="textarea1" chkname="Write a inquiry" chkrule="nnull/max10000"'); ?> </td> </tr> </table></td>