Index: mythweb/themes/wap/scheduled_recordings.php
===================================================================
--- mythweb/themes/wap/scheduled_recordings.php	(revision 7244)
+++ mythweb/themes/wap/scheduled_recordings.php	(working copy)
@@ -7,7 +7,6 @@
 
 \***                                                                        ***/
 
-#class theme_program_detail extends Theme {
 class Theme_scheduled_recordings extends Theme {
 
     function print_page(&$shows) {
@@ -16,61 +15,178 @@
     // Print the page contents
         global $All_Shows;
 
+    ?>
+    <hr>
+    Sort by:<br>
+    <?= get_sort_link('title',   t('title'))?>
+    <?= get_sort_link('channum', t('channum'))?>
+    <?= get_sort_link('airdate', t('airdate'))?>
+    <?= get_sort_link('length',  t('length'))?>
+    <table>
+    <?php 
 
-/*  <a href="scheduled_recordings.php?sortby=title">show</a><br>
-    <a href="scheduled_recordings.php?sortby=channum">station</a><br>
-    <a href="scheduled_recordings.php?sortby=airdate">air&nbsp;date</a><br>
-    <a href="scheduled_recordings.php?sortby=length">length</a><br>
-*/
-
     $row = 0;
     foreach ($shows as $show) {
-    // Reset the command variable
-        $command = '';
-    // Which class does this show fall into?
-        if ($show->duplicate == 1) {
-            $class = 'duplicate';
-            $command = '<a href="scheduled_recordings.php?rerecord=yes&title='.urlencode($show->title).'&subtitle='.urlencode($show->subtitle).'&description='.urlencode($show->description).'">Rerecord</a>';
+        $row++;
+        // Set the class to be used to display the recording status character
+        $rec_class = implode(' ', array(recstatus_class($show), $show->recstatus));
+        // Reset the command variable to a default URL
+        $commands = array();
+        $urlstr = 'chanid='.$show->chanid.'&starttime='.$show->starttime;
+        // Set the recording status character, class and any applicable commands for each show
+        switch ($show->recstatus) {
+            case 'Recording':
+            case 'WillRecord':
+                $rec_char   = $show->cardid;
+                $class      = 'scheduled';
+                $commands[] = '<a href="scheduled_recordings.php?dontrec=yes&'
+                              .$urlstr.'">'.t('Don\'t Record').'</a>';
+                // Offer to suppress any recordings that have enough info to do so.
+                if (preg_match('/\\S/', $show->title)
+                        && (preg_match('/\\S/', $show->programid.$show->subtitle.$show->description))) {
+                    $commands[] = '<a href="scheduled_recordings.php?'
+                                  .'never_record=yes&'.$urlstr.'">'
+                                  .t('Never Record').'</a>';
+                }
+                break;
+            case 'PreviousRecording':
+                $rec_char   = 'P';
+                $class      = 'duplicate';
+                $commands[] = '<a href="scheduled_recordings.php?record=yes&'
+                              .$urlstr.'">'.t('Record This').'</a>';
+                $commands[] = '<a href="scheduled_recordings.php?'
+                              .'forget_old=yes&'.$urlstr.'">'
+                              .t('Forget Old').'</a>';
+                break;
+            case 'CurrentRecording':
+                $rec_char   = 'R';
+                $class      = 'duplicate';
+                $commands[] = '<a href="scheduled_recordings.php?record=yes&'
+                              .$urlstr.'">'.t('Record This').'</a>';
+                $commands[] = '<a href="scheduled_recordings.php?'
+                              .'forget_old=yes&'.$urlstr.'">'
+                              .t('Forget Old').'</a>';
+                break;
+            case 'Repeat':
+                $rec_char = 'r';
+                $class    = 'duplicate';
+                break;
+            case 'EarlierShowing':
+                $rec_char = 'E';
+                $class    = 'deactivated';
+                $commands[] = '<a href="scheduled_recordings.php?record=yes&'
+                              .$urlstr.'">'.t('Activate').'</a>';
+                $commands[] = '<a href="scheduled_recordings.php?default=yes&'
+                              .$urlstr.'">'.t('Default').'</a>';
+                break;
+            case 'TooManyRecordings':
+                $rec_char = 'T';
+                $class    = 'deactivated';
+                break;
+            case 'Cancelled':
+                $rec_char   = 'N';
+                $class      = 'deactivated';
+                $commands[] = '<a href="scheduled_recordings.php?record=yes&'
+                              .$urlstr.'">'.t('Activate').'</a>';
+                $commands[] = '<a href="scheduled_recordings.php?default=yes&'
+                              .$urlstr.'">'.t('Default').'</a>';
+                break;
+            case 'Conflict':
+                $rec_char = 'C';
+                // We normally use the recstatus value as the name of the class
+                //  used when displaying the recording status character.
+                // However, there is already a class named 'conflict' so we
+                //  need to modify this specific recstatus to avoid a conflict.
+                $rec_class = implode(' ', array(recstatus_class($show),
+                                     'conflicting'));
+                $class      = 'conflict';
+                $commands[] = '<a href="scheduled_recordings.php?record=yes&'
+                              .$urlstr.'">'.t('Record This').'</a>';
+                $commands[] = '<a href="scheduled_recordings.php?dontrec=yes&'
+                              .$urlstr.'">'.t('Don\'t Record').'</a>';
+                break;
+            case 'LaterShowing':
+                $rec_char = 'L';
+                $class    = 'deactivated';
+                $commands[] = '<a href="scheduled_recordings.php?record=yes&'
+                              .$urlstr.'">'.t('Activate').'</a>';
+                $commands[] = '<a href="scheduled_recordings.php?default=yes&'
+                              .$urlstr.'">'.t('Default').'</a>';
+                break;
+            case 'LowDiskSpace':
+                $rec_char   = 'K';
+                $class      = 'deactivated';
+                $commands[] = 'Not Enough Disk Space';
+                break;
+            case 'TunerBusy':
+                $rec_char   = 'B';
+                $class      = 'deactivated';
+                $commands[] = 'Tuner is busy';
+                break;
+            case 'Overlap':
+                $rec_char   = 'X';
+                $class      = 'conflict';
+                $commands[] = '<a href="scheduled_recordings.php?record=yes&'
+                              .$urlstr.'">'.t('Record This').'</a>';
+                $commands[] = '<a href="scheduled_recordings.php?dontrec=yes&'
+                              .$urlstr.'">'.t('Don\'t Record').'</a>';
+                break;
+            case 'ManualOverride':
+                $rec_char   = 'X';
+                $class      = 'deactivated';
+                $commands[] = '<a href="scheduled_recordings.php?record=yes&'
+                              .$urlstr.'">'.t('Activate').'</a>';
+                $commands[] = '<a href="scheduled_recordings.php?default=yes&'
+                              .$urlstr.'">'.t('Default').'</a>';
+                break;
+            case 'ForceRecord':
+                $rec_char   = 'F';
+                $class      = 'scheduled';
+                $commands[] = '<a href="scheduled_recordings.php?dontrec=yes&'
+                              .$urlstr.'">'.t('Don\'t Record').'</a>';
+                $commands[] = '<a href="scheduled_recordings.php?default=yes&'
+                              .$urlstr.'">'.t('Default').'</a>';
+                break;
+            default:
+                $rec_char   = '&nbsp;';
+                $rec_class  = '';
+                $class      = 'deactivated';
+                $commands[] = '<a href="scheduled_recordings.php?record=yes&'
+                              .$urlstr.'">'.t('Activate').'</a>';
+                $commands[] = '<a href="scheduled_recordings.php?dontrec=yes&'
+                              .$urlstr.'">'.t('Don\'t Record').'</a>';
+                break;
         }
-        elseif ($show->conflicting == 1) {
-            $class   = 'conflict';
-            $command = '<a href="scheduled_recordings.php?record=yes&chanid='.$show->chanid.'&starttime='.$show->starttime.'&endtime='.$show->endtime.'">Record</a>';
-        }
-        elseif ($show->recording == 0) {
-            $class   = 'deactivated';
-            $command = '<a href="scheduled_recordings.php?activate=yes&chanid='.$show->chanid.'&starttime='.$show->starttime.'&endtime='.$show->endtime.'">Activate</a>';
-        }
-        else {
-            $class   = 'scheduled';
-            #$command = 'Don\'t&nbsp;Record';
-            $command = '';
-        }
-
-    // Print the content
-//  <tr class="<?=$class>">
-//  <td class="<?=$show->class>">
-
+    ?>
+    <tr class='<?=$class?>'><td><?=$rec_char?></td><td>
+    <?php
         // Print a link to record this show
         echo '<a id="program_'.$program_id_counter.'_anchor" href="program_detail.php?chanid='.$show->chanid.'&starttime='.$show->starttime.'"'
              .'>'.$show->title
              .(preg_match('/\\w/', $show->subtitle) ? ":  $show->subtitle" : '')
-             .'</a><br>';
+             .'</a></td></tr>';
         ?>
-    <?=$show->channel->name?><br>
-    <?=date('D, M j', $show->starttime)?><br>
-    <?=date('(g:i A)', $show->starttime)?> <?=nice_length($show->length)?><br>
-<?  if ($command) { ?>
-    <b><?=$command?></b><br>
-<?  } ?>
-    <br>
-    <?
+    <tr><td></td><td>
+      <?=$show->channel->name?><br>
+      <?=date('D, M j', $show->starttime)?>
+      <?=date('(g:i A)', $show->starttime)?> <?=nice_length($show->length)?></td></tr>
+      <tr><td></td><td>
+    <?php   
+        $first=true;
+        foreach ($commands as $command) { 
+            if ($first) {
+               $first=false;
+            } else {
+               echo ' | ';
+            }
+            echo $command;
+        }
+        $prev_group = $cur_group;
         $row++;
     }
-?>
-
-</table>
-<?
-
+    ?>
+    </table>
+    <?php
     // Print the main page footer
         parent::print_footer();
     }
Index: mythweb/themes/wap/theme.php
===================================================================
--- mythweb/themes/wap/theme.php	(revision 7244)
+++ mythweb/themes/wap/theme.php	(working copy)
@@ -20,6 +20,7 @@
     <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
 
     <Link Rel="stylesheet" HRef="<?=theme_dir?>style.css" Type="text/css" Media="screen">
+    <Link Rel="stylesheet" HRef="<?=theme_dir?>handheld.css" Type="text/css" Media="handheld">
 </head>
 
 <body bgcolor="#003060" text="#DEDEDE" link="#3181B4" alink="#CC0000" vlink="#3181B4">
@@ -37,9 +38,11 @@
 
     function print_menu_content() {
         ?>
-                <a href="program_listing.php">Listings</a><br>
-                <a href="scheduled_recordings.php">Scheduled</a><br>
-                <a href="recorded_programs.php">Recorded</a><br>
+        <span class="menu">
+                <a href="program_listing.php">Listings</a>
+                <a href="scheduled_recordings.php">Scheduled</a>
+                <a href="recorded_programs.php">Recorded</a>
+        </span>
 <?php
     }
 
