[add] message for confirm delete file

This commit is contained in:
Knah Tsaeb 2013-08-08 17:26:22 +02:00
parent f5ff23e33c
commit 53fd072fa7
3 changed files with 25 additions and 12 deletions

View File

@ -128,16 +128,25 @@ if (!empty($breadcrumb)) {
echo '</div>';
if (empty($listCurrentDir) && empty($listCurrentFile)) {
if ($ci['ac'] === 'confDel' && isLog()) {
if ($ci['ac'] === 'confDelDir' && isLog()) {
echo '<div class="confirm">
<a href="?bc=', $ci['bc'], '&amp;token=', $token, '&amp;ac=del" class="valid">Yes</a>
<h3>Delete this directory</h3>
<a href="?bc=', $ci['bc'], '&amp;token=', $token, '&amp;ac=delDir" class="valid">Yes</a>
<a href="?bc=', $ci['bc'], '&amp;token=', $token, '" class="cancel">No</a>
</div>';
} else {
echo '<a href="?bc=', $ci['bc'], '&amp;token=', $token, '&amp;ac=confDel" class="delete">Delete this directory</a>';
echo '<a href="?bc=', $ci['bc'], '&amp;token=', $token, '&amp;ac=confDelDir" class="delete">Delete this directory</a>';
}
}
if ($ci['op'] === 'confDelVideo' && isLog()) {
echo '<div class="confirm">
<h3>Delete this file</h3>
<a href="?ac=view&amp;op=4&amp;bc=', $ci['bc'], '&amp;file=', $ci['file'], '&amp;token=', $token, '" class="valid">Yes</a>
<a href="?ac=view&amp;bc=', $ci['bc'], '&amp;file=', $ci['file'], '&amp;token=', $token, '" class="cancel">No</a>
</div>';
}
echo '<div id="listFile">';
if (!empty($listCurrentDir) && $ci['ac'] !== 'view') {
$listCurrentDir = sortDir($listCurrentDir, $fullListDir);
@ -190,7 +199,7 @@ if (!empty($ci['ac']) && $ci['ac'] === 'view' && !empty($listCurrentFile)) {
if ($_SESSION['log'] === true) {
echo '<div id="toolbar">
<a href="?ac=view&amp;op=3&amp;bc=', $ci['bc'], '&amp;file=', $ci['file'], '&amp;token=', $token, '"><img src="images/useThumbnail.svg" alt="Use this thumbnail for folder thumbnail" title="Use this thumbnail for folder thumbnail"/></a>
<a href="?ac=view&amp;op=4&amp;bc=', $ci['bc'], '&amp;file=', $ci['file'], '&amp;token=', $token, '"><img src="images/delete.svg" alt="Delete this video" title="Delete this video"/></a>
<a href="?ac=view&amp;bc=', $ci['bc'], '&amp;file=', $ci['file'], '&amp;token=', $token, '&amp;op=confDelVideo"><img src="images/delete.svg" alt="Delete this video" title="Delete this video"/></a>
</div>';
}
if ($GLOBALS['config']['DOWNLOAD_METHOD'] === 'xsendfile' || $GLOBALS['config']['DOWNLOAD_METHOD'] === 'php') {
@ -217,20 +226,20 @@ if (!empty($ci['ac']) && $ci['ac'] === 'view' && !empty($listCurrentFile)) {
</tr>
<tr>
<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>
<th>Duration</th>
<td>', $videoInfo['duration'], '</td>
<tr>
<th>Publish date</th>
<td>', date("d m Y", strtotime($videoInfo['uploadDate'])), '</td>
<td>', date("d m Y", strtotime($videoInfo['uploadDate'])), '</td>
</tr>
<tr>
<th>Via</th>
<td>';
if (!empty($videoInfo['via'])) {
echo '<a href="', htmlentities($videoInfo['via']), '">', $videoInfo['via'], '</a>';
echo '<a href="', htmlentities($videoInfo['via']), '">', $videoInfo['via'], '</a>';
} else {
echo '';
}

View File

@ -586,6 +586,8 @@ if (isset($ci['ac']) && !empty($ci['ac'])) {
}
$deleteVideo = deleteVideo($ci['bc'], $ci['file']);
deleteCache($ci['bc'], $ci['file'], $ci['sort']);
unset($ci['file']);
unset($ci['ac']);
}
if ($ci['ac'] === 'view' && !empty($ci['op']) && (int)$ci['op'] === 3) {
verifToken($ci['token']);
@ -602,7 +604,7 @@ if (isset($ci['ac']) && !empty($ci['ac'])) {
}
$page = 'admin';
}
if ($ci['ac'] === 'del') {
if ($ci['ac'] === 'delDir') {
verifToken($ci['token']);
if (!isLog()) {
die('Tinker say : wonder what.. This does? ');

View File

@ -227,21 +227,23 @@ video {
border-radius: 0.2em;
padding: 1.2em;
}
.confirm > * {
color: #262626;
}
.confirm a {
padding: 0.5em 1em;
display: inline-block;
border-radius: 0.2em;
margin: 0 0.4em;
color:#262626;
font-weight: bold;
text-decoration : none;
text-decoration: none;
}
.confirm .valid {
background-color : #9bd840;
background-color: #9bd840;
}
.confirm .cancel {
background-color : #e74638;
background-color: #e74638;
}