update v3.32 (add module aliases)

This commit is contained in:
2026-04-20 23:32:12 +05:00
parent 66df2dac7d
commit 6113f0e86d
4 changed files with 64 additions and 41 deletions

View File

@@ -35,6 +35,33 @@ MODULES_ACTION_UPDATE = "Обновил модуль"
MODULES_ACTION_DELETE = "Удалил модуль из системы"
MODULES_ACTION_REMOVE = "Удалил модуль с сервера"
MODULES_ERR_DUPLICATE_URL = "ВНИМАНИЕ: Данный ЧПУ адрес уже используется другим модулем!"
MODULES_ERR_DUPLICATE_URL = "ВНИМАНИЕ: Данный ЧПУ адрес уже используется другим модулем!"
MODULES_ERR_DUPLICATE_LINK = "ОШИБКА: Для этой оригинальной ссылки уже создан алиас. Дубликаты запрещены!"
MODULES_ERR_SAVE_FAILED = "Не удалось сохранить данные из-за ошибки в базе данных."
MODULES_ERR_SAVE_FAILED = "Не удалось сохранить данные из-за ошибки в базе данных."
MODULES_EDIT_ALIAS = "Редактирование алиасов"
MODULES_REDIRECT = "Управление редиректами › "
MODULES_MODULE_HIS = "Модуль:"
MODULES_SYSLINK_HIS = "Системная ссылка:"
MODULES_MAIN_ALIASE_HIS = "Основной алиас:"
MODULES_REDIRECT_ACTIV_HIS = "Список редиректов"
MODULES_LIST_ALIAS_HIS = "Алиас редиректа"
MODULES_NAME_LINK_HIS = "ссылка"
MODULES_HTTP_CODE_HIS = "HTTP Код"
MODULES_ACTIONS_HIS = "Действия"
MODULES_GO_LINK_HIS = "Перейти по ссылке"
MODULES_DEL_LINK_HIS = "Удалить"
MODULES_REDIRECT_NO_HIS = "История редиректов пуста"
MODULES_BTN_DEL_HIS = "Удалить выбранные"
MODULES_BTN_ADD_HIS = "Добавить"
MODULES_BTN_CLOSE_WIN_HIS = "Закрыть окно"
MODULES_ADD_NEW_REDIR_HIS = "Добавить новый редирект"
MODULES_PLC_NEW_REDIR_HIS = "Введите новый алиас (например: new-alias/)"
MODULES_MES_NO_SELECT_HIS = "Ничего не выбрано"
MODULES_MES_DEL_SELECT_HIS = "Удалить выбранные редиректы?"
MODULES_MES_DEL_CONFRM_HIS = "Подтверждение"
MODULES_MES_DEL_OK = "Записи удалены"
MODULES_MES_INS_ADR = "Введите адрес!"
MODULES_MES_ADD_HIS = "Добавлено в историю"
MODULES_MES_ERR_SAVE_HIS = "Ошибка сохранения"
MODULES_MES_DEL_SEL_HIS = "Удалить этот редирект?"
MODULES_MES_DEL_ONE_OK = "Запись удалена"

View File

