PageRenderTime 26ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/modules/tv/tmpl/lite/schedules_custom.php

https://github.com/freedenizen/mythweb
PHP | 240 lines | 196 code | 27 blank | 17 comment | 62 complexity | aeb1405de9405c4adba1d9ff9c7f995d MD5 | raw file
  1. <?php
  2. /**
  3. * Schedule a custom recording by manually specifying various search options
  4. *
  5. * @license GPL
  6. *
  7. * @package MythWeb
  8. * @subpackage TV
  9. *
  10. /**/
  11. // Set the desired page title
  12. $page_title = 'MythWeb - '.t('Custom Schedule');
  13. // Custom headers
  14. $headers[] = '<link rel="stylesheet" type="text/css" href="'.skin_url.'/tv_schedules_custom.css" />';
  15. // Print the page header
  16. require 'modules/_shared/tmpl/'.tmpl.'/header.php';
  17. // Print the page contents
  18. ?>
  19. <script language="JavaScript" type="text/javascript">
  20. <!--
  21. // Swaps visibility of the standard/power options lists
  22. function toggle_options() {
  23. if ($('searchtype_power').checked) {
  24. $('standard_options').hide();
  25. $('power_options').show();
  26. }
  27. else {
  28. $('power_options').hide();
  29. $('standard_options').show();
  30. }
  31. // Get the search type
  32. if ($('searchtype_title').checked)
  33. $('search_type').innerHTML = '<?php echo str_replace("'", "\\'", t('$1 Search', t('Title'))) ?>';
  34. else if ($('searchtype_keyword').checked)
  35. $('search_type').innerHTML = '<?php echo str_replace("'", "\\'", t('$1 Search', t('Keyword'))) ?>';
  36. else if ($('searchtype_people').checked)
  37. $('search_type').innerHTML = '<?php echo str_replace("'", "\\'", t('$1 Search', t('People'))) ?>';
  38. else if ($('searchtype_power').checked)
  39. $('search_type').innerHTML = '<?php echo str_replace("'", "\\'", t('$1 Search', t('Power'))) ?>';
  40. }
  41. // -->
  42. </script>
  43. <div id="recording_info" class="command command_border_l command_border_t command_border_b command_border_r clearfix">
  44. <form name="custom_schedule" method="post" action="<?php echo root_url ?>tv/schedules/custom<?php if ($schedule->recordid) echo '/'.urlencode($schedule->recordid) ?>">
  45. <div id="schedule_options">
  46. <h3><?php echo t('Schedule Options') ?>:</h3>
  47. <ul>
  48. <?php if ($schedule->recordid) { ?>
  49. <li><input type="radio" class="radio" name="record" value="0" id="record_never" />
  50. <label for="record_never"><?php echo t('Cancel this schedule.') ?></label></li>
  51. <?php } ?>
  52. <li><input type="radio" class="radio" name="record" value="<?php echo rectype_always ?>" id="record_always"<?php
  53. if ($schedule->type == rectype_always) echo ' CHECKED' ?> />
  54. <label for="record_always"><?php echo t('rectype-long: always') ?></label></li>
  55. <li><input type="radio" class="radio" name="record" value="<?php echo rectype_finddaily ?>" id="rectype_finddaily"<?php
  56. if ($schedule->type == rectype_finddaily) echo ' CHECKED' ?> />
  57. <label for="rectype_finddaily"><?php echo t('rectype-long: finddaily') ?></label></li>
  58. <li><input type="radio" class="radio" name="record" value="<?php echo rectype_findweekly ?>" id="rectype_findweekly"<?php
  59. if($schedule->type == rectype_findweekly) echo ' CHECKED' ?> />
  60. <label for="rectype_findweekly"><?php echo t('rectype-long: findweekly') ?></label></li>
  61. <li><input type="radio" class="radio" name="record" value="<?php echo rectype_findone ?>" id="rectype_findone"<?php
  62. if ($schedule->type == rectype_findone) echo ' CHECKED' ?> />
  63. <label for="rectype_findone"><?php echo t('rectype-long: findone') ?></label></li>
  64. </ul>
  65. </div>
  66. <div id="searchtype_options">
  67. <h3><?php echo t('Search Type') ?>:</h3>
  68. <ul>
  69. <li><input type="radio" class="radio" name="searchtype" value="<?php echo searchtype_title ?>" id="searchtype_title"<?php
  70. if (empty($schedule->search) || $schedule->search == searchtype_title) echo ' CHECKED'
  71. ?> onclick="toggle_options()" />
  72. <label for="searchtype_title"><?php echo t('Title Search') ?></label></li>
  73. <li><input type="radio" class="radio" name="searchtype" value="<?php echo searchtype_keyword ?>" id="searchtype_keyword"<?php
  74. if ($schedule->search == searchtype_keyword) echo ' CHECKED'
  75. ?> onclick="toggle_options()" />
  76. <label for="searchtype_keyword"><?php echo t('Keyword Search') ?></label></li>
  77. <li><input type="radio" class="radio" name="searchtype" value="<?php echo searchtype_people ?>" id="searchtype_people"<?php
  78. if ($schedule->search == searchtype_people) echo ' CHECKED'
  79. ?> onclick="toggle_options()" />
  80. <label for="searchtype_people"><?php echo t('People Search') ?></label></li>
  81. <li><input type="radio" class="radio" name="searchtype" value="<?php echo searchtype_power ?>" id="searchtype_power"<?php
  82. if ($schedule->search == searchtype_power) echo ' CHECKED'
  83. ?> onclick="toggle_options()" />
  84. <label for="searchtype_power"><?php echo t('Power Search') ?></label></li>
  85. </ul>
  86. </div>
  87. <div id="recording_options">
  88. <h3><?php echo t('Recording Options') ?>:</h3>
  89. <dl id="title_options">
  90. <dt><?php echo t('Title') ?>:&nbsp;</dt>
  91. <dd><input type="text" name="title" value="<?php echo html_entities($schedule->edit_title) ?>" size="24">
  92. (<span id="search_type"><?php echo t('$1 Search', $schedule->search_type) ?></span>)</dd>
  93. </dl>
  94. <dl id="standard_options"<?php if ($schedule->search == searchtype_power) echo ' class="hidden"' ?>>
  95. <dt><?php echo t('Search Phrase') ?>:&nbsp;</dt>
  96. <dd><input type="text" name="search_phrase" value="<?php echo html_entities($schedule->description) ?>" size="30"></dd>
  97. </dl>
  98. <dl id="power_options"<?php if ($schedule->search != searchtype_power) echo ' class="hidden"' ?>>
  99. <dt><?php echo t('Additional Tables') ?>:&nbsp;</dt>
  100. <dd><input type="text" name="additional_tables" value="<?php echo html_entities($schedule->subtitle) ?>" size="30"></dd>
  101. <dt><?php echo t('Search Phrase') ?>:&nbsp;</dt>
  102. <dd><textarea name="search_sql" rows="10" cols="48"><?php echo html_entities($schedule->description) ?></textarea>
  103. <?php /** @todo would be cool to have sample stuff just like the frontend does */ ?>
  104. </dd>
  105. </dl>
  106. </div>
  107. <div id="find_date_options">
  108. <h3><?php echo t('Find Date & Time Options') ?>:</h3>
  109. <dl class="clearfix">
  110. <dt><?php echo t('Find Day') ?>:</dt>
  111. <dd><?php day_select($schedule->findday) ?></dd>
  112. <dt><?php echo t('Find Time') ?>:</dt>
  113. <dd><input type="text" name="findtime" value="<?php echo html_entities($schedule->findtime) ?>" /></dd>
  114. </dl>
  115. </div>
  116. <div id="advanced_options">
  117. <h3><?php echo t('Advanced Options') ?>:</h3>
  118. <dl class="clearfix">
  119. <dt><?php echo t('Recording Profile') ?>:</dt>
  120. <dd><?php profile_select($schedule->profile) ?></dd>
  121. <dt><?php echo t('Transcoder') ?>:</dt>
  122. <dd><?php transcoder_select($schedule->transcoder) ?></dd>
  123. <dt><?php echo t('Recording Group') ?>:</dt>
  124. <dd><?php recgroup_select($schedule->recgroup) ?></dd>
  125. <dt><?php echo t('Storage Group') ?>:</dt>
  126. <dd><?php storagegroup_select($schedule->storagegroup) ?></dd>
  127. <dt><?php echo t('Recording Priority') ?>:</dt>
  128. <dd><select name="recpriority"><?php
  129. for ($i=99; $i>=-99; --$i) {
  130. echo "<option value=\"$i\"";
  131. if ($schedule->recpriority == $i)
  132. echo ' SELECTED';
  133. echo ">$i</option>";
  134. }
  135. ?></select></dd>
  136. <dt><?php echo t('Check for duplicates in') ?>:</dt>
  137. <dd><select name="dupin"><?php
  138. echo '<option value="1"';
  139. if ($schedule->dupin == 1)
  140. echo ' SELECTED';
  141. echo '>' . t('Current recordings') . '</option>';
  142. echo '<option value="2"';
  143. if ($schedule->dupin == 2)
  144. echo ' SELECTED';
  145. echo '>' . t('Previous recordings') . '</option>';
  146. echo '<option value="4"';
  147. if ($schedule->dupin == 4)
  148. echo ' SELECTED';
  149. echo '>' . t('Only New Episodes') . '</option>';
  150. echo '<option value="15"';
  151. if ($schedule->dupin == 15 || $schedule->dupin == 0)
  152. echo ' SELECTED';
  153. echo '>' . t('All recordings') . '</option>';
  154. ?></select></dd>
  155. <dt><?php echo t('Duplicate Check method') ?>:</dt>
  156. <dd><select name="dupmethod"><?php
  157. echo '<option value="1"';
  158. if ($schedule->dupmethod == 1)
  159. echo ' SELECTED';
  160. echo '>' . t('None') . '</option>';
  161. echo '<option value="2"';
  162. if ($schedule->dupmethod == 2)
  163. echo ' SELECTED';
  164. echo '>' . t('Subtitle') . '</option>';
  165. echo '<option value="4"';
  166. if ($schedule->dupmethod == 4)
  167. echo ' SELECTED';
  168. echo '>' . t('Description') . '</option>';
  169. echo '<option value="6"';
  170. if ($schedule->dupmethod == 6 || $schedule->dupmethod == 0)
  171. echo ' SELECTED';
  172. echo '>'.t('Subtitle and Description').'</option>';
  173. echo '<option value="8"';
  174. if ($schedule->dupmethod == 8)
  175. echo ' SELECTED';
  176. echo '>'.t('Subtitle then Description').'</option>';
  177. ?></select></dd>
  178. <dt><?php echo t('Auto-flag commercials') ?>:</dt>
  179. <dd><input type="checkbox" class="radio" name="autocommflag"<?php if ($schedule->autocommflag) echo ' CHECKED' ?> value="1" /></dd>
  180. <dt><?php echo t('Auto-transcode') ?>:</dt>
  181. <dd><input type="checkbox" class="radio" name="autotranscode"<?php if ($schedule->autotranscode) echo ' CHECKED' ?> value="1" /></dd>
  182. <dt><?php echo get_backend_setting('UserJobDesc1') ?>:</dt>
  183. <dd><input type="checkbox" class="radio" name="autouserjob1"<?php if ($schedule->autouserjob1) echo ' CHECKED' ?> value="1" /></dd>
  184. <dt><?php echo get_backend_setting('UserJobDesc2') ?>:</dt>
  185. <dd><input type="checkbox" class="radio" name="autouserjob2"<?php if ($schedule->autouserjob2) echo ' CHECKED' ?> value="1" /></dd>
  186. <dt><?php echo get_backend_setting('UserJobDesc3') ?>:</dt>
  187. <dd><input type="checkbox" class="radio" name="autouserjob3"<?php if ($schedule->autouserjob3) echo ' CHECKED' ?> value="1" /></dd>
  188. <dt><?php echo get_backend_setting('UserJobDesc4') ?>:</dt>
  189. <dd><input type="checkbox" class="radio" name="autouserjob4"<?php if ($schedule->autouserjob4) echo ' CHECKED' ?> value="1" /></dd>
  190. <dt><?php echo t('Inactive') ?>:</dt>
  191. <dd><input type="checkbox" class="radio" name="inactive"<?php if ($schedule->inactive) echo ' CHECKED' ?> value="1" /></dd>
  192. <dt><?php echo t('Auto-expire recordings') ?>:</dt>
  193. <dd><input type="checkbox" class="radio" name="autoexpire"<?php if ($schedule->autoexpire) echo ' CHECKED' ?> value="1" /></dd>
  194. <dt><?php echo t('Record new and expire old') ?>:</dt>
  195. <dd><input type="checkbox" class="radio" name="maxnewest"<?php if ($schedule->maxnewest) echo ' CHECKED' ?> value="1" /></dd>
  196. <dt><?php echo t('No. of recordings to keep') ?>:</dt>
  197. <dd><input type="input" class="quantity" name="maxepisodes" value="<?php echo html_entities($schedule->maxepisodes) ?>" /></dd>
  198. <dt><?php echo t('Start Early') ?>:</dt>
  199. <dd><input type="input" class="quantity" name="startoffset" value="<?php echo html_entities($schedule->startoffset) ?>" />
  200. <?php echo t('minutes') ?></dd>
  201. <dt><?php echo t('End Late') ?>:</dt>
  202. <dd><input type="input" class="quantity" name="endoffset" value="<?php echo html_entities($schedule->endoffset) ?>" />
  203. <?php echo t('minutes') ?></dd>
  204. </dl>
  205. <p align="center">
  206. <input type="submit" class="submit" name="save" value="<?php echo $schedule->recordid ? t('Save Schedule') : t('Create Schedule') ?>">
  207. </p>
  208. </div>
  209. </form>
  210. </div>
  211. <?php
  212. // Print the page footer
  213. require 'modules/_shared/tmpl/'.tmpl.'/footer.php';