Thread (55 messages) flat view 55 messages, 3 authors, 2016-06-15
STALE3732d

[PATCH 6/9] gitweb: add a get function to compliment print_sort_th

From: "John 'Warthog9' Hawley" <warthog9@eaglescrag.net>
Date: 2016-06-15 22:48:01
Subsystem: the rest · Maintainer: Linus Torvalds

This adds a get function for print_sort_th so that the basic
function can be used outside of their straight printing operation.
---
 gitweb/gitweb.perl |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index d38aad6..07fdeb5 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -4375,17 +4375,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 get_sort_th(@_);
+}
+
+sub get_sort_th {
 	my ($name, $order, $header) = @_;
+	my $sortth = "";
 	$header ||= ucfirst($name);
 
 	if ($order eq $name) {
-		print "<th>$header</th>\n";
+		$sortth .= "<th>$header</th>\n";
 	} else {
-		print "<th>" .
+		$sortth .= "<th>" .
 		      $cgi->a({-href => href(-replay=>1, order=>$name),
 		               -class => "header"}, $header) .
 		      "</th>\n";
 	}
+
+	return $sortth;
 }
 
 sub git_project_list_body {
-- 
1.6.5.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help