--- loncom/interface/lonhtmlcommon.pm 2015/05/28 02:53:29 1.364
+++ loncom/interface/lonhtmlcommon.pm 2017/01/28 02:31:51 1.379
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.364 2015/05/28 02:53:29 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.379 2017/01/28 02:31:51 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -407,7 +407,7 @@ sub textbox {
##############################################
##############################################
sub checkbox {
- my ($name,$checked,$value) = @_;
+ my ($name,$checked,$value,$special) = @_;
my $Str = '';
return $Str;
}
@@ -538,6 +538,8 @@ sub date_setter {
if (! defined($state) || $state ne 'disabled') {
$state = '';
+ } else {
+ $state = 'disabled="disabled"';
}
if (! defined($no_hh_mm_ss)) {
$no_hh_mm_ss = 0;
@@ -673,7 +675,7 @@ ENDJS
my $minuteselector = qq{};
my $secondselector= qq{};
my $cal_link;
- if (!$nolink) {
+ unless (($nolink) || ($state eq 'disabled')) {
$cal_link = qq{};
}
#
@@ -700,7 +702,7 @@ ENDJS
$hourselector,$minuteselector,$secondselector).
$tzone;
}
- if (!$nolink) {
+ unless (($nolink) || ($state eq 'disabled')) {
$result .= &mt('[_1]Select Date[_2]',$cal_link,'');
}
$result .= "\n\n";
@@ -1194,9 +1196,9 @@ sub Close_PrgWin {
# ------------------------------------------------------- Puts directory header
sub crumbs {
- my ($uri,$target,$prefix,$form,$skiplast)=@_;
+ 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).'"';
@@ -1216,13 +1218,19 @@ 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) {
my $href = 'javascript:'.$form.".action='".$href_path."';".$form.'.submit();';
- $output.=qq{$dir/};
+ $output.=qq{$dir/};
} else {
- $output.=qq{$dir/};
+ $output.=qq{$dir/};
}
}
} else {
@@ -1293,9 +1301,9 @@ sub htmlareaheaders {
ENDEDITOR
}
$s.=(<
-
-
+
+
+
@@ -1704,7 +1712,8 @@ sub show_return_link {
if ($env{'request.noversionuri'}=~m{^/priv/} ||
$env{'request.uri'}=~m{^/priv/}) { return 1; }
return if ($env{'request.noversionuri'} eq '/adm/supplemental');
-
+ return if (($env{'course.'.$env{'request.course.id'}.'.type'} eq 'Placement') &&
+ (!$env{'request.role.adv'}));
if (($env{'request.noversionuri'} =~ m{^/adm/(viewclasslist|navmaps)($|\?)})
|| ($env{'request.noversionuri'} =~ m{^/adm/.*/aboutme($|\?)})) {
@@ -1718,7 +1727,7 @@ sub show_return_link {
(($env{'request.noversionuri'}=~/^\/adm\//) &&
($env{'request.noversionuri'}!~/^\/adm\/wrapper\//) &&
($env{'request.noversionuri'}!~
- m{^/adm/.*/(smppg|bulletinboard)($|\?)})
+ m{^/adm/.*/(smppg|bulletinboard|exttools?)($|\?)})
));
}
@@ -1804,6 +1813,8 @@ the text on the right side of the breadc
=item $component_help
+the help item filename (without .tex extension).
+
=item $menulink
boolean, controls whether to include a link to /adm/menu
@@ -1820,6 +1831,21 @@ optional name for the class to apply to
optional flag, 1 if &mt() is _not_ to be applied to $component when including the text on the right
+=item $CourseBreadcrumbs
+
+optional flag, 1 if &breadcrumbs called from &docs_breadcrumbs, because breadcrumbs are being
+used to display hierarchy for current folder shown in the Course Editor.
+
+=item $topic_help
+
+optional help item to be displayed on right side of the breadcrumbs row, using
+loncommon::help_open_topic() to generate the link.
+
+=item $topic_help_text
+
+text to include in the link in the optional help item ($topic_help) on the right
+side of the breadcrumbs row.
+
=back
=back
@@ -1851,7 +1877,7 @@ returns: nothing
sub breadcrumbs {
my ($component,$component_help,$menulink,$helplink,$css_class,$no_mt,
- $CourseBreadcrumbs,$topic_help,$topic_help_text) = @_;
+ $CourseBreadcrumbs,$topic_help,$topic_help_text,$crstype) = @_;
#
$css_class ||= 'LC_breadcrumbs';
@@ -2081,6 +2107,16 @@ returns: nothing
undef(%tools);
}
+=item ¤t_breadcrumb_tools()
+
+returns: a hash containing the current breadcrumb tools.
+
+=cut
+
+ sub current_breadcrumb_tools {
+ return %tools;
+ }
+
=item &render_tools(\$breadcrumbs)
Creates html for breadcrumb tools (categories navigation and tools) and inserts
@@ -2461,7 +2497,7 @@ sub course_selection {
if ($totcodes > 0) {
my $numtitles = @$codetitles;
if ($numtitles > 0) {
- $output .= ' ';
+ $output .= ' ';
$output .= '