--- loncom/interface/loncommon.pm 2010/08/07 19:23:50 1.972 +++ loncom/interface/loncommon.pm 2010/08/08 02:00:38 1.973 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.972 2010/08/07 19:23:50 raeburn Exp $ +# $Id: loncommon.pm,v 1.973 2010/08/08 02:00:38 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1072,7 +1072,7 @@ END =pod -=item * &help_open_topic($topic,$text,$stayOnPage,$width,$height) +=item * &help_open_topic($topic,$text,$stayOnPage,$width,$height,$imgid) Returns a string corresponding to an HTML link to the given help $topic, where $topic corresponds to the name of a .tex file in @@ -1090,12 +1090,16 @@ a new window using Javascript. (Default $width and $height are optional numerical parameters that will override the width and height of the popped up window, which may -be useful for certain help topics with big pictures included. +be useful for certain help topics with big pictures included. + +$imgid is the id of the img tag used for the help icon. This may be +used in a javascript call to switch the image src. See +lonhtmlcommon::htmlareaselectactive() for an example. =cut sub help_open_topic { - my ($topic, $text, $stayOnPage, $width, $height) = @_; + my ($topic, $text, $stayOnPage, $width, $height, $imgid) = @_; $text = "" if (not defined $text); $stayOnPage = 0 if (not defined $stayOnPage); $width = 350 if (not defined $width); @@ -1124,10 +1128,13 @@ sub help_open_topic { # (Always) Add the graphic my $title = &mt('Online Help'); my $helpicon=&lonhttpdurl("/adm/help/help.png"); + if ($imgid ne '') { + $imgid = ' id="'.$imgid.'"'; + } $template.=' ' .''.&mt('Help: [_1]',$topic).''; if ($text ne "") { $template.='';