diff options
author | Callan Barrett <wizzomafizzo@gmail.com> | 2008-06-07 18:19:40 +0800 |
---|---|---|
committer | Callan Barrett <wizzomafizzo@gmail.com> | 2008-06-07 18:20:00 +0800 |
commit | bf5029ad8a50c054a8bf80e87879ff9318fa6a36 (patch) | |
tree | 9c42b47089ca452bc5325a88a59c32a29d408ecd /web | |
parent | 4ac945a87e5c7e71831377bc95563aa53e7f1eaa (diff) | |
download | aurweb-bf5029ad8a50c054a8bf80e87879ff9318fa6a36.tar.xz |
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 <wizzomafizzo@gmail.com>
Diffstat (limited to 'web')
-rw-r--r-- | web/lib/pkgfuncs.inc | 81 |
1 files changed, 45 insertions, 36 deletions
diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index c83d9c8..46d8061 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -361,16 +361,17 @@ function package_details($id=0, $SID="") { echo "<span class='f6'>".__("This package has been flagged out of date.")."</span></td></tr>"; } echo " <tr><td class='boxSoft' colspan='2'><img src='/images/pad.gif' height='30'></td></tr>\n"; - echo " <tr>\n"; - echo " <td valign='top' style='padding-right: 10'>\n"; - echo " <table class='boxSoft' style='width: 200px'>\n"; - echo " <tr><td class='boxSoftTitle'><span class='f3'>"; - echo __("Dependencies")."</span></td></tr>\n"; - echo " <tr><td class='boxSoft'>"; + $deps = package_dependencies($row["ID"]); # $deps[0] = array('id','name', 'dummy'); - if (count($deps) == 0) { - print "None\n"; - } else { + if (count($deps) > 0) { + + echo " <tr>\n"; + echo " <td valign='top' style='padding-right: 10'>\n"; + echo " <table class='boxSoft' style='width: 200px'>\n"; + echo " <tr><td class='boxSoftTitle'><span class='f3'>"; + echo __("Dependencies")."</span></td></tr>\n"; + echo " <tr><td class='boxSoft'>"; + while (list($k, $darr) = each($deps)) { $url = "<a href='/packages.php?do_Details=1&ID=".$darr[0]; while(list($k, $var) = each($pkgsearch_vars)) { @@ -387,20 +388,22 @@ function package_details($id=0, $SID="") { if ($darr[2] == 0) echo $url."'>".$darr[1].$darr[3]."</a><br />\n"; else echo "<a href='http://archlinux.org/packages/search/?q=".$darr[1]."'>".$darr[1].$darr[3]."</a><br />\n"; } - } - echo "</td></tr>\n"; - echo "</table></td>"; + + echo "</td></tr>\n"; + echo "</table></td>"; + + } # reverse-deps by tardo - could use some beautification - echo " <td valign='top'>"; - echo "<table class='boxSoft' style='width: 200px'>"; - echo "<tr><td class='boxSoftTitle'><span class='f3'>"; - echo __("Required by")."</span></td></tr>\n"; - echo "<tr><td class='boxSoft'>"; $deps = package_required($row["ID"]); - if (count($deps) == 0) { - print "None\n"; - } else { + if (count($deps) > 0) { + + echo " <td valign='top'>"; + echo "<table class='boxSoft' style='width: 200px'>"; + echo "<tr><td class='boxSoftTitle'><span class='f3'>"; + echo __("Required by")."</span></td></tr>\n"; + echo "<tr><td class='boxSoft'>"; + while (list($k, $darr) = each($deps)) { $url = "<a href='/packages.php?do_Details=1&ID=".$darr[0]; while(list($k, $var) = each($pkgsearch_vars)) { @@ -417,19 +420,22 @@ function package_details($id=0, $SID="") { if ($darr[2] == 0) print $url."'>".$darr[1].$darr[3]."</a><br />\n"; else print "<a href='http://archlinux.org/packages/search/?q=".$darr[1]."'>".$darr[1].$darr[3]."</a><br />\n"; } - } - echo "</td></tr>\n"; - echo " </table>\n"; - echo " </td>\n"; - echo " <td valign='top'>\n"; - echo " <table class='boxSoft' style='width: 200px'>\n"; - echo " <tr><td class='boxSoftTitle'><span class='f3'>"; - echo __("Sources")."</span></td></tr>\n"; - echo " <tr><td class='boxSoft'>"; + + echo "</td></tr>\n"; + echo " </table>\n"; + echo " </td>\n"; + + } + $sources = package_sources($row["ID"]); # $sources[0] = 'src'; - if (count($sources) == 0) { - print "None\n"; - } else { + if (count($sources) > 0) { + + echo " <td valign='top'>\n"; + echo " <table class='boxSoft' style='width: 200px'>\n"; + echo " <tr><td class='boxSoftTitle'><span class='f3'>"; + echo __("Sources")."</span></td></tr>\n"; + echo " <tr><td class='boxSoft'>"; + 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 "</td></tr>\n"; - echo " </table>\n"; - echo " </td>\n"; + + echo "</td></tr>\n"; + echo " </table>\n"; + echo " </td>\n"; + + } + echo " </tr>\n"; echo " </table>\n"; echo " </div>\n"; |