/** * Returns a classname for a Program or a Schedule, based on its recording * settings. /**/ function category_class(&$item) { $css_class = array(); $cache = array(); // Disable categories colorization if (isset($_SESSION['genre_colors']) && $_SESSION['genre_colors'] == 0) { $css_class[] = $cache[$category] = 'cat_Unknown'; return $css_class[0]; } // Recording classes? $css_class[] = recstatus_class($item); // Category type? if ($item->category_type && !preg_match('/unknown/i', $item->category_type)) { $css_class[] = 'type_' . preg_replace("/[^a-zA-Z0-9\\-_]+/", '_', $item->category_type); } // Category cache $category = strtolower($item->category); // user lowercase to avoid a little overhead later static $cache = array(); if ($cache[$category]) { $css_class[] = $cache[$category]; } else { global $Categories; if (!empty($Categories)) { foreach ($Categories as $cat => $details) { if ($category == strtolower($details[0])) { $css_class[] = $cache[$category] = 'cat_' . $cat; break; } if (!$details[1]) { continue; } if (preg_match('/' . $details[1] . '/', $category)) { $css_class[] = $cache[$category] = 'cat_' . $cat; break; } } } } // No category found? if (!$cache[$category]) { $css_class[] = $cache[$category] = 'cat_Unknown'; } // Return return preg_replace('/ +/', ' ', implode(' ', $css_class)); }
$commands[] = 'activate'; $commands[] = 'default'; break; case 'DontRecord': $rec_char = t('Don\'t Record'); $css_class = 'deactivated'; $commands[] = 'activate'; $commands[] = 'default'; break; case 'Conflict': $rec_char = t('Conflict'); // 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')); $css_class = 'conflict'; $commands[] = 'record'; $commands[] = 'never_record'; break; case 'LaterShowing': $rec_char = t('Later'); $css_class = 'deactivated'; $commands[] = 'activate'; $commands[] = 'default'; break; case 'LowDiskSpace': $rec_char = t('Low Space'); $css_class = 'deactivated'; $commands[] = 'Not Enough Disk Space'; break;
?> </dd> <?php } ?> </dl> </div> <?php } if (count($conflicting_shows)) { echo " <div id=\"conflicting_shows\" class=\"clearfix\">\n ", t('Possible conflicts with this show'), ":\n <table>\n "; // A program id counter for popup info $program_id_counter = 0; foreach ($conflicting_shows as $show) { // Set the class to be used to display the recording status character $rec_class = implode(' ', array(recstatus_class($show), $show->recstatus)); // Set the recording status character, class and any applicable commands for each show switch ($show->recstatus) { case 'Recording': case 'WillRecord': case 'ForceRecord': $css_class = 'scheduled'; break; case 'PreviousRecording': case 'CurrentRecording': case 'Repeat': case 'Recorded': $css_class = 'duplicate'; break; case 'Conflict': case 'Overlap':