Browse Source

Fixes

pull/3/head
M@d D3n 5 years ago
parent
commit
ee6fd31eed
  1. 230
      admin/templates/settings/settings_cache.tpl
  2. 146
      fields/doc_from_rub_all/field.php
  3. 5
      fields/doc_from_rub_all/lang/bg.txt
  4. 3
      fields/doc_from_rub_all/lang/cz.txt
  5. 3
      fields/doc_from_rub_all/lang/en.txt
  6. 3
      fields/doc_from_rub_all/lang/pl.txt
  7. 3
      fields/doc_from_rub_all/lang/ru.txt
  8. 3
      fields/doc_from_rub_all/lang/ua.txt
  9. 31
      fields/doc_from_rub_all/tpl/field-doc.tpl
  10. 31
      fields/doc_from_rub_all/tpl/field-req.tpl
  11. 15
      fields/doc_from_rub_all/tpl/field.tpl

230
admin/templates/settings/settings_cache.tpl

@ -0,0 +1,230 @@
<script type="text/javascript">
$sess = '{$sess}';
</script>
<div class="title">
<h5>{#SETTINGS_CACHE_TITLE#}</h5>
</div>
<div class="widget" style="margin-top: 0px;">
<div class="body">
{#SETTINGS_SAVE_INFO#}
</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=settings&cp={$sess}">{#SETTINGS_MAIN_TITLE#}</a></li>
<li>{#SETTINGS_CACHE_TITLE#}</li>
</ul>
</div>
</div>
<div class="widget first">
<div class="body">
{if check_permission('cache_clear')}<a class="button redBtn clearCacheSess" href="javascript:void(0);">{#MAIN_STAT_CLEAR_CACHE_FULL#}</a>&nbsp;{/if}
{if check_permission('cache_thumb')}<a class="button redBtn clearThumb" href="javascript:void(0);">{#MAIN_STAT_CLEAR_THUMB#}</a>&nbsp;{/if}
{if check_permission('document_revisions')}<a class="button redBtn clearRev" href="javascript:void(0);">{#MAIN_STAT_CLEAR_REV#}</a>&nbsp;{/if}
{if check_permission('gen_settings')}<a class="button redBtn clearCount" href="javascript:void(0);">{#MAIN_STAT_CLEAR_COUNT#}</a>&nbsp;{/if}
{if check_permission('gen_settings_robots')}<a data-dialog="robots" data-title="{#SETTINGS_FILE_ROBOTS#}" data-height="650" data-modal="true" class="button greenBtn openDialog" href="index.php?do=settings&action=robots&cp={$sess}">{#SETTINGS_FILE_ROBOTS#}</a>&nbsp;{/if}
{if check_permission('gen_settings_fcustom')}<a data-dialog="custom" data-title="{#SETTINGS_FILE_CUSTOM#}" data-height="650" data-modal="true" class="button greenBtn openDialog" href="index.php?do=settings&action=custom&cp={$sess}">{#SETTINGS_FILE_CUSTOM#}</a>{/if}
</div>
</div>
<div class="widget first">
<ul class="inact_tabs">
{if check_permission('gen_settings')}<li><a href="index.php?do=settings&cp={$sess}">{#SETTINGS_MAIN_SETTINGS#}</a></li>{/if}
{if check_permission('gen_settings_more')}<li><a href="index.php?do=settings&sub=case&cp={$sess}">{#SETTINGS_CASE_TITLE#}</a></li>{/if}
{if check_permission('gen_settings_countries')}<li><a href="index.php?do=settings&sub=countries&cp={$sess}">{#MAIN_COUNTRY_EDIT#}</a></li>{/if}
{if check_permission('gen_settings_languages')}<li><a href="index.php?do=settings&sub=language&cp={$sess}">{#SETTINGS_LANG_EDIT#}</a></li>{/if}
<li><a href="index.php?do=settings&action=paginations&cp={$sess}">{#SETTINGS_PAGINATION#}</a></li>
<li class="activeTab"><a href="index.php?do=settings&action=showcache&cp={$sess}">{#SETTINGS_SHOWCACHE#}</a></li>
</ul>
<table cellpadding="0" cellspacing="0" width="100%" class="tableStatic">
<col />
<col width="150" />
<col width="100" />
<thead>
<tr>
<td>{#SETTINGS_CACHE_H_TITLE#}</td>
<td>{#SETTINGS_CACHE_H_SHOW#}</td>
<td>{#SETTINGS_CACHE_CLEAR#}</td>
</tr>
</thead>
<tbody>
<tr>
<td>
Шаблоны Smarty
</td>
<td align="center">
<strong class="code" id="btn-smarty"><a href="javascript:void(0);" class="link btn-show" data-source="smarty">{#SETTINGS_CACHE_SHOW#}</a></strong>
</td>
<td align="center">
<a href="javascript:void(0);" class="btn redBtn btn-clear" data-source="smarty">{#SETTINGS_CACHE_CLEAR#}</a>
</td>
</tr>
<tr>
<td>
Данные документов
</td>
<td align="center">
<strong class="code" id="btn-documents"><a href="javascript:void(0);" class="link btn-show" data-source="documents">{#SETTINGS_CACHE_SHOW#}</a></strong>
</td>
<td align="center">
<a href="javascript:void(0);" class="btn redBtn btn-clear" data-source="documents">{#SETTINGS_CACHE_CLEAR#}</a>
</td>
</tr>
<tr>
<td>
Данные запросов
</td>
<td align="center">
<strong class="code" id="btn-requests"><a href="javascript:void(0);" class="link btn-show" data-source="requests">{#SETTINGS_CACHE_SHOW#}</a></strong>
</td>
<td align="center">
<a href="javascript:void(0);" class="btn redBtn btn-clear" data-source="requests">{#SETTINGS_CACHE_CLEAR#}</a>
</td>
</tr>
<tr>
<td>
Данные модулей
</td>
<td align="center">
<strong class="code" id="btn-modules"><a href="javascript:void(0);" class="link btn-show" data-source="modules">{#SETTINGS_CACHE_SHOW#}</a></strong>
</td>
<td align="center">
<a href="javascript:void(0);" class="btn redBtn btn-clear" data-source="modules">{#SETTINGS_CACHE_CLEAR#}</a>
</td>
</tr>
<tr>
<td>
Данные навигации
</td>
<td align="center">
<strong class="code" id="btn-navigations"><a href="javascript:void(0);" class="link btn-show" data-source="navigations">{#SETTINGS_CACHE_SHOW#}</a></strong>
</td>
<td align="center">
<a href="javascript:void(0);" class="btn redBtn btn-clear" data-source="navigations">{#SETTINGS_CACHE_CLEAR#}</a>
</td>
</tr>
<tr>
<td>
Данные рубрик
</td>
<td align="center">
<strong class="code" id="btn-rubrics"><a href="javascript:void(0);" class="link btn-show" data-source="rubrics">{#SETTINGS_CACHE_SHOW#}</a></strong>
</td>
<td align="center">
<a href="javascript:void(0);" class="btn redBtn btn-clear" data-source="rubrics">{#SETTINGS_CACHE_CLEAR#}</a>
</td>
</tr>
<tr>
<td>
Данные постраничной навигации
</td>
<td align="center">
<strong class="code" id="btn-paginations"><a href="javascript:void(0);" class="link btn-show" data-source="paginations">{#SETTINGS_CACHE_SHOW#}</a></strong>
</td>
<td align="center">
<a href="javascript:void(0);" class="btn redBtn btn-clear" data-source="paginations">{#SETTINGS_CACHE_CLEAR#}</a>
</td>
</tr>
<tr>
<td>
Данные сессий
</td>
<td align="center">
<strong class="code" id="btn-sessions"><a href="javascript:void(0);" class="link btn-show" data-source="sessions">{#SETTINGS_CACHE_SHOW#}</a></strong>
</td>
<td align="center">
<a href="javascript:void(0);" class="btn redBtn btn-clear" data-source="sessions">{#SETTINGS_CACHE_CLEAR#}</a>
</td>
</tr>
<tr>
<td>
Данные системных настроек
</td>
<td align="center">
<strong class="code" id="btn-settings"><a href="javascript:void(0);" class="link btn-show" data-source="settings">{#SETTINGS_CACHE_SHOW#}</a></strong>
</td>
<td align="center">
<a href="javascript:void(0);" class="btn redBtn btn-clear" data-source="settings">{#SETTINGS_CACHE_CLEAR#}</a>
</td>
</tr>
</tbody>
</table>
</div>
{literal}
<script language="javascript">
$(document).ready(function() {
$('.btn-show').on('click', function (){
var button = $(this);
var source = button.data('source');
$.ajax({
url: 'index.php?do=settings&action=showsize&cp=' + $sess,
data: {
source: source
},
dataType: 'JSON',
beforeSend: function() {
// Действие перед отправкой
$.alerts._overlay('show');
},
complete: function() {
// Действие по окнчанию
$.alerts._overlay('hide');
},
success: function (data) {
if (data) {
$('#btn-' + source).html(data['size']);
}
}
});
});
$('.btn-clear').on('click', function (){
var button = $(this);
var source = button.data('source');
$.ajax({
url: 'index.php?do=settings&action=cacheclear&cp=' + $sess,
data: {
source: source
},
dataType: 'JSON',
beforeSend: function() {
// Действие перед отправкой
$.alerts._overlay('show');
},
complete: function() {
// Действие по окнчанию
$.alerts._overlay('hide');
},
success: function (data) {
if (data) {
$.jGrowl(data.message, {header: data.header, theme: data.theme});
$('#btn-' + source).html(data['size']);
}
}
});
});
});
</script>
{/literal}

146
fields/doc_from_rub_all/field.php

@ -0,0 +1,146 @@
<?php
/**
* AVE.cms
*
* @package AVE.cms
* @version 3.x
* @filesource
* @copyright © 2007-2015 AVE.cms, http://www.ave-cms.ru
*
* @license GPL v.2
*/
// Документ из рубрики
function get_field_doc_from_rub_all($field_value, $action, $field_id=0, $tpl='', $tpl_empty=0, &$maxlength=null, $document_fields=array(), $rubric_id=0, $default=null, $_tpl=null)
{
global $AVE_DB, $AVE_Template;
$fld_dir = dirname(__FILE__) . '/';
$tpl_dir = $fld_dir . 'tpl/';
$lang_file = $fld_dir . 'lang/' . (defined('ACP') ? $_SESSION['admin_language'] : $_SESSION['user_language']) . '.txt';
$AVE_Template->config_load($lang_file, 'lang');
$AVE_Template->assign('config_vars', $AVE_Template->get_config_vars());
$AVE_Template->config_load($lang_file, 'admin');
$res = 0;
switch ($action)
{
case 'edit':
if (isset($default))
{
$sql = $AVE_DB->Query("
SELECT
Id, document_parent, document_title
FROM
". PREFIX ."_documents
WHERE
rubric_id IN (" . $default . ")
ORDER BY
document_title DESC
");
$cats = [];
while ($cat = $sql->FetchAssocArray())
array_push($cats, $cat);
$AVE_Template->assign('fields', $cats);
$AVE_Template->assign('field_id', $field_id);
$AVE_Template->assign('doc_id', (isset($_REQUEST['Id']) ? (int)$_REQUEST['Id'] : 0));
$AVE_Template->assign('field_value', $field_value);
}
else
{
$AVE_Template->assign('error', $AVE_Template->get_config_vars('error'));
}
$tpl_file = get_field_tpl($tpl_dir, $field_id, 'admin', $_tpl);
return $AVE_Template->fetch($tpl_file);
break;
case 'doc':
$document = get_document($field_value);
if ($tpl_empty)
{
$field_value = $document['document_title'];
$field_value = clean_php($field_value);
$field_value = stripcslashes($field_value);
$field_value = htmlspecialchars_decode($field_value);
}
else
{
$field_param = explode('|', $field_value);
$field_value = preg_replace_callback(
'/\[tag:parametr:(\d+)\]/i',
function($data) use($field_param)
{
return $field_param[(int)$data[1]];
},
$tpl
);
}
$tpl_file = get_field_tpl($tpl_dir, $field_id, 'doc', $_tpl);
if ($tpl_empty && $tpl_file)
{
$AVE_Template->assign('field_id', $field_id);
$AVE_Template->assign('field_value', $field_value);
$AVE_Template->assign('document', $document);
return $AVE_Template->fetch($tpl_file);
}
$res = $field_value;
break;
case 'req':
$document = get_document($field_value);
if ($tpl_empty)
{
$field_value = $document['document_title'];
$field_value = clean_php($field_value);
$field_value = stripcslashes($field_value);
$field_value = htmlspecialchars_decode($field_value);
}
else
{
$field_param = explode('|', $field_value);
$field_value = preg_replace_callback(
'/\[tag:parametr:(\d+)\]/i',
function($data) use($field_param)
{
return $field_param[(int)$data[1]];
},
$tpl
);
}
$tpl_file = get_field_tpl($tpl_dir, $field_id, 'req', $_tpl);
if ($tpl_empty && $tpl_file)
{
$AVE_Template->assign('field_id', $field_id);
$AVE_Template->assign('field_value', $field_value);
$AVE_Template->assign('document', $document);
return $AVE_Template->fetch($tpl_file);
}
$res = $field_value;
break;
case 'name':
return $AVE_Template->get_config_vars('name');
break;
}
return ($res ? $res : $field_value);
}
?>

5
fields/doc_from_rub_all/lang/bg.txt

@ -0,0 +1,5 @@
[admin]
name = "Документ от рубрика"
error = "Не е зададена рубрика"

3
fields/doc_from_rub_all/lang/cz.txt

@ -0,0 +1,3 @@
[admin]
name = "Dokument z rubriky"
error = "Rubrika nazadaná"

3
fields/doc_from_rub_all/lang/en.txt

@ -0,0 +1,3 @@
[admin]
name = "Document from rubric"
error = "Not specified category"

3
fields/doc_from_rub_all/lang/pl.txt

@ -0,0 +1,3 @@
[admin]
name = "Dokument z rubryki"
error = "Nie wybrano rubryki"

3
fields/doc_from_rub_all/lang/ru.txt

@ -0,0 +1,3 @@
[admin]
name = "Документ из рубрики (Все)"
error = "Не задана рубрика"

3
fields/doc_from_rub_all/lang/ua.txt

@ -0,0 +1,3 @@
[admin]
name = "Документ з рубрики"
error = "Не задано рубрику"

31
fields/doc_from_rub_all/tpl/field-doc.tpl

@ -0,0 +1,31 @@
{*
Доступные параметры:
-----------------------------------------------------------
Id ID Документа
rubric_id ID Рубрики
document_parent ID Документа «родителя»
document_alias Алиас документа
document_title Заголовок документа
document_breadcrum_title Заголовок документа для «хлебных крошек»
document_published Начало публикации
document_expire Окончание публикации
document_changed Дата последнего изменения
document_author_id ID автора документа
document_in_search Учавствует в поиске (0|1)
document_meta_keywords Ключевые слова
document_meta_description Описание документа
document_meta_robots Индексация
document_status Документ опубликован (Статус) (0|1)
document_deleted Документ удален (0|1)
document_count_view Кол-во просмотров
document_linked_navi_id ID пункта меню,с которым связан документ
document_lang Язык документа
document_lang_group Языковая группа документа
Пример вывода:
-----------------------------------------------------------
<a href="{$ABS_PATH}{$document.document_alias}">{$document.document_title}</a> Просмотров: {$document.document_count_view}
*}
{$document.document_title|stripcslashes}

31
fields/doc_from_rub_all/tpl/field-req.tpl

@ -0,0 +1,31 @@
{*
Доступные параметры:
-----------------------------------------------------------
Id ID Документа
rubric_id ID Рубрики
document_parent ID Документа «родителя»
document_alias Алиас документа
document_title Заголовок документа
document_breadcrum_title Заголовок документа для «хлебных крошек»
document_published Начало публикации
document_expire Окончание публикации
document_changed Дата последнего изменения
document_author_id ID автора документа
document_in_search Учавствует в поиске (0|1)
document_meta_keywords Ключевые слова
document_meta_description Описание документа
document_meta_robots Индексация
document_status Документ опубликован (Статус) (0|1)
document_deleted Документ удален (0|1)
document_count_view Кол-во просмотров
document_linked_navi_id ID пункта меню,с которым связан документ
document_lang Язык документа
document_lang_group Языковая группа документа
Пример вывода:
-----------------------------------------------------------
<a href="{$ABS_PATH}{$document.document_alias}">{$document.document_title}</a> Просмотров: {$document.document_count_view}
*}
{$document.document_title|stripcslashes}

15
fields/doc_from_rub_all/tpl/field.tpl

@ -0,0 +1,15 @@
{if $fields && !isset($error)}
<select id="feld_{$field_id}_{$doc_id}" name="feld[{$field_id}]">
{foreach from=$fields key=key item=field name=field}
<option value="{$field.Id}" {if $field.Id == $field_value}selected="selected"{/if}>{$field.document_title}</option>
{/foreach}
</select>
{else}
<ul class="messages">
<li class="highlight yellow">{#error#}</li>
</ul>
{/if}
Loading…
Cancel
Save