--- loncom/interface/loncommon.pm 2010/09/27 01:16:22 1.948.2.11
+++ loncom/interface/loncommon.pm 2010/03/22 13:24:16 1.961
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.948.2.11 2010/09/27 01:16:22 raeburn Exp $
+# $Id: loncommon.pm,v 1.961 2010/03/22 13:24:16 onken Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -900,7 +900,7 @@ sub select_language {
$langchoices{$code} = &plainlanguagedescription($id);
}
}
- return &select_form($selected,$name,\%langchoices);
+ return &select_form($selected,$name,%langchoices);
}
=pod
@@ -1072,7 +1072,7 @@ END
=pod
-=item * &help_open_topic($topic,$text,$stayOnPage,$width,$height,$imgid)
+=item * &help_open_topic($topic,$text,$stayOnPage,$width,$height)
Returns a string corresponding to an HTML link to the given help
$topic, where $topic corresponds to the name of a .tex file in
@@ -1095,7 +1095,7 @@ be useful for certain help topics with b
=cut
sub help_open_topic {
- my ($topic, $text, $stayOnPage, $width, $height, $imgid) = @_;
+ my ($topic, $text, $stayOnPage, $width, $height) = @_;
$text = "" if (not defined $text);
$stayOnPage = 0 if (not defined $stayOnPage);
$width = 350 if (not defined $width);
@@ -1124,15 +1124,12 @@ 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.=' '
.'';
- if ($text ne "") {
+ if ($text ne "") {
$template.='';
}
return $template;
@@ -1205,12 +1202,7 @@ ENDOUTPUT
sub help_open_menu {
my ($topic,$component_help,$faq,$bug,$stayOnPage,$width,$height,$text)
= @_;
- $stayOnPage = 0 if (not defined $stayOnPage);
- # only use pop-up help (stayOnPage == 0)
- # if environment.remote is on (using remote control UI)
- if ($env{'environment.remote'} eq 'off' ) {
- $stayOnPage=1;
- }
+ $stayOnPage = 1;
my $output;
if ($component_help) {
if (!$text) {
@@ -1231,8 +1223,8 @@ sub help_open_menu {
sub top_nav_help {
my ($text) = @_;
$text = &mt($text);
- my $stay_on_page =
- ($env{'environment.remote'} eq 'off' );
+ my $stay_on_page = 1;
+
my $link = ($stay_on_page) ? "javascript:helpMenu('display')"
: "javascript:helpMenu('open')";
my $banner_link = &update_help_link(undef,undef,undef,undef,$stay_on_page);
@@ -1247,10 +1239,7 @@ END
sub help_menu_js {
my ($text) = @_;
-
- my $stayOnPage =
- ($env{'environment.remote'} eq 'off' );
-
+ my $stayOnPage = 1;
my $width = 620;
my $height = 600;
my $helptopic=&general_help();
@@ -1307,10 +1296,7 @@ sub help_open_bug {
unless ($env{'user.adv'}) { return ''; }
unless ($Apache::lonnet::perlvar{'BugzillaHost'}) { return ''; }
$text = "" if (not defined $text);
- $stayOnPage = 0 if (not defined $stayOnPage);
- if ($env{'environment.remote'} eq 'off' ) {
$stayOnPage=1;
- }
$width = 600 if (not defined $width);
$height = 600 if (not defined $height);
@@ -1351,10 +1337,7 @@ sub help_open_faq {
unless ($env{'user.adv'}) { return ''; }
unless ($Apache::lonnet::perlvar{'FAQHost'}) { return ''; }
$text = "" if (not defined $text);
- $stayOnPage = 0 if (not defined $stayOnPage);
- if ($env{'environment.remote'} eq 'off' ) {
$stayOnPage=1;
- }
$width = 350 if (not defined $width);
$height = 400 if (not defined $height);
@@ -1803,7 +1786,7 @@ sub domain_select {
return &multiple_select_form($name,$value,4,\%domains);
} else {
$domains{'select_form_order'} = [sort {lc($a) cmp lc($b) } (keys(%domains))];
- return &select_form($name,$value,\%domains);
+ return &select_form($name,$value,%domains);
}
}
@@ -1865,36 +1848,29 @@ sub multiple_select_form {
=pod
-=item * &select_form($defdom,$name,$hashref,$onchange)
+=item * &select_form($defdom,$name,%hash)
Returns a string containing a