version 1.36, 2007/07/17 22:07:52
|
version 1.41, 2013/07/15 17:42:11
|
Line 57 sub processLabelName {
|
Line 57 sub processLabelName {
|
|
|
# Serve out the text |
# Serve out the text |
sub servetext { |
sub servetext { |
my ($r,$text) = @_; |
my ($r,$text,$is_mobile,$firstfile) = @_; |
my $bugs=&Apache::loncommon::help_open_bug('Documentation','Report a documentation bug'); |
my $bugs=&Apache::loncommon::help_open_bug('Documentation',&mt('Report a documentation bug')); |
my $morehelp;#=&Apache::loncommon::help_open_menu(undef,undef,1,undef,undef,undef,undef,'Help and Assistance Menu'); |
my $morehelp;#=&Apache::loncommon::help_open_menu(undef,undef,1,undef,undef,undef,undef,'Help and Assistance Menu'); |
my $header=&mt('LON-CAPA Help'); |
my $header=&mt('LON-CAPA Help'); |
$r->print(<<HEADER); |
$r->print(<<HEADER); |
Line 66 sub servetext {
|
Line 66 sub servetext {
|
src="/adm/help/gif/lonhelpheader.gif"/>$header</h3><hr /> |
src="/adm/help/gif/lonhelpheader.gif"/>$header</h3><hr /> |
<!-- BEGIN --> |
<!-- BEGIN --> |
HEADER |
HEADER |
|
if ($is_mobile) { |
$r->print($text); |
my $width = 500; |
|
my $height = 400; |
|
my $machine = &Apache::lonnet::absolute_url(); |
|
$r->print(&Apache::loncommon::nicescroll_javascript('helpwrapper', |
|
{cursorcolor => '#00F', |
|
railalign => 'right', |
|
railoffset => '{top:5,left:40}'}, |
|
undef,1,$machine.$firstfile)); |
|
$r->print('<div id="helpwrapper" style="height:'.$height.'px; width:'.$width.'px; overflow: auto;">'. |
|
$text. |
|
'</div>'); |
|
} else { |
|
$r->print($text); |
|
} |
|
|
if (&Apache::lonnavmaps::advancedUser()) { |
if (&Apache::lonnavmaps::advancedUser()) { |
my $search=&mt('Search LON-CAPA help'); |
my $search=&mt('Search LON-CAPA help'); |
Line 106 sub render {
|
Line 119 sub render {
|
$tex =~ s| \\ref\{([^}]*)\} |
$tex =~ s| \\ref\{([^}]*)\} |
| |
| |
my $label=$1; |
my $label=$1; |
|
my $icon='/adm/help/help.png'; |
|
my $ext; |
if ($1!~/\.hlp$/) { |
if ($1!~/\.hlp$/) { |
if ((!exists($fragmentLabels{$1})) && ($1!~/\.hlp$/)) { |
if (($1 =~ /^\w+\.manual\.pdf$/) && (-e $docroot.'/adm/help/'.$1)) { |
|
$icon = '/adm/lonIcons/pdf.gif'; |
|
} elsif ((!exists($fragmentLabels{$1})) && ($1!~/\.hlp$/)) { |
&Apache::lonnet::logthis("ERROR: $1 not a valid help label"); |
&Apache::lonnet::logthis("ERROR: $1 not a valid help label"); |
$label='Error'; |
$label='Error'; |
} else { |
} else { |
$label=substr($fragmentLabels{$1}, 0, -4); |
$label=substr($fragmentLabels{$1}, 0, -4); |
|
$ext = '.hlp#' . &processLabelName($1); |
} |
} |
} else { |
} else { |
$label=~s/\.hlp$//; |
$label=~s/\.hlp$//; |
|
$ext = '.hlp#' . &processLabelName($1); |
} |
} |
'\\begin{html}<a href="/adm/help/'. |
'\\begin{html}<a href="/adm/help/'. |
$label . |
$label . |
'.hlp#' . &processLabelName($1) . |
$ext . |
'"><img src="/adm/help/gif/smallHelp.gif" border="0" /></a>' . |
'"><img src="'.$icon.'" border="0" /></a>' . |
'\\end{html}' |
'\\end{html}' |
|gxe; |
|gxe; |
|
|
Line 193 sub handler {
|
Line 212 sub handler {
|
|
|
&Apache::lonlocal::get_language_handle($r); |
&Apache::lonlocal::get_language_handle($r); |
&Apache::loncommon::content_type($r,"text/html"); |
&Apache::loncommon::content_type($r,"text/html"); |
|
my $caller; |
|
if ($env{'form.searchterm'}=~/\w/) { |
|
$caller = 'search'; |
|
} |
|
my $starthash = { |
|
only_body => 1, |
|
add_entries => { |
|
'onload' => "javascript:expand_div('$caller');", |
|
}, |
|
}; |
|
|
|
my $firstfile; |
my $start_page= |
my $start_page= |
&Apache::loncommon::start_page('LON-CAPA Help',undef, |
&Apache::loncommon::start_page('LON-CAPA Help',undef,$starthash); |
{'only_body' => 1,}); |
|
my $text=''; |
my $text=''; |
if ($env{'form.searchterm'}=~/\w/) { |
if ($env{'form.searchterm'}=~/\w/) { |
($text,my $matches)=&listmatches($docroot,$env{'form.searchterm'},&Apache::lonlocal::current_language().'/'); |
($text,my $matches)=&listmatches($docroot,$env{'form.searchterm'},&Apache::lonlocal::current_language().'/'); |
Line 225 sub handler {
|
Line 255 sub handler {
|
# so replace : with , |
# so replace : with , |
$filenames =~ s/:/,/g; |
$filenames =~ s/:/,/g; |
my @files = split(/,/, $filenames); |
my @files = split(/,/, $filenames); |
|
$firstfile = '/adm/help/'.$files[0].'.hlp'; |
|
|
for my $filename (@files) { |
for my $filename (@files) { |
if (-e $docroot.'/adm/help/tex/'. |
if (-e $docroot.'/adm/help/tex/'. |
&Apache::lonlocal::current_language().'/'. |
&Apache::lonlocal::current_language().'/'. |
Line 243 sub handler {
|
Line 274 sub handler {
|
|
|
$r->send_http_header; |
$r->send_http_header; |
$r->print($start_page); |
$r->print($start_page); |
&servetext($r,$text); |
&servetext($r,$text,$env{'browser.mobile'},$firstfile); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
|
|
return OK; |
return OK; |