Ticket #7527: newdiffvideo.diff

File newdiffvideo.diff, 12.0 KB (added by knight@…, 14 years ago)

Update to the patch to make it appyable after changeset 22985 and 22986

  • mythplugins/mythweb/modules/video/handler.php

     
    184184    while ($row = $sh->fetch_assoc())
    185185        $Category_String[$row['intid']] = $row['category'];
    186186    $sh->finish();
    187     $Category_String[0] = 'Uncategorized';
     187    $Category_String[0] = t('Uncategorized');
    188188
    189189// New:  Get the video genres on the system
    190190    $Genre_String = array();
     
    192192    while ($row = $sh->fetch_assoc())
    193193        $Genre_String[$row['intid']] = $row['genre'];
    194194    $sh->finish();
    195     $Genre_String[0] = 'No Genre';
     195    $Genre_String[0] = t('No Genre');
    196196
    197197// Parse the list
    198198// Filter_Category of -1 means All, 0 mean uncategorized
  • mythplugins/mythweb/modules/video/edit.php

     
    8181<body>
    8282
    8383<form method="post" action="<?php echo root_url ?>video/edit" enctype="multipart/form-data">
    84 Title<br>
     84<?php echo t('Title'); ?><br>
    8585<input name="title" type="text" value="<?php echo htmlspecialchars($Video->title, ENT_QUOTES ); ?>"><br><br>
    86 Subtitle<br>
     86<?php echo t('Subtitle'); ?><br>
    8787<input name="subtitle" type="text" value="<?php echo htmlspecialchars($Video->subtitle, ENT_QUOTES ); ?>"><br><br>
    88 Season:<br>
     88<?php echo t('Season'); ?><br>
    8989<input name="season" type="text" size="3" value="<?php echo intval($Video->season); ?>"><br><br>
    90 Episode:<br>
     90<?php echo t('Episode'); ?><br>
    9191<input name="episode" type="text" size="3" value="<?php echo intval($Video->episode); ?>"><br><br>
    92 Director<br>
     92<?php echo t('Director'); ?><br>
    9393<input name="director" type="text" value="<?php echo htmlspecialchars($Video->director, ENT_QUOTES ); ?>"><br><br>
    94 Plot<br>
     94<?php echo t('Plot'); ?><br>
    9595<textarea name="plot" rows="5" cols="30" wrap="VIRTUAL"><?php echo htmlspecialchars($Video->plot, ENT_QUOTES ); ?></textarea><br><br>
    96 Category<br>
     96<?php echo t('Category'); ?><br>
    9797<select name="category">
    98 <option <?php if ($Video->category == 0) echo ' SELECTED'; ?> value="0">Uncategorized</option>
     98<option <?php if ($Video->category == 0) echo ' SELECTED'; ?> value="0"><?php echo t('Uncategorized'); ?></option>
    9999<?php
    100100    $sh = $db->query('SELECT * FROM videocategory');
    101101    while ($cat_data = $sh->fetch_assoc()) {
     
    106106    }
    107107    $sh->finish();
    108108?></select><br><br>
    109 Rating<br>
     109<?php echo t('Rating'); ?><br>
    110110<input name="rating" type="text" value="<?php echo htmlspecialchars($Video->rating, ENT_QUOTES); ?>"><br><br>
    111 IMDB<br>
     111<?php echo t('IMDB'); ?><br>
    112112<input name="inetref" type="text" value="<?php echo htmlspecialchars($Video->inetref, ENT_QUOTES); ?>"><br><br>
    113 Year<br>
     113<?php echo t('Year'); ?><br>
    114114<input name="year" type="text" size="4" value="<?php echo htmlspecialchars($Video->year, ENT_QUOTES); ?>"><br><br>
    115 User Rating<br>
     115<?php echo t('User Rating'); ?><br>
    116116<input name="userrating" type="text" size="3" value="<?php echo htmlspecialchars($Video->userrating, ENT_QUOTES); ?>"><br><br>
    117 Length in minutes<br>
     117<?php echo t('Length in minutes'); ?><br>
    118118<input name="length" type="text" size="3" value="<?php echo htmlspecialchars($Video->length, ENT_QUOTES); ?>"><br><br>
    119 Browsable<br>
     119<?php echo t('Browsable'); ?><br>
    120120<select name="browse">
    121  <option value="0" <?php if ($Video->browse == 0) echo ' SELECTED'; ?>>No</option>
    122  <option value="1" <?php if ($Video->browse == 1) echo ' SELECTED'; ?>>Yes</option>
     121 <option value="0" <?php if ($Video->browse == 0) echo ' SELECTED'; ?>><?php echo t('No'); ?></option>
     122 <option value="1" <?php if ($Video->browse == 1) echo ' SELECTED'; ?>><?php echo t('Yes'); ?></option>
    123123</select><br><br>
    124 Parental Level<br>
     124<?php echo t('Parental Level'); ?><br>
    125125<select name="showlevel">
    126  <option value="1" <?php if ($Video->showlevel == 1) echo ' SELECTED'; ?>>1 - Lowest</option>
     126 <option value="1" <?php if ($Video->showlevel == 1) echo ' SELECTED'; ?>><?php echo t('1 - Lowest'); ?></option>
    127127 <option value="2" <?php if ($Video->showlevel == 2) echo ' SELECTED'; ?>>2</option>
    128128 <option value="3" <?php if ($Video->showlevel == 3) echo ' SELECTED'; ?>>3</option>
    129  <option value="4" <?php if ($Video->showlevel == 4) echo ' SELECTED'; ?>>4 - Highest</option>
     129 <option value="4" <?php if ($Video->showlevel == 4) echo ' SELECTED'; ?>><?php echo t('4 - Highest'); ?></option>
    130130</select><br><br>
    131 Cover Image<br>
     131<?php echo t('Cover Image'); ?><br>
    132132<input type="file" name="coverfile"><br><br>
    133133<input type="hidden" name="intid" value="<?php echo $_REQUEST['intid']; ?>">
    134 <input class="submit" type="submit" name="submit" value="submit">
     134<input class="submit" type="submit" name="submit" value="<?php echo t('Submit'); ?>">
    135135
    136136</form>
    137137
  • mythplugins/mythweb/modules/video/tmpl/default/video.php

     
    2626<script type="text/javascript">
    2727
    2828    function newWindow(id) {
    29         $('window_title').innerHTML   = '<?php echo t('Editing '); ?> ' + $(id+'-title').childNodes[0].innerHTML;
     29        $('window_title').innerHTML   = '<?php echo addslashes(t('Editing ')); ?> ' + $(id+'-title').childNodes[1].innerHTML;
    3030        $('window_content').innerHTML = '<iframe src="<?php echo root_url; ?>video/edit?intid='+id+'">';
    3131        $('window').show();
    3232        Tips.hideAll();
     
    3434
    3535    function imdb_lookup(id, title) {
    3636        if (pending_ajax_requests > 0) {
    37             alert('<?php echo t('Please wait for the pending ajax request'); ?>');
     37            alert('<?php echo addslashes(t('Please wait for the pending ajax request')); ?>');
    3838            return;
    3939        }
    4040        ajax_add_request();
     
    7575
    7676        if (result['action'] == 'lookup') {
    7777            if (result['matches']) {
    78                 $('window_title').innerHTML   = '<?php echo t('Video: IMDB: Window Title'); ?> (<a href="javascript: imdb_prompt(\''+result['id']+'\');"><?php echo t('Custom Search'); ?><\/a>)';
     78                $('window_title').innerHTML   = '<?php echo addslashes(t('Video: IMDB: Window Title')); ?> (<a href="javascript: imdb_prompt(\''+result['id']+'\');"><?php echo addslashes(t('Custom Search')); ?><\/a>)';
    7979                $('window_content').innerHTML = '';
    8080                for (var key in result['matches'])
    8181                    if (result['matches'][key]['title'])
     
    8585
    8686            }
    8787            else {
    88                 $('window_title').innerHTML   = '<?php echo t('Video: IMDB: Window Title'); ?> (<a href="javascript: imdb_prompt(\''+result['id']+'\');"><?php echo t('Custom Search'); ?><\/a>)';
    89                 $('window_content').innerHTML = '<?php echo t('Video: IMDB: No Matches');   ?>';
     88                $('window_title').innerHTML   = '<?php echo addslashes(t('Video: IMDB: Window Title')); ?> (<a href="javascript: imdb_prompt(\''+result['id']+'\');"><?php echo addslashes(t('Custom Search')); ?><\/a>)';
     89                $('window_content').innerHTML = '<?php echo addslashes(t('Video: IMDB: No Matches'));   ?>';
    9090
    9191            }
    9292            $('window').show();
     
    118118
    119119    function imdb_prompt(id) {
    120120        var title  = $(id+'-title').childNodes[1].innerHTML;
    121         var number = prompt('<?php echo t('Please enter an imdb number or a title to do another search'); ?>', title);
     121        var number = prompt('<?php echo addslashes(t('Please enter an imdb number or a title to do another search')); ?>', title);
    122122        if (typeof(number) != 'string' || number.length == 0)
    123123            return;
    124124        $('window').hide();
     
    218218    function video_create_popup(result) {
    219219        var video    = result.responseJSON['metadata'];
    220220        var content  = '<dl class="details_list">'
    221                      + '<dt>Plot:</dt>     <dd>'+(video['plot'] ? video['plot'] : '&nbsp;')+'</dd>'
    222                      + '<dt>Rating:</dt>   <dd>'+(video['rating'] ? video['rating'] : '&nbsp;')+'</dd>'
    223                      + '<dt>Director:</dt> <dd>'+(video['director'] ? video['director'] : '&nbsp;')+'</dd>'
    224                      + '<dt>Year:</dt>     <dd>'+(video['year'] ? video['year'] : '&nbsp;')+'</dd>';
     221                     + '<dt><?php echo addslashes(t('Plot:')); ?></dt>     <dd>' + (video['plot'] ? video['plot'] : '&nbsp;')+'</dd>'
     222                     + '<dt><?php echo addslashes(t('Rating:')); ?></dt>   <dd>' + (video['rating'] ? video['rating'] : '&nbsp;')+'</dd>'
     223                     + '<dt><?php echo addslashes(t('Director:')); ?></dt> <dd>' + (video['director'] ? video['director'] : '&nbsp;')+'</dd>'
     224                     + '<dt><?php echo addslashes(t('Year:')); ?></dt>     <dd>' + (video['year'] ? video['year'] : '&nbsp;')+'</dd>';
    225225                     + '</dl>';
    226226        new Tip(video['intid'], content, { className: 'popup' });
    227227        loading_popups[video['intid']] = false;
     
    299299<div id="videos">
    300300
    301301<div id="path">
    302   <b>Directory Structure</b><hr>
    303   <a class="<?php if (!isset($_SESSION['video']['path']) || $_SESSION['video']['path'] == '/') echo 'active'; ?>" href="<?php echo root_url; ?>video?path=/">Root Directory</a><br><br>
     302  <b><?php echo t('Directory Structure'); ?></b><hr>
     303  <a class="<?php if (!isset($_SESSION['video']['path']) || $_SESSION['video']['path'] == '/') echo 'active'; ?>" href="<?php echo root_url; ?>video?path=/"><?php echo t('Root Directory'); ?></a><br><br>
    304304  <?php foreach ($PATH_TREE as $path) { output_path_picker($path); } ?>
    305305</div>
    306306
     
    324324        <div id="<?php echo $video->intid; ?>_imdb">               <?php if ($video->inetref != '00000000') { ?><a href="<?php echo makeImdbWebUrl($video->inetref); ?>"><?php echo $video->inetref ?></a><?php } ?></div>
    325325        <div class="command">
    326326            <span class="commands"><a href="javascript:newWindow('<?php echo $video->intid ?>')" ><?php echo t('Edit') ?></a></span>
    327             <span class="commands"><a href="javascript:imdb_lookup('<?php echo $video->intid ?>','<?php echo addslashes($video->title); ?>')">IMDB</a></span>
     327            <span class="commands"><a href="javascript:imdb_lookup('<?php echo $video->intid ?>','<?php echo addslashes($video->title); ?>')"><?php echo t('IMDB') ?></a></span>
    328328        </div>
    329329    </div>
    330330<?php
  • mythplugins/mythweb/classes/Video.php

     
    4848        $this->episode      = $video['episode'];
    4949        $this->director     = $video['director'];
    5050        $this->inetref      = $video['inetref'];
    51         $this->year         = $video['year'] ? $video['year'] : 'Unknown';
    52         $this->userrating   = $video['userrating'] ? $video['userrating'] : 'Unknown';
     51        $this->year         = $video['year'] ? $video['year'] : t('Unknown');
     52        $this->userrating   = $video['userrating'] ? $video['userrating'] : t('Unknown');
    5353        $this->length       = $video['length'];
    5454        $this->showlevel    = $video['showlevel'];
    5555        $this->filename     = $video['filename'];
     
    9999                      'season'      => $this->season,
    100100                      'episode'     => $this->episode,
    101101                      'playtime'    => nice_length($this->length * 60),
    102                       'category'    => strlen($Category_String[$this->category]) ? $Category_String[$this->category] : 'Uncategorized',
     102                      'category'    => strlen($Category_String[$this->category]) ? $Category_String[$this->category] : t('Uncategorized'),
    103103                      'imdb'        => ($this->inetref != '00000000') ? '<a href="http://www.imdb.com/Title?'.$this->inetref.'">'.$this->inetref.'</a>' : '',
    104104                      'plot'        => $this->plot,
    105105                      'rating'      => $this->rating,