Ticket #7527: mythweb_video.diff

File mythweb_video.diff, 12.3 KB (added by anonymous, 17 years ago)
  • mythplugins/mythweb/modules/video/handler.php

     
    167167    while ($row = $sh->fetch_assoc())
    168168        $Category_String[$row['intid']] = $row['category'];
    169169    $sh->finish();
    170     $Category_String[0] = 'Uncategorized';
     170    $Category_String[0] = t('Uncategorized');
    171171
    172172
    173173// New:  Get the video genres on the system
     
    176176    while ($row = $sh->fetch_assoc())
    177177        $Genre_String[$row['intid']] = $row['genre'];
    178178    $sh->finish();
    179     $Genre_String[0] = 'No Genre';
     179    $Genre_String[0] = t('No Genre');
    180180
    181181// Parse the list
    182182// 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

     
    2525
    2626<script type="text/javascript">
    2727
    28     function newWindow(id) {
    29         $('window_title').innerHTML   = '<?php echo t('Editing '); ?> ' + $(id+'-title').childNodes[0].innerHTML;
     28    function newWindow(id, title) {
     29        $('window_title').innerHTML   = '<?php echo addslashes(t('Editing ')); ?> ' + title;
    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();
     
    6868
    6969        if (result['action'] == 'lookup') {
    7070            if (result['matches']) {
    71                 $('window_title').innerHTML   = '<?php echo t('Video: IMDB: Window Title'); ?> (<a href="javascript: imdb_prompt(\''+result['id']+'\');"><?php echo t('Custom Search'); ?><\/a>)';
     71                $('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>)';
    7272                $('window_content').innerHTML = '';
    7373                for (var key in result['matches'])
    7474                    if (result['matches'][key]['title'])
     
    7878
    7979            }
    8080            else {
    81                 $('window_title').innerHTML   = '<?php echo t('Video: IMDB: Window Title'); ?> (<a href="javascript: imdb_prompt(\''+result['id']+'\');"><?php echo t('Custom Search'); ?><\/a>)';
    82                 $('window_content').innerHTML = '<?php echo t('Video: IMDB: No Matches');   ?>';
     81                $('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>)';
     82                $('window_content').innerHTML = '<?php echo addslashes(t('Video: IMDB: No Matches'));   ?>';
    8383
    8484            }
    8585            $('window').show();
     
    110110    }
    111111
    112112    function imdb_prompt(id) {
    113         var title  = $(id+'-title').childNodes[0].innerHTML;
    114         var number = prompt('<?php echo t('Please enter an imdb number or a title to do another search'); ?>', title);
     113        var title  = ''; // $(id+'-title').childNodes[0].innerHTML;
     114        var number = prompt('<?php echo addslashes(t('Please enter an imdb number or a title to do another search')); ?>', title);
    115115        if (typeof(number) != 'string' || number.length == 0)
    116116            return;
    117117        $('window').hide();
     
    211211    function video_create_popup(result) {
    212212        var video    = result.responseJSON['metadata'];
    213213        var content  = '<dl class="details_list">'
    214                      + '<dt>Plot:</dt>     <dd>'+(video['plot'] ? video['plot'] : '&nbsp;')+'</dd>'
    215                      + '<dt>Rating:</dt>   <dd>'+(video['rating'] ? video['rating'] : '&nbsp;')+'</dd>'
    216                      + '<dt>Director:</dt> <dd>'+(video['director'] ? video['director'] : '&nbsp;')+'</dd>'
    217                      + '<dt>Year:</dt>     <dd>'+(video['year'] ? video['year'] : '&nbsp;')+'</dd>';
     214                     + '<dt><?php echo addslashes(t('Plot:')); ?></dt>     <dd>' + (video['plot'] ? video['plot'] : '&nbsp;')+'</dd>'
     215                     + '<dt><?php echo addslashes(t('Rating:')); ?></dt>   <dd>' + (video['rating'] ? video['rating'] : '&nbsp;')+'</dd>'
     216                     + '<dt><?php echo addslashes(t('Director:')); ?></dt> <dd>' + (video['director'] ? video['director'] : '&nbsp;')+'</dd>'
     217                     + '<dt><?php echo addslashes(t('Year:')); ?></dt>     <dd>' + (video['year'] ? video['year'] : '&nbsp;')+'</dd>';
    218218                     + '</dl>';
    219219        new Tip(video['intid'], content, { className: 'popup' });
    220220        loading_popups[video['intid']] = false;
     
    292292<div id="videos">
    293293
    294294<div id="path">
    295  <b>Directory Structure</b><hr>
    296  <a class="<?php if (!isset($_SESSION['video']['path']) || $_SESSION['video']['path'] == '/') echo 'active'; ?>" href="<?php echo root_url; ?>video?path=/">All Videos</a><br>
     295 <b><?php echo t('Directory Structure'); ?></b><hr>
     296 <a class="<?php if (!isset($_SESSION['video']['path']) || $_SESSION['video']['path'] == '/') echo 'active'; ?>" href="<?php echo root_url; ?>video?path=/"><?php echo t('All Videos'); ?></a><br>
    297297 <?php foreach ($PATH_TREE as $path) output_path_picker($path); ?>
    298298</div>
    299299
     
    316316        <div id="<?php echo $video->intid; ?>_playtime">           <?php echo nice_length($video->length * 60); ?></div>
    317317        <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>
    318318        <div class="command">
    319             <span class="commands"><a href="javascript:newWindow('<?php echo $video->intid ?>')" ><?php echo t('Edit') ?></a></span>
    320             <span class="commands"><a href="javascript:imdb_lookup('<?php echo $video->intid ?>','<?php echo addslashes($video->title); ?>')">IMDB</a></span>
     319            <span class="commands"><a href="javascript:newWindow('<?php echo $video->intid ?>','<?php echo addslashes($video->title); ?>')" ><?php echo t('Edit') ?></a></span>
     320            <span class="commands"><a href="javascript:imdb_lookup('<?php echo $video->intid ?>','<?php echo addslashes($video->title); ?>')"><?php echo t('IMDB') ?></a></span>
    321321        </div>
    322322    </div>
    323323<?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,