--- loncom/interface/lonhtmlcommon.pm 2015/05/05 21:45:55 1.362
+++ loncom/interface/lonhtmlcommon.pm 2015/05/28 02:53:29 1.364
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.362 2015/05/05 21:45:55 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.364 2015/05/28 02:53:29 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -484,7 +484,36 @@ 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
@@ -500,7 +529,7 @@ The method used to restrict user input w
##############################################
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 $tzname;
@@ -653,17 +682,26 @@ ENDJS
$result .= &mt('[_1] [_2] [_3] ',
$monthselector,$dayselector,$yearselector).
$tzone;
- if (!$nolink) {
- $result .= &mt('[_1]Select Date[_2]',$cal_link,'');
- }
+ } elsif ($no_mm_ss) {
+ $result .= &mt('[_1] [_2] [_3] [_4]',
+ $monthselector,$dayselector,$yearselector,
+ $hourselector).
+ $tzone;
+
+ } elsif ($no_ss) {
+ $result .= &mt('[_1] [_2] [_3] [_4] [_5]m',
+ $monthselector,$dayselector,$yearselector,
+ $hourselector,$minuteselector).
+ $tzone;
+
} else {
$result .= &mt('[_1] [_2] [_3] [_4] [_5]m [_6]s ',
$monthselector,$dayselector,$yearselector,
$hourselector,$minuteselector,$secondselector).
$tzone;
- if (!$nolink) {
- $result .= &mt('[_1]Select Date[_2]',$cal_link,'');
- }
+ }
+ if (!$nolink) {
+ $result .= &mt('[_1]Select Date[_2]',$cal_link,'');
}
$result .= "\n\n";
return $result;
@@ -1813,7 +1851,7 @@ returns: nothing
sub breadcrumbs {
my ($component,$component_help,$menulink,$helplink,$css_class,$no_mt,
- $CourseBreadcrumbs) = @_;
+ $CourseBreadcrumbs,$topic_help,$topic_help_text) = @_;
#
$css_class ||= 'LC_breadcrumbs';
@@ -1920,6 +1958,10 @@ returns: nothing
$component_help,
$faq,$bug);
}
+ if ($topic_help && $topic_help_text) {
+ $icons .= ' '.&Apache::loncommon::help_open_topic($topic_help,&mt($topic_help_text),'',
+ undef,600);
+ }
#
@@ -1932,7 +1974,7 @@ returns: nothing
}
- if ($component) {
+ if (($component) || ($topic_help && $topic_help_text)) {
$links = &htmltag('span',
( $no_mt ? $component : mt($component) ).
( $icons ? $icons : '' ),