Skip to content

Commit 1ee4b4e

Browse files
warthog9gitster
authored andcommitted
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 <[email protected]> Signed-off-by: Jakub Narebski <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0cf207f commit 1ee4b4e

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

gitweb/gitweb.perl

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4347,17 +4347,24 @@ sub fill_project_list_info {
43474347
# print 'sort by' <th> element, generating 'sort by $name' replay link
43484348
# if that order is not selected
43494349
sub print_sort_th {
4350+
print format_sort_th(@_);
4351+
}
4352+
4353+
sub format_sort_th {
43504354
my ($name, $order, $header) = @_;
4355+
my $sort_th = "";
43514356
$header ||= ucfirst($name);
43524357

43534358
if ($order eq $name) {
4354-
print "<th>$header</th>\n";
4359+
$sort_th .= "<th>$header</th>\n";
43554360
} else {
4356-
print "<th>" .
4357-
$cgi->a({-href => href(-replay=>1, order=>$name),
4358-
-class => "header"}, $header) .
4359-
"</th>\n";
4361+
$sort_th .= "<th>" .
4362+
$cgi->a({-href => href(-replay=>1, order=>$name),
4363+
-class => "header"}, $header) .
4364+
"</th>\n";
43604365
}
4366+
4367+
return $sort_th;
43614368
}
43624369

43634370
sub git_project_list_body {

0 commit comments

Comments
 (0)