[LON-CAPA-cvs] cvs: loncom /interface lonhelp.pm
raeburn
raeburn@source.lon-capa.org
Tue, 04 Jan 2011 21:53:23 -0000
raeburn Tue Jan 4 21:53:23 2011 EDT
Modified files:
/loncom/interface lonhelp.pm
Log:
- Link and Icon for PDF version of manuals on Help Intro pages.
Index: loncom/interface/lonhelp.pm
diff -u loncom/interface/lonhelp.pm:1.39 loncom/interface/lonhelp.pm:1.40
--- loncom/interface/lonhelp.pm:1.39 Tue Jul 8 01:08:57 2008
+++ loncom/interface/lonhelp.pm Tue Jan 4 21:53:23 2011
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonhelp.pm,v 1.39 2008/07/08 01:08:57 raeburn Exp $
+# $Id: lonhelp.pm,v 1.40 2011/01/04 21:53:23 raeburn Exp $
#
# .tex help system web server handler
#
@@ -106,20 +106,26 @@
$tex =~ s| \\ref\{([^}]*)\}
|
my $label=$1;
+ my $icon='/adm/help/help.png';
+ my $ext;
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");
$label='Error';
} else {
$label=substr($fragmentLabels{$1}, 0, -4);
+ $ext = '.hlp#' . &processLabelName($1);
}
} else {
$label=~s/\.hlp$//;
+ $ext = '.hlp#' . &processLabelName($1);
}
'\\begin{html}<a href="/adm/help/'.
$label .
- '.hlp#' . &processLabelName($1) .
- '"><img src="/adm/help/help.png" border="0" /></a>' .
+ $ext .
+ '"><img src="'.$icon.'" border="0" /></a>' .
'\\end{html}'
|gxe;