--- loncom/interface/lonmenu.pm 2009/10/29 16:15:57 1.297
+++ loncom/interface/lonmenu.pm 2009/11/30 21:29:47 1.308
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.297 2009/10/29 16:15:57 raeburn Exp $
+# $Id: lonmenu.pm,v 1.308 2009/11/30 21:29:47 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -150,7 +150,7 @@ sub prep_menuitem {
} else { # textual Link
$link = &mt($$menuitem[3]);
}
- return '
-$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!)
+ Apache::lonhtmlcommon::clear_breadcrumb_tools();
+ # 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
+
@@ -1213,7 +1276,7 @@ sub switch {
my $pic=
'';
+ '" align="'.($nobreak==3?'right':'left').'" class="LC_icon" />';
if ($env{'browser.interface'} eq 'faketextual') {
# Main Menu
if ($nobreak==3) {
@@ -1239,7 +1302,7 @@ sub switch {
$inlineremote[$idx]=''.$pic.'';
} else {
$inlineremote[$idx]=
- '';
}
}
@@ -1398,15 +1461,31 @@ sub rawconfig {
}
} elsif ($pro =~ /^courseenv_(.*)$/) {
my $key = $1;
- if (($env{'course.'.$env{'request.course.id'}.'.'.$key}) &&
- ($crstype ne 'Community')) {
- $output.=&switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat);
+ if ($crstype ne 'Community') {
+ my $coursepref = $env{'course.'.$env{'request.course.id'}.'.'.$key};
+ if ($key eq 'canuse_pdfforms') {
+ if ($env{'request.course.id'} && $coursepref eq '') {
+ my %domdefs = &Apache::lonnet::get_domain_defaults($env{'course.'.$env{'request.course.id'}.'.domain'});
+ $coursepref = $domdefs{'canuse_pdfforms'};
+ }
+ }
+ if ($coursepref) {
+ $output.=&switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat);
+ }
}
} elsif ($pro =~ /^communityenv_(.*)$/) {
my $key = $1;
- if (($env{'course.'.$env{'request.course.id'}.'.'.$key}) &&
- ($crstype eq 'Community')) {
- $output.=&switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat);
+ if ($crstype eq 'Community') {
+ my $coursepref = $env{'course.'.$env{'request.course.id'}.'.'.$key};
+ if ($key eq 'canuse_pdfforms') {
+ if ($env{'request.course.id'} && $coursepref eq '') {
+ my %domdefs = &Apache::lonnet::get_domain_defaults($env{'course.'.$env{'request.course.id'}.'.domain'});
+ $coursepref = $domdefs{'canuse_pdfforms'};
+ }
+ }
+ if ($coursepref) {
+ $output.=&switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat);
+ }
}
} elsif ($pro =~ /^course_(.*)$/) {
# Check for permissions inside of a course
@@ -1551,6 +1630,31 @@ function gonav(url) {
NAVCONTROL
}
+sub dc_popup_js {
+ my %lt = &Apache::lonlocal::texthash(
+ more => '(More ...)',
+ less => '(Less ...)',
+ );
+ return <<"END";
+
+function showCourseID() {
+ document.getElementById('dccid').style.display='block';
+ document.getElementById('dccid').style.textAlign='left';
+ document.getElementById('dccid').style.textFace='normal';
+ document.getElementById('dccidtext').innerHTML ='$lt{'less'}';
+ return;
+}
+
+function hideCourseID() {
+ document.getElementById('dccid').style.display='none';
+ document.getElementById('dccidtext').innerHTML ='$lt{'more'}';
+ return;
+}
+
+END
+
+}
+
sub utilityfunctions {
my $caller = shift;
unless ($env{'environment.remote'} eq 'off' ||
@@ -1568,6 +1672,13 @@ sub utilityfunctions {
my $currentsymb=&Apache::lonenc::check_encrypt($env{'request.symb'});
my $nav_control=&nav_control_js();
+ my $dc_popup_cid;
+ if ($env{'user.adv'} && exists($env{'user.role.dc./'.
+ $env{'course.'.$env{'request.course.id'}.
+ '.domain'}.'/'})) {
+ $dc_popup_cid = &dc_popup_js();
+ }
+
my $start_page_annotate =
&Apache::loncommon::start_page('Annotator',undef,
{'only_body' => 1,
@@ -1595,6 +1706,7 @@ return (< 1) {
$role_selector = &jump_to_role($cdom,$cnum,\%seccount,\%courseroles);
$role_selector .= ' | |