Files
comment/templates/admin_settings.tpl

300 lines
17 KiB
Smarty
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<div class="title"><h5>{#COMMENT_MODULE_NAME#}</h5></div>
<div class="widget" style="margin-top: 0px;">
<div class="body">
{#COMMENT_MODULE_SETTINGS#}
</div>
</div>
<div class="breadCrumbHolder module">
<div class="breadCrumb module">
<ul>
<li class="firstB"><a href="index.php" title="{#MAIN_PAGE#}">{#MAIN_PAGE#}</a></li>
<li><a href="index.php?do=modules&amp;cp={$sess}">{#MODULES_SUB_TITLE#}</a></li>
<li><a href="index.php?do=modules&action=modedit&mod=comment&moduleaction=1&cp={$sess}">{#COMMENT_MODULE_NAME#}</a></li>
<li><strong class="code">{#COMMENT_MODULE_SETTINGS#}</strong></li>
</ul>
</div>
</div>
<div class="widget first">
<div class="head">
<h5 class="iFrames">{#COMMENT_MODULE_SETTINGS#}</h5>
<div class="num"><a class="basicNum" href="index.php?do=modules&action=modedit&mod=comment&moduleaction=1&cp={$sess}">{#COMMENT_MODULE_COMENTS#}</a></div>
</div>
<form id="commentSettingsForm" action="index.php?do=modules&action=modedit&mod=comment&moduleaction=settings&cp={$sess}&sub=save" method="post" class="mainForm">
<table cellpadding="0" cellspacing="0" width="100%" class="tableStatic">
<thead>
<tr>
<td width="20%">{#COMMENT_HEADER_NAME#}</td>
<td width="30%">{#COMMENT_HEADER_PARAMETR#}</td>
<td width="20%">{#COMMENT_HEADER_NAME#}</td>
<td width="30%">{#COMMENT_HEADER_PARAMETR#}</td>
</tr>
</thead>
<tbody>
<tr class="noborder">
<td>{#COMMENT_ENABLE_COMMENT#}</td>
<td><input name="comment_active" type="checkbox" value="1" {if $comment_active=='1'}checked{/if} /></td>
<td>{#COMMENT_CHECK_ADMIN#}</td>
<td><input name="comment_need_approve" type="checkbox" value="1" {if $comment_need_approve=='1'}checked{/if} /></td>
</tr>
<tr>
<td colspan="4" style="background: #f9f9f9; font-weight: bold; text-align: center;">Настройка постраничной навигации</td>
</tr>
<tr>
<td>{#COMMENT_USE_PAGE_NAV#}</td>
<td style="border-right: 1px solid #ddd;"><input name="comment_use_page_nav" type="checkbox" value="1" {if $comment_use_page_nav=='1'}checked{/if} /></td>
<td>{#COMMENT_PAGE_NAV_COUNT#} (родителей)</td>
<td><input name="comment_page_nav_count" type="text" value="{$comment_page_nav_count}" size="4" style="width: 50px;" /></td>
</tr>
<tr>
<td>Лимит AJAX-ответов в ветке:</td>
<td style="border-right: 1px solid #ddd;">
<input name="comment_ajax_replies_limit" type="text" value="{$comment_ajax_replies_limit|default:'5'}" size="4" style="width: 50px;" />
<span style="color: #888; font-size: 11px; margin-left: 5px;">(0 - без лимита)</span>
</td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="4" style="background: #f9f9f9; font-weight: bold; text-align: center;">Защита и ограничения</td>
</tr>
<tr>
<td>{#COMMENT_SPAMPROTECT#}</td>
<td style="border-right: 1px solid #ddd;"><input name="comment_use_antispam" type="checkbox" value="1" {if $comment_use_antispam=='1'}checked{/if} /></td>
<td>{#COMMENT_MAX_CHARS#}</td>
<td><input name="comment_max_chars" type="text" id="comment_max_chars" value="{$comment_max_chars}" size="5" maxlength="5" style="width: 50px;" /></td>
</tr>
<tr>
<td>Время на редактирование:</td>
<td style="border-right: 1px solid #ddd;">
<input name="comment_edit_time" type="text" value="{$comment_edit_time}" size="5" style="width: 50px;" />
<span style="color: #888; font-size: 11px; margin-left: 5px;">сек.</span>
</td>
<td>Жизнь куки анонима:</td>
<td>
<input name="comment_cookie_life" type="text" value="{$comment_cookie_life}" size="5" style="width: 50px;" />
<span style="color: #888; font-size: 11px; margin-left: 5px;">дн.</span>
</td>
</tr>
<tr>
<td style="vertical-align: top; padding-top: 15px;">{#COMMENT_FOR_GROUPS#}</td>
<td style="vertical-align: top; padding-top: 10px;">
<select name="comment_user_groups[]" multiple="multiple" size="6" style="width:90%">
{foreach from=$groups item=g}
{assign var='sel' value=''}
{if $g->user_group}
{if (in_array($g->user_group,$comment_user_groups)) }
{assign var='sel' value='selected'}
{/if}
{/if}
<option value="{$g->user_group}" {$sel}>{$g->user_group_name|escape}</option>
{/foreach}
</select>
</td>
<td style="vertical-align: top; padding-top: 15px;">{#COMMENT_FOR_GROUPS_READ#}</td>
<td style="vertical-align: top; padding-top: 10px;">
<select name="comment_user_groups_read[]" multiple="multiple" size="6" style="width:90%">
{foreach from=$groups item=g}
{assign var='sel_read' value=''}
{if $g->user_group}
{if (in_array($g->user_group,$comment_user_groups_read)) }
{assign var='sel_read' value='selected'}
{/if}
{/if}
<option value="{$g->user_group}" {$sel_read}>{$g->user_group_name|escape}</option>
{/foreach}
</select>
</td>
</tr>
<tr>
<td colspan="2" style="background: #f9f9f9; font-weight: bold; text-align: center; border-right: 1px solid #ddd;">Дополнительное поле №1</td>
<td colspan="2" style="background: #f9f9f9; font-weight: bold; text-align: center;">Дополнительное поле №2</td>
</tr>
<tr>
<td>Заголовок поля 1:</td>
<td style="border-right: 1px solid #ddd;">
<input name="comment_name_f1" type="text" value="{$comment_name_f1|escape}" style="width: 90%;" placeholder="Введите название поля" />
<div style="margin-top: 5px;">
<label><input name="comment_show_f1" type="checkbox" value="1" {if $comment_show_f1=='1'}checked{/if} /> Показывать</label>
&nbsp;&nbsp;
<label><input name="comment_req_f1" type="checkbox" value="1" {if $comment_req_f1=='1'}checked{/if} /> Обязательное</label>
</div>
</td>
<td>Заголовок поля 2:</td>
<td>
<input name="comment_name_f2" type="text" value="{$comment_name_f2|escape}" style="width: 90%;" placeholder="Введите название поля" />
<div style="margin-top: 5px;">
<label><input name="comment_show_f2" type="checkbox" value="1" {if $comment_show_f2=='1'}checked{/if} /> Показывать</label>
&nbsp;&nbsp;
<label><input name="comment_req_f2" type="checkbox" value="1" {if $comment_req_f2=='1'}checked{/if} /> Обязательное</label>
</div>
</td>
</tr>
<tr>
<td colspan="4" style="background: #f9f9f9; font-weight: bold; text-align: center;">Настройка общего рейтинга</td>
</tr>
<tr>
<td>Тип общего рейтинга:</td>
<td style="border-right: 1px solid #ddd;">
<div style="display: flex; gap: 20px;">
<span style="display: flex; align-items: center;">
<input type="radio" name="comment_rating_type" id="type_stars" value="0" {if $comment_rating_type == '0'}checked="checked"{/if} style="margin-right: 5px; cursor: pointer;" />
<label for="type_stars" style="cursor: pointer; margin-bottom: 0;">Звезды (1-5)</label>
</span>
<span style="display: flex; align-items: center;">
<input type="radio" name="comment_rating_type" id="type_likes" value="1" {if $comment_rating_type == '1'}checked="checked"{/if} style="margin-right: 5px; cursor: pointer;" />
<label for="type_likes" style="cursor: pointer; margin-bottom: 0;">Лайк (Сердечко)</label>
</span>
<span style="display: flex; align-items: center;">
<input type="radio" name="comment_rating_type" id="type_none" value="2" {if $comment_rating_type == '2'}checked="checked"{/if} style="margin-right: 5px; cursor: pointer;" />
<label for="type_none" style="cursor: pointer; margin-bottom: 0; color: #d9534f;">Выключить рейтинг</label>
</span>
</div>
</td>
<td>Права на голосование:</td>
<td>
<label style="cursor: pointer; display: flex; align-items: center; font-weight: normal;">
<input name="comment_rating_anon_vote" type="checkbox" value="1" {if $comment_rating_anon_vote=='1'}checked{/if} style="margin-right: 10px;" />
&nbsp;Разрешить анонимам голосовать
</label>
</td>
</tr>
<tr>
<td colspan="4" style="background: #f9f9f9; font-weight: bold; text-align: center;">Настройка авторского рейтинга</td>
</tr>
<tr>
<td>Авторская оценка:</td>
<td style="border-right: 1px solid #ddd;">
<label style="cursor: pointer; display: flex; align-items: center; font-weight: normal;">
<input name="comment_show_user_rating" type="checkbox" value="1" {if $comment_show_user_rating=='1'}checked{/if} style="margin-right: 10px;" />
&nbsp;Включить "Авторские звезды"
</label>
</td>
<td style="border-right: 1px solid #ddd;">
<label style="cursor: pointer; display: flex; align-items: center; font-weight: normal;">
<input name="comment_show_user_rating_replies" type="checkbox" value="1" {if $comment_show_user_rating_replies=='1'}checked{/if} style="margin-right: 10px;" />
&nbsp;Использовать в ответах
</label>
</td>
<td>
<label style="cursor: pointer; display: flex; align-items: center; font-weight: normal;">
<input name="comment_rating_anon_set" type="checkbox" value="1" {if $comment_rating_anon_set=='1'}checked{/if} style="margin-right: 10px;" />
&nbsp;Разрешить анонимам ставить звезды
</label>
</td>
</tr>
<tr>
<td colspan="4" style="background: #f9f9f9; font-weight: bold; text-align: center;">Настройки медиафайлов</td>
</tr>
<tr>
<td>Разрешить загрузку фото:</td>
<td style="border-right: 1px solid #ddd;">
<label style="cursor: pointer; display: flex; align-items: center; font-weight: normal;">
<input name="comment_allow_files" type="checkbox" value="1" {if $comment_allow_files=='1'}checked{/if} style="margin-right: 10px;" />
&nbsp;Включить загрузку изображений
</label>
</td>
<td>Права на загрузку изображений:</td>
<td>
<label style="cursor: pointer; display: flex; align-items: center; font-weight: normal;">
<input name="comment_allow_files_anon" type="checkbox" value="1" {if $comment_allow_files_anon=='1'}checked{/if} style="margin-right: 10px;" />
&nbsp;Разрешить анонимам загружать изображения
</label>
</td>
</tr>
<tr>
<td>Допустимые расширения:</td>
<td style="border-right: 1px solid #ddd;">
<input name="comment_allowed_extensions" type="text" value="{$comment_allowed_extensions|default:'jpg,jpeg,png,gif,webp'}" style="width: 90%;" placeholder="Пример: jpg, png, gif" />
</td>
<td>Макс. размер файла (Кб):</td>
<td>
<input name="comment_max_file_size" type="text" value="{$comment_max_file_size|default:'2048'}" size="6" style="width: 80px;" />
<span style="color: #888; font-size: 11px; margin-left: 5px;">KB</span>
</td>
</tr>
<tr>
<td>Макс. кол-во файлов:</td>
<td style="border-right: 1px solid #ddd;">
<input name="comment_max_files" type="text" value="{$comment_max_files|default:'5'}" size="4" style="width: 50px;" />
<span style="color: #888; font-size: 11px; margin-left: 5px;">шт. на один комментарий</span>
</td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="4" class="submitArea">
<div class="rowElem" style="border:none; padding: 10px;">
<div class="saveBtn" style="float: left; width: 100%;">
<input type="submit" class="basicBtn" value="{#COMMENT_BUTTON_SAVE#}" style="margin-right: 5px;" />
<span style="margin: 0 5px;">или</span>
<input type="button" id="apply_comment_settings" class="blackBtn" value="Применить" style="margin-left: 5px;" />
<a class="button redBtn" href="index.php?do=modules&cp={$sess}" style="float:right; height: 18px; padding: 0 10px; line-height: 18px;">Отменить</a>
</div>
</div>
<div class="fix"></div>
</td>
</tr>
</tbody>
</table>
</form>
</div>
<script type="text/javascript">
$(document).ready(function() {
function saveCommentSettings() {
var form = $("#commentSettingsForm");
var formData = form.serialize();
var actionUrl = form.attr("action").replace("sub=save", "sub=apply");
$.ajax({
type: "POST",
url: actionUrl,
data: formData,
beforeSend: function() {
$("#apply_comment_settings").val("Сохранение...").attr("disabled", true);
},
success: function (data) {
if (data.trim() === "success") {
$.jGrowl("Настройки модуля успешно обновлены (Ctrl+S)", { theme: "accept", life: 3000 });
} else {
$.jGrowl("Ошибка: " + data, { theme: "error", life: 5000 });
}
},
error: function () {
$.jGrowl("Ошибка связи с сервером", { theme: "error" });
},
complete: function() {
$("#apply_comment_settings").val("Применить").attr("disabled", false);
}
});
}
$(document).on("click", "#apply_comment_settings", function () {
saveCommentSettings();
return false;
});
$(document).keydown(function(e) {
if ((e.ctrlKey || e.metaKey) && e.which === 83) {
e.preventDefault();
saveCommentSettings();
return false;
}
});
});
</script>