345 lines
20 KiB
Smarty
345 lines
20 KiB
Smarty
<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&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>
|
|
<td colspan="4" style="background: #f9f9f9; font-weight: bold; text-align: center;">{#COMMENT_SET_TAG_TITEL#}</td>
|
|
</tr>
|
|
<tr class="noborder">
|
|
<td>{#COMMENT_SET_MAIN_TAG#}</td>
|
|
<td>
|
|
<input id="main_tag" type="text" value="[mod_comment]" readonly size="15" style="width: 94px;" />
|
|
<a style="text-align: center; padding: 5px 3px 4px 3px;" class="whiteBtn copyBtn topDir" href="javascript:void(0);" data-clipboard-action="copy" data-clipboard-target="#main_tag" title="{#COMMENT_SET_COPY#}">
|
|
<img style="margin-top: -3px; position: relative; top: 4px; padding: 0 3px;" class="clippy" src="{$ABS_PATH}admin/templates/images/clippy.svg" width="13"></a>
|
|
</td>
|
|
<td>{#COMMENT_SET_ADDIT_TAG#}</td>
|
|
<td>
|
|
<div class="pr12" style="display: table;">
|
|
<input id="addit_tag" type="text" value="[mod_comment:X]" readonly size="20" style="width: 104px;" />
|
|
<a style="text-align: center; padding: 5px 3px 4px 3px;" class="whiteBtn copyBtn topDir" href="javascript:void(0);" data-clipboard-action="copy" data-clipboard-target="#addit_tag" title="{#COMMENT_SET_COPY#}">
|
|
<img style="margin-top: -3px; position: relative; top: 4px; padding: 0 3px;" class="clippy" src="{$ABS_PATH}admin/templates/images/clippy.svg" width="13"></a>
|
|
<span style="color: #888; font-size: 11px; margin-left: 5px;">{#COMMENT_SET_ADDIT_TAG_NUM#}</span>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="4" style="background: #f9f9f9; font-weight: bold; text-align: center;">{#COMMENT_SET_GEN#}</td>
|
|
</tr>
|
|
<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>{#COMMENT_USE_ANSWER_ALL#}</td>
|
|
<td style="border-right: 1px solid #ddd;">
|
|
<div style="display: flex; align-items: center;">
|
|
<input name="comment_allow_self_answer" type="checkbox" value="1" {if $comment_allow_self_answer=='1'}checked{/if} style="margin-right: 10px; width: auto; cursor: pointer;" />
|
|
<span style="color: #888; font-size: 11px; margin-left: 5px;">{#COMMENT_USE_ANSWER_ALL_A#}</span>
|
|
</div>
|
|
</td>
|
|
<td>{#COMMENT_SORT#}</td>
|
|
<td>
|
|
<select name="comment_sort_order" style="width: 180px; padding: 2px;">
|
|
<option value="ASC" {if $comment_sort_order == 'ASC'}selected{/if}>{#COMMENT_SORT_ASC#}</option>
|
|
<option value="DESC" {if $comment_sort_order == 'DESC'}selected{/if}>{#COMMENT_SORT_DESC#}</option>
|
|
<option value="RATING" {if $comment_sort_order == 'RATING'}selected{/if}>{#COMMENT_SORT_RATING#}</option>
|
|
<option value="USER_RATING" {if $comment_sort_order == 'USER_RATING'}selected{/if}>{#COMMENT_SORT_AUTOR_STARS#}</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td colspan="4" style="background: #f9f9f9; font-weight: bold; text-align: center;">{#COMMENT_USE_PAGE_TITEL#}</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;" />
|
|
<span style="color: #888; font-size: 11px; margin-left: 5px;">{#COMMENT_USE_PAGE_NO_LIMIT#}</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>{#COMMENT_USE_PAGE_ANSWER#}</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;">{#COMMENT_USE_PAGE_NO_LIMIT#}</span>
|
|
</td>
|
|
<td></td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td colspan="4" style="background: #f9f9f9; font-weight: bold; text-align: center;">{#COMMENT_SAFE_LIMIT_TITEL#}</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>{#COMMENT_SAFE_LIMIT_TIME_EDIT#}</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;">{#COMMENT_SAFE_LIMIT_TIME_EDIT_SEC#}</span>
|
|
</td>
|
|
<td>{#COMMENT_TIME_COOKIE_ANONIM#}</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;">{#COMMENT_TIME_COOKIE_ANONIM_DAY#}</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;">{#COMMENT_ADD_FIELD_1#}</td>
|
|
<td colspan="2" style="background: #f9f9f9; font-weight: bold; text-align: center;">{#COMMENT_ADD_FIELD_2#}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>{#COMMENT_TITEL_FIELD_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} />{#COMMENT_FIELD_SHOW#}</label>
|
|
|
|
<label><input name="comment_req_f1" type="checkbox" value="1" {if $comment_req_f1=='1'}checked{/if} />{#COMMENT_FIELD_REQUIRED#}</label>
|
|
</div>
|
|
</td>
|
|
<td>{#COMMENT_TITEL_FIELD_1#}</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} />{#COMMENT_FIELD_SHOW#}</label>
|
|
|
|
<label><input name="comment_req_f2" type="checkbox" value="1" {if $comment_req_f2=='1'}checked{/if} />{#COMMENT_FIELD_REQUIRED#}</label>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td colspan="4" style="background: #f9f9f9; font-weight: bold; text-align: center;">{#COMMENT_SET_OVER_RATING_TITEL#}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>{#COMMENT_OVER_RATING_TYPE#}</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;">{#COMMENT_OVER_RATING_STAR#}</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;">{#COMMENT_OVER_RATING_LIKE#}</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;">{#COMMENT_OVER_RATING_OFF#}</label>
|
|
</span>
|
|
</div>
|
|
</td>
|
|
<td>{#COMMENT_VOTING_RIGHTS#}</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;" />
|
|
{#COMMENT_VOTING_RIGHTS_ANONIM#}
|
|
</label>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td colspan="4" style="background: #f9f9f9; font-weight: bold; text-align: center;">{#COMMENT_SET_AVTOR_RATING_TITEL#}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>{#COMMENT_SET_AVTOR_ASSESS#}</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;" />
|
|
{#COMMENT_SET_AVTOR_ON#}
|
|
</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;" />
|
|
Использовать в ответах
|
|
</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;" />
|
|
{#COMMENT_AVTOR_RIGHTS_ANONIM#}
|
|
</label>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td colspan="4" style="background: #f9f9f9; font-weight: bold; text-align: center;">{#COMMENT_FILES_TITEL#}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>{#COMMENT_FILES_ON#}</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;" />
|
|
{#COMMENT_FILES_ON_CHEK#}
|
|
</label>
|
|
</td>
|
|
<td>{#COMMENT_FILES_RIGHTS#}</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;" />
|
|
{#COMMENT_FILES_RIGHTS_ANONIM#}
|
|
</label>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>{#COMMENT_FILES_ALLOWED_EXT#}</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, webp" />
|
|
</td>
|
|
<td>{#COMMENT_FILES_MAX_SIZE#}</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>{#COMMENT_FILES_MAX_COUNT#}</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;">{#COMMENT_FILES_MAX_COUNT_TEXT#}</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="{#COMMENT_BUTTON_APPLY#}" 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;">{#COMMENT_BUTTON_CANCEL#}</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("{#COMMENT_SETTING_SAVE#}").attr("disabled", true);
|
|
},
|
|
success: function (data) {
|
|
if (data.trim() === "success") {
|
|
$.jGrowl("{#COMMENT_SETTING_APPLY#} (Ctrl+S)", { theme: "accept", life: 3000 });
|
|
} else {
|
|
$.jGrowl("Ошибка: " + data, { theme: "error", life: 5000 });
|
|
}
|
|
},
|
|
error: function () {
|
|
$.jGrowl("{#COMMENT_SETTING_ERROR#}", { theme: "error" });
|
|
},
|
|
complete: function() {
|
|
$("#apply_comment_settings").val("{#COMMENT_BUTTON_APPLY#}").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;
|
|
}
|
|
});
|
|
var clipboard = new Clipboard('.copyBtn');
|
|
});
|
|
</script> |