Ticket #486: DayScrolling.diff

File DayScrolling.diff, 2.2 KB (added by Christian@…, 14 years ago)
  • mythplugins/mythweb/themes/Default/program_listing.php

     
    1919        parent::print_header('MythWeb - ' . t('Program Listing') . ': '.strftime($_SESSION['date_statusbar'], $start_time));
    2020    // Print the header info specific to the program listing
    2121?>
     22
     23<script language=javascript>
     24function 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
    2241<p>
    2342<table align="center" width="90%" cellspacing="2" cellpadding="2">
    2443<tr>
     
    3958                }
    4059                ?></select></td>
    4160            <td align="right"><?echo t('Date') ?>:&nbsp;</td>
    42             <td><select name="date" onchange="get_element('program_listing').submit()"><?php
     61            <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
    4362            // Find out how many days into the future we should bother checking
    4463                $result = mysql_query('SELECT TO_DAYS(max(starttime)) - TO_DAYS(NOW()) FROM program')
    4564                    or trigger_error('SQL Error: '.mysql_error(), FATAL);
     
    5372                    if ($date == date("Ymd", $start_time)) echo " selected";
    5473                    echo ">".strftime($_SESSION['date_listing_jump'] , $time)."</option>";
    5574                }
    56                 ?></select></td>
     75                ?></select><a href="javascript:MoveProgramListing(+1);"><img src="images/right.gif" border=0></a></td>
    5776            <td align="center"><noscript><input type="submit" class="submit" value="<? echo t('Jump') ?>"></noscript></td>
    5877
    5978