--- loncom/interface/loncommon.pm 2009/10/10 03:32:46 1.895
+++ loncom/interface/loncommon.pm 2009/10/26 18:59:16 1.903
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.895 2009/10/10 03:32:46 raeburn Exp $
+# $Id: loncommon.pm,v 1.903 2009/10/26 18:59:16 droeschl Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2955,7 +2955,7 @@ sub messagewrapper {
sub noteswrapper {
my ($link,$un,$do)=@_;
return
-"$link";
+"$link";
}
# ------------------------------------------------------------- Aboutme Wrapper
@@ -4397,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);
@@ -4436,53 +4439,49 @@ 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 ($no_nav_bar) { return $bodytag; }
- # 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') { $forcereg=1; }
- my $titletable = '
'
- ." $titleinfo $dc_info | "
- .'
';
+ # if ($env{'request.state'} eq 'construct') {
+ # $titleinfo = &CSTR_pageheader(); #FIXME: Will be removed once all scripts have their own calls
+ # }
- if ($no_nav_bar) {
- $bodytag .= $titletable;
- } else {
- $bodytag .= qq|$name $role
- $realm $dc_info
| unless $env{'form.inhibitmenu'};
+ $bodytag .= qq|$name $role
+ $realm $dc_info
| unless $env{'form.inhibitmenu'};
-#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;
- }
+ 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::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;
+ $bodytag .= Apache::lonmenu::primary_menu();
+
+ #don't show menus for public users
+ if($env{'user.name'} ne 'public' && $env{'user.domain'} ne 'public'){
+ $bodytag .= Apache::lonmenu::secondary_menu();
+ $bodytag .= Apache::lonmenu::serverform();
+ $bodytag .= Apache::lonhtmlcommon::scripttag('', 'end');
+ $bodytag .= Apache::lonmenu::innerregister($forcereg) if $forcereg;
+ }else{
+ # this is to seperate menu from content when there's no secondary
+ # menu. Especially needed for public accessible ressources.
+ $bodytag .= '
';
+ $bodytag .= Apache::lonhtmlcommon::scripttag('', 'end');
}
+
+ #SD testing
+ #$bodytag .= Apache::lonmenu::menubuttons($forcereg);
return $bodytag;
}
@@ -4501,7 +4500,7 @@ sub bodytag {
:''.&mt('Switch to Inline Menu Mode').'');
$bodytag .= qq|$name $role
$realm $dc_info
-