Sovigall/inc/admin.php

49 lines
1.4 KiB
PHP

<?php
if (!isLog()) {
die ;
}
require 'inc/topMenu.php';
if (!empty($ci['ac']) && $ci['ac'] === 'viewQueue' && $_SESSION['log'] === true) {
$getQueue = getQueue();
echo 'You have ', $getQueue, ' video in download queue.';
}
if (!empty($ci['ac']) && $ci['ac'] === 'clearCache' && $_SESSION['log'] === true) {
if (clearCache() === true) {
echo 'Cache are clear.';
} else {
echo 'Error on delete cache.';
}
}
if (empty($ci['bc'])) {
$path = $GLOBALS['config']['VIDEODIR'].'/';
} else {
$splitBc = chunk_split($ci['bc'], 8, '/');
$path = $GLOBALS['config']['VIDEODIR'].'/'.$splitBc;
$breadcrumb = makeBreadcrumb($ci['bc'], $fullListDir);
$nbBread = count($breadcrumb);
}
$listCurrentDir = listCurrentDir($path);
$listCurrentFile = listVideo($path);
if (!empty($listCurrentFile) && count($listCurrentFile) > 1 && $ci['ac'] !== 'view') {
echo '<div id="sort">
<ul>
<li><a href="?bc=', $ci['bc'], '&amp;sort=date">Date</a></li>
<li><a href="?bc=', $ci['bc'], '&amp;sort=name">Name</a></li>
</ul>
</div>';
}
echo '<div id="breadcrumb">';
$i = 1;
echo '<a href="?">Home</a> >>';
if (!empty($breadcrumb)) {
foreach ($breadcrumb as $key => $value) {
if ($i === $nbBread) {
echo '<a href="?bc=', $key, '">', $value, '</a>';
} else {
echo '<a href="?bc=', $key, '">', $value, '</a> >> ';
}
$i++;
}
}