Browse Source

Fixes

pull/3/head
MadD3n 4 years ago
parent
commit
bf72fbad05
  1. 4
      admin/lang/ru/settings.txt
  2. 4
      admin/templates/settings/settings_cache.tpl
  3. 22
      class/class.settings.php

4
admin/lang/ru/settings.txt

@ -169,8 +169,8 @@ SETTINGS_CACHE_H_TITLE = "Тип кеша"
SETTINGS_CACHE_H_SHOW = "Показать размер" SETTINGS_CACHE_H_SHOW = "Показать размер"
SETTINGS_CACHE_SHOW = "Показать" SETTINGS_CACHE_SHOW = "Показать"
SETTINGS_CACHE_CLEAR = "Очистить" SETTINGS_CACHE_CLEAR = "Очистить"
SETTINGS_CACHE_SUCCES = "Удачно" SETTINGS_CACHE_SUCCESS = "Удачно"
SETTINGS_CACHE_SUCCES_T = "Кеш удачно удален" SETTINGS_CACHE_SUCCESS_T = "Кеш удачно удален"
SETTINGS_CACHE_ERROR = "Ошибка" SETTINGS_CACHE_ERROR = "Ошибка"
SETTINGS_CACHE_ERROR_T = "Произошла ошибка. Попробуйте повторить операцию еще раз" SETTINGS_CACHE_ERROR_T = "Произошла ошибка. Попробуйте повторить операцию еще раз"
SETTINGS_CACHE_T_SMARTY = "Шаблоны Smarty" SETTINGS_CACHE_T_SMARTY = "Шаблоны Smarty"

4
admin/templates/settings/settings_cache.tpl

@ -151,10 +151,10 @@
{#SETTINGS_CACHE_T_BLOCKS#} {#SETTINGS_CACHE_T_BLOCKS#}
</td> </td>
<td align="center"> <td align="center">
<strong class="code" id="btn-settings"><a href="javascript:void(0);" class="link btn-show" data-source="blocks">{#SETTINGS_CACHE_SHOW#}</a></strong> <strong class="code" id="btn-settings"><a href="javascript:void(0);" class="link btn-show" data-source="block">{#SETTINGS_CACHE_SHOW#}</a></strong>
</td> </td>
<td align="center"> <td align="center">
<a href="javascript:void(0);" class="btn redBtn btn-clear" data-source="blocks">{#SETTINGS_CACHE_CLEAR#}</a> <a href="javascript:void(0);" class="btn redBtn btn-clear" data-source="block">{#SETTINGS_CACHE_CLEAR#}</a>
</td> </td>
</tr> </tr>
<tr> <tr>

22
class/class.settings.php

@ -761,12 +761,18 @@
function showCacheSize () function showCacheSize ()
{ {
global $AVE_Template;
switch ($_REQUEST['source']) switch ($_REQUEST['source'])
{ {
case 'smarty': case 'smarty':
$size = format_size(get_dir_size(BASE_DIR . '/tmp/cache/smarty')); $size = format_size(get_dir_size(BASE_DIR . '/tmp/cache/smarty'));
break; break;
case 'block':
$size = format_size(get_dir_size(BASE_DIR . '/tmp/cache/sql/block'));
break;
case 'documents': case 'documents':
$size = format_size(get_dir_size(BASE_DIR . '/tmp/cache/sql/documents')); $size = format_size(get_dir_size(BASE_DIR . '/tmp/cache/sql/documents'));
break; break;
@ -799,6 +805,10 @@
$size = format_size(get_dir_size(BASE_DIR . '/tmp/session')); $size = format_size(get_dir_size(BASE_DIR . '/tmp/session'));
break; break;
case 'sysblocks':
$size = format_size(get_dir_size(BASE_DIR . '/tmp/cache/sql/sysblocks'));
break;
case 'settings': case 'settings':
$size = format_size(get_dir_size(BASE_DIR . '/tmp/cache/sql/settings')); $size = format_size(get_dir_size(BASE_DIR . '/tmp/cache/sql/settings'));
break; break;
@ -806,7 +816,7 @@
$return = [ $return = [
'size' => $size, 'size' => $size,
'message' => 'Успешно выполнено', 'message' => $AVE_Template->get_config_vars('SETTINGS_SUCCESS'),
'theme' => 'accept' 'theme' => 'accept'
]; ];
@ -824,8 +834,8 @@
$cache_dir = BASE_DIR . '/tmp/cache/smarty'; $cache_dir = BASE_DIR . '/tmp/cache/smarty';
break; break;
case 'blocks': case 'block':
$cache_dir = BASE_DIR . '/tmp/blocks'; $cache_dir = BASE_DIR . '/tmp/cache/sql/block';
break; break;
case 'documents': case 'documents':
@ -857,7 +867,7 @@
break; break;
case 'sysblocks': case 'sysblocks':
$cache_dir = BASE_DIR . '/tmp/sysblocks'; $cache_dir = BASE_DIR . '/tmp/cache/sql/sysblocks';
break; break;
case 'sessions': case 'sessions':
@ -873,8 +883,8 @@
$return = [ $return = [
'size' => format_size(get_dir_size($cache_dir)), 'size' => format_size(get_dir_size($cache_dir)),
'header' => $remove ? $AVE_Template->get_config_vars('SETTINGS_CACHE_SUCCES') : $AVE_Template->get_config_vars('SETTINGS_CACHE_ERROR'), 'header' => $remove ? $AVE_Template->get_config_vars('SETTINGS_CACHE_SUCCESS') : $AVE_Template->get_config_vars('SETTINGS_CACHE_ERROR'),
'message' => $remove ? $AVE_Template->get_config_vars('SETTINGS_CACHE_SUCCES_T') : $AVE_Template->get_config_vars('SETTINGS_CACHE_ERROR_T'), 'message' => $remove ? $AVE_Template->get_config_vars('SETTINGS_CACHE_SUCCESS_T') : $AVE_Template->get_config_vars('SETTINGS_CACHE_ERROR_T'),
'theme' => $remove ? 'accept' : 'error' 'theme' => $remove ? 'accept' : 'error'
]; ];

Loading…
Cancel
Save