[dev] Odin attribute patch

Vilius Sumskas vilius at lnk.lt
Wed Jun 23 05:42:10 PDT 2004


Hello,

attribute type 'hh:mm:ss' had missing second widget in advanced search window.
This patch fixes this.

--
   Best Regards,

   Vilius Sumskas
   LNK TV system administrator
   mob.: +370 614 75713
   www.lnk.lt
-------------- next part --------------
<br />
<b>Parse error</b>:  parse error, unexpected T_ELSE in <b>/home/pop/vilius/www/public/horde/criteria.inc.patch</b> on line <b>20</b><br />
-------------- next part --------------
Index: Odin.php
===================================================================
RCS file: /repository/odin/lib/Odin.php,v
retrieving revision 1.11
diff -u -r1.11 Odin.php
--- Odin.php	7 Apr 2004 14:43:41 -0000	1.11
+++ Odin.php	23 Jun 2004 12:33:18 -0000
@@ -171,6 +171,25 @@
         return $html;
     }
 
+    function buildSecondWidget($name, $increment = 1, $timestamp = null, $javascript = null)
+    {
+        $selected = (isset($timestamp)) ? date('s', $timestamp) : null;
+
+        $html = "<select name=\"$name\"";
+        if ($javascript != null) {
+            $html .= ' ' . $javascript;
+        }
+        $html .= '><option value="">' . _("[Sec]") . '</option>';
+        for ($second = 0; $second <= 60; $second += $increment) {
+            $html .= "<option value=\"$second\"";
+            $html .= ($second === $selected) ? ' selected="selected">' : '>';
+            $html .= sprintf("%02d", $second) . '</option>';
+        }
+        $html .= "</select>\n";
+
+        return $html;
+    }
+
     function menu()
     {
         global $notification, $registry, $conf;


More information about the dev mailing list