Commit 74a2b1ff authored by Tino Goratsch's avatar Tino Goratsch

refs #39

- reworked the system cache clearing page
parent 7e21340a
......@@ -18,7 +18,7 @@ class Cache extends Core\Controller\AbstractAdminAction
/**
* @param string $action
*
* @return \Symfony\Component\HttpFoundation\RedirectResponse
* @return array|\Symfony\Component\HttpFoundation\RedirectResponse
*/
public function execute($action = '')
{
......@@ -27,6 +27,16 @@ class Cache extends Core\Controller\AbstractAdminAction
return $this->redirectMessages()->setMessage($result, $text, 'acp/system/maintenance/cache');
}
return [
'cache_types' => [
'general',
'images',
'minify',
'page',
'templates'
]
];
}
/**
......@@ -43,6 +53,7 @@ class Cache extends Core\Controller\AbstractAdminAction
],
'images' => $this->appPath->getCacheDir() . 'images',
'minify' => $this->appPath->getUploadsDir() . 'assets',
'page' => $this->appPath->getCacheDir() . 'http',
'templates' => [
$this->appPath->getCacheDir() . 'tpl_compiled',
$this->appPath->getCacheDir() . 'tpl_cached'
......@@ -54,6 +65,7 @@ class Cache extends Core\Controller\AbstractAdminAction
case 'general':
case 'images':
case 'minify':
case 'page':
case 'templates':
$result = Core\Cache\Purge::doPurge($cacheTypes[$action]);
$text = $this->translator->t(
......
......@@ -5,56 +5,25 @@
<p>
{lang t="system|delete_caches_description"}
</p>
<div class="well well-sm">
<div class="row">
<div class="col-sm-9 cache-type">
{lang t="system|cache_type_general"}
</div>
<div class="col-sm-3">
<a href="{uri args="acp/system/maintenance/cache/action_general"}" class="btn btn-block btn-warning">
<i class="glyphicon glyphicon-refresh"></i>
{lang t="system|refresh"}
</a>
</div>
</div>
</div>
<div class="well well-sm">
<div class="row">
<div class="col-sm-9 cache-type">
{lang t="system|cache_type_templates"}
</div>
<div class="col-sm-3">
<a href="{uri args="acp/system/maintenance/cache/action_templates"}" class="btn btn-block btn-warning">
<i class="glyphicon glyphicon-refresh"></i>
{lang t="system|refresh"}
</a>
</div>
</div>
</div>
<div class="well well-sm">
<div class="row">
<div class="col-sm-9 cache-type">
{lang t="system|cache_type_minify"}
</div>
<div class="col-sm-3">
<a href="{uri args="acp/system/maintenance/cache/action_minify"}" class="btn btn-block btn-warning">
<i class="glyphicon glyphicon-refresh"></i>
{lang t="system|refresh"}
</a>
</div>
</div>
</div>
<div class="well well-sm">
<div class="row">
<div class="col-sm-9 cache-type">
{lang t="system|cache_type_images"}
</div>
<div class="col-sm-3">
<a href="{uri args="acp/system/maintenance/cache/action_images"}" class="btn btn-block btn-warning">
<i class="glyphicon glyphicon-refresh"></i>
{lang t="system|refresh"}
</a>
{foreach $cache_types as $cache_type}
<div class="well well-sm">
<div class="row">
<div class="col-sm-9 cache-type">
{lang t="system|cache_type_`$cache_type`"}
</div>
<div class="col-sm-3">
<a href="{uri args="acp/system/maintenance/cache/action_`$cache_type`"}"
class="btn btn-block btn-warning"
data-ajax-form="true"
data-ajax-form-loading-text="{lang t="system|loading_please_wait"}">
<i class="glyphicon glyphicon-refresh"></i>
{lang t="system|refresh"}
</a>
</div>
</div>
</div>
</div>
{/foreach}
{javascripts}
{include_js module="system" file="ajax-form"}
{/javascripts}
{/block}
......@@ -28,17 +28,20 @@
<item key="back">Zurück</item>
<item key="cache_images">Bilder cachen</item>
<item key="cache_type_general">Allgemeiner Modul-Cache (Module, Datenbankabfragen, Pfade zu statischen Resourcen)</item>
<item key="cache_type_general_delete_error">Beim leeren des Modul-Caches ist ein Fehler aufgetreten.</item>
<item key="cache_type_general_delete_error">Beim Leeren des Modul-Caches ist ein Fehler aufgetreten.</item>
<item key="cache_type_general_delete_success">Der Modul-Cache wurde erfolgreich geleert.</item>
<item key="cache_type_images">Zwischengespeicherte Bilder</item>
<item key="cache_type_images_delete_error">Beim leeren des Bilder-Caches ist ein Fehler aufgetreten.</item>
<item key="cache_type_images_delete_error">Beim Leeren des Bilder-Caches ist ein Fehler aufgetreten.</item>
<item key="cache_type_images_delete_success">Der Bilder-Cache wurde erfolgreich geleert.</item>
<item key="cache_type_minify">Zwischengespeicherte Stylesheets und JavaScript-Dateien</item>
<item key="cache_type_minify_delete_error">Beim leeren des Stylesheet- und JavaScript-Caches ist ein Fehler aufgetreten.</item>
<item key="cache_type_minify_delete_error">Beim Leeren des Stylesheet- und JavaScript-Caches ist ein Fehler aufgetreten.</item>
<item key="cache_type_minify_delete_success">Der Stylesheet- und JavaScript-Cache wurde erfolgreich geleert.</item>
<item key="cache_type_not_found">Der angeforderte Cachetyp konnte nicht gefunden werden.</item>
<item key="cache_type_page">Seiten-Cache (HTTP-Cache)</item>
<item key="cache_type_page_delete_error">Beim Leeren des Seiten-Caches ist ein Fehler aufgetreten.</item>
<item key="cache_type_page_delete_success">Der Seiten-Cache wurde erfolgreich geleert.</item>
<item key="cache_type_templates">Zwischengespeicherte Smarty-Templates</item>
<item key="cache_type_templates_delete_error">Beim leeren des Template-Caches ist ein Fehler aufgetreten.</item>
<item key="cache_type_templates_delete_error">Beim Leeren des Template-Caches ist ein Fehler aufgetreten.</item>
<item key="cache_type_templates_delete_success">Der Template-Cache wurde erfolgreich geleert.</item>
<item key="cancel">Abbrechen</item>
<item key="close">Schließen</item>
......
......@@ -37,6 +37,9 @@
<item key="cache_type_minify_delete_error">While emptying the Stylesheets and JavaScript files cache an error has occurred.</item>
<item key="cache_type_minify_delete_success">The Stylesheets and JavaScript files cache has been successfully emptied.</item>
<item key="cache_type_not_found">The requested cache type could not be found.</item>
<item key="cache_type_page">Page cache (HTTP-Cache)</item>
<item key="cache_type_page_delete_error">While clearing the page cache as error has occurred.</item>
<item key="cache_type_page_delete_success">The page cache has been succesfully cleared.</item>
<item key="cache_type_templates">Cached Smarty-Templates</item>
<item key="cache_type_templates_delete_error">While emptying the Templates-Cache an error has occurred.</item>
<item key="cache_type_templates_delete_success">The Templates-Cache has been successfully emptied.</item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment