summaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorJohn 'Warthog9' Hawley <warthog9@kernel.org>2010-01-30 22:30:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-01-30 23:53:54 (GMT)
commit1ee4b4ef70e26c540d028cc497313000e63cd7dc (patch)
tree071178979734c36adac693170ad13d7bf10ac7d8 /gitweb
parent0cf207f7a621d2f15bc3a5ec0fa6a7c8f3333386 (diff)
downloadgit-1ee4b4ef70e26c540d028cc497313000e63cd7dc.zip
git-1ee4b4ef70e26c540d028cc497313000e63cd7dc.tar.gz
git-1ee4b4ef70e26c540d028cc497313000e63cd7dc.tar.bz2
gitweb: add a "string" variant of print_sort_th
Add a function (named format_sort_th) that returns the string that print_sort_th would print. Signed-off-by: John 'Warthog9' Hawley <warthog9@kernel.org> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl17
1 files changed, 12 insertions, 5 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index debaf55..466fa8a 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -4347,17 +4347,24 @@ sub fill_project_list_info {
# print 'sort by' <th> element, generating 'sort by $name' replay link
# if that order is not selected
sub print_sort_th {
+ print format_sort_th(@_);
+}
+
+sub format_sort_th {
my ($name, $order, $header) = @_;
+ my $sort_th = "";
$header ||= ucfirst($name);
if ($order eq $name) {
- print "<th>$header</th>\n";
+ $sort_th .= "<th>$header</th>\n";
} else {
- print "<th>" .
- $cgi->a({-href => href(-replay=>1, order=>$name),
- -class => "header"}, $header) .
- "</th>\n";
+ $sort_th .= "<th>" .
+ $cgi->a({-href => href(-replay=>1, order=>$name),
+ -class => "header"}, $header) .
+ "</th>\n";
}
+
+ return $sort_th;
}
sub git_project_list_body {