Ticket #53: wap.theme.patch

File wap.theme.patch, 11.7 KB (added by mythtv-dev.spam@…, 15 years ago)

fixups for the mythweb WAP theme.

  • 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(&$program, &$schedule, &$channel) {
    1514    // Print the main page header
    16         parent::print_header("MythWeb - Program Detail:  $this_program->title");
     15        parent::print_header("MythWeb - Program Detail:  $program->title");
    1716    // Print the page contents
    1817?>
    1918<a href="channel_detail.php?chanid=<?=$this_channel->chanid?>" >
    2019<?=prefer_channum ? $this_channel->channum : $this_channel->callsign?> &nbsp;
    2120<?=prefer_channum ? $this_channel->callsign : $this_channel->channum?></a><br>
    2221
    23 <?=$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>
     22<?=$program->title?><BR>
     23<?=date('D m/d/y', $program->starttime)?><br>
     24<?=date('g:i A', $program->starttime)?> to <?=date('g:i A', $program->endtime)?> (<?=(int)($program->length/60)?> minutes)<BR>
    2625                <?
    27                 if ($this_program->previouslyshown)
     26                if ($program->previouslyshown)
    2827                    echo '(Rerun) ';
    29 //              if ($this_program->category_type == 'movie')
    30 //                  echo " (<a href=\"http://www.imdb.com/Find?select=Titles&for=" . urlencode($this_program->title) . "\">Search IMDB</a>)";
     28//              if ($program->category_type == 'movie')
     29//                  echo " (<a href=\"http://www.imdb.com/Find?select=Titles&for=" . urlencode($program->title) . "\">Search IMDB</a>)";
    3130//              else
    32 //                  echo " (<a href=\"http://www.google.com/search?q=" . urlencode($this_program->title) . "\">Search Google</a>)";
     31//                  echo " (<a href=\"http://www.google.com/search?q=" . urlencode($program->title) . "\">Search Google</a>)";
    3332                ?>
    34         <? if (strlen($this_program->subtitle)) { ?>
    35             Episode: <b><?=$this_program->subtitle?></b><br>
     33        <? if (strlen($program->subtitle)) { ?>
     34            Episode: <b><?=$program->subtitle?></b><br>
    3635        <? }
    37            if (strlen($this_program->description)) {?>
    38                 Description: <?=$this_program->description?><br>
     36           if (strlen($program->description)) {?>
     37                Description: <?=$program->description?><br>
    3938        <? } ?>
    40         <? if (strlen($this_program->category)) {?>
    41                 Category: <?=$this_program->category?><br>
     39        <? if (strlen($program->category)) {?>
     40                Category: <?=$program->category?><br>
    4241        <? }
    43            if (strlen($this_program->airdate)) {?>
    44                 Orig. Airdate: <?=$this_program->airdate?><br>
     42           if (strlen($program->airdate)) {?>
     43                Orig. Airdate: <?=$program->airdate?><br>
    4544        <? }
    46            if (strlen($this_program->rating)) {?>
    47                 <?=strlen($this_program->rater) > 0 ? "$this_program->rater " : ''?>Rating: <?=$this_program->rating?><br>
     45           if (strlen($program->rating)) {?>
     46                <?=strlen($program->rater) > 0 ? "$program->rater " : ''?>Rating: <?=$program->rating?><br>
    4847        <?
    49            if (strlen($this_program->starstring) > 0)
    50                     echo ", $this_program->starstring";
     48           if (strlen($program->starstring) > 0)
     49                    echo ", $program->starstring";
    5150                ?><br>
    5251        <? } ?>
    5352
    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']?>">
    57 <br>
    58         <center>Recording Options:</center>
    59                     <input type="radio" class="radio" name="record" value="never" id="record_never"<?=
    60                     $this_program->will_record ? '' : ' CHECKED'?>></input>
    61   <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>
    67   <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>
    70   <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>
    73   <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>
    76   <a>Always record on any channel</a><br>
     53        <form name="program_detail" method="post" action="program_detail.php?<?php
     54            if ($_GET['recordid'])
     55                echo 'recordid='.urlencode($_GET['recordid']);
     56            else
     57                echo 'chanid='.urlencode($_GET['chanid']).'&starttime='.urlencode($_GET['starttime'])
     58            ?>">
     59        <center>Schedule Options:</center>
     60                    <input type="radio" class="radio" name="record" value="record_never" id="record_never"<?=
     61                    $schedule->recordid ? '' : ' CHECKED'?>></input>
     62  <a><?php
     63    if ($schedule->recordid)
     64       echo 'Cancel';
     65    else
     66       echo 'Don\'t record';
     67      ?>
     68  </a><br>
     69    <input type="radio" class="radio" name="record" value="<? echo rectype_once?>" id="record_once"<?=
     70        $schedule->type == rectype_once ? ' CHECKED' : ''?>></input>
     71        <a>Record showing</a><br>
     72    <input type="radio" class="radio" name="record" value="<?echo rectype_daily ?>" id="record_daily"<?=
     73        $schedule->type == rectype_daily ? ' CHECKED' : ''?>></input>
     74        <a>Record every day</a> at this time<br>
     75    <input type="radio" class="radio" name="record" value="<? echo rectype_weekly?>" id="record_weekly"<?=
     76        $schedule->type == rectype_weekly ? ' CHECKED' : ''?>></input>
     77        <a>Record every week</a> at this time<br>
     78    <input type="radio" class="radio" name="record" value="<? echo rectype_findone ?>" id="record_findone"<?=
     79        $schedule->type == rectype_findone ? ' CHECKED' : ''?>></input>
     80        <a>Find one episode</a><br>
     81    <input type="radio" class="radio" name="record" value="<? echo rectype_finddaily ?>" id="record_finddaily"<?=
     82        $schedule->type == rectype_finddaily ? ' CHECKED' : ''?>></input>
     83        <a>Find one episode every day</a><br>
     84    <input type="radio" class="radio" name="record" value="<? echo rectype_findweekly ?>" id="record_findweekly"<?=
     85        $schedule->type == rectype_finddaily ? ' CHECKED' : ''?>></input>
     86        <a>Find one episode every week</a><br>
     87    <input type="radio" class="radio" name="record" value="<? echo rectype_channel?>" id="record_channel"<?=
     88        $schedule->type == rectype_channel ? ' CHECKED' : ''?>></input>
     89        <a>Always record on this channel</a><br>
     90    <input type="radio" class="radio" name="record" value="<? echo retype_always ?>" id="record_always"<?=
     91        $schedule->type == rectype_always ? ' CHECKED' : ''?>></input>
     92        <a>Always record on any channel</a><br>
    7793                <br>
    7894  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>
    102   <input type="checkbox" class="radio" name="autoexpire" <?php if ($this_program->autoexpire) echo "CHECKED" ?>>
    103   Auto-expire?&nbsp;<br>
    104                     No of recordings to keep?<br><input type="input" name="maxepisodes" size="1" value="<?php echo htmlentities($this_program->maxepisodes) ?>"><br>
    105   <input type="checkbox" class="radio" name="maxnewest" <?php if ($this_program->maxnewest) echo "CHECKED" ?>>
    106   Record new and expire old?&nbsp;<br>
    107 
     95  <?php profile_select($schedule->profile) ?>
     96                        <br>
     97  <input type="checkbox" class="radio" name="autocommflag"<?php if ($schedule->autocommflag) echo ' CHECKED' ?> value="1" />
     98       <a><? echo t('Auto-flag commercials') ?></a><br/>
     99  <input type="checkbox" class="radio" name="autoexpire"<?php if ($schedule->autoexpire) echo ' CHECKED' ?> value="1" />
     100       <a><? echo t('Auto-expire recordings') ?></a><br/>
     101  <input type="checkbox" class="radio" name="maxnewest"<?php if ($schedule->maxnewest) echo ' CHECKED' ?> value="1" />
     102       <a><? echo t('Record new and expire old') ?></a><br/>
     103  <input type="checkbox" class="radio" name="inactive"<?php if ($schedule->inactive) echo ' CHECKED' ?> value="1" />
     104       <a><? echo t('Inactive') ?></a><br/>
     105  <?php echo t('No. of recordings to keep') ?>:
     106  <input type="input" class="quantity" name="maxepisodes" value="<?php echo htmlentities($schedule->maxepisodes) ?>" size="2"/><br/>
     107  <?php echo t('Start Early') ?>:
     108  <input type="input" class="quantity" name="startoffset" value="<?php echo htmlentities($schedule->startoffset) ?>" size="2"/>
     109       <?php echo t('minutes') ?><br/>
     110  <?php echo t('End Late') ?>:
     111  <input type="input" class="quantity" name="endoffset" value="<?php echo htmlentities($schedule->endoffset) ?>" size="2"/>
     112  <?php echo t('minutes') ?><br/>
    108113                    <center><input type="submit" class="submit" name="save" value="Update Settings"></center>
    109114                <br>
    110115
     
    117122
    118123}
    119124
    120 ?>
    121  No newline at end of file
     125?>
  • mythweb/themes/wap/scheduled_recordings.php

     
    1010#class theme_program_detail extends Theme {
    1111class Theme_scheduled_recordings extends Theme {
    1212
    13     function print_page() {
     13    function print_page(&$shows) {
    1414    // Print the main page header
    1515        parent::print_header('MythWeb - Scheduled Recordings');
    1616    // Print the page contents
     
    2424*/
    2525
    2626    $row = 0;
    27     foreach ($All_Shows as $show) {
     27    foreach ($shows as $show) {
    2828    // Reset the command variable
    2929        $command = '';
    3030    // Which class does this show fall into?
     
    7777
    7878}
    7979
    80 ?>
    81  No newline at end of file
     80?>