Ticket #7527: mythweb_video.diff
File mythweb_video.diff, 12.3 KB (added by , 14 years ago) |
---|
-
mythplugins/mythweb/modules/video/handler.php
167 167 while ($row = $sh->fetch_assoc()) 168 168 $Category_String[$row['intid']] = $row['category']; 169 169 $sh->finish(); 170 $Category_String[0] = 'Uncategorized';170 $Category_String[0] = t('Uncategorized'); 171 171 172 172 173 173 // New: Get the video genres on the system … … 176 176 while ($row = $sh->fetch_assoc()) 177 177 $Genre_String[$row['intid']] = $row['genre']; 178 178 $sh->finish(); 179 $Genre_String[0] = 'No Genre';179 $Genre_String[0] = t('No Genre'); 180 180 181 181 // Parse the list 182 182 // Filter_Category of -1 means All, 0 mean uncategorized -
mythplugins/mythweb/modules/video/edit.php
81 81 <body> 82 82 83 83 <form method="post" action="<?php echo root_url ?>video/edit" enctype="multipart/form-data"> 84 Title<br>84 <?php echo t('Title'); ?><br> 85 85 <input name="title" type="text" value="<?php echo htmlspecialchars($Video->title, ENT_QUOTES ); ?>"><br><br> 86 Subtitle<br>86 <?php echo t('Subtitle'); ?><br> 87 87 <input name="subtitle" type="text" value="<?php echo htmlspecialchars($Video->subtitle, ENT_QUOTES ); ?>"><br><br> 88 Season:<br>88 <?php echo t('Season'); ?><br> 89 89 <input name="season" type="text" size="3" value="<?php echo intval($Video->season); ?>"><br><br> 90 Episode:<br>90 <?php echo t('Episode'); ?><br> 91 91 <input name="episode" type="text" size="3" value="<?php echo intval($Video->episode); ?>"><br><br> 92 Director<br>92 <?php echo t('Director'); ?><br> 93 93 <input name="director" type="text" value="<?php echo htmlspecialchars($Video->director, ENT_QUOTES ); ?>"><br><br> 94 Plot<br>94 <?php echo t('Plot'); ?><br> 95 95 <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> 97 97 <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> 99 99 <?php 100 100 $sh = $db->query('SELECT * FROM videocategory'); 101 101 while ($cat_data = $sh->fetch_assoc()) { … … 106 106 } 107 107 $sh->finish(); 108 108 ?></select><br><br> 109 Rating<br>109 <?php echo t('Rating'); ?><br> 110 110 <input name="rating" type="text" value="<?php echo htmlspecialchars($Video->rating, ENT_QUOTES); ?>"><br><br> 111 IMDB<br>111 <?php echo t('IMDB'); ?><br> 112 112 <input name="inetref" type="text" value="<?php echo htmlspecialchars($Video->inetref, ENT_QUOTES); ?>"><br><br> 113 Year<br>113 <?php echo t('Year'); ?><br> 114 114 <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> 116 116 <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> 118 118 <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> 120 120 <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> 123 123 </select><br><br> 124 Parental Level<br>124 <?php echo t('Parental Level'); ?><br> 125 125 <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> 127 127 <option value="2" <?php if ($Video->showlevel == 2) echo ' SELECTED'; ?>>2</option> 128 128 <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> 130 130 </select><br><br> 131 Cover Image<br>131 <?php echo t('Cover Image'); ?><br> 132 132 <input type="file" name="coverfile"><br><br> 133 133 <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'); ?>"> 135 135 136 136 </form> 137 137 -
mythplugins/mythweb/modules/video/tmpl/default/video.php
25 25 26 26 <script type="text/javascript"> 27 27 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; 30 30 $('window_content').innerHTML = '<iframe src="<?php echo root_url; ?>video/edit?intid='+id+'">'; 31 31 $('window').show(); 32 32 Tips.hideAll(); … … 34 34 35 35 function imdb_lookup(id, title) { 36 36 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')); ?>'); 38 38 return; 39 39 } 40 40 ajax_add_request(); … … 68 68 69 69 if (result['action'] == 'lookup') { 70 70 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>)'; 72 72 $('window_content').innerHTML = ''; 73 73 for (var key in result['matches']) 74 74 if (result['matches'][key]['title']) … … 78 78 79 79 } 80 80 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')); ?>'; 83 83 84 84 } 85 85 $('window').show(); … … 110 110 } 111 111 112 112 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); 115 115 if (typeof(number) != 'string' || number.length == 0) 116 116 return; 117 117 $('window').hide(); … … 211 211 function video_create_popup(result) { 212 212 var video = result.responseJSON['metadata']; 213 213 var content = '<dl class="details_list">' 214 + '<dt> Plot:</dt> <dd>'+(video['plot'] ? video['plot'] : ' ')+'</dd>'215 + '<dt> Rating:</dt> <dd>'+(video['rating'] ? video['rating'] : ' ')+'</dd>'216 + '<dt> Director:</dt> <dd>'+(video['director'] ? video['director'] : ' ')+'</dd>'217 + '<dt> Year:</dt> <dd>'+(video['year'] ? video['year'] : ' ')+'</dd>';214 + '<dt><?php echo addslashes(t('Plot:')); ?></dt> <dd>' + (video['plot'] ? video['plot'] : ' ')+'</dd>' 215 + '<dt><?php echo addslashes(t('Rating:')); ?></dt> <dd>' + (video['rating'] ? video['rating'] : ' ')+'</dd>' 216 + '<dt><?php echo addslashes(t('Director:')); ?></dt> <dd>' + (video['director'] ? video['director'] : ' ')+'</dd>' 217 + '<dt><?php echo addslashes(t('Year:')); ?></dt> <dd>' + (video['year'] ? video['year'] : ' ')+'</dd>'; 218 218 + '</dl>'; 219 219 new Tip(video['intid'], content, { className: 'popup' }); 220 220 loading_popups[video['intid']] = false; … … 292 292 <div id="videos"> 293 293 294 294 <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> 297 297 <?php foreach ($PATH_TREE as $path) output_path_picker($path); ?> 298 298 </div> 299 299 … … 316 316 <div id="<?php echo $video->intid; ?>_playtime"> <?php echo nice_length($video->length * 60); ?></div> 317 317 <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> 318 318 <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> 321 321 </div> 322 322 </div> 323 323 <?php -
mythplugins/mythweb/classes/Video.php
48 48 $this->episode = $video['episode']; 49 49 $this->director = $video['director']; 50 50 $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'); 53 53 $this->length = $video['length']; 54 54 $this->showlevel = $video['showlevel']; 55 55 $this->filename = $video['filename']; … … 99 99 'season' => $this->season, 100 100 'episode' => $this->episode, 101 101 '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'), 103 103 'imdb' => ($this->inetref != '00000000') ? '<a href="http://www.imdb.com/Title?'.$this->inetref.'">'.$this->inetref.'</a>' : '', 104 104 'plot' => $this->plot, 105 105 'rating' => $this->rating,