@@ -1,20 +1,20 @@
<div class="title">
<h5>Управление редиректами модуля: <span class="blue">{$module_link_name}</span></h5>
<h5>{#MODULES_REDIRECT#} {$module_link_name}</h5>
</div>
<div class="breadCrumbHolder module">
<div class="breadCrumb module">
<ul>
<li>Модуль: <strong class="code">{$module_name}</strong></li>
<li>Системная ссылка: <strong class="code">{$module_link}</strong></li>
<li>Основной алиас: <strong class="code">{$module_url}</strong></li>
<li>{#MODULES_MODULE_HIS#} <strong class="code">{$module_name}</strong></li>
<li>{#MODULES_SYSLINK_HIS#} <strong class="code">{$module_link}</strong></li>
<li>{#MODULES_MAIN_ALIASE_HIS#} <strong class="code">{$module_url}</strong></li>
</ul>
</div>
</div>
<div class="widget">
<div class="head">
<h5 class="iFrames">Активные редиректы</h5>
<h5 class="iFrames">{#MODULES_REDIRECT_ACTIV_HIS#}</h5>
</div>
<form action="index.php?do=modules&action=alias_history_save&cp={$sess}" method="post" class="mainForm" id="HistoryForm-{$alias_id}">
@@ -23,9 +23,9 @@
<thead id="history_thead" {if !$history_list}style="display:none;"{/if}>
<tr>
<td width="20"><div align="center"><input type="checkbox" class="selall_history"></div></td>
<td style="padding-left: 10px;">Старый URL (Алиас)</td>
<td width="80" align="center">HTTP Код</td>
<td width="80" colspan="2" align="center">Действия</td>
<td style="padding-left: 10px;">{#MODULES_LIST_ALIAS_HIS#}</td>
<td width="80" align="center">{#MODULES_HTTP_CODE_HIS#}</td>
<td width="80" colspan="2" align="center">{#MODULES_ACTIONS_HIS#}</td>
</tr>
</thead>
<tbody id="history_items_container">
@@ -37,20 +37,20 @@
<td style="padding-left: 10px;"><span class="dgrey">{$h.module_alias}</span></td>
<td align="center"><span class="blue"><b>{$h.module_alias_header}</b></span></td>
<td width="30" align="center">
<a href="/{$h.module_alias}" class="icon_sprite ico_globus" target="_blank" title="Просмотр"></a>
<a href="/{$h.module_alias}" class="icon_sprite ico_globus topDir" target="_blank" title="{#MODULES_GO_LINK_HIS#}"></a>
</td>
<td width="30" align="center">
<a href="javascript:void(0);"
class="icon_sprite ico_delete deleteHistory"
class="topDir icon_sprite ico_delete deleteHistory"
data-id="{$h.id}"
title="Удалить"></a>
title="{#MODULES_DEL_LINK_HIS#}"></a>
</td>
</tr>
{foreachelse}
<tr id="no-history-row">
<td colspan="5" align="center">
<ul class="messages">
<li class="highlight yellow">История редиректов пуста</li>
<li class="highlight yellow">{#MODULES_REDIRECT_NO_HIS#}</li>
</ul>
</td>
</tr>
@@ -67,11 +67,11 @@
<table cellpadding="0" cellspacing="0" width="auto">
<tr style=" border: none;">
<td style="padding-right: 10px; border: none;">
<input type="submit" id="btn_save_history" class="redBtn SaveHistoryBatch" value="Удалить выбранные" style="float: none; {if !$history_list}display:none;{/if}" />
<input type="submit" id="btn_save_history" class="redBtn SaveHistoryBatch" value="{#MODULES_BTN_DEL_HIS#}" style="float: none; {if !$history_list}display:none;{/if}" />
</td>
<td style=" border: none;">
<a href="javascript:void(0);" class="button basicBtn CloseHistory" style="float: none; ">
Закрыть окно
{#MODULES_BTN_CLOSE_WIN_HIS#}
</a>
</td>
</tr>
@@ -85,13 +85,13 @@
<div class="widget first">
<div class="head">
<h5 class="iPlus">Добавить новый редирект</h5>
<h5 class="iPlus">{#MODULES_ADD_NEW_REDIR_HIS#}</h5>
</div>
<table cellpadding="0" cellspacing="0" width="100%" class="tableStatic mainForm">
<tbody>
<tr style="background: #f9f9f9;">
<td style="padding: 15px;">
<input type="text" id="new_alias_input" placeholder="Введите новый алиас (например: new-alias/)" style="width: 96%;" />
<input type="text" id="new_alias_input" placeholder="{#MODULES_PLC_NEW_REDIR_HIS#}" style="width: 96%;" />
</td>
<td width="100" align="center">
<select id="new_alias_code" style="width: 80px;">
@@ -100,8 +100,7 @@
</select>
</td>
<td width="50" align="center">
<a href="javascript:void(0);" class="button greenBtn addHistoryRecord" >Добавить</a>
<a href="javascript:void(0);" class="button greenBtn addHistoryRecord" >{#MODULES_BTN_ADD_HIS#}</a>
</td>
</tr>
</tbody>
@@ -140,7 +139,7 @@ $(function(){
$thead.hide();
$btnSave.hide();
if ($('#no-history-row').length == 0) {
$tbody.append('<tr id="no-history-row"><td colspan="5" align="center"><ul class="messages"><li class="highlight yellow">История редиректов пуста</li></ul></td></tr>');
$tbody.append('<tr id="no-history-row"><td colspan="5" align="center"><ul class="messages"><li class="highlight yellow">{/literal}{#MODULES_REDIRECT_NO_HIS#}{literal}</li></ul></td></tr>');
}
}
}
@@ -150,14 +149,13 @@ $(function(){
$dialog.dialog('destroy').remove();
});
// ИСПРАВЛЕНО: Массовое выделение с поддержкой jqTransform
$form.on('change', '.selall_history', function(){
var checked = $(this).is(':checked');
var $checkboxes = $form.find('.history_check');
$checkboxes.each(function(){
$(this).prop('checked', checked);
// Находим ссылку-обертку, которую создал jqTransform
var $anchor = $(this).parent().find('a.jqTransformCheckbox');
if(checked) {
@@ -174,18 +172,18 @@ $(function(){
e.preventDefault();
var $checked = $form.find('.history_check:checked');
if($checked.length == 0) {
$.jGrowl("Ничего не выбрано", {theme: 'error'});
$.jGrowl("{/literal}{#MODULES_MES_NO_SELECT_HIS#}{literal}", {theme: 'error'});
return false;
}
jConfirm('Удалить выбранные редиректы?', 'Подтверждение', function(r) {
jConfirm('{/literal}{#MODULES_MES_DEL_SELECT_HIS#}{literal}', '{/literal}{#MODULES_MES_DEL_CONFRM_HIS#}{literal}', function(r) {
if(r) {
$form.ajaxSubmit({
url: 'index.php?do=modules&action=alias_history_delete_batch&ajax=1&cp=' + sess,
dataType: 'json',
success: function(data){
if(data.status == 'success') {
$.jGrowl("Записи удалены", {theme: 'accept'});
$.jGrowl("{/literal}{#MODULES_MES_DEL_OK#}{literal}", {theme: 'accept'});
$checked.closest('tr').fadeOut(400, function(){
$(this).remove();
toggleHistoryVisibility();
@@ -204,7 +202,7 @@ $(function(){
var h_code = $dialog.find('#new_alias_code').val();
if (new_val == '') {
$.jGrowl("Введите адрес!", {theme: 'error'});
$.jGrowl("{/literal}{#MODULES_MES_INS_ADR#}{literal}", {theme: 'error'});
return false;
}
@@ -215,15 +213,15 @@ $(function(){
cp: sess
}, function(data) {
if (data && data.status == 'success') {
$.jGrowl("Добавлено в историю", {theme: 'accept'});
$.jGrowl("{/literal}{#MODULES_MES_ADD_HIS#}{literal}", {theme: 'accept'});
var $tbody = $('#history_items_container');
var newRow = '<tr id="history-row-' + data.id + '" style="display:none;">' +
'<td width="20" align="center"><input type="checkbox" class="checkbox history_check" name="history_del['+data.id+']" value="1"></td>' +
'<td style="padding-left: 10px;"><span class="dgrey">' + new_val + '</span></td>' +
'<td width="80" align="center"><span class="blue"><b>' + h_code + '</b></span></td>' +
'<td width="30" align="center"><a href="/' + new_val + '" class="icon_sprite ico_globus" target="_blank"></a></td>' +
'<td width="30" align="center"><a href="javascript:void(0);" class="icon_sprite ico_delete deleteHistory" data-id="' + data.id + '"></a></td>' +
'<td width="30" align="center"><a href="/' + new_val + '" class="icon_sprite ico_globus topDir" title="{/literal}{#MODULES_GO_LINK_HIS#}{literal}" target="_blank"></a></td>' +
'<td width="30" align="center"><a href="javascript:void(0);" class="topDir icon_sprite ico_delete deleteHistory" title="{/literal}{#MODULES_DEL_LINK_HIS#}{literal}" data-id="' + data.id + '"></a></td>' +
'</tr>';
var $rowObj = $(newRow);
@@ -235,7 +233,7 @@ $(function(){
$input.val('');
toggleHistoryVisibility();
} else {
$.jGrowl(data.message || "Ошибка сохранения", {theme: 'error'});
$.jGrowl(data.message || "{/literal}{#MODULES_MES_ERR_SAVE_HIS#}{literal}", {theme: 'error'});
}
}, 'json');
});
@@ -244,7 +242,7 @@ $(function(){
var h_id = $(this).data('id');
var $row = $('#history-row-' + h_id);
jConfirm('Удалить этот редирект?', 'Подтверждение', function(r) {
jConfirm('{/literal}{#MODULES_MES_DEL_SEL_HIS#}{literal}', '{/literal}{#MODULES_MES_DEL_CONFRM_HIS#}{literal}', function(r) {
if(r) {
$.post('index.php?do=modules&action=alias_history_delete&ajax=1', { id: h_id, cp: sess }, function(data){
if(data && data.status == 'success') {
@@ -252,7 +250,7 @@ $(function(){
$(this).remove();
toggleHistoryVisibility();
});
$.jGrowl("Запись удалена", {theme: "accept"});
$.jGrowl("{/literal}{#MODULES_MES_DEL_ONE_OK#}{literal}", {theme: "accept"});
}
}, 'json');
}

View File

@@ -85,7 +85,7 @@
data-dialog="alias-history-{$mod.id}"
data-height="650"
data-modal="true"
data-title="История алиасов: {$mod.module_link_name|default:$mod.sys_name}"
data-title="История алиасов модуля {$mod.sys_name}"
class="openDialog icon_sprite ico_list topleftDir"
title="История"></a>
</td>

View File

@@ -50,7 +50,7 @@ $(document).ready(function(){ldelim}
<div class="widget first">
<div class="num">
<a class="basicNum topDir" href="index.php?do=modules&action=aliases_all&cp={$sess}">Редактирование алиасов</a>
<a class="basicNum topDir" href="index.php?do=modules&action=aliases_all&cp={$sess}">{#MODULES_EDIT_ALIAS#}</a>
</div>
<ul class="tabs">
<li class="activeTab"><a href="#tab1">{#MODULES_INSTALLED#}</a></li>
@@ -229,9 +229,7 @@ $(document).ready(function(){ldelim}
</tbody>
</table>
{/if}
</div>
</div>
<div class="fix"></div>
</div>
</div>
</div>
<div class="fix"></div>
</div>