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 = ' '; |
| 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; |