Ticket #5671: 5671_diff.patch

File 5671_diff.patch, 3.4 KB (added by Joe Ripley <vitaminjoe@…>, 12 years ago)

Adds sorting option to Mythweb Video module

  • mythplugins/mythweb/includes/sorting.php

     
    145145        return by_no_articles($a->title, $b->title);
    146146    }
    147147
     148    function by_filename(&$a, &$b) {
     149        return strcasecmp($a->filename, $b->filename);
     150    }
     151
    148152    function by_subtitle(&$a, &$b) {
    149153        return by_no_articles($a->subtitle, $b->subtitle);
    150154    }
  • mythplugins/mythweb/modules/_shared/lang/English.lang

     
    216216"Exclude Repeat Episodes"
    217217"Exec. Producer"
    218218"Extended Check"
     219"File Name"
    219220"File Size"
    220221"film"
    221222"Filter"
     
    655656"Songs Played"
    656657"Songs Rated"
    657658"Sorry, but you cannot add this playlist as it would create a circular dependancy."
     659"Sort By"
    658660"sortby_channum"
    659661    Sort channel list by channel number (checked) or by callsign (unchecked)
    660662"sourceid"
  • mythplugins/mythweb/modules/video/handler.php

     
    212212    else
    213213        $Filter_Browse = -1;
    214214
     215    if( isset($_REQUEST['sortby']) ) {
     216        $_SESSION['video_sortby'] = array(array('field'   => $_REQUEST['sortby'],
     217                                                'reverse' => true));
     218    }
     219
     220    if (isset($_SESSION['video_sortby']) )
     221        $Filter_Sort = $_SESSION['video_sortby'][0]['field'];
     222    else
     223        $Filter_Sort = 'title';
     224
     225
     226
    215227    if( isset($_REQUEST['search']) ) {
    216228        $Filter_Search = $_REQUEST['search'];
    217229        if( strlen($Filter_Search) != 0)
  • mythplugins/mythweb/modules/video/tmpl/default/video.php

     
    278278   <option value="1"  <?php if ($Filter_Browse ==  1) echo 'SELECTED'; ?>><?php echo t('Browse = yes'); ?></option>
    279279   <option value="0"  <?php if ($Filter_Browse ==  0) echo 'SELECTED'; ?>><?php echo t('Browse = no'); ?></option>
    280280  </select>&nbsp;&nbsp;
     281  <?php echo t('Sort By'); ?>: <select name="sortby" id="sortby" onchange="this.form.submit();">
     282   <option value='title'     <?php if ($Filter_Sort == 'title')     echo 'SELECTED'; ?>><?php echo t('Title'); ?></option>
     283   <option value='filename'  <?php if ($Filter_Sort == 'filename')  echo 'SELECTED'; ?>><?php echo t('File Name'); ?></option>
     284   <option value='file_size' <?php if ($Filter_Sort == 'file_size') echo 'SELECTED'; ?>><?php echo t('File Size'); ?></option>
     285  </select>&nbsp;&nbsp;
     286
    281287  <?php echo t('Title search'); ?>: <input id="filter_box" name="search" value="<?php echo $Filter_Search; ?>" onchange="filter();" onkeyup="filter();">
    282288  <?php echo t('Admin Key'); ?>: <input type="password" name="VideoAdminPassword" value="<?php echo $_SESSION['video']['VideoAdminPassword']; ?>" size="5">
    283289  <input type="submit" class="submit" value="<?php echo t('Update') ?>">