mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
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>
This commit is contained in:
parent
d4b07f2b33
commit
379e16eebd
7 changed files with 43 additions and 62 deletions
|
@ -8,7 +8,7 @@ include("pkgfuncs_po.inc"); # Add to handle the i18n of My Packages
|
||||||
include("account_po.inc"); # use some form of this for i18n support
|
include("account_po.inc"); # use some form of this for i18n support
|
||||||
set_lang(); # this sets up the visitor's language
|
set_lang(); # this sets up the visitor's language
|
||||||
check_sid(); # see if they're still logged in
|
check_sid(); # see if they're still logged in
|
||||||
html_header(); # print out the HTML header
|
html_header(__("Accounts")); # print out the HTML header
|
||||||
|
|
||||||
|
|
||||||
# Main page processing here
|
# Main page processing here
|
||||||
|
|
|
@ -7,10 +7,7 @@ include("pkgfuncs_po.inc"); # Add to handle the i18n of My Packages
|
||||||
include("aur.inc");
|
include("aur.inc");
|
||||||
set_lang();
|
set_lang();
|
||||||
check_sid();
|
check_sid();
|
||||||
|
html_header(__("Home"));
|
||||||
# Any cookies have been sent, can now display HTML
|
|
||||||
#
|
|
||||||
html_header();
|
|
||||||
|
|
||||||
# Big Top Level Table (Table 1)
|
# Big Top Level Table (Table 1)
|
||||||
echo "<div class=\"pgbox\">\n";
|
echo "<div class=\"pgbox\">\n";
|
||||||
|
|
|
@ -7,7 +7,24 @@ include("pkgfuncs.inc"); # package specific functions
|
||||||
include("search_po.inc"); # use some form of this for i18n support
|
include("search_po.inc"); # use some form of this for i18n support
|
||||||
set_lang(); # this sets up the visitor's language
|
set_lang(); # this sets up the visitor's language
|
||||||
check_sid(); # see if they're still logged in
|
check_sid(); # see if they're still logged in
|
||||||
html_header(); # print out the HTML header
|
|
||||||
|
# set the title to something useful depending on
|
||||||
|
# what "page" we're on
|
||||||
|
#
|
||||||
|
if (isset($_GET['ID'])) {
|
||||||
|
$id = pkgname_from_id($_GET['ID']);
|
||||||
|
if (!empty($id)) {
|
||||||
|
$title = $id;
|
||||||
|
}
|
||||||
|
} else if (isset($_GET['K'])) {
|
||||||
|
$title = "Search: " . $_GET['K'];
|
||||||
|
} else if (isset($_GET['do_MyPackages'])) {
|
||||||
|
$title = __("My Packages");
|
||||||
|
} else {
|
||||||
|
$title = __("Packages");
|
||||||
|
}
|
||||||
|
|
||||||
|
html_header($title); # print out the HTML header
|
||||||
|
|
||||||
# enable debugging
|
# enable debugging
|
||||||
#
|
#
|
||||||
|
|
|
@ -8,7 +8,7 @@ include("pkgfuncs.inc"); # package functions
|
||||||
include("config.inc"); # configuration file with dir locations
|
include("config.inc"); # configuration file with dir locations
|
||||||
set_lang(); # this sets up the visitor's language
|
set_lang(); # this sets up the visitor's language
|
||||||
check_sid(); # see if they're still logged in
|
check_sid(); # see if they're still logged in
|
||||||
html_header(); # print out the HTML header
|
html_header("Submit"); # print out the HTML header
|
||||||
echo "<div class=\"pgbox\">\n";
|
echo "<div class=\"pgbox\">\n";
|
||||||
echo " <div class=\"pgboxtitle\"><span class=\"f3\">".__("Submit")."</span></div>\n";
|
echo " <div class=\"pgboxtitle\"><span class=\"f3\">".__("Submit")."</span></div>\n";
|
||||||
echo " <div class=\"pgboxbody\">\n";
|
echo " <div class=\"pgboxbody\">\n";
|
||||||
|
|
|
@ -334,7 +334,7 @@ function set_lang() {
|
||||||
|
|
||||||
# common header
|
# common header
|
||||||
#
|
#
|
||||||
function html_header() {
|
function html_header($title="") {
|
||||||
global $_SERVER;
|
global $_SERVER;
|
||||||
global $_COOKIE;
|
global $_COOKIE;
|
||||||
global $_POST;
|
global $_POST;
|
||||||
|
@ -405,6 +405,8 @@ function html_header() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$title = htmlspecialchars($title, ENT_QUOTES);
|
||||||
|
|
||||||
include('header.php');
|
include('header.php');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -250,6 +250,23 @@ function pkgnotify_from_sid($sid="") {
|
||||||
return $pkgs;
|
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
|
# display package details
|
||||||
#
|
#
|
||||||
function package_details($id=0, $SID="") {
|
function package_details($id=0, $SID="") {
|
||||||
|
@ -638,7 +655,7 @@ function pkg_search_page($SID="") {
|
||||||
|
|
||||||
# The search form
|
# 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 "<input type='hidden' name='O' value='".$O."'>\n";
|
||||||
|
|
||||||
print "<center>\n";
|
print "<center>\n";
|
||||||
|
@ -714,58 +731,6 @@ function pkg_search_page($SID="") {
|
||||||
print " </select>\n";
|
print " </select>\n";
|
||||||
print "</td>\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 "<td align='right'>\n";
|
||||||
print " <span class='f5'><span class='blue'>".__("Per page");
|
print " <span class='f5'><span class='blue'>".__("Per page");
|
||||||
print "</span></span><br />\n";
|
print "</span></span><br />\n";
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||||
xml:lang="<?php print "$LANG\" lang=\"$LANG"; ?>">
|
xml:lang="<?php print "$LANG\" lang=\"$LANG"; ?>">
|
||||||
<head>
|
<head>
|
||||||
<title>AUR (<?php print $LANG; ?>)</title>
|
<title>AUR (<?php print $LANG; ?>)<?php if ($title != "") { print " - " . $title; } ?></title>
|
||||||
<link rel='stylesheet' type='text/css' href='/css/fonts.css' />
|
<link rel='stylesheet' type='text/css' href='/css/fonts.css' />
|
||||||
<link rel='stylesheet' type='text/css' href='/css/containers.css' />
|
<link rel='stylesheet' type='text/css' href='/css/containers.css' />
|
||||||
<link rel='stylesheet' type='text/css' href='/css/arch.css' />
|
<link rel='stylesheet' type='text/css' href='/css/arch.css' />
|
||||||
|
|
Loading…
Add table
Reference in a new issue