[mythtv] [PATCH] mythweb: Scrolling through days while keeping time constant

Christian Höhle Christian at FamilieHoehle.de
Mon Oct 17 14:59:57 UTC 2005


Shame on me, missed the attachment...
-------------- next part --------------
Index: mythplugins/mythweb/themes/Default/program_listing.php
===================================================================
--- mythplugins/mythweb/themes/Default/program_listing.php	(revision 7502)
+++ mythplugins/mythweb/themes/Default/program_listing.php	(working copy)
@@ -19,6 +19,25 @@
         parent::print_header('MythWeb - ' . t('Program Listing') . ': '.strftime($_SESSION['date_statusbar'], $start_time));
     // Print the header info specific to the program listing
 ?>
+
+<script language=javascript>
+function MoveProgramListing(amount) {
+  var length = get_element('program_listing').date.length;
+  var cur = get_element('program_listing').date.selectedIndex;
+  var newPos = cur;
+  if (cur + amount < 0) {
+    newPos = 0;
+  } else if (cur + amount > length - 1) {
+    newPos = length - 1;
+  } else {
+    newPos = cur + amount;
+  }
+    
+  get_element('program_listing').date.selectedIndex = newPos;
+  get_element('program_listing').submit();
+}
+</script>
+
 <p>
 <table align="center" width="90%" cellspacing="2" cellpadding="2">
 <tr>
@@ -39,7 +58,7 @@
                 }
                 ?></select></td>
             <td align="right"><?echo t('Date') ?>:&nbsp;</td>
-            <td><select name="date" onchange="get_element('program_listing').submit()"><?php
+            <td style="vertical-align:middle;"><a href="javascript:MoveProgramListing(-1);"><img src="images/left.gif" border=0></a><select name="date" onchange="get_element('program_listing').submit()"><?php
             // Find out how many days into the future we should bother checking
                 $result = mysql_query('SELECT TO_DAYS(max(starttime)) - TO_DAYS(NOW()) FROM program')
                     or trigger_error('SQL Error: '.mysql_error(), FATAL);
@@ -53,7 +72,7 @@
                     if ($date == date("Ymd", $start_time)) echo " selected";
                     echo ">".strftime($_SESSION['date_listing_jump'] , $time)."</option>";
                 }
-                ?></select></td>
+                ?></select><a href="javascript:MoveProgramListing(+1);"><img src="images/right.gif" border=0></a></td>
             <td align="center"><noscript><input type="submit" class="submit" value="<? echo t('Jump') ?>"></noscript></td>
 
 


More information about the mythtv-dev mailing list