[dev] Odin attribute patch

Vilius Sumskas vilius at lnk.lt
Wed Jun 23 05:53:34 PDT 2004


sorry, something bad happened, this one is correct patch.

--
    Best Regards,

    Vilius Sumskas
    LNK TV system administrator
    mob.: +370 614 75713
    www.lnk.lt

-------------- next part --------------
Index: criteria.inc
===================================================================
RCS file: /repository/odin/templates/advanced/criteria.inc,v
retrieving revision 1.5
diff -u -r1.5 criteria.inc
--- criteria.inc	3 Oct 2002 21:27:17 -0000	1.5
+++ criteria.inc	23 Jun 2004 12:49:49 -0000
@@ -13,9 +13,11 @@
     <td class="light" align="right"><b><?php echo $attributes[$name]['desc'] ?></b> <?php echo _("Starting:") ?><br /><?php echo ("Until:") ?></td>
     <td class="light" align="left">
     <?php echo Odin::buildHourWidget($name . '[start][hour]'); ?>
-    <?php echo Odin::buildMinuteWidget($name . '[start][min]'); ?><br />
+    <?php echo Odin::buildMinuteWidget($name . '[start][min]'); ?>
+    <?php echo Odin::buildSecondWidget($name . '[start][sec]'); ?><br />
     <?php echo Odin::buildHourWidget($name . '[end][hour]'); ?>
     <?php echo Odin::buildMinuteWidget($name . '[end][min]'); ?>
+    <?php echo Odin::buildSecondWidget($name . '[end][sec]'); ?>
     </td>
 </tr>
 <?php else: ?>
-------------- 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