update v3.32 (add module aliases)
This commit is contained in:
@@ -151,10 +151,15 @@
|
||||
|
||||
case 'alias_history_delete_batch':
|
||||
if (check_permission_acp('modules_system') && $_REQUEST['ajax']) {
|
||||
// Вызываем новый метод в классе
|
||||
$AVE_Module->deleteAliasHistoryBatch();
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'alias_delete_batch':
|
||||
if (check_permission_acp('modules_system')) {
|
||||
$AVE_Module->moduleAliasDeleteBatch();
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -12,30 +12,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="widget first">
|
||||
<div class="head">
|
||||
<h5 class="iPlus">Добавить новый редирект</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="Введите старый URL (например: old-page.html)" style="width: 96%;" />
|
||||
</td>
|
||||
<td width="100" align="center">
|
||||
<select id="new_alias_code" style="width: 80px;">
|
||||
<option value="301">301</option>
|
||||
<option value="302">302</option>
|
||||
</select>
|
||||
</td>
|
||||
<td width="50" align="center">
|
||||
<a href="javascript:void(0);" class="icon_sprite ico_add addHistoryRecord" title="Добавить"></a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="widget">
|
||||
<div class="head">
|
||||
<h5 class="iFrames">Активные редиректы</h5>
|
||||
@@ -72,22 +48,29 @@
|
||||
</tr>
|
||||
{foreachelse}
|
||||
<tr id="no-history-row">
|
||||
<td colspan="5" align="center" style="padding: 30px;">
|
||||
<span class="lred">История редиректов пуста</span>
|
||||
<td colspan="5" align="center">
|
||||
<ul class="messages">
|
||||
<li class="highlight yellow">История редиректов пуста</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="5" style="padding: 10px;">
|
||||
<table cellpadding="0" cellspacing="0" width="auto">
|
||||
<tr>
|
||||
<td style="padding-right: 10px;">
|
||||
<input type="submit" id="btn_save_history" class="basicBtn SaveHistoryBatch" value="Сохранить" style="float: none; {if !$history_list}display:none;{/if}" />
|
||||
<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}" />
|
||||
</td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="button redBtn CloseHistory" style="float: none; ">
|
||||
<td style=" border: none;">
|
||||
<a href="javascript:void(0);" class="button basicBtn CloseHistory" style="float: none; ">
|
||||
Закрыть окно
|
||||
</a>
|
||||
</td>
|
||||
@@ -100,6 +83,31 @@
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="widget first">
|
||||
<div class="head">
|
||||
<h5 class="iPlus">Добавить новый редирект</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%;" />
|
||||
</td>
|
||||
<td width="100" align="center">
|
||||
<select id="new_alias_code" style="width: 80px;">
|
||||
<option value="301">301</option>
|
||||
<option value="302">302</option>
|
||||
</select>
|
||||
</td>
|
||||
<td width="50" align="center">
|
||||
|
||||
<a href="javascript:void(0);" class="button greenBtn addHistoryRecord" >Добавить</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
@@ -108,6 +116,16 @@ $(function(){
|
||||
var $dialog = $('#ajax-dialog-alias-history-' + a_id);
|
||||
var $form = $('#HistoryForm-' + a_id);
|
||||
|
||||
// Инициализация стилей
|
||||
$(".mainForm").jqTransform();
|
||||
setTimeout(function() {
|
||||
$('#new_alias_code').styler({
|
||||
selectSmartPositioning: true,
|
||||
selectVisibleOptions: 5,
|
||||
selectSearch: false
|
||||
});
|
||||
}, 100);
|
||||
|
||||
function toggleHistoryVisibility() {
|
||||
var rowsCount = $('#history_items_container tr').not('#no-history-row, :hidden').length;
|
||||
var $thead = $('#history_thead');
|
||||
@@ -122,7 +140,7 @@ $(function(){
|
||||
$thead.hide();
|
||||
$btnSave.hide();
|
||||
if ($('#no-history-row').length == 0) {
|
||||
$tbody.append('<tr id="no-history-row"><td colspan="5" align="center" style="padding: 30px;"><span class="lred">История редиректов пуста</span></td></tr>');
|
||||
$tbody.append('<tr id="no-history-row"><td colspan="5" align="center"><ul class="messages"><li class="highlight yellow">История редиректов пуста</li></ul></td></tr>');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -132,12 +150,23 @@ $(function(){
|
||||
$dialog.dialog('destroy').remove();
|
||||
});
|
||||
|
||||
// ИСПРАВЛЕНО: Массовое выделение с поддержкой jqTransform
|
||||
$form.on('change', '.selall_history', function(){
|
||||
var checked = $(this).is(':checked');
|
||||
$form.find('.history_check').each(function(){
|
||||
var $checkboxes = $form.find('.history_check');
|
||||
|
||||
$checkboxes.each(function(){
|
||||
$(this).prop('checked', checked);
|
||||
if(checked) $(this).addClass('jqTransformChecked');
|
||||
else $(this).removeClass('jqTransformChecked');
|
||||
// Находим ссылку-обертку, которую создал jqTransform
|
||||
var $anchor = $(this).parent().find('a.jqTransformCheckbox');
|
||||
|
||||
if(checked) {
|
||||
$(this).addClass('jqTransformChecked');
|
||||
$anchor.addClass('jqTransformChecked');
|
||||
} else {
|
||||
$(this).removeClass('jqTransformChecked');
|
||||
$anchor.removeClass('jqTransformChecked');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -189,16 +218,20 @@ $(function(){
|
||||
$.jGrowl("Добавлено в историю", {theme: 'accept'});
|
||||
var $tbody = $('#history_items_container');
|
||||
|
||||
var newRow = '<tr id="history-row-' + data.id + '" style="display:none;">' +
|
||||
'<td 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 align="center"><span class="blue"><b>' + h_code + '</b></span></td>' +
|
||||
'<td align="center"><a href="/' + new_val + '" class="icon_sprite ico_globus" target="_blank"></a></td>' +
|
||||
'<td align="center"><a href="javascript:void(0);" class="icon_sprite ico_delete deleteHistory" data-id="' + data.id + '"></a></td>' +
|
||||
'</tr>';
|
||||
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>' +
|
||||
'</tr>';
|
||||
|
||||
$tbody.prepend(newRow);
|
||||
$('#history-row-' + data.id).fadeIn(400);
|
||||
var $rowObj = $(newRow);
|
||||
$tbody.prepend($rowObj);
|
||||
|
||||
$rowObj.jqTransform();
|
||||
|
||||
$rowObj.fadeIn(400);
|
||||
$input.val('');
|
||||
toggleHistoryVisibility();
|
||||
} else {
|
||||
|
||||
@@ -10,126 +10,134 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="widget first">
|
||||
<table cellpadding="0" cellspacing="0" width="100%" class="tableStatic mainForm">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Название ссылки</td>
|
||||
<td>Системное имя</td>
|
||||
<td>Action</td>
|
||||
<td>Оригинальный URL</td>
|
||||
<td>ЧПУ Алиас</td>
|
||||
<td>Документ (ID)</td>
|
||||
<td width="40" align="center">Меню</td>
|
||||
<td width="40" align="center">Док.</td>
|
||||
<td width="40" align="center">Сайт</td>
|
||||
<td width="40" align="center">История</td>
|
||||
<td width="40" align="center">Правка</td>
|
||||
<td width="40" align="center">Удалить</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach from=$modules_list item=mod}
|
||||
<tr>
|
||||
<td><strong>{$mod.module_link_name|default:$mod.title}</strong></td>
|
||||
<td><span class="cmsStats">{$mod.sys_name}</span></td>
|
||||
<td><span class="blue">{$mod.module_action|default:'---'}</span></td>
|
||||
<td><span class="dgrey" style="font-size: 11px;">{$mod.module_link|default:'---'}</span></td>
|
||||
<td>
|
||||
<input type="text" value="{$mod.alias_url}" style="width: 90%; font-family: monospace;" readonly />
|
||||
</td>
|
||||
<td>
|
||||
{if $mod.doc_id > 0}
|
||||
<span class="green" style="font-size: 11px;">
|
||||
{$all_docs[$mod.doc_id]|default:'Документ не найден'}
|
||||
<small class="dgrey">(ID: {$mod.doc_id})</small>
|
||||
</span>
|
||||
{else}
|
||||
<span class="dgrey">Без привязки</span>
|
||||
{/if}
|
||||
</td>
|
||||
<form action="index.php?do=modules&action=alias_delete_batch&cp={$sess}" method="post" id="AliasBatchForm" class="mainForm">
|
||||
<div class="widget first">
|
||||
<table cellpadding="0" cellspacing="0" width="100%" class="tableStatic">
|
||||
<thead>
|
||||
<tr>
|
||||
<td width="20"><div align="center"><input type="checkbox" class="selall_aliases"></div></td>
|
||||
<td>Название ссылки</td>
|
||||
<td>Системное имя</td>
|
||||
<td>Action</td>
|
||||
<td>Оригинальный URL</td>
|
||||
<td>ЧПУ Алиас</td>
|
||||
<td>Документ (ID)</td>
|
||||
<td width="40" align="center">Меню</td>
|
||||
<td width="40" align="center">Док.</td>
|
||||
<td width="40" align="center">Сайт</td>
|
||||
<td width="40" align="center">История</td>
|
||||
<td width="40" align="center">Правка</td>
|
||||
<td width="40" align="center">Удалить</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach from=$modules_list item=mod}
|
||||
<tr>
|
||||
<td align="center">
|
||||
<input type="checkbox" name="alias_ids[]" value="{$mod.id}" class="alias_check">
|
||||
</td>
|
||||
<td><strong>{$mod.module_link_name|default:$mod.title}</strong></td>
|
||||
<td><span class="cmsStats">{$mod.sys_name}</span></td>
|
||||
<td><span class="blue">{$mod.module_action|default:'---'}</span></td>
|
||||
<td><span class="dgrey" style="font-size: 11px;">{$mod.module_link|default:'---'}</span></td>
|
||||
<td>
|
||||
<input type="text" value="{$mod.alias_url}" style="width: 90%; font-family: monospace;" readonly />
|
||||
</td>
|
||||
<td>
|
||||
{if $mod.doc_id > 0}
|
||||
<span class="green" style="font-size: 11px;">
|
||||
{$all_docs[$mod.doc_id]|default:'Документ не найден'}
|
||||
<small class="dgrey">(ID: {$mod.doc_id})</small>
|
||||
</span>
|
||||
{else}
|
||||
<span class="dgrey">Без привязки</span>
|
||||
{/if}
|
||||
</td>
|
||||
|
||||
{* Переключатель меню *}
|
||||
<td align="center">
|
||||
{if $mod.module_admin == '1'}
|
||||
<span class="icon_sprite ico_navigation" title="В меню"></span>
|
||||
{else}
|
||||
<span class="icon_sprite ico_navigation_no" title="Скрыт"></span>
|
||||
{/if}
|
||||
</td>
|
||||
<td align="center">
|
||||
{if $mod.module_admin == '1'}
|
||||
<span class="icon_sprite ico_navigation" title="В меню"></span>
|
||||
{else}
|
||||
<span class="icon_sprite ico_navigation_no" title="Скрыт"></span>
|
||||
{/if}
|
||||
</td>
|
||||
|
||||
{* Иконка редактирования документа *}
|
||||
<td align="center">
|
||||
{if $mod.doc_id > 0 && $mod.rubric_id}
|
||||
<a class="topDir icon_sprite ico_copy"
|
||||
title="Перейти к редактированию документа"
|
||||
href="index.php?do=docs&action=edit&rubric_id={$mod.rubric_id}&Id={$mod.doc_id}&cp={$sess}"
|
||||
<td align="center">
|
||||
{if $mod.doc_id > 0 && $mod.rubric_id}
|
||||
<a class="topDir icon_sprite ico_copy"
|
||||
title="Перейти к редактированию документа"
|
||||
href="index.php?do=docs&action=edit&rubric_id={$mod.rubric_id}&Id={$mod.doc_id}&cp={$sess}"
|
||||
target="_blank"></a>
|
||||
{else}
|
||||
<span class="icon_sprite ico_copy" style="opacity: 0.2;" title="Привязка отсутствует"></span>
|
||||
{/if}
|
||||
</td>
|
||||
|
||||
<td align="center">
|
||||
<a href="../{$mod.alias_url}"
|
||||
title="Посмотреть на сайте"
|
||||
class="icon_sprite ico_globus topDir"
|
||||
target="_blank"></a>
|
||||
{else}
|
||||
<span class="icon_sprite ico_copy" style="opacity: 0.2;" title="Привязка отсутствует"></span>
|
||||
{/if}
|
||||
</td>
|
||||
</td>
|
||||
|
||||
{* Иконка перехода на сайт *}
|
||||
<td align="center">
|
||||
<a href="../{$mod.alias_url}"
|
||||
title="Посмотреть на сайте"
|
||||
class="icon_sprite ico_globus topDir"
|
||||
target="_blank"></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="index.php?do=modules&action=alias_history&id={$mod.id}&cp={$sess}&ajax=1&onlycontent=1"
|
||||
data-dialog="alias-history-{$mod.id}"
|
||||
data-height="650"
|
||||
data-modal="true"
|
||||
data-title="История алиасов: {$mod.module_link_name|default:$mod.sys_name}"
|
||||
class="openDialog icon_sprite ico_list topleftDir"
|
||||
title="История"></a>
|
||||
</td>
|
||||
|
||||
{* История *}
|
||||
<td align="center">
|
||||
<a href="index.php?do=modules&action=alias_history&id={$mod.id}&cp={$sess}&ajax=1&onlycontent=1"
|
||||
data-dialog="alias-history-{$mod.id}"
|
||||
data-height="650"
|
||||
data-width=""
|
||||
data-modal="true"
|
||||
data-title="История алиасов: {$mod.module_link_name|default:$mod.sys_name}"
|
||||
class="openDialog icon_sprite ico_list topleftDir"
|
||||
title="История"></a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="index.php?do=modules&action=aliases&id={$mod.id}&cp={$sess}&ajax=1&onlycontent=1"
|
||||
data-dialog="aliases-{$mod.id}"
|
||||
data-height="650"
|
||||
data-modal="true"
|
||||
data-title="Редактировать алиас: {$mod.module_link_name|default:$mod.title}"
|
||||
class="openDialog icon_sprite ico_edit topleftDir"
|
||||
title="Редактировать"></a>
|
||||
</td>
|
||||
|
||||
{* Правка *}
|
||||
<td align="center">
|
||||
<a href="index.php?do=modules&action=aliases&id={$mod.id}&cp={$sess}&ajax=1&onlycontent=1"
|
||||
data-dialog="aliases-{$mod.id}"
|
||||
data-height="650"
|
||||
data-width=""
|
||||
data-modal="true"
|
||||
data-title="Редактировать алиас: {$mod.module_link_name|default:$mod.title}"
|
||||
class="openDialog icon_sprite ico_edit topleftDir"
|
||||
title="Редактировать"></a>
|
||||
</td>
|
||||
|
||||
{* Удаление *}
|
||||
<td align="center">
|
||||
<a href="javascript:void(0);"
|
||||
class="icon_sprite ico_delete topleftDir"
|
||||
title="Удалить"
|
||||
onclick="jConfirm('Удалить алиас <strong>{$mod.alias_url}</strong>?', 'Подтверждение', function(r) {
|
||||
if(r) window.location.href='index.php?do=modules&action=alias_delete&id={$mod.id}&cp={$sess}';
|
||||
});"></a>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{if empty($modules_list)}
|
||||
<table cellpadding="0" cellspacing="0" width="100%" class="tableStatic">
|
||||
<tbody>
|
||||
<tr class="noborder">
|
||||
<td colspan="12">
|
||||
<ul class="messages">
|
||||
<li class="highlight yellow">Список ЧПУ алиасов пуст.</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{/if}
|
||||
</div>
|
||||
<td align="center">
|
||||
<a href="javascript:void(0);"
|
||||
class="icon_sprite ico_delete topleftDir"
|
||||
title="Удалить"
|
||||
onclick="jConfirm('Удалить алиас <strong>{$mod.alias_url}</strong>?', 'Подтверждение', function(r) {
|
||||
if(r) window.location.href='index.php?do=modules&action=alias_delete&id={$mod.id}&cp={$sess}';
|
||||
});"></a>
|
||||
</td>
|
||||
</tr>
|
||||
{foreachelse}
|
||||
<tr class="noborder">
|
||||
<td colspan="13" align="center">
|
||||
<ul class="messages">
|
||||
<li class="highlight yellow">Список ЧПУ алиасов пуст.</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
{if $modules_list}
|
||||
<thead>
|
||||
<tr>
|
||||
<td colspan="13"> </td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="13" style="padding: 10px;">
|
||||
<div class="formSubmit" style="margin: 0; padding: 0; float: left;">
|
||||
<input type="button" class="button redBtn deleteSelected" value="Удалить выбранные" style="float: left;">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
{/if}
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="fix" style="margin-top: 20px;">
|
||||
<a href="index.php?do=modules&cp={$sess}" class="button basicBtn">Вернуться к списку модулей</a>
|
||||
@@ -137,8 +145,44 @@
|
||||
<a href="index.php?do=modules&action=aliases&id=0&cp={$sess}&ajax=1&onlycontent=1"
|
||||
data-dialog="aliases-0"
|
||||
data-height="650"
|
||||
data-width=""
|
||||
data-modal="true"
|
||||
data-title="Добавить новый алиас"
|
||||
class="button basicBtn greenBtn openDialog">Добавить новый алиас</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
// Выделить все
|
||||
$('.selall_aliases').on('change', function() {
|
||||
var checked = $(this).is(':checked');
|
||||
$('.alias_check').prop('checked', checked);
|
||||
// Обновляем визуальные стили jqTransform если используется
|
||||
if ($.isFunction($.fn.jqTransform)) {
|
||||
if(checked) {
|
||||
$('.alias_check').parent().find('a').addClass('jqTransformChecked');
|
||||
} else {
|
||||
$('.alias_check').parent().find('a').removeClass('jqTransformChecked');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Массовое удаление
|
||||
$('.deleteSelected').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
var $checked = $('.alias_check:checked');
|
||||
|
||||
if ($checked.length === 0) {
|
||||
$.jGrowl("Ничего не выбрано!", {theme: 'error'});
|
||||
return false;
|
||||
}
|
||||
|
||||
jConfirm('Удалить выбранные алиасы (' + $checked.length + ' шт.)?', 'Подтверждение', function(r) {
|
||||
if (r) {
|
||||
$('#AliasBatchForm').submit();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/literal}
|
||||
@@ -51,10 +51,12 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Доступ в админке:</td>
|
||||
<td>
|
||||
<input type="checkbox" name="module_admin" value="1" {if ($alias_data.module_admin|default:'1') == '1'}checked="checked"{/if} />
|
||||
<label>Отображать в меню модулей</label>
|
||||
</td>
|
||||
<td style="vertical-align: middle;">
|
||||
<div style="display: flex; align-items: center; gap: 8px; min-height: 24px;">
|
||||
<input type="checkbox" name="module_admin" value="1" class="checkbox" {if $alias_id != 0 && ($alias_data.module_admin|default:'0') == '1'}checked="checked"{/if}} />
|
||||
<label style="margin: 0; cursor: pointer; white-space: nowrap; line-height: 1;">Отображать в меню модулей</label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="padding: 15px 10px;">
|
||||
@@ -71,6 +73,16 @@
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
var a_id = '{/literal}{$alias_id}{literal}';
|
||||
|
||||
$("#AliasForm").jqTransform();
|
||||
|
||||
setTimeout(function() {
|
||||
$('#AliasForm select').styler({
|
||||
selectSmartPositioning: true,
|
||||
selectVisibleOptions: 5,
|
||||
selectSearch: false
|
||||
});
|
||||
}, 100);
|
||||
|
||||
function closeAndReload() {
|
||||
$('#ajax-dialog-aliases-' + a_id).dialog('destroy').remove();
|
||||
|
||||
@@ -1076,5 +1076,38 @@ public function deleteAliasHistoryBatch()
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Метод для массового удаления основных ЧПУ записей
|
||||
*/
|
||||
public function moduleAliasDeleteBatch()
|
||||
{
|
||||
global $AVE_DB;
|
||||
|
||||
$alias_ids = $_POST['alias_ids'] ?? [];
|
||||
|
||||
if (!empty($alias_ids) && is_array($alias_ids)) {
|
||||
$clean_ids = array_map('intval', $alias_ids);
|
||||
$ids_string = implode(',', $clean_ids);
|
||||
|
||||
$m_names = [];
|
||||
$q = $AVE_DB->Query("SELECT DISTINCT module_name FROM " . PREFIX . "_modules_aliases WHERE id IN ({$ids_string})");
|
||||
while ($row = $q->FetchAssocArray()) {
|
||||
$m_names[] = "'" . addslashes($row['module_name']) . "'";
|
||||
}
|
||||
|
||||
if (!empty($m_names)) {
|
||||
$names_list = implode(',', $m_names);
|
||||
$AVE_DB->Query("DELETE FROM " . PREFIX . "_modules_aliases_history WHERE module_name IN ({$names_list})");
|
||||
}
|
||||
|
||||
$res = $AVE_DB->Query("DELETE FROM " . PREFIX . "_modules_aliases WHERE id IN ({$ids_string})");
|
||||
|
||||
if (function_exists('clear_cache')) clear_cache();
|
||||
}
|
||||
|
||||
header('Location: index.php?do=modules&action=aliases_all&cp=' . SESSION . '&msg=batch_deleted');
|
||||
exit;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user