--- loncom/interface/lonmenu.pm 2009/10/30 00:19:49 1.298
+++ loncom/interface/lonmenu.pm 2009/11/18 04:59:56 1.302
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.298 2009/10/30 00:19:49 raeburn Exp $
+# $Id: lonmenu.pm,v 1.302 2009/11/18 04:59:56 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -150,7 +150,7 @@ sub prep_menuitem {
} else { # textual Link
$link = &mt($$menuitem[3]);
}
- return '
'.$link.'';
+ return ''.$link.'';
}
# primary_menu() evaluates @primary_menu and returns XHTML for the menu
@@ -230,7 +230,7 @@ sub secondary_menu {
next if $$menuitem[4] =~ /^(no|)remotenavCommunity$/
&& $crstype ne 'Community';
next if $$menuitem[4] =~ /showgroups$/
- && $canviewgrps
+ && !$canviewgrps
&& !%groups;
if ($$menuitem[3] eq 'Roles' && $env{'request.course.id'}) {
@@ -545,7 +545,13 @@ sub innerregister {
my $maptitle = &Apache::lonnet::gettitle($mapurl);
my $restitle = &Apache::lonnet::gettitle(&Apache::lonnet::symbread());
- my @crumbs = ({text => "Course Contents",
+ my $contentstext;
+ if ($env{'course.'.$env{'request.course.id'}.'.type'} eq 'Community') {
+ $contentstext = &mt('Community Contents');
+ } else {
+ $contentstext = &mt('Course Contents');
+ }
+ my @crumbs = ({text => $contentstext,
href => "Javascript:gonav('/adm/navmaps')"});
if ($mapurl ne $env{'course.'.$env{'request.course.id'}.'.url'}) {
@@ -561,7 +567,7 @@ sub innerregister {
&Apache::lonhtmlcommon::clear_breadcrumbs();
&Apache::lonhtmlcommon::add_breadcrumb(@crumbs);
- $breadcrumb .= &Apache::lonhtmlcommon::breadcrumbs(undef,undef,0);
+ #$breadcrumb .= &Apache::lonhtmlcommon::breadcrumbs(undef,undef,0);
unless (($env{'request.state'} eq 'edit') || ($newmail) ||
($env{'request.state'} eq 'construct') ||
($env{'form.register'})) {
@@ -683,10 +689,22 @@ sub innerregister {
}
# Finally, turn the button on or off
if ($cfile && !$const_space) {
- $editbutton=&switch
- ('','',6,1,'pcstr.gif','edit[_1]','resource[_2]',
+ my $nocrsedit;
+ # Suppress display where CC has switched to student role.
+ if ($env{'request.course.id'}) {
+ unless(&Apache::lonnet::allowed('mdc',
+ $env{'request.course.id'})) {
+ $nocrsedit = 1;
+ }
+ }
+ if ($nocrsedit) {
+ $editbutton=&clear(6,1);
+ } else {
+ $editbutton=&switch
+ ('','',6,1,'pcstr.gif','edit[_1]','resource[_2]',
"go('".$cfile."');","Edit this resource");
- $noeditbutton = 0;
+ $noeditbutton = 0;
+ }
} elsif ($editbutton eq '') {
$editbutton=&clear(6,1);
}
@@ -811,51 +829,87 @@ ENDMENUITEMS
my $addremote=0;
foreach (@inlineremote) { if ($_ ne '') { $addremote=1; last;} }
my $inlinebuttons='';
- if ($addremote) {
- # Registered, textual output
- if ($env{'environment.icons'} eq 'iconsonly') {
- $inlinebuttons=(<
-$inlineremote[21] $inlineremote[23]
-ENDARROWSINLINE
- if (&hidden_button_check() ne 'yes') {
- $inlinebuttons .= (<
-ENDINLINEICONS
- }
- } else {
- if ($inlineremote[21] ne '' || $inlineremote[23] ne '') {
- $inlinebuttons=(<$inlineremote[21] | | $inlineremote[23] |
-ENDFIRSTLINE
- }
- if (&hidden_button_check() ne 'yes') {
- foreach my $row (6..9) {
- if ($inlineremote[${row}.'1'] ne ''
- || $inlineremote[$row.'2'] ne ''
- || $inlineremote[$row.'3'] ne '') {
- $inlinebuttons .= <<"ENDLINE";
-$inlineremote["${row}1"] | $inlineremote["${row}2"] | $inlineremote["${row}3"] |
-ENDLINE
- }
- }
- }
- }
- }
+ if ($addremote) {
+
+ #SD START (work in progress!)
+ # Arrows for navigation
+ Apache::lonhtmlcommon::add_breadcrumb_tool( 'A', $inlineremote[21] );
+ Apache::lonhtmlcommon::add_breadcrumb_tool( 'A', $inlineremote[23] );
+ if(hidden_button_check() ne 'yes'){
+ # notes
+ Apache::lonhtmlcommon::add_breadcrumb_tool( 'B', $inlineremote[93]);
+ # bookmark
+ Apache::lonhtmlcommon::add_breadcrumb_tool( 'B', $inlineremote[91]);
+ # evaluate
+ Apache::lonhtmlcommon::add_breadcrumb_tool( 'B', $inlineremote[81]);
+ # feedback
+ Apache::lonhtmlcommon::add_breadcrumb_tool( 'B', $inlineremote[82]);
+ # print
+ Apache::lonhtmlcommon::add_breadcrumb_tool( 'B', $inlineremote[83]);
+ # metadata
+ Apache::lonhtmlcommon::add_breadcrumb_tool( 'B', $inlineremote[63]);
+
+ # ?
+ Apache::lonhtmlcommon::add_breadcrumb_tool( 'C', $inlineremote[61]);
+ # ?
+ Apache::lonhtmlcommon::add_breadcrumb_tool( 'C', $inlineremote[71]);
+ # ?
+ Apache::lonhtmlcommon::add_breadcrumb_tool( 'C', $inlineremote[72]);
+ # ?
+ Apache::lonhtmlcommon::add_breadcrumb_tool( 'C', $inlineremote[73]);
+ # ?
+ Apache::lonhtmlcommon::add_breadcrumb_tool( 'C', $inlineremote[92]);
+
+ }
+
+ #SD END
+# # Registered, textual output
+# if ( $env{'environment.icons'} eq 'iconsonly' ) {
+# $inlinebuttons = (<
+#$inlineremote[21] $inlineremote[23]
+#ENDARROWSINLINE
+# if ( &hidden_button_check() ne 'yes' ) {
+# $inlinebuttons .= (<
+#ENDINLINEICONS
+# }
+# } else { # not iconsonly
+# if ( $inlineremote[21] ne '' || $inlineremote[23] ne '' ) {
+# $inlinebuttons = (<$inlineremote[21] | | $inlineremote[23] |
+#ENDFIRSTLINE
+# }
+# if ( &hidden_button_check() ne 'yes' ) {
+# foreach my $row ( 6 .. 9 ) {
+# if ( $inlineremote[ ${row} . '1' ] ne ''
+# || $inlineremote[ $row . '2' ] ne ''
+# || $inlineremote[ $row . '3' ] ne '' )
+# {
+# $inlinebuttons .= <<"ENDLINE";
+#$inlineremote["${row}1"] | $inlineremote["${row}2"] | $inlineremote["${row}3"] |
+#ENDLINE
+# }
+# }
+# }
+# }
+ }
+ #SD see below
+ $breadcrumb = &Apache::lonhtmlcommon::breadcrumbs(undef,undef,0);
$result =(<
// BEGIN LON-CAPA Internal
$timesync
$breadcrumb
-$tablestart
-$inlinebuttons
-$tableend
+
+
+
$newmail
-$separator
+
@@ -1239,7 +1293,7 @@ sub switch {
$inlineremote[$idx]=''.$pic.'';
} else {
$inlineremote[$idx]=
- '';
}
}
| |