--- loncom/interface/loncommon.pm 2009/08/05 23:44:52 1.879
+++ loncom/interface/loncommon.pm 2009/10/22 13:13:12 1.900
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.879 2009/08/05 23:44:52 raeburn Exp $
+# $Id: loncommon.pm,v 1.900 2009/10/22 13:13:12 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -483,7 +483,7 @@ ENDAUTHORBRW
sub coursebrowser_javascript {
my ($domainfilter,$sec_element,$formname)=@_;
- my $crs_or_grp_alert = &mt('Please select the type of LON-CAPA entity - Course or Community - for which you wish to add/modify a user role');
+ my $crs_or_grp_alert = &mt('Please select the type of LON-CAPA entity - Course or Community - for which you wish to add/modify a user role.');
my $id_functions = &javascript_index_functions();
my $output = '
END_MYBLOCK
+
+ $output = Apache::lonhtmlcommon::scripttag($output);
+
my $popupUrl = "/adm/blockingstatus/$querystring";
+ my $text = mt('Communication Blocked');
+
$output .= <<"END_BLOCK";
END_BLOCK
@@ -4032,7 +4047,7 @@ sub determinedomain {
my $domain=shift;
if (! $domain) {
# Determine domain if we have not been given one
- $domain = $Apache::lonnet::perlvar{'lonDefDomain'};
+ $domain = &Apache::lonnet::default_login_domain();
if ($env{'user.domain'}) { $domain=$env{'user.domain'}; }
if ($env{'request.role.domain'}) {
$domain=$env{'request.role.domain'};
@@ -4382,6 +4397,9 @@ sub bodytag {
if ($env{'request.role'} !~ /^cr/) {
$role = &Apache::lonnet::plaintext($role,&course_type());
}
+ if ($env{'request.course.sec'}) {
+ $role .= (' 'x2).'- '.&mt('section:').' '.$env{'request.course.sec'};
+ }
$realm = $env{'course.'.$env{'request.course.id'}.'.description'};
} else {
$role = &Apache::lonnet::plaintext($role);
@@ -4421,34 +4439,52 @@ sub bodytag {
$dc_info = '('.$dc_info.')';
}
- $role = "($role)" if $role;
+ $role = '('.$role.')' if $role;
&get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['inhibitmenu']);
if ($env{'environment.remote'} eq 'off') {
# No Remote
- if ($env{'request.state'} eq 'construct') {
- $forcereg=1;
- }
+ if ($env{'request.state'} eq 'construct') {
+ $forcereg=1;
+ }
-# if ($env{'request.state'} eq 'construct') {
-# $titleinfo = &CSTR_pageheader(); #FIXME: Will be removed once all scripts have their own calls
-# }
+ # if ($env{'request.state'} eq 'construct') {
+ # $titleinfo = &CSTR_pageheader(); #FIXME: Will be removed once all scripts have their own calls
+ # }
my $titletable = ''
- ." $titleinfo $dc_info | "
- .'
';
+ ." $titleinfo $dc_info | "
+ .'
';
- if ($no_nav_bar) {
- $bodytag .= $titletable;
- } else {
- $bodytag .= qq|$name $role
- $realm $dc_info
| unless $env{'form.inhibitmenu'};
+ if ($no_nav_bar) {
+ $bodytag .= $titletable;
+ } else {
+ $bodytag .= qq|$name $role
+ $realm $dc_info
| unless $env{'form.inhibitmenu'};
- if ($env{'request.state'} eq 'construct') {
- $bodytag .= &Apache::lonmenu::menubuttons($forcereg,$titletable);
- } else {
- $bodytag .= &Apache::lonmenu::menubuttons($forcereg).$titletable;
- }
+#SD $titletable is obsolete
+#SD if ($env{'request.state'} eq 'construct') {
+#SD $bodytag .= &Apache::lonmenu::menubuttons($forcereg,$titletable);
+#SD } else {
+#SD $bodytag .= &Apache::lonmenu::menubuttons($forcereg).$titletable;
+#SD }
+ if ( $env{'form.inhibitmenu'} eq 'yes'
+ || $ENV{'REQUEST_URI'} eq '/adm/logout'
+ || $env{'request.noversionuri'} =~ m{^/res/adm/pages/}) {
+
+ return $bodytag;
+ }
+
+ $bodytag .= Apache::lonhtmlcommon::scripttag(
+ Apache::lonmenu::utilityfunctions(),
+ 'start');
+ $bodytag .= Apache::lonmenu::primary_menu();
+ $bodytag .= Apache::lonmenu::secondary_menu();
+ #SD remove next line
+ #$bodytag .= Apache::lonmenu::menubuttons($forcereg);
+ $bodytag .= Apache::lonmenu::serverform();
+ $bodytag .= Apache::lonhtmlcommon::scripttag('', 'end');
+ $bodytag .= Apache::lonmenu::innerregister($forcereg) if $forcereg;
}
return $bodytag;
}
@@ -4465,10 +4501,10 @@ sub bodytag {
# Explicit link to get inline menu
my $menu= ($no_inline_link?''
- :''.&mt('Switch to Inline Menu Mode').'');
+ :''.&mt('Switch to Inline Menu Mode').'');
$bodytag .= qq|$name $role
$realm $dc_info
-