--- loncom/interface/lonhtmlcommon.pm 2016/10/31 21:00:49 1.358.2.9
+++ loncom/interface/lonhtmlcommon.pm 2018/09/09 21:16:34 1.358.2.14
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.358.2.9 2016/10/31 21:00:49 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.358.2.14 2018/09/09 21:16:34 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -92,7 +92,7 @@ sub raw_href_to_link {
sub entity_encode {
my ($text)=@_;
- return &HTML::Entities::encode($text, '<>&"');
+ return &HTML::Entities::encode($text, '\'<>&"');
}
sub direct_parm_link {
@@ -407,7 +407,7 @@ sub textbox {
##############################################
##############################################
sub checkbox {
- my ($name,$checked,$value) = @_;
+ my ($name,$checked,$value,$special) = @_;
my $Str = '';
return $Str;
}
@@ -671,7 +671,7 @@ ENDJS
my $minuteselector = qq{};
my $secondselector= qq{};
my $cal_link;
- if (!$nolink) {
+ unless (($nolink) || ($state eq 'disabled')) {
$cal_link = qq{};
}
#
@@ -696,7 +696,7 @@ ENDJS
$hourselector,$minuteselector,$secondselector).
$tzone;
}
- if (!$nolink) {
+ unless (($nolink) || ($state eq 'disabled')) {
$result .= &mt('[_1]Select Date[_2]',$cal_link,'');
}
$result .= "\n\n";
@@ -1009,10 +1009,13 @@ Inputs
=item $number_to_do The total number of items being processed.
+=item $preamble Optional HTML to display before the progress bar.
+
=back
Returns a hash containing the progress state data structure.
-
+If $number_to_do is zero or null, an indeterminate progress bar will
+be used.
=item &Update_PrgWin()
@@ -1082,20 +1085,20 @@ Returns: none
# Create progress
sub Create_PrgWin {
- my ($r,$number_to_do)=@_;
+ my ($r,$number_to_do,$preamble)=@_;
my %prog_state;
$prog_state{'done'}=0;
$prog_state{'firststart'}=&Time::HiRes::time();
$prog_state{'laststart'}=&Time::HiRes::time();
$prog_state{'max'}=$number_to_do;
- &Apache::loncommon::LCprogressbar($r);
+ &Apache::loncommon::LCprogressbar($r,$prog_state{'max'},$preamble);
return %prog_state;
}
# update progress
sub Update_PrgWin {
my ($r,$prog_state,$displayString)=@_;
- &Apache::loncommon::LCprogressbarUpdate($r,undef,$displayString);
+ &Apache::loncommon::LCprogressbarUpdate($r,undef,$displayString,$$prog_state{'max'});
$$prog_state{'laststart'}=&Time::HiRes::time();
}
@@ -1145,7 +1148,7 @@ sub Increment_PrgWin {
if ($$prog_state{'max'}) {
$percent=int(100.*$current/$$prog_state{'max'});
}
- &Apache::loncommon::LCprogressbarUpdate($r,$percent,$timeinfo);
+ &Apache::loncommon::LCprogressbarUpdate($r,$percent,$timeinfo,$$prog_state{'max'});
$$prog_state{'laststart'}=&Time::HiRes::time();
}
@@ -1162,7 +1165,7 @@ sub Close_PrgWin {
sub crumbs {
my ($uri,$target,$prefix,$form,$skiplast,$onclick)=@_;
# You cannot crumbnify uploaded or adm resources
- if ($uri=~/^\/*(uploaded|adm)\//) { return &mt('(Internal Course/Group Content)'); }
+ if ($uri=~/^\/*(uploaded|adm)\//) { return &mt('(Internal Course/Community Content)'); }
if ($target) {
$target = ' target="'.
&Apache::loncommon::escape_single($target).'"';
@@ -1182,6 +1185,12 @@ sub crumbs {
} else {
$path.='/';
}
+ if ($path eq '/res/') {
+ unless (&Apache::lonnet::allowed('bre',$path)) {
+ $output.="$dir/";
+ next;
+ }
+ }
my $href_path = &HTML::Entities::encode($path,'<>&"');
&Apache::loncommon::inhibit_menu_check(\$href_path);
if ($form) {
@@ -1259,9 +1268,9 @@ sub htmlareaheaders {
ENDEDITOR
}
$s.=(<
-
-
+
+
+
@@ -1824,7 +1833,7 @@ returns: nothing
$env{'course.'.$env{'request.course.id'}.'.description'};
$no_mt_descr = 1;
if ($env{'request.noversionuri'} =~
- m{^/public/($match_domain)/($match_courseid)/syllabus$}) {
+ m{^/?public/($match_domain)/($match_courseid)/syllabus$}) {
unless (($env{'course.'.$env{'request.course.id'}.'.domain'} eq $1) &&
($env{'course.'.$env{'request.course.id'}.'.num'} eq $2)) {
$description = 'Menu';