Ticket #7032: mythweb_playgroup_select.diff
| File mythweb_playgroup_select.diff, 3.5 KB (added by gnome42, 4 years ago) |
|---|
-
mythplugins/mythweb/modules/tv/classes/Schedule.php
class Schedule { 388 388 /** 389 389 * prints a <select> of the various playback groups available 390 390 /**/ 391 function playgroup_select($this_playgroup, $name = 'playgroup', $id = NULL, $js = NULL){391 function playgroup_select($this_playgroup, $name = 'playgroup', &$schedule = NULL, $id = NULL, $js = NULL) { 392 392 // Make sure we have some data 393 393 static $playgroups = array(); 394 394 if (!count($playgroups)) { 395 395 global $db; 396 $sh = $db->query('SELECT name FROM playgroup ORDER BY name ');396 $sh = $db->query('SELECT name FROM playgroup ORDER BY name = "Default" DESC, name'); 397 397 while (list($group) = $sh->fetch_row()) { 398 398 $playgroups[] = $group; 399 399 } 400 400 $sh->finish(); 401 401 } 402 // Do PlayGroup titlematch 403 if (count($playgroups) > 1 && empty($this_playgroup) && is_object($schedule)) { 404 $this_playgroup =& $schedule->this_playgroup; 405 $sh = $db->query('SELECT DISTINCT name FROM playgroup 406 WHERE name = ? OR name = ? OR (titlematch <> "" AND ? REGEXP titlematch) 407 ORDER BY titlematch DESC', 408 $schedule->title, $schedule->category, $schedule->title); 409 if (list($grp) = $sh->fetch_row()) 410 $this_playgroup = $grp; 411 $sh->finish(); 412 } 413 if (empty($this_playgroup)) 414 $this_playgroup = 'Default'; 402 415 // Print the actual select 403 416 echo "<select name=\"$name\""; 404 417 if ($id) -
mythplugins/mythweb/modules/tv/tmpl/default/_advanced_options.php
57 57 <dt><?php echo t('Storage Group') ?>:</dt> 58 58 <dd><?php storagegroup_select($schedule->storagegroup) ?></dd> 59 59 <dt><?php echo t('Playback Group') ?>:</dt> 60 <dd><?php playgroup_select($schedule->playgroup, 'playgroup' ) ?></dd>60 <dd><?php playgroup_select($schedule->playgroup, 'playgroup', $schedule) ?></dd> 61 61 <dt><?php echo t('Recording Priority') ?>:</dt> 62 62 <dd><select name="recpriority"><?php 63 63 for ($i=99; $i>=-99; --$i) { -
mythplugins/mythweb/modules/tv/tmpl/default/set_playgroup.php
19 19 <table border="0" cellspacing="0" cellpadding="0"> 20 20 <tr class="x-sep"> 21 21 <th><?php echo t('Edit existing group') ?>:</th> 22 <td><?php playgroup_select($group['name'], 'playgroup', NULL, '$(\'chg_grp_form\').submit()') ?>22 <td><?php playgroup_select($group['name'], 'playgroup', NULL, NULL, '$(\'chg_grp_form\').submit()') ?> 23 23 <noscript><input type="submit" class="submit" value="<?php echo t('Edit') ?>"></noscript></td> 24 24 <td><input type="submit" class="submit" name="new_group" value="<?php echo t('New Group') ?>"></td> 25 25 </tr>
