';
@@ -639,8 +634,18 @@ sub innerregister {
&& $maptitle ne $coursetitle);
push @crumbs, {text => $restitle, no_mt => 1} if $restitle;
+ my @tools;
+ if ($env{'request.filename'} =~ /\.page$/) {
+ my %breadcrumb_tools = &Apache::lonhtmlcommon::current_breadcrumb_tools();
+ if (ref($breadcrumb_tools{'tools'}) eq 'ARRAY') {
+ @tools = @{$breadcrumb_tools{'tools'}};
+ }
+ }
&Apache::lonhtmlcommon::clear_breadcrumbs();
&Apache::lonhtmlcommon::add_breadcrumb(@crumbs);
+ if (@tools) {
+ &Apache::lonhtmlcommon::add_breadcrumb_tool('tools',@tools);
+ }
} else {
$resurl = $env{'request.noversionuri'};
my $courseurl = &Apache::lonnet::courseid_to_courseurl($env{'request.course.id'});
@@ -776,6 +781,9 @@ sub innerregister {
my $currdir = '/priv/'.$udom.'/'.$uname.'/'.$thisdisfn;
if ($currdir =~ m-/$-) {
$is_const_dir = 1;
+ if ($thisdisfn eq '') {
+ $is_const_dir = 2;
+ }
} else {
$currdir =~ s|[^/]+$||;
my $cleandisfn = &Apache::loncommon::escape_single($thisdisfn);
@@ -839,7 +847,7 @@ if ($env{'browser.mobile'}) {
$is_mobile = 1;
}
- unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme|viewclasslist|portfolio)(\?|$)/) {
+ unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme|viewclasslist|portfolio|exttools?)(\?|$)/) {
if ((!$env{'request.enc'}) && ($env{'request.noversionuri'} !~ m{^/adm/wrapper/ext/}) && ($env{'request.noversionuri'} !~ m{^/uploaded/$match_domain/$match_courseid/docs/})) {
$menuitems.=(< 'WARNING!',
+ button => 'Done',
+ preamble => 'You are trying to end this timed event early.',
+ map => 'Confirming that you are done will cause the time to expire and prevent you from changing any answers in the current folder.',
+ resource => 'Confirming that you are done will cause the time to expire for this question, and prevent you from changing your answer(s).',
+ ok => 'Click "OK" if you are completely finished.',
+ cancel => 'Click "Cancel" to continue working.',
+ );
+ my $confirm;
+ if (($type eq 'map') || ($type eq 'resource')) {
+ $confirm = $lt{'preamble'}.' '.$lt{$type}.' '.$lt{'ok'}.' '.$lt{'cancel'};
+ }
+ if ($confirm) {
+ return <
+
+
+
+
+
+
$confirm
+
+
+
+
END
+ } else {
+ return;
+ }
}
sub utilityfunctions {
@@ -1792,7 +1873,7 @@ sub roles_selector {
my $now = time;
my (%courseroles,%seccount,%courseprivs);
my $is_cc;
- my ($js,$form,$switcher,$switchtext);
+ my ($js,$form,$switcher);
my $ccrole;
if ($crstype eq 'Community') {
$ccrole = 'co';
@@ -1880,7 +1961,6 @@ sub roles_selector {
}
}
}
- $switchtext = 'Switch role'; # do not translate here
my @roles_order = ($ccrole,'in','ta','ep','ad','st');
my $numdiffsec;
if (keys(%seccount) == 1) {
@@ -1936,7 +2016,7 @@ sub roles_selector {
}
}
if (@submenu > 0) {
- $switcher = &create_submenu('','',$switchtext,\@submenu);
+ $switcher = &create_submenu('','',&mt('Switch role'),\@submenu);
}
}
return ($js,$form,$switcher);
@@ -2207,10 +2287,12 @@ sub countdown_timer {
}
my $duedate = &Apache::lonnet::EXT("resource.0.duedate");
my @interval=&Apache::lonnet::EXT("resource.0.interval");
+ my ($timelimit,$usesdone);
if (@interval > 1) {
+ ($timelimit,$usesdone) = split(/_/,$interval[0]);
my $first_access=&Apache::lonnet::get_first_access($interval[1]);
if ($first_access > 0) {
- if ($first_access+$interval[0] > time) {
+ if ($first_access+$timelimit > time) {
$hastimeleft = 1;
}
}
@@ -2218,11 +2300,16 @@ sub countdown_timer {
if (($duedate && $duedate > time) ||
(!$duedate && $hastimeleft) ||
($slot_name ne '' && $slothastime)) {
- my ($collapse,$expand,$alttxt,$title,$currdisp);
+ my ($collapse,$expand,$alttxt,$title,$currdisp,$donebutton);
if ((@interval > 1 && $hastimeleft) ||
($type eq 'Task' && $slothastime)) {
$currdisp = 'inline';
$collapse = '► ';
+ if ((@interval > 1) && ($hastimeleft)) {
+ if ($usesdone eq 'done') {
+ $donebutton = &done_button_js($interval[1]);
+ }
+ }
} else {
$currdisp = 'none';
$expand = '◄ ';
@@ -2232,8 +2319,9 @@ sub countdown_timer {
$title = $alttxt.' ';
}
my $desc = &mt('Countdown to due date/time');
- return <
$collapse
@@ -2242,10 +2330,6 @@ $collapse
$expand$title
-
END
}
}