Re: cvs: pearweb /public_html/bugs search.php /public_html/bugs/include functions.inc
| From: | Klaus Guenther | Date: | Mon, 07 Jun 2004 20:26:11 +0000 |
| Subject: | Re: cvs: pearweb /public_html/bugs search.php /public_html/bugs/include functions.inc | ||
| References: | 1 | Groups: | php.pear.cvs |
| Request: | Send a blank email to pear-cvs+get-20339@lists.php.net to get a copy of this message | ||
Martin Jansen wrote:
mj Mon Jun 7 15:07:20 2004 EDTModified files: /pearweb/public_html/bugs search.php /pearweb/public_html/bugs/include functions.inc Log:* Provide "Status" links from bug.php * Provide "Status" links when searching for multiple packages * Use & in some additional places Patch by: danielc [snip]
http://cvs.php.net/diff.php/pearweb/public_html/bugs/include/functions.inc?r1=1.36&r2=1.37&ty=u Index: pearweb/public_html/bugs/include/functions.inc diff -u pearweb/public_html/bugs/include/functions.inc:1.36 pearweb/public_html/bugs/include/functions.inc:1.37 --- pearweb/public_html/bugs/include/functions.inc:1.36 Mon Jun 7 15:06:16 2004 +++ pearweb/public_html/bugs/include/functions.inc Mon Jun 7 15:07:20 2004 @@ -1,6 +1,6 @@ <?php /* vim: set noet ts=4 sw=4 ft=php : */ -// $Id: functions.inc,v 1.36 2004/06/07 19:06:16 mj Exp $ +// $Id: functions.inc,v 1.37 2004/06/07 19:07:20 mj Exp $ /* Email spam protection */ function spam_protect($txt) @@ -617,46 +617,51 @@ {This line breaks it (628). You can't use an ampersand here. Klausglobal $dbh;- if (empty($pkgname) || - !preg_match('/^[A-Za-z0-9_ ]+$/', $pkgname)) - { + if (empty($pkgname)) { return; }- if (in_array($pkgname, array('Web Site', 'Documentation', 'Bug System', 'PEPr'))) { - $pkgname = strtr($pkgname, ' ', '+'); - $full = false; - } else { - if (1 != $dbh->getOne('SELECT count(*) FROM packages WHERE' . - " packages.name='$pkgname'")) { + $pkgname = (array)$pkgname; + $webpkgs = array('Web Site', 'Documentation', 'Bug System', 'PEPr'); + $home = true;++ foreach ($pkgname as $key => &$value) {
+ if (!preg_match('/^[A-Za-z0-9_ ]+$/', $value)) { return; } - $full = true; + if (in_array($value, $webpkgs)) { + $home = false; + $pkgname[$key] = strtr($value, ' ', '+'); + } } + $pkgs = 'package_name[]=' . implode('&package_name[]=', $pkgname);echo "\n\n<!-- BEGIN BUG NAV -->\n\n"; echo '<table width="100%" align="center" border="0"><tr><td>' . "\n "; - - if ($full) { - echo make_link('/package/'.$pkgname, 'Package home');++ if (count($pkgname) == 1) { + if ($home) { + echo make_link('/package/' . $pkgname[0], 'Package home'); + echo delim(); + } + echo make_link('/bugs/report.php?package=' . $pkgname[0], + 'Report new bug'); echo delim(); }- echo make_link('/bugs/report.php?package='.$pkgname, 'Report a new bug'); - echo delim();-- echo make_link('/bugs/search.php?cmd=display&package_name[]='.$pkgname.'&status=Open', 'Bug list'); - echo delim();-echo make_link('/bugs/search.php', 'New search');- if (preg_match('/search.php/', $_SERVER['PHP_SELF'])) { - echo "\n</td>"; - echo '<td style="text-align: right;">' . "\n Status: "; - echo make_link('/bugs/search.php?cmd=display&package_name[]='.$pkgname.'&status=Open', 'Open'); - echo delim(); - echo make_link('/bugs/search.php?cmd=display&package_name[]='.$pkgname.'&status=All', 'All'); - } + echo "\n</td>\n";++ echo '<td style="text-align: right;">' . "\n Status: "; + echo make_link('/bugs/search.php?cmd=display&' . $pkgs . + '&status=Open', 'Open'); + echo delim(); + echo make_link('/bugs/search.php?cmd=display&' . $pkgs . + '&status=Feedback', 'Feedback'); + echo delim(); + echo make_link('/bugs/search.php?cmd=display&' . $pkgs . + '&status=All', 'All');echo "\n</td></tr></table>\n"; echo '<hr />';