From bf5029ad8a50c054a8bf80e87879ff9318fa6a36 Mon Sep 17 00:00:00 2001 From: Callan Barrett Date: Sat, 7 Jun 2008 18:19:40 +0800 Subject: Don't show None on pacckage info page Just cuts out the table of deps/sources if none exist instead of displaying "None" Signed-off-by: Callan Barrett --- web/lib/pkgfuncs.inc | 81 +++++++++++++++++++++++++++++----------------------- 1 file changed, 45 insertions(+), 36 deletions(-) (limited to 'web/lib') diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index c83d9c89..46d80617 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -361,16 +361,17 @@ function package_details($id=0, $SID="") { echo "".__("This package has been flagged out of date.").""; } echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; + echo " "; + + echo "\n"; + echo "
"; - echo __("Dependencies")."
"; + $deps = package_dependencies($row["ID"]); # $deps[0] = array('id','name', 'dummy'); - if (count($deps) == 0) { - print "None\n"; - } else { + if (count($deps) > 0) { + + echo "
\n"; + echo " \n"; + echo " \n"; + echo " \n"; - echo "
"; + echo __("Dependencies")."
"; + while (list($k, $darr) = each($deps)) { $url = "".$darr[1].$darr[3]."
\n"; else echo "".$darr[1].$darr[3]."
\n"; } - } - echo "
"; + + } # reverse-deps by tardo - could use some beautification - echo " "; - echo ""; - echo "\n"; - echo "\n"; - echo " \n"; + + } + $sources = package_sources($row["ID"]); # $sources[0] = 'src'; - if (count($sources) == 0) { - print "None\n"; - } else { + if (count($sources) > 0) { + + echo " \n"; + + echo "\n"; + echo "
"; - echo __("Required by")."
"; $deps = package_required($row["ID"]); - if (count($deps) == 0) { - print "None\n"; - } else { + if (count($deps) > 0) { + + echo " "; + echo ""; + echo "\n"; + echo "\n"; - echo "
"; + echo __("Required by")."
"; + while (list($k, $darr) = each($deps)) { $url = "".$darr[1].$darr[3]."
\n"; else print "".$darr[1].$darr[3]."
\n"; } - } - echo "
\n"; - echo "
\n"; - echo " \n"; - echo " \n"; - echo " \n"; + echo "
"; - echo __("Sources")."
"; + + echo "
\n"; + echo "
\n"; + echo " \n"; + echo " \n"; + echo " \n"; - echo "
"; + echo __("Sources")."
"; + while (list($k, $src) = each($sources)) { $parsed_url = parse_url($src); if ($parsed_url['scheme']) @@ -449,10 +455,13 @@ function package_details($id=0, $SID="") { } } } - } - echo "
\n"; - echo "
\n"; + echo " \n"; + + } + echo " \n"; echo " \n"; echo " \n"; -- cgit v1.2.3-24-g4f1b