[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface lonhtmlcommon.pm

raeburn raeburn at source.lon-capa.org
Mon May 11 13:18:36 EDT 2015


raeburn		Mon May 11 17:18:36 2015 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	lonhtmlcommon.pm 
  Log:
  - For 2.11
    Backport 1.363 and 1.362 (part).
  
  
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.358 loncom/interface/lonhtmlcommon.pm:1.358.2.1
--- loncom/interface/lonhtmlcommon.pm:1.358	Sat Dec 20 15:35:40 2014
+++ loncom/interface/lonhtmlcommon.pm	Mon May 11 17:18:36 2015
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.358 2014/12/20 15:35:40 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.358.2.1 2015/05/11 17:18:36 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -482,7 +482,36 @@
 =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
 
@@ -496,7 +525,7 @@
 ##############################################
 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;
@@ -649,17 +678,24 @@
         $result .= &mt('[_1] [_2] [_3] ',
                        $monthselector,$dayselector,$yearselector).
                    $tzone;
-        if (!$nolink) {
-            $result .= &mt('[_1]Select Date[_2]',$cal_link,'</a>');
-        }
+    } 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,'</a>');
-        }
+    }
+    if (!$nolink) {
+        $result .= &mt('[_1]Select Date[_2]',$cal_link,'</a>');
     }
     $result .= "</span>\n<!-- end $dname date setting form -->\n";
     return $result;
@@ -3611,6 +3647,7 @@
 Inputs: ./.
 
 Returns: HTML code with function list end
+
 =cut
 
 sub end_funclist {
@@ -3654,6 +3691,8 @@
 
 =pod
 
+=over
+
 =item &actionbox( \@array )
 
 Constructs a XHTML list from \@array with the first item being visually
@@ -3671,7 +3710,7 @@
 
 =back
  
-Returns: XHTML div as string. 
+Returns: XHTML div as string.
 
 =back
 




More information about the LON-CAPA-cvs mailing list