if ($baseid == $openid) { $opento_selected = "true"; } $target = ""; // create the first node, parent is always -1 $menu_htmlcode .= "{$tree}.add(\"{$baseid}\",\"-1\",\"{$basename}\",\"{$baselink}\",\"\",\"{$target}\");\n"; $db->reset(); // process each of the nodes while ($db->next_record()) { // get name and link (just to save space in the code later on) $name = htmlentities($db->f("category_name"), ENT_QUOTES, vmGetCharset()) . ps_product_category::products_in_category($db->f("category_id")); $url = $sess->url($mm_action_url . "index.php?page=shop.browse&category_id=" . $db->f("category_id")); $menu_htmlcode .= "{$tree}.add(\"" . $db->f("category_id") . "\",\"" . $db->f("category_parent_id") . "\",\"{$name}\",\"{$url}\",\"\",\"{$target}\");\n"; // if this node is the selected node if ($db->f("category_id") == $openid) { $opento = $openid; $opento_selected = "true"; } } $menu_htmlcode .= "document.write({$tree});\n"; $menu_htmlcode .= $openAll == "true" ? "{$tree}.openAll();\n" : "{$tree}.closeAll();\n"; $menu_htmlcode .= "{$tree}.openTo(\"{$opento}\",\"{$opento_selected}\");\n"; $menu_htmlcode .= "</script>\n"; $menu_htmlcode .= "<noscript>\n"; $menu_htmlcode .= $ps_product_category->get_category_tree($category_id, $class_mainlevel); $menu_htmlcode .= "</noscript>\n"; $menu_htmlcode .= "</td></tr></table>\n"; echo $menu_htmlcode; /************* END OF CATEGORY TREE ****************************** ********************************************************* */
$jscookTree_style = $params->get('jscookTree_style', 'ThemeXP'); $jscook_type = $params->get('jscook_type', 'menu'); $menu_orientation = $params->get('menu_orientation', 'hbr'); $_REQUEST['root_label'] = $params->get('root_label', 'Shop'); $class_mainlevel = "mainlevel" . $class_sfx; $db = new ps_DB(); // This is "Categories:" by default. Change it in the Module Parameters Form echo $pretext; // update the cart because something could have // changed while running a function $cart = $_SESSION["cart"]; $auth = $_SESSION["auth"]; if ($show_categories == "yes") { if ($menutype == 'links') { /* MENUTPYE LINK LIST */ echo $ps_product_category->get_category_tree($category_id, $class_mainlevel); } elseif ($menutype == "transmenu") { /* TransMenu script to display a DHTML Drop-Down Menu */ include_once $mod_dir . '/vm_transmenu.php'; } elseif ($menutype == "dtree") { /* dTree script to display structured categories */ include_once $mod_dir . '/vm_dtree.php'; } elseif ($menutype == "jscook") { /* JSCook Script to display structured categories */ include_once $mod_dir . '/vm_JSCook.php'; } elseif ($menutype == "tigratree") { /* TigraTree script to display structured categories */ include_once $mod_dir . '/vm_tigratree.php'; } } ?>