From: <lfa...@us...> - 2004-10-22 14:05:29
|
Update of /cvsroot/tikiwiki/tiki In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19649 Modified Files: Tag: BRANCH-1-9 tiki-browse_categories.php Log Message: lots of url parameters were missing Index: tiki-browse_categories.php =================================================================== RCS file: /cvsroot/tikiwiki/tiki/tiki-browse_categories.php,v retrieving revision 1.18.2.4 retrieving revision 1.18.2.5 diff -u -d -r1.18.2.4 -r1.18.2.5 --- tiki-browse_categories.php 22 Oct 2004 13:23:41 -0000 1.18.2.4 +++ tiki-browse_categories.php 22 Oct 2004 14:05:19 -0000 1.18.2.5 @@ -34,9 +34,46 @@ $_REQUEST["parentId"] = 0; } +$smarty->assign('parentId', $_REQUEST["parentId"]); +if (!isset($_REQUEST["sort_mode"])) { + $sort_mode = 'name_asc'; +} else { + $sort_mode = $_REQUEST["sort_mode"]; +} -$smarty->assign('parentId', $_REQUEST["parentId"]); +if (!isset($_REQUEST["offset"])) { + $offset = 0; +} else { + $offset = $_REQUEST["offset"]; +} + +$smarty->assign_by_ref('offset', $offset); + +if (!isset($_REQUEST["type"])) { + $type = ''; +} else { + $type = $_REQUEST["type"]; +} + +$smarty->assign('type', $type); + +if (isset($_REQUEST["find"])) { + $find = $_REQUEST["find"]; +} else { + $find = ''; +} + +$smarty->assign('find', $find); +$smarty->assign_by_ref('sort_mode', $sort_mode); + +if (isset($_REQUEST["deep"]) && $_REQUEST["deep"] == 'on') { + $deep = 'on'; + $smarty->assign('deep', 'on'); +} else { + $deep = 'off'; + $smarty->assign('deep', 'off'); +} // If the parent category is not zero get the category path if ($_REQUEST["parentId"]) { @@ -56,9 +93,9 @@ //$ctall = $categlib->get_all_categories(); $ctall = $categlib->get_all_categories_respect_perms($user, 'tiki_p_view_categories'); -if ($feature_phplayers == 'y') { +if (true || $feature_phplayers == 'y') { function mktree($ind,$indent="",$back) { - global $ctall; + global $ctall, $deep, $type; $kids = array(); foreach ($ctall as $v) { if ($v['parentId'] == $ind) { @@ -67,7 +104,7 @@ } if (count($kids)) { foreach ($kids as $k) { - $back.= $indent."|".$k['name']."|tiki-browse_categories.php?parentId=".$k['categId']."\n"; + $back.= $indent."|".$k['name']."|tiki-browse_categories.php?parentId=".$k['categId']."&type=".urlencode($type)."&deep=$deep\n"; $back.= mktree($k['categId'],".$indent",""); } return $back; @@ -97,7 +134,7 @@ $tree_nodes[] = array( "id" => $c["categId"], "parent" => $c["parentId"], - "data" => '<a class="catname" href="tiki-browse_categories.php?parentId=' . $c["categId"] . '">' . $c["name"] . '</a><br />' + "data" => '<a class="catname" href="tiki-browse_categories.php?parentId=' . $c["categId"] . '&deep='.$deep.'&type='.urlencode($type).'">' . $c["name"] . '</a><br />' ); } $tm = new CatBrowseTreeMaker("categ"); @@ -105,46 +142,7 @@ $smarty->assign('tree', $res); } -if (!isset($_REQUEST["sort_mode"])) { - $sort_mode = 'name_asc'; -} else { - $sort_mode = $_REQUEST["sort_mode"]; -} - -if (!isset($_REQUEST["offset"])) { - $offset = 0; -} else { - $offset = $_REQUEST["offset"]; -} - -$smarty->assign_by_ref('offset', $offset); - -if (!isset($_REQUEST["type"])) { - $type = ''; -} else { - $type = $_REQUEST["type"]; -} - -$smarty->assign('type', $type); - -if (isset($_REQUEST["find"])) { - $find = $_REQUEST["find"]; -} else { - $find = ''; -} - -$smarty->assign('find', $find); -$smarty->assign_by_ref('sort_mode', $sort_mode); - -if (isset($_REQUEST["deep"]) && $_REQUEST["deep"] == 'on') { - $deep = true; - $smarty->assign('deep', 'on'); -} else { - $deep = false; - $smarty->assign('deep', 'off'); -} - -$objects = $categlib->list_category_objects($_REQUEST["parentId"], $offset, $maxRecords, $sort_mode, $type, $find, $deep); +$objects = $categlib->list_category_objects($_REQUEST["parentId"], $offset, $maxRecords, $sort_mode, $type, $find, $deep=='on'); $smarty->assign_by_ref('objects', $objects["data"]); $smarty->assign_by_ref('cantobjects', $objects["cant"]); |