From ee6fd31eed1cb8931bab114df1fc0ca9c40452e2 Mon Sep 17 00:00:00 2001 From: "M@d D3n" Date: Thu, 7 May 2020 10:16:27 +0300 Subject: [PATCH] Fixes --- admin/templates/settings/settings_cache.tpl | 230 ++++++++++++++++++++ fields/doc_from_rub_all/field.php | 146 +++++++++++++ fields/doc_from_rub_all/lang/bg.txt | 5 + fields/doc_from_rub_all/lang/cz.txt | 3 + fields/doc_from_rub_all/lang/en.txt | 3 + fields/doc_from_rub_all/lang/pl.txt | 3 + fields/doc_from_rub_all/lang/ru.txt | 3 + fields/doc_from_rub_all/lang/ua.txt | 3 + fields/doc_from_rub_all/tpl/field-doc.tpl | 31 +++ fields/doc_from_rub_all/tpl/field-req.tpl | 31 +++ fields/doc_from_rub_all/tpl/field.tpl | 15 ++ 11 files changed, 473 insertions(+) create mode 100644 admin/templates/settings/settings_cache.tpl create mode 100644 fields/doc_from_rub_all/field.php create mode 100644 fields/doc_from_rub_all/lang/bg.txt create mode 100644 fields/doc_from_rub_all/lang/cz.txt create mode 100644 fields/doc_from_rub_all/lang/en.txt create mode 100644 fields/doc_from_rub_all/lang/pl.txt create mode 100644 fields/doc_from_rub_all/lang/ru.txt create mode 100644 fields/doc_from_rub_all/lang/ua.txt create mode 100644 fields/doc_from_rub_all/tpl/field-doc.tpl create mode 100644 fields/doc_from_rub_all/tpl/field-req.tpl create mode 100644 fields/doc_from_rub_all/tpl/field.tpl diff --git a/admin/templates/settings/settings_cache.tpl b/admin/templates/settings/settings_cache.tpl new file mode 100644 index 0000000..a383247 --- /dev/null +++ b/admin/templates/settings/settings_cache.tpl @@ -0,0 +1,230 @@ + + +
+
{#SETTINGS_CACHE_TITLE#}
+
+ +
+
+ {#SETTINGS_SAVE_INFO#} +
+
+ + + +
+
+ {if check_permission('cache_clear')}{#MAIN_STAT_CLEAR_CACHE_FULL#} {/if} + {if check_permission('cache_thumb')}{#MAIN_STAT_CLEAR_THUMB#} {/if} + {if check_permission('document_revisions')}{#MAIN_STAT_CLEAR_REV#} {/if} + {if check_permission('gen_settings')}{#MAIN_STAT_CLEAR_COUNT#} {/if} + {if check_permission('gen_settings_robots')}{#SETTINGS_FILE_ROBOTS#} {/if} + {if check_permission('gen_settings_fcustom')}{#SETTINGS_FILE_CUSTOM#}{/if} +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{#SETTINGS_CACHE_H_TITLE#}{#SETTINGS_CACHE_H_SHOW#}{#SETTINGS_CACHE_CLEAR#}
+ Шаблоны Smarty + + {#SETTINGS_CACHE_SHOW#} + + {#SETTINGS_CACHE_CLEAR#} +
+ Данные документов + + {#SETTINGS_CACHE_SHOW#} + + {#SETTINGS_CACHE_CLEAR#} +
+ Данные запросов + + {#SETTINGS_CACHE_SHOW#} + + {#SETTINGS_CACHE_CLEAR#} +
+ Данные модулей + + {#SETTINGS_CACHE_SHOW#} + + {#SETTINGS_CACHE_CLEAR#} +
+ Данные навигации + + {#SETTINGS_CACHE_SHOW#} + + {#SETTINGS_CACHE_CLEAR#} +
+ Данные рубрик + + {#SETTINGS_CACHE_SHOW#} + + {#SETTINGS_CACHE_CLEAR#} +
+ Данные постраничной навигации + + {#SETTINGS_CACHE_SHOW#} + + {#SETTINGS_CACHE_CLEAR#} +
+ Данные сессий + + {#SETTINGS_CACHE_SHOW#} + + {#SETTINGS_CACHE_CLEAR#} +
+ Данные системных настроек + + {#SETTINGS_CACHE_SHOW#} + + {#SETTINGS_CACHE_CLEAR#} +
+
+ + +{literal} + +{/literal} diff --git a/fields/doc_from_rub_all/field.php b/fields/doc_from_rub_all/field.php new file mode 100644 index 0000000..cfcfc74 --- /dev/null +++ b/fields/doc_from_rub_all/field.php @@ -0,0 +1,146 @@ +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); + } +?> \ No newline at end of file diff --git a/fields/doc_from_rub_all/lang/bg.txt b/fields/doc_from_rub_all/lang/bg.txt new file mode 100644 index 0000000..42d4ab5 --- /dev/null +++ b/fields/doc_from_rub_all/lang/bg.txt @@ -0,0 +1,5 @@ +[admin] + +name = "Документ от рубрика" + +error = "Не е зададена рубрика" \ No newline at end of file diff --git a/fields/doc_from_rub_all/lang/cz.txt b/fields/doc_from_rub_all/lang/cz.txt new file mode 100644 index 0000000..472feb7 --- /dev/null +++ b/fields/doc_from_rub_all/lang/cz.txt @@ -0,0 +1,3 @@ +[admin] +name = "Dokument z rubriky" +error = "Rubrika nazadaná" \ No newline at end of file diff --git a/fields/doc_from_rub_all/lang/en.txt b/fields/doc_from_rub_all/lang/en.txt new file mode 100644 index 0000000..4070c5f --- /dev/null +++ b/fields/doc_from_rub_all/lang/en.txt @@ -0,0 +1,3 @@ +[admin] +name = "Document from rubric" +error = "Not specified category" \ No newline at end of file diff --git a/fields/doc_from_rub_all/lang/pl.txt b/fields/doc_from_rub_all/lang/pl.txt new file mode 100644 index 0000000..e8839ea --- /dev/null +++ b/fields/doc_from_rub_all/lang/pl.txt @@ -0,0 +1,3 @@ +[admin] +name = "Dokument z rubryki" +error = "Nie wybrano rubryki" \ No newline at end of file diff --git a/fields/doc_from_rub_all/lang/ru.txt b/fields/doc_from_rub_all/lang/ru.txt new file mode 100644 index 0000000..9176202 --- /dev/null +++ b/fields/doc_from_rub_all/lang/ru.txt @@ -0,0 +1,3 @@ +[admin] +name = "Документ из рубрики (Все)" +error = "Не задана рубрика" \ No newline at end of file diff --git a/fields/doc_from_rub_all/lang/ua.txt b/fields/doc_from_rub_all/lang/ua.txt new file mode 100644 index 0000000..380e51b --- /dev/null +++ b/fields/doc_from_rub_all/lang/ua.txt @@ -0,0 +1,3 @@ +[admin] +name = "Документ з рубрики" +error = "Не задано рубрику" \ No newline at end of file diff --git a/fields/doc_from_rub_all/tpl/field-doc.tpl b/fields/doc_from_rub_all/tpl/field-doc.tpl new file mode 100644 index 0000000..e7fb4dc --- /dev/null +++ b/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 Языковая группа документа + +Пример вывода: +----------------------------------------------------------- +{$document.document_title} Просмотров: {$document.document_count_view} + +*} +{$document.document_title|stripcslashes} \ No newline at end of file diff --git a/fields/doc_from_rub_all/tpl/field-req.tpl b/fields/doc_from_rub_all/tpl/field-req.tpl new file mode 100644 index 0000000..e7fb4dc --- /dev/null +++ b/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 Языковая группа документа + +Пример вывода: +----------------------------------------------------------- +{$document.document_title} Просмотров: {$document.document_count_view} + +*} +{$document.document_title|stripcslashes} \ No newline at end of file diff --git a/fields/doc_from_rub_all/tpl/field.tpl b/fields/doc_from_rub_all/tpl/field.tpl new file mode 100644 index 0000000..c127347 --- /dev/null +++ b/fields/doc_from_rub_all/tpl/field.tpl @@ -0,0 +1,15 @@ +{if $fields && !isset($error)} + + + +{else} + + + +{/if}