}
    } else {
        $categId = 0;
    }
    if (isset($module_params['style'])) {
        $style = $module_params['style'];
    } else {
        $style = 'tree';
    }
    if ($prefs['feature_phplayers'] == 'y') {
        global $tikiphplayers;
        include_once 'lib/phplayers_tiki/tiki-phplayers.php';
        $urlEnd .= "\n";
        if ($categId != 0 && $name != "") {
            list($itall, $count) = $tikiphplayers->mkCatEntry($categId, "..", "", $categories, $urlEnd);
            $itall = '.|' . $name . '|tiki-browse_categories.php?parentId=' . $categId . $urlEnd . $itall;
        } else {
            list($itall, $count) = $tikiphplayers->mkCatEntry($categId, ".", "", $categories, $urlEnd);
        }
        $smarty->assign('tree', $tikiphplayers->mkmenu($itall, $name, $style));
    } else {
        include_once 'lib/tree/categ_browse_tree.php';
        $tree_nodes = array();
        foreach ($categories as $cat) {
            $tree_nodes[] = array("id" => $cat["categId"], "parent" => $cat["parentId"], "data" => '<a class="catname" href="tiki-browse_categories.php?parentId=' . $cat["categId"] . $urlEnd . '">' . $cat["name"] . '</a><br />');
        }
        $tm = new CatBrowseTreeMaker("mod_categ");
        $res = $tm->make_tree($categId, $tree_nodes);
        $smarty->assign('tree', $res);
    }
}
    $urlEnd = "&amp;deep={$deep}";
    if ($type) {
        $urlEnd .= "&amp;type={$type}";
    }
    if (isset($_REQUEST['expanded'])) {
        $urlEnd .= "||||1";
    }
    $urlEnd .= "\n";
    list($itall, $count) = $tikiphplayers->mkCatEntry(0, ".", '', $ctall, $urlEnd, 'browsedcategory.tpl');
    $smarty->assign('tree', $tikiphplayers->mkmenu($itall, 'treecategories', 'tree'));
} else {
    $tree_nodes = array();
    foreach ($ctall as $c) {
        $tree_nodes[] = array("id" => $c["categId"], "parent" => $c["parentId"], "data" => '<a class="catname" href="tiki-browse_categories.php?parentId=' . $c["categId"] . '&amp;deep=' . $deep . '&amp;type=' . urlencode($type) . '">' . $c["name"] . '</a><br />');
    }
    $tm = new CatBrowseTreeMaker("categ");
    $res = $tm->make_tree($_REQUEST["parentId"], $tree_nodes);
    $smarty->assign('tree', $res);
}
$objects = $categlib->list_category_objects($_REQUEST["parentId"], $offset, $maxRecords, $sort_mode, $type, $find, $deep == 'on', !empty($_REQUEST['and']) ? true : false);
if ($deep == 'on') {
    for ($i = count($objects["data"]) - 1; $i >= 0; --$i) {
        $objects['data'][$i]['categName'] = $tikilib->other_value_in_tab_line($ctall, $objects['data'][$i]['categId'], 'categId', 'name');
    }
}
$smarty->assign_by_ref('objects', $objects["data"]);
$smarty->assign_by_ref('cantobjects', $objects["cant"]);
$cant_pages = ceil($objects["cant"] / $maxRecords);
$smarty->assign_by_ref('cant_pages', $cant_pages);
$smarty->assign('actual_page', 1 + $offset / $maxRecords);
if ($objects["cant"] > $offset + $maxRecords) {