Файл: forum/inc/set_forum_form.php
Строк: 96
<?php
/*
* Форум
* DCMS Special
* Модифицировал densnet
* Файл set_forum_form.php
*/
if (isset($_POST['otmena'])) {
header("Location: /forum/$forum[id]/" . SID);
exit;
}
if (user_access('forum_razd_create') && (isset($_GET['act']) && $_GET['act'] == 'new' || !isset($_GET['act']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_r` WHERE `id_forum` = '$forum[id]'"), 0) == 0)) {
echo "<form class = 'razd' method = 'POST' action = '/forum/$forum[id]/?act=new&ok'>";
echo "Название раздела<br />";
echo "<input name = 'name' type = 'text' maxlength = '100' value = '' /><br />";
echo "<button class = 'action'>";
echo "<span class = 'label'>Добавить</span>";
echo "</button>";
echo "<button class = 'action red' name = 'otmena'>";
echo "<span class = 'label'>Отмена</span>";
echo "</button></form>";
}
if (user_access('forum_for_edit') && (isset($_GET['act']) && $_GET['act'] == 'set')) {
echo "<form class = 'razd' name = 'message' method = 'POST' action = '/forum/$forum[id]/?act=set&ok'>";
echo "Название форума<br />";
echo "<input name = 'name' type = 'text' maxlength = '100' value = '$forum[name]' /><br />";
echo "Описание<br />";
echo text::auto_bb("message", "opis");
echo L . "<textarea name = 'opis'>" . text::esc(trim(stripcslashes(htmlspecialchars($forum['opis'])))) . "</textarea><br />";
echo "Позиция<br /><input size = '3' name = 'pos' type = 'text' maxlength = '3' value = '$forum[pos]' /><br />";
if ($user['level'] >= 3) {
if ($forum['adm'] == 1) {
$check = ' checked = "checked"';
} else {
$check = NULL;
}
echo "<label><input type = 'checkbox'$check name = 'adm' value = '1' /> Только для администрации</label><br />";
}
echo "<button class = 'action green'>";
echo "<span class = 'label'>Сохранить</span>";
echo "</button>";
echo "<button class = 'action red' name = 'otmena'>";
echo "<span class = 'label'>Отмена</span>";
echo "</button></form>";
}
if (isset($_GET['act']) && $_GET['act'] == 'del' && user_access('forum_for_delete')) {
echo "<form class = 'razd' name = 'name' method = 'POST' action = '/forum/$forum[id]/?act=delete&ok'>";
echo "Подтвердите удаление форума [$forum[name]]<br />";
echo "<img src = '/captcha.php?SESS=$sess' width = '100' height = '30' alt = 'Проверочное число' /><br />";
echo "<input name = 'chislo' size = '5' maxlength = '5' value = '' type = 'text' /><br />";
echo "<button class = 'action green'>";
echo "<span class = 'label'>Да, удалить</span>";
echo "</button>";
echo "<button class = 'action red' name = 'otmena'>";
echo "<span class = 'label'>Отмена</span>";
echo "</button></form>";
}
if (user_access('forum_razd_create') || user_access('forum_for_edit') || user_access('forum_for_delete')) {
echo "<div class = 'razd clear_fix'>";
echo "<div class = 'dropdown'>";
echo "<a href = '#' class = 'button'><span class = 'icon icon96' /><span class = 'label'>Администрирование</span><span class = 'toggle'></span></a>";
echo "<div class = 'dropdown-slider'>";
if (user_access('forum_razd_create')) {
echo "<a href = '/forum/$forum[id]/?act=new' class = 'ddm'><span class = 'icon icon3' /><span class = 'label'>Новый раздел</span></a>";
}
if (user_access('forum_for_edit')) {
echo "<a href = '/forum/$forum[id]/?act=set' class = 'ddm'><span class = 'icon icon98' /><span class = 'label'>Изменить подфорум</span></a>";
}
if (user_access('forum_for_delete')) {
echo "<a href = '/forum/$forum[id]/?act=del' class = 'ddm'><span class = 'icon icon58' /><span class = 'label'>Удалить подфорум</span></a>";
}
echo "</div></div></div>";
}