Initial commit
This commit is contained in:
20
playarea/plugins/bive-cache-control/main.php
Normal file
20
playarea/plugins/bive-cache-control/main.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
$b->admin_page_set("system", "cache", "Управление кешем", array(), "bive_cache_control", false, "bolt");
|
||||
|
||||
function bive_cache_control()
|
||||
{
|
||||
global $b;
|
||||
$b->template_load("bive-cache-control/template/panel.php");
|
||||
}
|
||||
|
||||
$b->event_add("bive_clear_cache", "bive_clear_cache");
|
||||
|
||||
function bive_clear_cache($args)
|
||||
{
|
||||
global $b;
|
||||
$b->template_cache_remove();
|
||||
$b->alerts_add("Кеш успешно очищен!", "notice", "b_cache");
|
||||
$b->router_refresh();
|
||||
exit();
|
||||
}
|
||||
7
playarea/plugins/bive-cache-control/manifest.yaml
Normal file
7
playarea/plugins/bive-cache-control/manifest.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
plugin_script: main.php
|
||||
plugin_name: BiveEngine - Управление кешем
|
||||
plugin_description: Базовый модуль отвечающий за управление кешем.
|
||||
plugin_author: Артём Никулин
|
||||
plugin_version: 1.0
|
||||
plugin_dependencies:
|
||||
- bive-admin-panel
|
||||
34
playarea/plugins/bive-cache-control/template/panel.php
Normal file
34
playarea/plugins/bive-cache-control/template/panel.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
$admin_page = $b->ls_get_key("admin_page");
|
||||
$pages = $b->admin_pages_list;
|
||||
$current_page = $pages[$admin_page];
|
||||
|
||||
$count = $b->template_cache_count();
|
||||
|
||||
?>
|
||||
<div class="page_wrapper">
|
||||
<h1 class="page_name">
|
||||
Управление кешем
|
||||
<?php $b->template_load("bive-admin-panel/template/menu/favorite_star.php"); ?>
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<form class="admin-data-form" method="post">
|
||||
<?php $b->event_form("bive_clear_cache");?>
|
||||
<?php $b->alerts_view("b_cache"); ?>
|
||||
<div class="admin-left-column">
|
||||
<div class="b-row">
|
||||
<div class="b-col b-block-500">
|
||||
<div class="admin-block mb-1">
|
||||
<div class="input-separator">Очистка кеша шаблонов</div>
|
||||
<div class="admin-subtitle">Кеш позволяет не просчитывать один и тот же блок с каждой загрузкой страницы. Очистка кеша может привети к замедлению сайта.</div>
|
||||
<div class="admin-subtitle">В данный момент шаблонов кешировано - <b><?= $count; ?></b></div>
|
||||
<div class="input-group">
|
||||
<button class="btn btn-primary">Очистить кеш</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
Reference in New Issue
Block a user