diff options
author | Callan Barrett <wizzomafizzo@gmail.com> | 2008-01-12 23:43:05 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2008-01-20 07:21:20 +0100 |
commit | 379e16eebda1ba9bfc45de486e99e480843d086a (patch) | |
tree | d2cd1ea7bd79657b475422ce95aea6b81b8e6894 /web/lib | |
parent | d4b07f2b334dada626e4743951cdd6adab87f62e (diff) | |
download | aur-379e16eebda1ba9bfc45de486e99e480843d086a.tar.gz aur-379e16eebda1ba9bfc45de486e99e480843d086a.tar.xz |
Support for verbose page titles
Verbose page titles again
Adds support for more verbose page titles based on current
page and action by user and removes sort by options from
search form as they're obsolete by column links.
Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Diffstat (limited to 'web/lib')
-rw-r--r-- | web/lib/aur.inc | 4 | ||||
-rw-r--r-- | web/lib/pkgfuncs.inc | 71 |
2 files changed, 21 insertions, 54 deletions
diff --git a/web/lib/aur.inc b/web/lib/aur.inc index c18365cc..a9095cd9 100644 --- a/web/lib/aur.inc +++ b/web/lib/aur.inc @@ -334,7 +334,7 @@ function set_lang() { # common header # -function html_header() { +function html_header($title="") { global $_SERVER; global $_COOKIE; global $_POST; @@ -405,6 +405,8 @@ function html_header() { } } + $title = htmlspecialchars($title, ENT_QUOTES); + include('header.php'); return; } diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index 46bc5226..d4f3ae7c 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -250,6 +250,23 @@ function pkgnotify_from_sid($sid="") { return $pkgs; } +# get name of package based on pkgid +# +function pkgname_from_id($id="") { + if (!empty($id)) { + $dbh = db_connect(); + $id = intval($id); + $q = "SELECT Name FROM Packages WHERE ID = " . mysql_real_escape_string($id); + $result = db_query($q, $dbh); + if (mysql_num_rows($result) > 0) { + $id = mysql_result($result, 0); + } else { + $id = ""; + } + } + return $id; +} + # display package details # function package_details($id=0, $SID="") { @@ -638,7 +655,7 @@ function pkg_search_page($SID="") { # The search form # - print "<form action='/packages.php' method='post'>\n"; + print "<form action='/packages.php' method='get'>\n"; print "<input type='hidden' name='O' value='".$O."'>\n"; print "<center>\n"; @@ -714,58 +731,6 @@ function pkg_search_page($SID="") { print " </select>\n"; print "</td>\n"; - /* Sort by */ - - print "<td align='right'>\n"; - print " <span class='f5'><span class='blue'>".__("Sort by"); - print "</span></span><br />\n"; - print " <select name='SB'>\n"; - - print " <option value=n"; - $_REQUEST["SB"] == "n" ? print " selected> " : print "> "; - print __("Name")."</option>\n"; - - print " <option value=c"; - $_REQUEST["SB"] == "c" ? print " selected> " : print "> "; - print __("Category")."</option>\n"; - - print " <option value=l"; - $_REQUEST["SB"] == "l" ? print " selected> " : print "> "; - print __("Location")."</option>\n"; - - print " <option value=v"; - $_REQUEST["SB"] == "v" ? print " selected> " : print "> "; - print __("Votes")."</option>\n"; - - print " <option value=m"; - $_REQUEST["SB"] == "m" ? print " selected> " : print "> "; - print __("Maintainer")."</option>\n"; - - print " <option value=a"; - $_REQUEST["SB"] == "a" ? print " selected> " : print "> "; - print __("Age")."</option>\n"; - - print " </select>\n"; - print "</td>\n"; - - print "<td align='right'>\n"; - print " <span class='f5'><span class='blue'>".__("Sort order"); - print "</span></span><br />\n"; - print " <select name='SO'>\n"; - - print " <option value=a"; - $_REQUEST["SO"] == "a" ? print " selected> " : print "> "; - print __("Ascending")."</option>\n"; - - print " <option value=d"; - $_REQUEST["SO"] == "d" ? print " selected> " : print "> "; - print __("Descending")."</option>\n"; - - print " </select>\n"; - print "</td>\n"; - - /* End of Sort by */ - print "<td align='right'>\n"; print " <span class='f5'><span class='blue'>".__("Per page"); print "</span></span><br />\n"; |