Ticket #5235: recorded_limit.patch
File recorded_limit.patch, 3.1 KB (added by , 16 years ago) |
---|
-
modules/tv/recorded.php
13 13 * 14 14 /**/ 15 15 16 //Optional display limit for Recordings menu. The "limit" variable can also be passed as an option and will always override this setting. If commented out, all shows will be displayed unless specified otherwise. 17 // ( Note: this setting would probably have a better home somewhere else, but I'm not sure where that would be ) 18 // $Limit = 40; 19 16 20 // Populate the $Channels array 17 21 load_all_channels(); 18 22 … … 182 186 if (count($All_Shows)) 183 187 sort_programs($All_Shows, 'recorded_sortby'); 184 188 189 //Routines to handle display limits 190 if ( !$Limit ) { $Limit = count($All_Shows); } 191 if ( ( $Limit && $Limit > 0 ) || ( $_REQUEST['limit'] && $_REQUEST['limit'] > 0 ) ) { 192 if ( $_REQUEST['limit'] ) { $Limit = $_REQUEST['limit']; } 193 if ( $Limit > count($All_Shows) ) { $Limit = count($All_Shows); } 194 if ( $Limit < count($All_Shows) ) { 195 //New temp array 196 $All_Shows_temp = array(); 197 //Copy first X elements from All_Shows array into temp array 198 for ( $LimitCount = 0; $LimitCount < $Limit; $LimitCount ++) { 199 $All_Shows_temp[$LimitCount] = $All_Shows[$LimitCount]; 200 } 201 $All_Shows = $All_Shows_temp; 202 } 203 } 204 185 205 // How much free disk space on the backend machine? 186 206 list($size_high, $size_low, $used_high, $used_low) = explode(backend_sep, backend_command('QUERY_FREE_SPACE_SUMMARY')); 187 207 if (function_exists('gmp_add')) { -
modules/tv/tmpl/default/recorded.php
214 214 // --> 215 215 </script> 216 216 217 <table id="title_choices" class="commandbox commands" border="0" cellspacing="0" cellpadding="4"> 217 218 <form id="change_title" action="<?php echo root ?>tv/recorded" method="get"> 218 <table id="title_choices" class="commandbox commands" border="0" cellspacing="0" cellpadding="4">219 219 <tr> 220 220 <?php if (count($Groups) > 1) { ?> 221 221 <td class="x-group"><?php echo t('Show group') ?>:</td> … … 248 248 } 249 249 ?> 250 250 </select></td> 251 </form> 252 <form id="change_limit" action="<?php echo root ?>tv/recorded" method="get"> 253 <td> 254 <?php 255 echo 'Limit: '; 256 echo '<input id="set_limit" type="text" name="limit" size="5" value="'.htmlspecialchars($Limit).'">' 257 ?> 258 <input type="submit" class="submit" value="Change"> 259 </td> 260 </form> 251 261 </tr> 252 262 </table> 253 </form>254 263 255 264 <table id="recorded_list" border="0" cellpadding="0" cellspacing="0" class="list small"> 256 265 <tr class="menu"> … … 421 430 422 431 <?php 423 432 echo '<p style="padding-right: 75px; text-align: right;">' 433 .'Showing '.$Limit.' / ' 424 434 .t('$1 programs, using $2 ($3) out of $4 ($5 free).', 425 435 '<span id="programcount">'.t($Total_Programs).'</span>', 426 436 '<span id="diskused">'.nice_filesize($Total_Used).'</span>',