Файл: modules/obmen/inc/admin_form.php
Строк: 142
<?php
/* DCMS Special
* Дата последнего редактирования 11.12.2015
* Модифицировал densnet
*/
if (access('obmen_dir_edit') && isset($_GET['act']) && $_GET['act'] == 'set') {
echo '<div class="card">';
echo "<div class='card-header'>Параметры <a style = 'float:right;color: grey;' href = '?'><small>Закрыть</small></a></div>";
echo "<form class='card-block' action='?act=set&ok&page=$page' method="post">";
echo "<div class='row'>";
echo "<div class='input-field col s12'>";
echo "<input id='name' name='name' type='text' value='$dir_id[name]' class='validate'>";
echo "<label for='name'>Название папки</label>";
echo "</div>";
echo "</div>";
if ($dir_id['upload'] == 1) {
$check = ' checked="checked"';
} else {
$check = NULL;
}
echo "<div class='switch'>";
echo "<label><input type='checkbox' $check name='upload' value='1'><span class='lever'></span>Выгрузка</label>";
echo "</div>";
echo "<div class='row'>";
echo "<div class='input-field col s12'>";
echo "<input id='ras' name='ras' type='text' value='$dir_id[ras]' class='validate'>";
echo "<label for='ras'>Расширения через ";"</label>";
echo "</div>";
echo "</div>";
if ($dir_id['maxfilesize'] < 1024) {
$size = $dir_id['maxfilesize'];
} elseif ($dir_id['maxfilesize'] >= 1024 && $dir_id['maxfilesize'] < 1048576) {
$size = intval($dir_id['maxfilesize'] / 1024);
} elseif ($dir_id['maxfilesize'] >= 1048576) {
$size = intval($dir_id['maxfilesize'] / 1048576);
}
echo "<div class='row'>";
echo "<div class='input-field col s5'>";
echo "<input id='size' name='size' type='text' value='$size' class='validate'>";
echo "<label for='size'>Мак. размер файлов</label>";
echo "</div>";
echo "<div class='input-field col s5'>";
echo "<select class='browser-default' name='mn'>n";
if ($dir_id['maxfilesize'] < 1024) {
$sel = ' selected="selected"';
} else {
$sel = NULL;
}
echo "<option value='1'$sel>B</option>n";
if ($dir_id['maxfilesize'] >= 1024 && $dir_id['maxfilesize'] < 1048576) {
$sel = ' selected="selected"';
} else {
$sel = NULL;
}
echo "<option value='1024'$sel>KB</option>n";
if ($dir_id['maxfilesize'] >= 1048576) {
$sel = ' selected="selected"';
} else {
$sel = NULL;
}
echo "<option value='1048576'$sel>MB</option>n";
echo "</select>n";
echo "</div>";
echo "</div>";
echo "*настройки сервера не позволяют выгружать файлы объемом более: " . size_file($upload_max_filesize) . "<br />n";
echo "<button class='waves-effect waves-light btn'><i class='material-icons'>save</i> Сохранить</button>";
echo "</form>";
echo "</div>";
}
if (access('obmen_dir_create') && isset($_GET['act']) && $_GET['act'] == 'mkdir') {
echo '<div class="card">';
echo "<div class='card-header'>Новая папка <a style = 'float:right;color: grey;' href = '?'><small>Закрыть</small></a></div>";
echo "<form class='card-block' action = '?act=mkdir&ok&page=$page' method = 'post'>";
echo "<div class='row'>";
echo "<div class='input-field col s12'>";
echo "<input id='name' name='name' type='text' value='' class='validate'>";
echo "<label for='name'>Название папки</label>";
echo "</div>";
echo "</div>";
echo "<div class='switch'>";
echo "<label><input type='checkbox' name='upload' value='1'><span class='lever'></span>Выгрузка</label>";
echo "</div>";
echo "<div class='row'>";
echo "<div class='input-field col s12'>";
echo "<input id='ras' name='ras' type='text' value='' class='validate'>";
echo "<label for='ras'>Расширения через ";"</label>";
echo "</div>";
echo "</div>";
echo "<div class='row'>";
echo "<div class='input-field col s5'>";
echo "<input id='size' name='size' type='text' value='500' class='validate'>";
echo "<label for='size'>Мак. размер файлов</label>";
echo "</div>";
echo "<div class='input-field col s5'>";
echo "<select class='browser-default' name='mn'>n";
echo "<option value='1'>B</option>n";
echo "<option value='1024' selected = 'selected'>KB</option>n";
echo "<option value='1048576'>MB</option>n";
echo "</select>n";
echo "</div>";
echo "</div>";
echo "*настройки сервера не позволяют выгружать файлы объемом более: " . size_file($upload_max_filesize) . "<br />n";
echo "<button class='waves-effect waves-light btn'>Создать папку</button>";
echo "</form>";
echo "</div>";
}
if (access('obmen_dir_edit') && isset($_GET['act']) && $_GET['act'] == 'rename' && $l != '/') {
echo '<div class="card">';
echo "<div class='card-header'>Переименование <a style = 'float:right;color: grey;' href = '?'><small>Закрыть</small></a></div>";
echo "<form class='card-block' action='?act=rename&ok' method="post">";
echo "<div class='row'>";
echo "<div class='input-field col s12'>";
echo "<input id='name' name='name' type='text' value='$dir_id[name]' class='validate'>";
echo "<label for='name'>Название папки</label>";
echo "</div>";
echo "</div>";
echo "<button class='waves-effect waves-light btn'><i class='material-icons'>save</i> Сохранить</button>";
echo "</form>";
echo "</div>";
}
if (access('obmen_dir_edit') && isset($_GET['act']) && $_GET['act'] == 'mesto' && $l != '/') {
echo '<div class="card">';
echo "<div class='card-header'>Перемещение <a style = 'float:right;color: grey;' href = '?page=$page'><small>Закрыть</small></a></div>";
echo "<form class='card-block' action = '?act=mesto&ok&page=$page' method = "post">";
echo "Новый путь<br />n";
echo "<div class='row'>";
echo "<div class='input-field col s12'>";
echo "<select class='browser-default' name='dir_osn'>n";
echo "<option value='/'>[в корень]</option>n";
$q = mysql_query("SELECT DISTINCT `dir` FROM `obmennik_dir` WHERE `dir` not like '$l%' ORDER BY 'dir' ASC");
while ($post = mysql_fetch_assoc($q)) {
echo "<option value='$post[dir]'>$post[dir]</option>n";
}
echo "</select>n";
echo "</div>";
echo "</div>";
echo "<button class='waves-effect waves-light btn'>Переместить</button>";
echo "</form>";
echo "</div>";
}
if (access('obmen_dir_delete') && isset($_GET['act']) && $_GET['act'] == 'delete' && $l != '/') {
echo '<div class="card">';
echo "<div class='card-header'>Удаление <a style = 'float:right;color: grey;' href = '?page=$page'><small>Закрыть</small></a></div>";
echo "<div class='card-block'>";
echo "Удалить текущую папку ($dir_id[name])?<br />";
echo "<a class = 'waves-effect waves-light btn' href='?act=delete&ok&page=$page' style = 'color:white;'>Да</a> n";
echo "<a class = 'waves-effect waves-light btn btn-secondary' href='?page=$page'>Нет</a>";
echo "</div></div>";
}
if (access('obmen_dir_edit') || access('obmen_dir_delete') || access('obmen_dir_create')) {
echo "<div class='collection'>";
if (access('obmen_dir_create')) {
echo "<a href='?act=mkdir&page=$page' class='collection-item'><i class='material-icons left'>create_new_folder</i> Создать папку</a>";
}
if ($l != '/') {
if (access('obmen_dir_edit')) {
echo "<a href='?act=rename&page=$page' class='collection-item'><i class='material-icons left'>edit</i> Переименовать</a>";
echo "<a href='?act=set&page=$page' class='collection-item'><i class='material-icons left'>settings</i> Параметры</a>";
echo "<a href='?act=mesto&page=$page' class='collection-item'><i class='material-icons left'>undo</i> Переместить</a>";
}
if (access('obmen_dir_delete')) {
echo "<a href='?act=delete&page=$page' class='collection-item'><i class='material-icons left'>delete</i> Удалить папку</a>";
}
}
echo "</div>";
}