Ticket #327: mythweb.wap.v2.patch

File mythweb.wap.v2.patch, 11.3 KB (added by mythtv.spam@…, 19 years ago)

v2 of the wap patch

  • mythweb/themes/wap/scheduled_recordings.php

     
    77
    88\***                                                                        ***/
    99
    10 #class theme_program_detail extends Theme {
    1110class Theme_scheduled_recordings extends Theme {
    1211
    1312    function print_page(&$shows) {
     
    1615    // Print the page contents
    1716        global $All_Shows;
    1817
     18    ?>
     19    <hr>
     20    Sort by:<br>
     21    <?= get_sort_link('title',   t('title'))?>
     22    <?= get_sort_link('channum', t('channum'))?>
     23    <?= get_sort_link('airdate', t('airdate'))?>
     24    <?= get_sort_link('length',  t('length'))?>
     25    <table>
     26    <?php
    1927
    20 /*  <a href="scheduled_recordings.php?sortby=title">show</a><br>
    21     <a href="scheduled_recordings.php?sortby=channum">station</a><br>
    22     <a href="scheduled_recordings.php?sortby=airdate">air&nbsp;date</a><br>
    23     <a href="scheduled_recordings.php?sortby=length">length</a><br>
    24 */
    25 
    2628    $row = 0;
    2729    foreach ($shows as $show) {
    28     // Reset the command variable
    29         $command = '';
    30     // Which class does this show fall into?
    31         if ($show->duplicate == 1) {
    32             $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>';
     30        $row++;
     31        // Set the class to be used to display the recording status character
     32        $rec_class = implode(' ', array(recstatus_class($show), $show->recstatus));
     33        // Reset the command variable to a default URL
     34        $commands = array();
     35        $urlstr = 'chanid='.$show->chanid.'&starttime='.$show->starttime;
     36        // Set the recording status character, class and any applicable commands for each show
     37        switch ($show->recstatus) {
     38            case 'Recording':
     39            case 'WillRecord':
     40                $rec_char   = $show->cardid;
     41                $class      = 'scheduled';
     42                $commands[] = '<a href="scheduled_recordings.php?dontrec=yes&'
     43                              .$urlstr.'">'.t('Don\'t Record').'</a>';
     44                // Offer to suppress any recordings that have enough info to do so.
     45                if (preg_match('/\\S/', $show->title)
     46                        && (preg_match('/\\S/', $show->programid.$show->subtitle.$show->description))) {
     47                    $commands[] = '<a href="scheduled_recordings.php?'
     48                                  .'never_record=yes&'.$urlstr.'">'
     49                                  .t('Never Record').'</a>';
     50                }
     51                break;
     52            case 'PreviousRecording':
     53                $rec_char   = 'P';
     54                $class      = 'duplicate';
     55                $commands[] = '<a href="scheduled_recordings.php?record=yes&'
     56                              .$urlstr.'">'.t('Record This').'</a>';
     57                $commands[] = '<a href="scheduled_recordings.php?'
     58                              .'forget_old=yes&'.$urlstr.'">'
     59                              .t('Forget Old').'</a>';
     60                break;
     61            case 'CurrentRecording':
     62                $rec_char   = 'R';
     63                $class      = 'duplicate';
     64                $commands[] = '<a href="scheduled_recordings.php?record=yes&'
     65                              .$urlstr.'">'.t('Record This').'</a>';
     66                $commands[] = '<a href="scheduled_recordings.php?'
     67                              .'forget_old=yes&'.$urlstr.'">'
     68                              .t('Forget Old').'</a>';
     69                break;
     70            case 'Repeat':
     71                $rec_char = 'r';
     72                $class    = 'duplicate';
     73                break;
     74            case 'EarlierShowing':
     75                $rec_char = 'E';
     76                $class    = 'deactivated';
     77                $commands[] = '<a href="scheduled_recordings.php?record=yes&'
     78                              .$urlstr.'">'.t('Activate').'</a>';
     79                $commands[] = '<a href="scheduled_recordings.php?default=yes&'
     80                              .$urlstr.'">'.t('Default').'</a>';
     81                break;
     82            case 'TooManyRecordings':
     83                $rec_char = 'T';
     84                $class    = 'deactivated';
     85                break;
     86            case 'Cancelled':
     87                $rec_char   = 'N';
     88                $class      = 'deactivated';
     89                $commands[] = '<a href="scheduled_recordings.php?record=yes&'
     90                              .$urlstr.'">'.t('Activate').'</a>';
     91                $commands[] = '<a href="scheduled_recordings.php?default=yes&'
     92                              .$urlstr.'">'.t('Default').'</a>';
     93                break;
     94            case 'Conflict':
     95                $rec_char = 'C';
     96                // We normally use the recstatus value as the name of the class
     97                //  used when displaying the recording status character.
     98                // However, there is already a class named 'conflict' so we
     99                //  need to modify this specific recstatus to avoid a conflict.
     100                $rec_class = implode(' ', array(recstatus_class($show),
     101                                     'conflicting'));
     102                $class      = 'conflict';
     103                $commands[] = '<a href="scheduled_recordings.php?record=yes&'
     104                              .$urlstr.'">'.t('Record This').'</a>';
     105                $commands[] = '<a href="scheduled_recordings.php?dontrec=yes&'
     106                              .$urlstr.'">'.t('Don\'t Record').'</a>';
     107                break;
     108            case 'LaterShowing':
     109                $rec_char = 'L';
     110                $class    = 'deactivated';
     111                $commands[] = '<a href="scheduled_recordings.php?record=yes&'
     112                              .$urlstr.'">'.t('Activate').'</a>';
     113                $commands[] = '<a href="scheduled_recordings.php?default=yes&'
     114                              .$urlstr.'">'.t('Default').'</a>';
     115                break;
     116            case 'LowDiskSpace':
     117                $rec_char   = 'K';
     118                $class      = 'deactivated';
     119                $commands[] = 'Not Enough Disk Space';
     120                break;
     121            case 'TunerBusy':
     122                $rec_char   = 'B';
     123                $class      = 'deactivated';
     124                $commands[] = 'Tuner is busy';
     125                break;
     126            case 'Overlap':
     127                $rec_char   = 'X';
     128                $class      = 'conflict';
     129                $commands[] = '<a href="scheduled_recordings.php?record=yes&'
     130                              .$urlstr.'">'.t('Record This').'</a>';
     131                $commands[] = '<a href="scheduled_recordings.php?dontrec=yes&'
     132                              .$urlstr.'">'.t('Don\'t Record').'</a>';
     133                break;
     134            case 'ManualOverride':
     135                $rec_char   = 'X';
     136                $class      = 'deactivated';
     137                $commands[] = '<a href="scheduled_recordings.php?record=yes&'
     138                              .$urlstr.'">'.t('Activate').'</a>';
     139                $commands[] = '<a href="scheduled_recordings.php?default=yes&'
     140                              .$urlstr.'">'.t('Default').'</a>';
     141                break;
     142            case 'ForceRecord':
     143                $rec_char   = 'F';
     144                $class      = 'scheduled';
     145                $commands[] = '<a href="scheduled_recordings.php?dontrec=yes&'
     146                              .$urlstr.'">'.t('Don\'t Record').'</a>';
     147                $commands[] = '<a href="scheduled_recordings.php?default=yes&'
     148                              .$urlstr.'">'.t('Default').'</a>';
     149                break;
     150            default:
     151                $rec_char   = '&nbsp;';
     152                $rec_class  = '';
     153                $class      = 'deactivated';
     154                $commands[] = '<a href="scheduled_recordings.php?record=yes&'
     155                              .$urlstr.'">'.t('Activate').'</a>';
     156                $commands[] = '<a href="scheduled_recordings.php?dontrec=yes&'
     157                              .$urlstr.'">'.t('Don\'t Record').'</a>';
     158                break;
    34159        }
    35         elseif ($show->conflicting == 1) {
    36             $class   = 'conflict';
    37             $command = '<a href="scheduled_recordings.php?record=yes&chanid='.$show->chanid.'&starttime='.$show->starttime.'&endtime='.$show->endtime.'">Record</a>';
    38         }
    39         elseif ($show->recording == 0) {
    40             $class   = 'deactivated';
    41             $command = '<a href="scheduled_recordings.php?activate=yes&chanid='.$show->chanid.'&starttime='.$show->starttime.'&endtime='.$show->endtime.'">Activate</a>';
    42         }
    43         else {
    44             $class   = 'scheduled';
    45             #$command = 'Don\'t&nbsp;Record';
    46             $command = '';
    47         }
    48 
    49     // Print the content
    50 //  <tr class="<?=$class>">
    51 //  <td class="<?=$show->class>">
    52 
     160    ?>
     161    <tr class='<?=$class?>'><td><?=$rec_char?></td><td>
     162    <?php
    53163        // Print a link to record this show
    54164        echo '<a id="program_'.$program_id_counter.'_anchor" href="program_detail.php?chanid='.$show->chanid.'&starttime='.$show->starttime.'"'
    55165             .'>'.$show->title
    56166             .(preg_match('/\\w/', $show->subtitle) ? ":  $show->subtitle" : '')
    57              .'</a><br>';
     167             .'</a></td></tr>';
    58168        ?>
    59     <?=$show->channel->name?><br>
    60     <?=date('D, M j', $show->starttime)?><br>
    61     <?=date('(g:i A)', $show->starttime)?> <?=nice_length($show->length)?><br>
    62 <?  if ($command) { ?>
    63     <b><?=$command?></b><br>
    64 <?  } ?>
    65     <br>
    66     <?
     169    <tr><td></td><td>
     170      <?=$show->channel->name?><br>
     171      <?=date('D, M j', $show->starttime)?>
     172      <?=date('(g:i A)', $show->starttime)?> <?=nice_length($show->length)?></td></tr>
     173      <tr><td></td><td>
     174    <?php   
     175        $first=true;
     176        foreach ($commands as $command) {
     177            if ($first) {
     178               $first=false;
     179            } else {
     180               echo ' | ';
     181            }
     182            echo $command;
     183        }
     184        $prev_group = $cur_group;
    67185        $row++;
    68186    }
    69 ?>
    70 
    71 </table>
    72 <?
    73 
     187    ?>
     188    </table>
     189    <?php
    74190    // Print the main page footer
    75191        parent::print_footer();
    76192    }
  • mythweb/themes/wap/theme.php

     
    2020    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
    2121
    2222    <Link Rel="stylesheet" HRef="<?=theme_dir?>style.css" Type="text/css" Media="screen">
     23    <Link Rel="stylesheet" HRef="<?=theme_dir?>handheld.css" Type="text/css" Media="handheld">
    2324</head>
    2425
    2526<body bgcolor="#003060" text="#DEDEDE" link="#3181B4" alink="#CC0000" vlink="#3181B4">
     
    3738
    3839    function print_menu_content() {
    3940        ?>
    40                 <a href="program_listing.php">Listings</a><br>
    41                 <a href="scheduled_recordings.php">Scheduled</a><br>
    42                 <a href="recorded_programs.php">Recorded</a><br>
     41        <span class="menu">
     42                <a href="program_listing.php">Listings</a>
     43                <a href="scheduled_recordings.php">Scheduled</a>
     44                <a href="recorded_programs.php">Recorded</a>
     45        </span>
    4346<?php
    4447    }
    4548