--- loncom/interface/lonhtmlcommon.pm 2015/04/24 21:31:56 1.361 +++ 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.361 2015/04/24 21:31:56 musolffc 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; @@ -1773,11 +1811,11 @@ boolean, controls whether to include a l =item $helplink if 'nohelp' don't include the orange help link - + =item $css_class optional name for the class to apply to the table for CSS - + =item $no_mt optional flag, 1 if &mt() is _not_ to be applied to $component when including the text on the right @@ -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 : '' ), @@ -3606,7 +3648,7 @@ See htmltag() for more details. =back =back - + returns: XHTML list as String. =cut @@ -3807,18 +3849,17 @@ End list of available functions =back -=back - Inputs: ./. Returns: HTML code with function list end + =cut sub end_funclist { return "\n"; } -=over +=pod =item &funclist_from_array( \@array, {legend => 'text for legend'} ) @@ -3838,7 +3879,7 @@ A string that's used as visually highlig it's value evaluates to false. =back - + returns: XHTML list as string. =back @@ -3851,7 +3892,9 @@ sub funclist_from_array { $args->{legend} ||= mt('Functions'); return list_from_array( [$args->{legend}, @$items], { listattr => {class => 'LC_funclist'} }); -} +} + +=pod =over @@ -3871,7 +3914,7 @@ e.g. a file operation in Authoring Space A reference to the array containing text. Details: sub funclist_from_array =back - + Returns: XHTML div as string. =back