Ticket #476: mythweb-0.18-fixes.diff

File mythweb-0.18-fixes.diff, 15.7 KB (added by tahoward@…, 19 years ago)

I added a new file, but it wasn't included in the previous diff

  • mythweb/themes/wap/program_detail.php

     
    1010#class theme_program_detail extends Theme {
    1111class Theme_program_detail extends Theme {
    1212
    13     function print_page() {
    14         global $this_channel, $this_program;
     13    function print_page(&$this_program, &$schedule, &$this_channel) {
     14     //   global $this_channel, $this_program;
    1515    // Print the main page header
    1616        parent::print_header("MythWeb - Program Detail:  $this_program->title");
    1717    // Print the page contents
     
    2121<?=prefer_channum ? $this_channel->callsign : $this_channel->channum?></a><br>
    2222
    2323<?=$this_program->title?><BR>
    24 <?=date('D m/d/y', $$this_program->starttime)?><br>
    25 <?=date('g:i A', $this_program->starttime)?> to <?=date('g:i A', $this_program->endtime)?> (<?=(int)($this_program->length/60)?> minutes)<BR>
     24<?=date('D m/d/y', $schedule->starttime)?><br>
     25<?=date('g:i A', $schedule->starttime)?> to <?=date('g:i A', $schedule->endtime)?> (<?=(int)($this_program->length/60)?> minutes)<BR>
    2626                <?
    2727                if ($this_program->previouslyshown)
    2828                    echo '(Rerun) ';
     
    5151                ?><br>
    5252        <? } ?>
    5353
    54         <form action="program_detail.php" method="get" name="record_settings">
    55         <input type="hidden" name="chanid" value="<?=$_GET['chanid']?>">
    56         <input type="hidden" name="starttime" value="<?=$_GET['starttime']?>">
     54        <form name="program_detail" method="post" action="program_detail.php?<?php
     55            if ($_GET['recordid'])
     56                echo 'recordid='.urlencode($_GET['recordid']);
     57            else
     58                echo 'chanid='.urlencode($_GET['chanid']).'&starttime='.urlencode($_GET['starttime'])
     59            ?>">
     60
    5761<br>
    5862        <center>Recording Options:</center>
    59                     <input type="radio" class="radio" name="record" value="never" id="record_never"<?=
    60                     $this_program->will_record ? '' : ' CHECKED'?>></input>
     63                    <input type="radio" class="radio" name="record" value="0" id="record_never"<?=
     64                    $schedule->recordid ? '' : ' CHECKED'?>></input>
    6165  <a>Don't record</a><br>
    62                     <input type="radio" class="radio" name="record" value="once" id="record_once"<?=
    63                     $this_program->record_once ? ' CHECKED' : ''?>></input>
    64   <a>Record showing</a><br>
    65                     <input type="radio" class="radio" name="record" value="daily" id="record_daily"<?=
    66                     $this_program->record_daily ? ' CHECKED' : ''?>></input>
     66                    <input type="radio" class="radio" name="record" value="<?php echo rectype_once ?>" id="record_once"<?=
     67                    $schedule->type == rectype_once ? ' CHECKED' : ''?>></input>
     68  <a>Record this showing</a><br>
     69                    <input type="radio" class="radio" name="record" value="<?php echo rectype_findone ?>" id="record_once"<?=
     70                    $schedule->type == rectype_findone ? ' CHECKED' : ''?>></input>
     71  <a>Record one showing</a><br>
     72                    <input type="radio" class="radio" name="record" value="<?php echo rectype_daily ?>" id="record_daily"<?=
     73                    $schedule->type == rectype_daily ? ' CHECKED' : ''?>></input>
    6774  <a>Record every day</a> at this time<br>
    68                     <input type="radio" class="radio" name="record" value="weekly" id="record_weekly"<?=
    69                     $this_program->record_weekly ? ' CHECKED' : ''?>></input>
     75                    <input type="radio" class="radio" name="record" value="<?php echo rectype_weekly ?>" id="record_weekly"<?=
     76                    $schedule->type == rectype_weekly ? ' CHECKED' : ''?>></input>
    7077  <a>Record every week</a> at this time<br>
    71                     <input type="radio" class="radio" name="record" value="channel" id="record_channel"<?=
    72                     $this_program->record_channel ? ' CHECKED' : ''?>></input>
     78                    <input type="radio" class="radio" name="record" value="<?php echo rectype_channel ?>" id="record_channel"<?=
     79                    $schedule->type == rectype_channel ? ' CHECKED' : ''?>></input>
    7380  <a>Always record on this channel</a><br>
    74                     <input type="radio" class="radio" name="record" value="always" id="record_always"<?=
    75                     $this_program->record_always ? ' CHECKED' : ''?>></input>
     81                    <input type="radio" class="radio" name="record" value="<?php echo rectype_always ?>" id="record_always"<?=
     82                    $schedule->type == rectype_always ? ' CHECKED' : ''?>></input>
    7683  <a>Always record on any channel</a><br>
    7784                <br>
    7885  Recording Profile<br>
    79   <select name="profile">
    80                     <?php
    81 
    82                         global $Profiles;
    83                         foreach($Profiles as $profile) {
    84                             echo '<option value="'.htmlentities($profile['id']).'"';
    85                             if ($this_program->profile == $profile['id'])
    86                                 echo ' SELECTED';
    87                             echo '>'.htmlentities($profile['name']).'</option>';
    88                         }
    89                         ?></select><br>
    90   Rank<br>
    91   <select name="rank">
    92                     <?php
    93                         for($rankcount=-10;$rankcount<=10;++$rankcount) {
    94                             echo '<option value="'.htmlentities($rankcount).'"';
    95                             if ($this_program->rank == $rankcount)
    96                                 echo ' SELECTED';
    97                             echo '>'.htmlentities($rankcount).'</option>';
    98                         }
    99                         ?></select><br>
    100   <input type="checkbox" class="radio" name="recorddups"<?php if ($this_program->recorddups) echo ' CHECKED' ?>>
    101   Record Dupes?&nbsp;<br>
     86                        <?php profile_select($schedule->profile) ?><br>
     87  Priority<br>
     88                        <select name="recpriority"><?php
     89                    for ($i=99; $i>=-99; --$i) {
     90                        echo "<option value=\"$i\"";
     91                        if ($schedule->recpriority == $i)
     92                            echo ' SELECTED';
     93                        echo ">$i</option>";
     94                    }
     95                    ?></select><br>
    10296  <input type="checkbox" class="radio" name="autoexpire" <?php if ($this_program->autoexpire) echo "CHECKED" ?>>
    10397  Auto-expire?&nbsp;<br>
    10498                    No of recordings to keep?<br><input type="input" name="maxepisodes" size="1" value="<?php echo htmlentities($this_program->maxepisodes) ?>"><br>
     
    117111
    118112}
    119113
    120 ?>
    121  No newline at end of file
     114?>
  • mythweb/themes/wap/scheduled_recordings.php

     
    1414    // Print the main page header
    1515        parent::print_header('MythWeb - Scheduled Recordings');
    1616    // Print the page contents
    17         global $All_Shows;
     17        global $all_shows;
    1818
    1919
    2020/*  <a href="scheduled_recordings.php?sortby=title">show</a><br>
     
    2424*/
    2525
    2626    $row = 0;
    27     foreach ($All_Shows as $show) {
     27    foreach ($all_shows as $show) {
    2828    // Reset the command variable
    2929        $command = '';
    3030    // Which class does this show fall into?
    31         if ($show->duplicate == 1) {
     31        if ($show->recstatus == 'PreviousRecording' || $show->recstatus == 'CurrentRecording') {
    3232            $class = 'duplicate';
    33             $command = '<a href="scheduled_recordings.php?rerecord=yes&title='.urlencode($show->title).'&subtitle='.urlencode($show->subtitle).'&description='.urlencode($show->description).'">Rerecord</a>';
     33            $command = '<a href="scheduled_recordings.php?record=yes&chanid='.$show->chanid.'&starttime='.$show->starttime.'">Re-record</a>';
    3434        }
    35         elseif ($show->conflicting == 1) {
     35        elseif ($show->recstatus == 'Conflict' || $show->recstatus == 'Overlap') {
    3636            $class   = 'conflict';
    37             $command = '<a href="scheduled_recordings.php?record=yes&chanid='.$show->chanid.'&starttime='.$show->starttime.'&endtime='.$show->endtime.'">Record</a>';
     37            $command = '<a href="scheduled_recordings.php?record=yes&chanid='.$show->chanid.'&starttime='.$show->starttime.'">Record</a>';
    3838        }
    39         elseif ($show->recording == 0) {
     39        elseif ($show->recstatus == 'WillRecord') {
     40            $class   = 'scheduled';
     41            $command = '<a href="scheduled_recordings.php?suppress=yes&chanid='.$show->chanid.'&starttime='.$show->starttime.'">Don\'t Record</a>';
     42        }
     43        elseif ($show->recstatus == 'ForceRecord') {
     44            $class   = 'scheduled';
     45            $command = '<a href="scheduled_recordings.php?default=yes&chanid='.$show->chanid.'&starttime='.$show->starttime.'">Remove Record</a>';
     46        }
     47        elseif ($show->recstatus == 'ManualOverride' || $show->recstatus == 'Cancelled') {
    4048            $class   = 'deactivated';
    41             $command = '<a href="scheduled_recordings.php?activate=yes&chanid='.$show->chanid.'&starttime='.$show->starttime.'&endtime='.$show->endtime.'">Activate</a>';
     49            $command = '<a href="scheduled_recordings.php?default=yes&chanid='.$show->chanid.'&starttime='.$show->starttime.'">Remove Block</a>';
    4250        }
     51        elseif ($show->recstatus == 'LaterShowing' || $show->recstatus == 'EarlierShowing' ) {
     52            $class   = 'deactivated';
     53            $command = '<a href="scheduled_recordings.php?record=yes&chanid='.$show->chanid.'&starttime='.$show->starttime.'">Activate</a>';
     54        }
    4355        else {
    4456            $class   = 'scheduled';
    4557            #$command = 'Don\'t&nbsp;Record';
    46             $command = '';
     58            $command = 'Unknown '.$show->recstatus;
    4759        }
    4860
    4961    // Print the content
     
    7789
    7890}
    7991
    80 ?>
    81  No newline at end of file
     92?>
  • mythweb/themes/wap/program_listing.php

     
    2626    Currently Browsing<br><?=date('D m/d/y', $start_time)?><br>
    2727    <?=date('g:i A', $start_time)?><br>
    2828            Jump to<br>
    29             <select name="hour"><?
    30                 for ($h=0;$h<24;$h++) {
    31                     echo "<option value=\"$h\"";
    32                     if ($h == date('H', $start_time))
    33                         echo ' SELECTED';
    34                     echo ">$h:00</option>";
     29            <select name="daytime"><?
     30                $day=getdate($start_time);
     31                $start=$start_time - $day['hours'] * 60 * 60 - $day['minutes'] * 60;
     32                for ($t=0;$t<48;$t++) {
     33                    //echo "<option value=\"".($start + $t * 30 * 60)."\"";
     34                    echo "<option value=\"".date('Hi',$start + $t * 30 * 60)."\"";
     35                    if ($start+$t*30*60 <= $start_time && $start+($t+1)*30*60 > $start_time )
     36                        echo ' SELECTED';
     37                    echo '>'.date('g:i A',$start+$t*30*60).'</option>';
    3538                }
    3639                ?></select><br>
    3740            <select name="date"><?
     
    104107    function print_channel($channel, $start_time, $end_time) {
    105108        ?>
    106109        <a href="channel_detail.php?chanid=<?=$channel->chanid?>&time=<?=$start_time?>">
    107         <?=prefer_channum ? $channel->channum : $channel->callsign?>&nbsp;
    108         <?=prefer_channum ? $channel->callsign : $channel->channum?></a><br>
     110        <?=prefer_channum ? $channel->channum : $chann->callsign?>&nbsp;
     111        <?=prefer_channum ? $channel->callsign : $channel->channum?> </a>
     112        <a href="program_detail.php?chanid=<?=$channel->chanid?>&starttime=<?=$channel->programs[0]->starttime?>"><?=$channel->programs[0]->title?></a><br>
    109113        <?
    110114    }
    111115
     116
    112117}
    113118
    114119?>
  • mythweb/themes/wap/recorded_programs.php

     
    5050        echo nice_length($show->length)." ".nice_filesize($show->filesize)."<br>";
    5151
    5252        if ($show->endtime > time()) { ?>
    53             <font color="#FF0000">currently recording</font><br>
    54 <?php   } else { ?>
    55             <b></b><a id="delete_<?php echo $row?>" href="recorded_programs.php?delete=yes&file=<?php echo urlencode($show->filename)?>">Delete</a></b><br>
    56 <?php   }
     53            <font color="#FF0000">currently recording - </font>
     54<?php   } ?>
     55            <b></b><a id="delete_<?php echo $row?>" href="recorded_programs.php?delete=yes&file=<?php echo urlencode($show->filename)?>">Delete </a></b>
     56            <b></b><a id="delete_<?php echo $row?>" href="recorded_programs.php?delete=yes&file=<?php echo urlencode($show->filename)?>&forget_old">Rerecord</a></b><br>
     57<?php
    5758        echo "<br>";
    5859
    5960        $row++;
     
    6970
    7071}
    7172
    72 ?>
    73  No newline at end of file
     73?>
  • mythweb/themes/wap/theme.php

     
    4040                <a href="program_listing.php">Listings</a><br>
    4141                <a href="scheduled_recordings.php">Scheduled</a><br>
    4242                <a href="recorded_programs.php">Recorded</a><br>
     43                <a href="status.php">Backend Status</a><br>
    4344<?php
    4445    }
    4546
  • mythweb/themes/wap/status.php

     
     1<?php
     2/***                                                                        ***\
     3    status.php                               Last Updated: 2005.02.06 (xris)
     4
     5    This file defines a theme class for the backend status section.
     6    It must define one method.   documentation will be added someday.
     7\***                                                                        ***/
     8
     9class Theme_status extends Theme {
     10
     11    function print_page(&$content, $title) {
     12    // Load this page's custom stylesheet
     13        $this->headers[] = '<link rel="stylesheet" type="text/css" href="'.theme_dir.'status.css" />';
     14    // Print the main page header
     15        parent::print_header($title);
     16    // Print the page contents
     17        echo "<div id=\"content_wrapper\">\n"
     18            .$content
     19            ."\n</div>";
     20    // Print the main page footer
     21        parent::print_footer();
     22    }
     23
     24}
     25
     26?>
  • mythweb/program_listing.php

     
    1717// Were we passed a timestamp?  This is going to be the most common occurrence
    1818    if ($_GET['time'])
    1919        $list_starttime = (int)$_GET['time'];
     20    elseif(isset($_GET['daytime']))
     21        $list_starttime = unixtime(sprintf('%08d%04d00', $_GET['date'], $_GET['daytime']));
    2022// Did we get passed a date (and probably an hour, too)?
    2123    elseif(isset($_GET['date']))
    2224        $list_starttime = unixtime(sprintf('%08d%02d0000', $_GET['date'], $_GET['hour']));
  • mythweb/includes/init.php

     
    107107            define('Theme', 'wml');
    108108        }
    109109    }
     110    elseif (strpos($_SERVER['HTTP_USER_AGENT'],"Blazer") !== false) // The browser is MythPhone
     111        define('Theme', 'wap');
    110112    elseif (strpos($_SERVER['HTTP_USER_AGENT'],"MythPhone") !== false) // The browser is MythPhone
    111113        define('Theme', 'vxml');
    112114// Load the theme from session data?