示例#1
0
function tep_get_information_tree($parent_id = '0', $spacing = '', $section_tree_array = '', $disable_sections = true)
{
    global $languages_id;
    if (!is_array($section_tree_array)) {
        $section_tree_array = array();
    }
    $information_list = tep_get_information_list($parent_id, $disable_sections);
    reset($information_list);
    while (list(, $item) = each($information_list)) {
        $ar = array('id' => $item['id'], 'text' => $item['text']);
        if (isset($item['active'])) {
            $ar['active'] = $item['active'];
        }
        $section_tree_array[] = $ar;
        if ($item['type'] == 'section') {
            $section_tree_array = tep_get_information_tree($item['id'], $spacing . '   ', $section_tree_array, $disable_sections);
        }
    }
    return $section_tree_array;
}
示例#2
0
    echo tep_draw_separator('pixel_trans.gif', '1', '10');
    ?>
</td>
          </tr>
		  <tr>
			<td valign="top" class="main"><?php 
    echo TEXT_INFORMATION_LINKED;
    ?>
</td>
			<td class="smallText" style="padding-left: 25px;"><?php 
    if ((int) $pInfo->products_id > 0) {
        ?>
			<table border="0" cellspacing="0" cellpadding="0">
			  <tr>
				<td class="smallText"><?php 
        echo TEXT_CHOOSE_INFORMATION . '<br /><div id="information_list">' . tep_draw_pull_down_menu('information_tree', tep_get_information_tree()) . '</div>';
        ?>
</td>
				<td><?php 
        echo tep_draw_separator('pixel_trans.gif', '15', '1');
        ?>
</td>
				<td valign="bottom"><?php 
        echo tep_image_button('button_insert.gif', IMAGE_INSERT, 'style="cursor: pointer;" onClick="getXMLDOM(\'' . tep_href_link(FILENAME_CATEGORIES, 'tPath=' . $tPath . '&action=add_linked_information&products_id=' . $pInfo->products_id, getenv('HTTPS') == 'on' ? 'SSL' : 'NONSSL', false) . '&linked_id=\' + information_tree.options[information_tree.selectedIndex].value, \'linked_information\'); information_tree.selectedIndex = \'\';"');
        ?>
</td>
			  </tr>
			</table>
<?php 
        $linked_query = tep_db_query("select i.information_id, i.information_name from " . TABLE_PRODUCTS_TO_INFORMATION . " p2i, " . TABLE_INFORMATION . " i where i.information_id = p2i.information_id and i.language_id = '" . (int) $languages_id . "' and p2i.products_id = '" . (int) $pInfo->products_id . "' order by i.information_name");
        echo '<div id="linked_information" class="smallText">';