--- loncom/interface/loncommon.pm 2009/08/14 03:50:09 1.692.4.5
+++ loncom/interface/loncommon.pm 2008/12/03 00:09:56 1.702
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.692.4.5 2009/08/14 03:50:09 raeburn Exp $
+# $Id: loncommon.pm,v 1.702 2008/12/03 00:09:56 harmsja Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -406,10 +406,9 @@ sub studentbrowser_javascript {
|| ($env{'request.role'}=~/^(au|dc|su)/)
) { return ''; }
return (<<'ENDSTDBRW');
-
ENDSTDBRW
}
sub selectstudent_link {
- my ($form,$unameele,$udomele,$courseadvonly)=@_;
- my $callargs = "'".$form."','".$unameele."','".$udomele."'";
+ my ($form,$unameele,$udomele)=@_;
if ($env{'request.course.id'}) {
if (!&Apache::lonnet::allowed('srm',$env{'request.course.id'})
&& !&Apache::lonnet::allowed('srm',$env{'request.course.id'}.
'/'.$env{'request.course.sec'})) {
return '';
}
- if ($courseadvonly) {
- $callargs .= ",'',1,1";
- }
- return ''.
- ''.
- &mt('Select User').'';
+ return "".&mt('Select User')."";
}
if ($env{'request.role'}=~/^(au|dc|su)/) {
- $callargs .= ",1";
- return ''.
- ''.
- &mt('Select User').'';
+ return "".&mt('Select User')."";
}
return '';
}
@@ -463,7 +453,6 @@ sub selectstudent_link {
sub authorbrowser_javascript {
return <<"ENDAUTHORBRW";
ENDAUTHORBRW
}
@@ -484,8 +473,7 @@ sub coursebrowser_javascript {
my ($domainfilter,$sec_element,$formname)=@_;
my $crs_or_grp_alert = &mt('Please select the type of LON-CAPA entity - Course or Group - for which you wish to add/modify a user role');
my $output = '
-';
return $output;
}
@@ -615,13 +602,8 @@ function setSect(sectionlist) {
sub selectcourse_link {
my ($form,$unameele,$udomele,$desc,$extra_element,$multflag,$selecttype)=@_;
- return ''
- ."".&mt('Select Course').''
- .'';
+ return "".&mt('Select Course')."";
}
sub selectauthor_link {
@@ -728,21 +710,6 @@ sub select_datelocale {
return $output;
}
-sub select_language {
- my ($name,$selected,$includeempty) = @_;
- my %langchoices;
- if ($includeempty) {
- %langchoices = ('' => 'No language preference');
- }
- foreach my $id (&languageids()) {
- my $code = &supportedlanguagecode($id);
- if ($code) {
- $langchoices{$code} = &plainlanguagedescription($id);
- }
- }
- return &select_form($selected,$name,%langchoices);
-}
-
=pod
=item * &linked_select_forms(...)
@@ -829,8 +796,7 @@ sub linked_select_forms {
my $first = "document.$formname.$firstselectname";
# output the javascript to do the changing
my $result = '';
- $result.='
END
# output the initial values for the selection lists
@@ -967,12 +932,10 @@ sub help_open_topic {
# Add the graphic
my $title = &mt('Online Help');
my $helpicon=&lonhttpdurl("/adm/help/help.png");
- $template .= ''.
- '';
- if ($text ne '') {
- $template.='';
- }
+ $template .= <<"ENDTEMPLATE";
+
+ENDTEMPLATE
+ if ($text ne '') { $template.='' };
return $template;
}
@@ -980,30 +943,24 @@ sub help_open_topic {
# This is a quicky function for Latex cheatsheet editing, since it
# appears in at least four places
sub helpLatexCheatsheet {
- my ($topic,$text,$not_author) = @_;
- my $out;
+ my $other = shift;
my $addOther = '';
- if ($topic) {
- $addOther = &Apache::loncommon::help_open_topic($topic,$text,
+ if ($other) {
+ $addOther = Apache::loncommon::help_open_topic($other, shift,
undef, undef, 600) .
'
';
}
- $out = ''.
- $addOther .
- &Apache::loncommon::help_open_topic("Greek_Symbols",&mt('Greek Symbols'),
- undef,undef,600).
- ' | '.
- &Apache::loncommon::help_open_topic("Other_Symbols",&mt('Other Symbols'),
- undef,undef,600).
- ' | ';
- unless ($not_author) {
- $out .= ''.
- &Apache::loncommon::help_open_topic("Authoring_Output_Tags",&mt('Output Tags'),
- undef,undef,600).
- ' | ';
- }
- $out .= ' ';
- return $out;
+ return ''.
+ $addOther .
+ &Apache::loncommon::help_open_topic("Greek_Symbols",&mt('Greek Symbols'),
+ undef,undef,600)
+ .' | '.
+ &Apache::loncommon::help_open_topic("Other_Symbols",&mt('Other Symbols'),
+ undef,undef,600)
+ .' | '.
+ &Apache::loncommon::help_open_topic("Authoring_Output_Tags",&mt('Output Tags'),
+ undef,undef,600)
+ .' | ';
}
sub general_help {
@@ -1030,9 +987,7 @@ sub update_help_link {
my $banner_link = "/adm/helpmenu?page=banner&topic=$topic&component_help=$component_help&faq=$faq&bug=$bug&origurl=$origurl&stamp=$timestamp&stayonpage=$stayOnPage";
my $output .= <<"ENDOUTPUT";
ENDOUTPUT
return $output;
@@ -1404,7 +1359,6 @@ sub resize_textarea_js {
my $geometry = &viewport_geometry_js();
return <<"RESIZE";
RESIZE
@@ -1676,7 +1629,7 @@ sub multiple_select_form {
$size = scalar(keys(%$hash));
}
}
- $output.="\n".' |