--- loncom/interface/lonhelp.pm 2005/04/07 06:56:23 1.18 +++ loncom/interface/lonhelp.pm 2025/02/21 21:28:48 1.50 @@ -1,4 +1,7 @@ # The LearningOnline Network with CAPA +# +# $Id: lonhelp.pm,v 1.50 2025/02/21 21:28:48 raeburn Exp $ +# # .tex help system web server handler # # Copyright Michigan State University Board of Trustees @@ -24,8 +27,7 @@ # http://www.lon-capa.org/ # # .tex file help handler -# YEAR=2002 -# 7/4 Jeremy Bowers + package Apache::lonhelp; @@ -40,59 +42,95 @@ use Apache::lonlocal; use Apache::lonnet; use tth(); use GDBM_File(); +use lib '/home/httpd/lib/perl/'; +use LONCAPA; + # This sub takes the name of a label in, and converts it to something # that is a valid anchor name. -sub processLabelName -{ + +sub processLabelName { my ($name) = @_; $name =~ tr/a-zA-Z0-9/_/cs; return $name; } -# Serve out the Tex -sub serveTex -{ - my ($tex, $r) = @_; - my $html=&Apache::lonxml::xmlbegin(); - my $bugs=&Apache::loncommon::help_open_bug('Documentation'); - my $header=&mt('LON-CAPA Help'); - my $footer=&mt('About LON-CAPA help and More Help'); +# Serve out the text +sub servetext { + my ($r,$uri,$text,$is_mobile,$firstfile) = @_; + my $bugs; + my %helpconfig = &Apache::lonnet::get_dom('configuration',['helpsettings'], + $env{'request.role.domain'}); + if (ref($helpconfig{'helpsettings'}) eq 'HASH') { + if ($helpconfig{'helpsettings'}{'submitbugs'} eq '1') { + $bugs = &Apache::loncommon::help_open_bug('Documentation',&mt('Report a documentation bug')); + } + } + my %lt = &Apache::lonlocal::texthash( + header => 'LON-CAPA Help', + search => 'Search LON-CAPA help', + query => 'Search', + ); + my $goback; + if ((($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) || + (($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'} eq '_self'))) { + my $backicon = &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL').'/').'clickhere.gif'; + $goback = ''. + ''. + ' '; + } $r->print(< - LON-CAPA Help - - - $header$bugs + + + + $goback$lt{'header'} + HEADER - - $r->print($tex); - - if (Apache::lonnavmaps::advancedUser()) { -$r->print(<