From: John 'Warthog9' Hawley Date: Thu, 14 Jan 2010 01:23:02 GMT Subject: [PATCH 6/9] gitweb: add a get function to compliment print_sort_th Message-ID: <1263432185-21334-7-git-send-email-warthog9@eaglescrag.net> In-Reply-To: <1263432185-21334-6-git-send-email-warthog9@eaglescrag.net> 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' 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 "$header\n"; + $sortth .= "$header\n"; } else { - print "" . + $sortth .= "" . $cgi->a({-href => href(-replay=>1, order=>$name), -class => "header"}, $header) . "\n"; } + + return $sortth; } sub git_project_list_body { -- 1.6.5.2