[add] change default titile of video

This commit is contained in:
Knah Tsaeb 2013-07-26 13:41:07 +02:00
parent e61d43da1f
commit 277ca16643

View file

@ -11,13 +11,13 @@ if (!empty($ci['ac']) && $ci['ac'] === 'login') {
<input type="hidden" name="op" value="2"/> <input type="hidden" name="op" value="2"/>
<input type="hidden" name="ac" value="login"/> <input type="hidden" name="ac" value="login"/>
<input type="hidden" name="bc" value="'.$ci['bc'].'" /> <input type="hidden" name="bc" value="'.$ci['bc'].'" />
<input type="hidden" name="token" value="', genToken(), '"/> <input type="hidden" name="token" value="', genToken(), '"/>
<input type="submit" /> <input type="submit" />
</fieldset> </fieldset>
</form>'; </form>';
} }
if (!empty($ci['ac']) && $ci['ac'] === 'newDir') { if (!empty($ci['ac']) && $ci['ac'] === 'newDir') {
echo '<form action="?" method="post"> echo '<form action="?" method="post">
<fieldset> <fieldset>
<legend>New directory</legend> <legend>New directory</legend>
<label>Name</label> <label>Name</label>
@ -25,13 +25,13 @@ if (!empty($ci['ac']) && $ci['ac'] === 'newDir') {
<input type="hidden" name="op" value="1"/> <input type="hidden" name="op" value="1"/>
<input type="hidden" name="ac" value="newDir" /> <input type="hidden" name="ac" value="newDir" />
<input type="hidden" name="bc" value="'.$ci['bc'].'" /> <input type="hidden" name="bc" value="'.$ci['bc'].'" />
<input type="hidden" name="token" value="', genToken(), '"/> <input type="hidden" name="token" value="', genToken(), '"/>
<input type="submit"/> <input type="submit"/>
</fieldset> </fieldset>
</form>'; </form>';
} }
if (!empty($ci['ac']) && $ci['ac'] === 'renDir') { if (!empty($ci['ac']) && $ci['ac'] === 'renDir') {
if (empty($ci['op'])){ if (empty($ci['op'])) {
$currentDir = getCurrentDir($ci['bc']); $currentDir = getCurrentDir($ci['bc']);
echo '<form action="?" method="post"> echo '<form action="?" method="post">
<fieldset> <fieldset>
@ -41,14 +41,14 @@ if (!empty($ci['ac']) && $ci['ac'] === 'renDir') {
<input type="hidden" name="op" value="1"/> <input type="hidden" name="op" value="1"/>
<input type="hidden" name="ac" value="renDir" /> <input type="hidden" name="ac" value="renDir" />
<input type="hidden" name="bc" value="'.$ci['bc'].'" /> <input type="hidden" name="bc" value="'.$ci['bc'].'" />
<input type="hidden" name="token" value="', genToken(), '"/> <input type="hidden" name="token" value="', genToken(), '"/>
<input type="submit"/> <input type="submit"/>
</fieldset> </fieldset>
</form>'; </form>';
} }
} }
if (!empty($ci['ac']) && $ci['ac'] === 'addVideo') { if (!empty($ci['ac']) && $ci['ac'] === 'addVideo') {
echo '<form action="?" method="post"> echo '<form action="?" method="post">
<fieldset> <fieldset>
<legend>New video</legend> <legend>New video</legend>
<label>Url</label> <label>Url</label>
@ -66,7 +66,7 @@ if (!empty($ci['ac']) && $ci['ac'] === 'addVideo') {
<input type="hidden" name="op" value="1"/> <input type="hidden" name="op" value="1"/>
<input type="hidden" name="ac" value="addVideo" /> <input type="hidden" name="ac" value="addVideo" />
<input type="hidden" name="bc" value="'.$ci['bc'].'" /> <input type="hidden" name="bc" value="'.$ci['bc'].'" />
<input type="hidden" name="token" value="', genToken(), '"/> <input type="hidden" name="token" value="', genToken(), '"/>
<input type="submit"/> <input type="submit"/>
</fieldset> </fieldset>
</form>'; </form>';
@ -122,8 +122,13 @@ if (!empty($listCurrentFile) && $ci['ac'] !== 'view') {
echo '</div>'; echo '</div>';
if ($ci['ac'] === 'view' && !empty($listCurrentFile)) { if ($ci['ac'] === 'view' && !empty($listCurrentFile)) {
if (!empty($videoInfo)) { if (!empty($videoInfo)) {
if (empty($videoInfo['title'])) {
$fullTitle = $videoInfo['originalTitle'];
} else {
$fullTitle = $videoInfo['title'].' ('.$videoInfo['originalTitle'].')';
}
echo '<div id="viewFile">'; echo '<div id="viewFile">';
echo '<h2>', $videoInfo['title'], ' (', $videoInfo['originalTitle'], ')</h2>'; echo '<h2>', $fullTitle,'</h2>';
echo '<video width="640" controls="controls" poster="', $path.$videoInfo['hash'], '.jpg">'; echo '<video width="640" controls="controls" poster="', $path.$videoInfo['hash'], '.jpg">';
echo '<source src="', $path.$videoInfo['hash'], '.webm" type="video/webm" />'; echo '<source src="', $path.$videoInfo['hash'], '.webm" type="video/webm" />';
echo '<source src="', $path.$videoInfo['hash'], '.mp4" type="video/mp4" />'; echo '<source src="', $path.$videoInfo['hash'], '.mp4" type="video/mp4" />';
@ -142,7 +147,11 @@ if ($ci['ac'] === 'view' && !empty($listCurrentFile)) {
echo '<table> echo '<table>
<tr> <tr>
<th>Title</th> <th>Title</th>
<td>', $videoInfo['title'], ' (', $videoInfo['originalTitle'], ')</td> <td>', $videoInfo['title'],'</td>
</tr>
<tr>
<th>Original title</th>
<td>', $videoInfo['originalTitle'],'</td>
</tr> </tr>
<tr> <tr>
<th>Description</th> <th>Description</th>
@ -154,7 +163,7 @@ if ($ci['ac'] === 'view' && !empty($listCurrentFile)) {
</tr> </tr>
<tr> <tr>
<th>Url</th> <th>Url</th>
<td><a href="', htmlentities($videoInfo['url']), '">', $videoInfo['url'], '</a></td> <td><a href="', htmlentities($videoInfo['url']), '">', $videoInfo['url'], '</a></td>
</tr> </tr>
<tr> <tr>
<th>Duration</th> <th>Duration</th>
@ -166,12 +175,12 @@ if ($ci['ac'] === 'view' && !empty($listCurrentFile)) {
<tr> <tr>
<th>Via</th> <th>Via</th>
<td>'; <td>';
if(!empty($videoInfo['via'])) { if (!empty($videoInfo['via'])) {
echo '<a href="', htmlentities($videoInfo['via']), '">', $videoInfo['via'], '</a>'; echo '<a href="', htmlentities($videoInfo['via']), '">', $videoInfo['via'], '</a>';
} else { } else {
echo ''; echo '';
} }
echo ' echo '
</td> </td>
</tr> </tr>
<tr> <tr>