--- loncom/interface/loncommon.pm 2002/10/29 20:57:31 1.71 +++ loncom/interface/loncommon.pm 2003/02/13 18:11:26 1.79 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.71 2002/10/29 20:57:31 www Exp $ +# $Id: loncommon.pm,v 1.79 2003/02/13 18:11:26 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -27,9 +27,7 @@ # # YEAR=2001 # 2/13-12/7 Guy Albertelli -# 12/11,12/12,12/17 Scott Harrison # 12/21 Gerd Kortemeyer -# 12/21 Scott Harrison # 12/25,12/28 Gerd Kortemeyer # YEAR=2002 # 1/4 Gerd Kortemeyer @@ -311,7 +309,44 @@ sub browser_and_searcher_javascript { END } +sub studentbrowser_javascript { + unless ($ENV{'request.course.id'}) { return ''; } + unless (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) { + return ''; + } + return (<<'ENDSTDBRW'); + +ENDSTDBRW +} +sub selectstudent_link { + my ($form,$unameele,$udomele)=@_; + unless ($ENV{'request.course.id'}) { return ''; } + unless (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) { + return ''; + } + return "Select"; +} ############################################################### @@ -483,6 +518,9 @@ sub help_open_topic { my ($topic, $text, $stayOnPage, $width, $height) = @_; $text = "" if (not defined $text); $stayOnPage = 0 if (not defined $stayOnPage); + if ($ENV{'browser.interface'} eq 'textual') { + $stayOnPage=1; + } $width = 350 if (not defined $width); $height = 400 if (not defined $height); my $filename = $topic; @@ -493,7 +531,7 @@ sub help_open_topic { if (!$stayOnPage) { - $link = "javascript:void(open('/adm/help/${filename}.hlp', 'Help_for_$topic', 'menubar=0,toolbar=1,scrollbars=1,width=$width,height=$height'))"; + $link = "javascript:void(open('/adm/help/${filename}.hlp', 'Help_for_$topic', 'menubar=0,toolbar=1,scrollbars=1,width=$width,height=$height,resizable=yes'))"; } else { @@ -503,14 +541,16 @@ sub help_open_topic { # Add the text if ($text ne "") { - $template .= "$text "; + $template .= + "". + "
$text"; } # Add the graphic $template .= <<"ENDTEMPLATE"; -(Help: $topic) + (Help: $topic) ENDTEMPLATE - + if ($text ne '') { $template.='
' }; return $template; } @@ -802,7 +842,7 @@ sub authform_internal{ onclick="javascript:changed_radio('int',$args{'formname'});" /> Internally authenticated (with initial password + onchange="javascript:changed_text('int',$args{'formname'});" />) END return $result; } @@ -838,7 +878,7 @@ sub authform_filesystem{ onclick="javascript:changed_radio('fsys',$in{'formname'});" /> Filesystem authenticated (with initial password + onchange="javascript:changed_text('fsys',$in{'formname'});">) END return $result; } @@ -1010,6 +1050,13 @@ sub messagewrapper { return "$link"; } +# --------------------------------------------------------------- Notes Wrapper + +sub noteswrapper { + my ($link,$un,$do)=@_; + return +"$link"; +} # ------------------------------------------------------------- Aboutme Wrapper sub aboutmewrapper { @@ -1021,7 +1068,8 @@ sub aboutmewrapper { sub syllabuswrapper { - my ($link,$un,$do)=@_; + my ($link,$un,$do,$tf)=@_; + if ($tf) { $link=''.$link.''; } return "$link"; } @@ -1399,6 +1447,9 @@ $addentries> END if ($bodyonly) { return $bodytag; + } elsif ($ENV{'browser.interface'} eq 'textual') { + return $bodytag.'

LON-CAPA: '.$title. + '

Main Menu
'; } else { return(<