--- loncom/interface/lonhtmlcommon.pm 2013/07/11 18:25:51 1.350
+++ loncom/interface/lonhtmlcommon.pm 2025/03/06 16:42:40 1.420
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.350 2013/07/11 18:25:51 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.420 2025/03/06 16:42:40 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -64,15 +64,26 @@ use HTML::Entities();
use LONCAPA qw(:DEFAULT :match);
sub java_not_enabled {
- return "\n".''.
- &mt('The required Java applet could not be started. Please make sure to have Java installed and active in your browser.').
- "\n";
+ if (($env{'browser.mobile'}) && ($env{'browser.mobile'} =~ /^ipad|ipod|iphone$/i)) {
+ return "\n".''.
+ &mt('The required Java applet could not be started, because Java is not supported by your mobile device.').
+ "\n";
+ } else {
+ return "\n".''.
+ &mt('The required Java applet could not be started. Please make sure to have Java installed and active in your browser.').
+ "\n";
+ }
}
sub coursepreflink {
my ($text,$category)=@_;
if (&Apache::lonnet::allowed('opa',$env{'request.course.id'})) {
- return '&"').'">'.$text.'';
+ my $target =' target="_top"';
+ if ((($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) ||
+ (($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'} eq '_self'))) {
+ $target ='';
+ }
+ return '&"').'">'.$text.'';
} else {
return '';
}
@@ -86,7 +97,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 {
@@ -95,9 +106,14 @@ sub direct_parm_link {
$filter=&entity_encode($filter);
$part=&entity_encode($part);
if (($symb) && (&Apache::lonnet::allowed('opa')) && ($target ne 'tex')) {
- return "$linktext";
+ my $target=' target="_top"';
+ if ((($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) ||
+ (($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'} eq '_self'))) {
+ $target='';
+ }
+ return "$linktext";
} else {
- return $linktext;
+ return $linktext;
}
}
##############################################
@@ -170,7 +186,7 @@ sub dragmath_js {
function mathedit(textarea, doc) {
targetEntry = textarea;
targetDoc = doc;
- newwin = window.open("/adm/dragmath/applet/$popup.html","","width=565,height=500,resizable");
+ newwin = window.open("/adm/dragmath/$popup.html","","width=565,height=500,resizable");
}
// ]]>
@@ -215,15 +231,16 @@ sub dependencycheck_js {
$link = '/adm/dependencies?symb='.&HTML::Entities::encode($symb,'<>&"');
} elsif ($folderpath) {
$link = '/adm/dependencies?folderpath='.&HTML::Entities::encode($folderpath,'<>&"');
- $url = $uri;
+ $url = $uri;
} elsif ($uri =~ m{^/public/$match_domain/$match_courseid/syllabus$}) {
$link = '/adm/dependencies';
}
- $link .= (($link=~/\?/)?'&':'?').'title='.
+ $link .= (($link=~/\?/)?'&':'?').'title='.
&HTML::Entities::encode($title,'<>&"');
if ($url) {
$link .= '&url='.&HTML::Entities::encode($url,'<>&"');
}
+ &js_escape(\$link);
return <
// ';
+ $Str .= $special.' />';
return $Str;
}
@@ -445,10 +462,12 @@ sub radio {
&date_setter returns html and javascript for a compact date-setting form.
To retrieve values from it, use &get_date_from_form.
-Inputs
-
=over 4
+=item Inputs
+
+=over
+
=item $dname
The name to prepend to the form elements.
@@ -476,29 +495,69 @@ the date/time fields are left empty.
=item $state
Specifies the initial state of the form elements. Either 'disabled' or empty.
-Defaults to empty, which indiciates the form elements are not disabled.
+Defaults to empty, which indicates the form elements are not disabled.
+
+=item $no_hh_mm_ss
+
+If true, text boxes for hours, minutes and seconds are omitted.
+
+=item $defhour
+
+Default value for hours (a default of 0 is used otherwise).
+
+=item $defmin
+
+Default value for minutes (a default of 0 is used otherwise).
+
+=item defsec
+
+Default value for seconds (a default of 0 is used otherwise).
+
+=item $nolink
+
+If true, a "Select calendar" link (to pop-up a calendar) is not displayed
+to the right of the items.
+
+=item $no_mm_ss
+
+If true, text boxes for minutes and seconds are omitted.
+
+=item $no_ss
+
+If true, text boxes for seconds are omitted.
=back
-Bugs
+=item Bugs
The method used to restrict user input will fail in the year 2400.
+=back
+
=cut
##############################################
##############################################
sub date_setter {
my ($formname,$dname,$currentvalue,$special,$includeempty,$state,
- $no_hh_mm_ss,$defhour,$defmin,$defsec,$nolink) = @_;
+ $no_hh_mm_ss,$defhour,$defmin,$defsec,$nolink,$no_mm_ss,$no_ss) = @_;
my $now = time;
-
+ my %labels = &Apache::lonlocal::texthash(
+ day => 'day',
+ month => 'month',
+ year => 'year',
+ sec => 'seconds',
+ min => 'minutes',
+ hour => 'hours',
+ );
my $tzname;
my ($sec,$min,$hour,$mday,$month,$year) = ('', '', undef,''.''.'');
#other potentially useful values: wkday,yrday,is_daylight_savings
if (! defined($state) || $state ne 'disabled') {
$state = '';
+ } else {
+ $state = 'disabled="disabled"';
}
if (! defined($no_hh_mm_ss)) {
$no_hh_mm_ss = 0;
@@ -591,7 +650,7 @@ document.$formname.$dname\_year.value,
ENDJS
$result .= ' ';
- my $monthselector = qq{\n\n";
return $result;
@@ -697,7 +765,9 @@ sub build_url {
get_date_from_form retrieves the date specified in an &date_setter form.
-Inputs:
+=over
+
+=item Inputs:
=over 4
@@ -711,6 +781,8 @@ The unix time to use as the default in c
=back
+=back
+
Returns: Unix time represented in the form.
=cut
@@ -804,13 +876,14 @@ parameter setting wizard.
##############################################
sub pjump_javascript_definition {
my $Str = <&"');
&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 {
@@ -1215,13 +1324,13 @@ sub htmlareaheaders {
ENDEDITOR
}
$s.=(<
-
-
+
+
+
-
+
@@ -1254,6 +1363,68 @@ $(document).ready(function(){
});';
}
+sub countdown {
+
+ # Code to put a due date countdown in 'duedatecountdown' span.
+ # This is currently located in the breadcrumb headers.
+ # note that the dueDateLayout is internatinoalized below.
+ # Here document is used to support the substitution into the javascript below.
+ # ..which unforunately necessitates escaping the $'s in the javascript.
+ # There are several times of importance
+ #
+ # serverDueDate - The absolute time at which the problem expires.
+ # serverTime - The server's time when the problem finished computing.
+ # clientTime - The client's time...as close to serverTime as possible.
+ # The clientTime will be slightly later due to
+ # 1. The latency between problem computation and
+ # the first network action.
+ # 2. The time required between the page load-start and the actual
+ # initial javascript execution that got clientTime.
+ # These are used as follows:
+ # The difference between clientTime and serverTime are used to
+ # correct for differences in clock settings between the browser's system and the
+ # server's.
+ #
+ # The difference between clientTime and the time at which the ready() method
+ # starts executing is used to estimate latencies for page load and submission.
+ # Since this is an estimate, it is doubled. The latency estimate + one minute
+ # is used to determine when the countdown timer turns red to warn the user
+ # to think about submitting.
+
+
+ my $dueDateLayout = &mt('Due in: {dn} {dl} {hnn}{sep}{mnn}{sep}{snn} [_1]',
+ "");
+ my $early = '- '.&mt('Submit Early').'';
+ my $pastdue = '- '.&mt('Past Due').'';
+ return <<"JAVASCRIPT";
+
+ var documentReadyTime;
+
+\$(document).ready(function() {
+ if (typeof(dueDate) != "undefined") {
+ documentReadyTime = (new Date()).getTime();
+ \$("#duedatecountdown").countdown({until: dueDate, compact: true,
+ layout: "$dueDateLayout",
+ onTick: function (periods) {
+ var latencyEstimate = (documentReadyTime - clientTime) * 2;
+ if(\$.countdown.periodsToSeconds(periods) < (300 + latencyEstimate)) {
+ \$("#submitearly").html("$early");
+ if (\$.countdown.periodsToSeconds(periods) < 1) {
+ \$("#submitearly").html("$pastdue");
+ }
+ }
+ if(\$.countdown.periodsToSeconds(periods) < (60 + latencyEstimate)) {
+ \$(this).css("color", "red"); //Highlight last minute.
+ }
+ }
+ });
+ }
+});
+
+JAVASCRIPT
+
+}
+
# ----------------------------------------- Script to activate only some fields
sub htmlareaselectactive {
@@ -1300,6 +1471,41 @@ sub htmlareaselectactive {
}
function startRichEditor(id) {
+ // fix character entities inside
+ // NOTE: this is not fixing characters inside
+ // NOTE: < and > inside should fix automatically because there should not be a letter after <.
+ var ta = document.getElementById(id);
+ var value = ta.value;
+ var in_m = false; // in the m element
+ var in_text = false; // in the text inside the m element
+ var im = -1; // position of
+ var it = -1; // position of the text inside
+ for (var i=0; i if found twice
+ in_m = true;
+ in_text = false;
+ im = i;
+ it = -1;
+ } else if (in_m) {
+ if (!in_text) {
+ if (value.charAt(i) == ">") {
+ in_text = true;
+ it = i+1;
+ }
+ } else if (value.substr(i, 4) == "") {
+ in_m = false;
+ var text = value.substr(it, i-it);
+ var l1 = text.length;
+ text = text.replace(//g, ">");
+ var l2 = text.length;
+ value = value.substr(0, it) + text + "" + value.substr(i+4);
+ i = i + (l2-l1);
+ }
+ }
+ }
+ ta.value = value;
CKEDITOR.replace(id,
{
customConfig: "/ckeditor/loncapaconfig.js",
@@ -1311,6 +1517,68 @@ sub htmlareaselectactive {
function destroyRichEditor(id) {
CKEDITOR.instances[id].destroy();
+ // replace character entities < and > in and
+ // and "&fctname(" by "&fctname("
+ // and the quotes inside functions: "&fct(1, "a")" -> "&fct(1, "a")"
+ var ta = document.getElementById(id);
+ var value = ta.value;
+ var in_element = false; // in the m or chem element
+ var tagname = ""; // m or chem
+ var in_text = false; // in the text inside the element
+ var im = -1; // position of start tag
+ var it = -1; // position of the text inside
+ for (var i=0; i") {
+ in_text = true;
+ it = i+1;
+ }
+ } else if (value.substr(i, 3+tagname.length) == ""+tagname+">") {
+ in_element = false;
+ var text = value.substr(it, i-it);
+ var l1 = text.length;
+ text = text.replace(/</g, "<");
+ text = text.replace(/>/g, ">");
+ var l2 = text.length;
+ value = value.substr(0, it) + text + value.substr(i);
+ i = i + (l2-l1);
+ }
+ }
+ }
+ // fix function names
+ value = value.replace(/&([a-zA-Z_]+)\(/g, "&$1(");
+ // fix quotes in functions
+ var pos_next_fct = value.search(/&[a-zA-Z_]+\(/);
+ var depth = 0;
+ for (var i=0; i 0) {
+ if (value.charAt(i) == ")")
+ depth--;
+ else if (value.substr(i, 6) == """)
+ value = value.substr(0, i) + "\"" + value.substr(i+6);
+ }
+ }
+ // replace the text value
+ ta.value = value;
}
function editorHandler(event) {
@@ -1380,62 +1648,11 @@ sub htmlareaselectactive {
});
';
- $output .= &color_picker;
-
- # Code to put a due date countdown in 'duedatecountdown' span.
- # This is currently located in the breadcrumb headers.
- # note that the dueDateLayout is internatinoalized below.
- # Here document is used to support the substitution into the javascript below.
- # ..which unforunately necessitates escaping the $'s in the javascript.
- # There are several times of importance
- #
- # serverDueDate - The absolute time at which the problem expires.
- # serverTime - The server's time when the problem finished computing.
- # clientTime - The client's time...as close to serverTime as possible.
- # The clientTime will be slightly later due to
- # 1. The latency between problem computation and
- # the first network action.
- # 2. The time required between the page load-start and the actual
- # initial javascript execution that got clientTime.
- # These are used as follows:
- # The difference between clientTime and serverTime are used to
- # correct for differences in clock settings between the browser's system and the
- # server's.
- #
- # The difference between clientTime and the time at which the ready() method
- # starts executing is used to estimate latencies for page load and submission.
- # Since this is an estimate, it is doubled. The latency estimate + one minute
- # is used to determine when the countdown timer turns red to warn the user
- # to think about submitting.
+ $output .= &color_picker();
- my $dueDateLayout = &mt('Due in: {dn} {dl} {hnn}{sep}{mnn}{sep}{snn} [_1]',
- "");
- my $early = '- '.&mt('Submit Early').'';
- my $pastdue = '- '.&mt('Past Due').'';
- $output .= < 1)
+#
+# Will apply to any input tag with class: LC_numresponse_text.
+# Currently set in start_textline for numericalresponse items.
+#
+
+sub dash_to_minus_js {
+ return <<'ENDJS';
+
+
+
+ENDJS
+}
+
############################################################
############################################################
@@ -1617,13 +1900,63 @@ A link to help for the component will be
All inputs can be undef without problems.
-Inputs: $component (the text on the right side of the breadcrumbs trail),
- $component_help
- $menulink (boolean, controls whether to include a link to /adm/menu)
- $helplink (if 'nohelp' don't include the orange help link)
- $css_class (optional name for the class to apply to the table for CSS)
- $no_mt (optional flag, 1 if &mt() is _not_ to be applied to $component
- when including the text on the right.
+=over
+
+=item Inputs:
+
+=over
+
+=item $component
+
+the text on the right side of the breadcrumbs trail
+
+=item $component_help
+
+the help item filename (without .tex extension).
+
+=item $menulink
+
+boolean, controls whether to include a link to /adm/menu
+
+=item $helplink
+
+if 'nohelp' don't include the orange help link
+
+=item $crumbs_style
+
+optional style attribute for div containing breadcrumbs
+unless called from docs_breadcrumbs
+
+=item $no_mt
+
+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.
+
+=item $links_target
+
+optionally includes the target (_top, _parent or _self) for (i) initial
+$menulink item in the breadcrumbs (if present), (ii) return to last location
+(if present), and (iii) help item at the right side of breadcrumbs menu,
+created by loncommon::help_open_topic() or loncommon::help_open_menu().
+
+=back
+
+=back
+
Returns a string containing breadcrumbs for the current page.
=item &clear_breadcrumbs()
@@ -1650,11 +1983,9 @@ returns: nothing
my %tools = ();
sub breadcrumbs {
- my ($component,$component_help,$menulink,$helplink,$css_class,$no_mt,
- $CourseBreadcrumbs) = @_;
+ my ($component,$component_help,$menulink,$helplink,$crumbs_style,$no_mt,
+ $CourseBreadcrumbs,$topic_help,$topic_help_text,$links_target) = @_;
#
- $css_class ||= 'LC_breadcrumbs';
-
# Make the faq and bug data cascade
my $faq = '';
my $bug = '';
@@ -1667,6 +1998,16 @@ returns: nothing
# The first one should be the course or a menu link
if (!defined($menulink)) { $menulink=1; }
if ($menulink) {
+ if ($env{'request.course.id'}) {
+ my ($menucoll,$deeplinkmenu,$menuref) = &Apache::loncommon::menucoll_in_effect();
+ if (($menucoll) && (ref($menuref) eq 'HASH')) {
+ if ($menuref->{'main'} eq 'n') {
+ undef($menulink);
+ }
+ }
+ }
+ }
+ if ($menulink) {
my $description = 'Menu';
my $no_mt_descr = 0;
if ((exists($env{'request.course.id'})) &&
@@ -1676,7 +2017,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';
@@ -1684,9 +2025,16 @@ returns: nothing
}
}
}
+ my $target = '_top';
+ if ($links_target) {
+ $target = $links_target;
+ } elsif ((($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) ||
+ (($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'} eq '_self'))) {
+ $target='';
+ }
$menulink = { href =>'/adm/menu',
title =>'Go to main menu',
- target =>'_top',
+ target =>$target,
text =>$description,
no_mt =>$no_mt_descr, };
if($last) {
@@ -1700,11 +2048,15 @@ returns: nothing
my $links;
if ((&show_return_link) && (!$CourseBreadcrumbs) && (ref($last) eq 'HASH')) {
my $alttext = &mt('Go Back');
+ my $hashref = { href => '/adm/flip?postdata=return:',
+ title => &mt('Back to most recent content resource'),
+ class => 'LC_menubuttons_link',
+ };
+ if ($links_target) {
+ $hashref->{'target'} = $links_target;
+ }
$links=&htmltag( 'a','',
- { href => '/adm/flip?postdata=return:',
- title => &mt('Back to most recent content resource'),
- class => 'LC_menubuttons_link',
- });
+ $hashref);
$links=&htmltag('li',$links);
}
$links.= join "",
@@ -1735,7 +2087,7 @@ returns: nothing
if ($lasttext ne '') {
$links .= &htmltag( 'li', htmltag($CourseBreadcrumbs ? 'b' : 'h1',
- $lasttext), {title => $lasttext});
+ $lasttext));
}
my $icons = '';
@@ -1752,7 +2104,12 @@ returns: nothing
if ($faq ne '' || $component_help ne '' || $bug ne '') {
$icons .= &Apache::loncommon::help_open_menu($component,
$component_help,
- $faq,$bug);
+ $faq,$bug,'','','','',
+ $links_target);
+ }
+ if ($topic_help && $topic_help_text) {
+ $icons .= ' '.&Apache::loncommon::help_open_topic($topic_help,&mt($topic_help_text),'',
+ undef,600,'',$links_target);
}
#
@@ -1766,7 +2123,7 @@ returns: nothing
}
- if ($component) {
+ if (($component) || ($topic_help && $topic_help_text)) {
$links = &htmltag('span',
( $no_mt ? $component : mt($component) ).
( $icons ? $icons : '' ),
@@ -1782,8 +2139,13 @@ returns: nothing
}
if (($links ne '') || ($nav_and_tools)) {
&render_tools(\$links);
- $links = &htmltag('div', $links,
- { id => "LC_breadcrumbs" }) unless ($CourseBreadcrumbs) ;
+ unless ($CourseBreadcrumbs) {
+ my $args = { id => 'LC_breadcrumbs' };
+ if ($crumbs_style ne '') {
+ $args->{'style'} = $crumbs_style;
+ }
+ $links = &htmltag('div', $links, $args);
+ }
}
my $adv_tools = 0;
if (ref($tools{'advtools'}) eq 'ARRAY') {
@@ -1800,9 +2162,8 @@ returns: nothing
# Return the breadcrumb's line
-
-
- return "$links";
+ my $labeltext = &HTML::Entities::encode(&mt('Links for navigation and information'));
+ return '
'.$links.'
';
}
sub clear_breadcrumbs {
@@ -1821,7 +2182,9 @@ Adds $html to $category of the breadcrum
$html is usually a link to a page that invokes a function on the currently
displayed data (e.g. print when viewing a problem)
-Currently there are 3 possible values for $category:
+=over
+
+=item Currently there are 3 possible values for $category:
=over
@@ -1835,7 +2198,9 @@ remaining items in right of breadcrumbs
advanced tools shown in a separate box below breadcrumbs line
=back
-
+
+=back
+
returns: nothing
=cut
@@ -1869,13 +2234,32 @@ 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
\$breadcrumbs at the correct position.
-input: \$breadcrumbs - a reference to the string containing prepared
-breadcrumbs.
+=over
+
+=item input:
+
+=over
+
+=item \$breadcrumbs - a reference to the string containing prepared breadcrumbs.
+
+=back
+
+=back
returns: nothing
@@ -1901,8 +2285,17 @@ returns: nothing
Creates html for advanced tools (category advtools) and inserts \$breadcrumbs
at the correct position.
-input: \$breadcrumbs - a reference to the string containing prepared
-breadcrumbs (after render_tools call).
+=over
+
+=item input:
+
+=over
+
+=item \$breadcrumbs - a reference to the string containing prepared breadcrumbs (after render_tools call).
+
+=back
+
+=back
returns: nothing
@@ -1920,7 +2313,7 @@ returns: nothing
} # End of scope for @Crumbs
sub docs_breadcrumbs {
- my ($allowed,$crstype,$contenteditor,$title,$precleared)=@_;
+ my ($allowed,$crstype,$contenteditor,$title,$precleared,$checklinkprot)=@_;
my ($folderpath,@folders,$supplementalflag);
@folders = split('&',$env{'form.folderpath'});
if ($env{'form.folderpath'} =~ /^supplemental/) {
@@ -1935,19 +2328,21 @@ sub docs_breadcrumbs {
my $foldername=shift(@folders);
if ($folderpath) {$folderpath.='&';}
$folderpath.=$folder.'&'.$foldername;
- my $url;
+ my $url = $env{'request.use_absolute'};
if ($allowed) {
- $url = '/adm/coursedocs?folderpath=';
+ $url .= '/adm/coursedocs?folderpath=';
} else {
- $url = '/adm/supplemental?folderpath=';
+ $url .= '/adm/supplemental?folderpath=';
}
$url .= &escape($folderpath);
my $name=&unescape($foldername);
# each of randompick number, hidden, encrypted, random order, is_page
# are appended with ":"s to the foldername
$name=~s/\:(\d*)\:(\w*)\:(\w*):(\d*)\:?(\d*)$//;
- unless ($supplementalflag) {
- if ($contenteditor) {
+ if ($contenteditor) {
+ if ($supplementalflag) {
+ if ($2) { $ishidden=1; }
+ } else {
if ($1 ne '') {
$randompick=$1;
} else {
@@ -1988,9 +2383,17 @@ sub docs_breadcrumbs {
$plain=~s/\>\;\s*$//;
}
my $menulink = 0;
- if (!$allowed && !$contenteditor) {
+ if (!$allowed && !$contenteditor && !$supplementalflag) {
$menulink = 1;
}
+ if ($checklinkprot) {
+ if ($env{'request.deeplink.login'}) {
+ my $linkprotout = &Apache::lonmenu::linkprot_exit();
+ if ($linkprotout) {
+ &Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$linkprotout);
+ }
+ }
+ }
return (&breadcrumbs(undef,undef,$menulink,'nohelp',undef,undef,
$contenteditor),
$randompick,$ishidden,$isencrypted,$plain,
@@ -2093,7 +2496,7 @@ END
}
sub row_title {
- my ($title,$css_title_class,$css_value_class, $css_value_furtherAttributes) = @_;
+ my ($title,$css_title_class,$css_value_class,$css_value_furtherAttributes,$nocolon) = @_;
$row_count[0]++;
my $css_class = ($row_count[0] % 2)?'LC_odd_row':'LC_even_row';
$css_title_class ||= 'LC_pick_box_title';
@@ -2101,14 +2504,14 @@ sub row_title {
$css_value_class ||= 'LC_pick_box_value';
- if ($title ne '') {
+ if (($title ne '') && (!$nocolon)) {
$title .= ':';
}
my $output = <<"ENDONE";
-
+
$title
-
+
ENDONE
return $output;
@@ -2231,10 +2634,10 @@ sub course_selection {
if ($totcodes > 0) {
my $numtitles = @$codetitles;
if ($numtitles > 0) {
- $output .= ' ';
+ $output .= ' ';
$output .= '
'.$$codetitles[0].' '."\n".
''."\n".
+ '" onchange="setPick(this.form);courseSet('."'$$codetitles[0]'".')">'."\n".
' Select'."\n";
my @items = ();
my @longitems = ();
@@ -2264,7 +2667,7 @@ sub course_selection {
for (my $i=1; $i<$numtitles; $i++) {
$output .= '