Ticket #486: DayScrolling.diff
File DayScrolling.diff, 2.2 KB (added by , 20 years ago) |
---|
-
mythplugins/mythweb/themes/Default/program_listing.php
19 19 parent::print_header('MythWeb - ' . t('Program Listing') . ': '.strftime($_SESSION['date_statusbar'], $start_time)); 20 20 // Print the header info specific to the program listing 21 21 ?> 22 23 <script language=javascript> 24 function MoveProgramListing(amount) { 25 var length = get_element('program_listing').date.length; 26 var cur = get_element('program_listing').date.selectedIndex; 27 var newPos = cur; 28 if (cur + amount < 0) { 29 newPos = 0; 30 } else if (cur + amount > length - 1) { 31 newPos = length - 1; 32 } else { 33 newPos = cur + amount; 34 } 35 36 get_element('program_listing').date.selectedIndex = newPos; 37 get_element('program_listing').submit(); 38 } 39 </script> 40 22 41 <p> 23 42 <table align="center" width="90%" cellspacing="2" cellpadding="2"> 24 43 <tr> … … 39 58 } 40 59 ?></select></td> 41 60 <td align="right"><?echo t('Date') ?>: </td> 42 <td ><select name="date" onchange="get_element('program_listing').submit()"><?php61 <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 43 62 // Find out how many days into the future we should bother checking 44 63 $result = mysql_query('SELECT TO_DAYS(max(starttime)) - TO_DAYS(NOW()) FROM program') 45 64 or trigger_error('SQL Error: '.mysql_error(), FATAL); … … 53 72 if ($date == date("Ymd", $start_time)) echo " selected"; 54 73 echo ">".strftime($_SESSION['date_listing_jump'] , $time)."</option>"; 55 74 } 56 ?></select>< /td>75 ?></select><a href="javascript:MoveProgramListing(+1);"><img src="images/right.gif" border=0></a></td> 57 76 <td align="center"><noscript><input type="submit" class="submit" value="<? echo t('Jump') ?>"></noscript></td> 58 77 59 78