str('action') === 'clearCache' && checkSecurityToken()) { /** @var helper_plugin_pagestats $helper */ $helper = plugin_load('helper', 'pagestats'); if ($helper) { $helper->clearCache(); msg($this->getLang('admin_cache_cleared'), 1); } } } /** * Output HTML for the admin page */ public function html() { global $ID; /** @var helper_plugin_pagestats $helper */ $helper = plugin_load('helper', 'pagestats'); if (!$helper) { echo '
Failed to load PageStats helper
'; return; } $stats = $helper->getStats(); echo '

' . $this->getLang('admin_title') . '

'; echo '
'; echo '

' . $this->getLang('admin_intro') . '

'; echo '
'; echo '

' . $this->getLang('admin_current_stats') . '

'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
StatisticValue
' . $this->getLang('admin_total_pages') . '' . hsc($stats['PAGESTATSPAGE']) . '
' . $this->getLang('admin_pages_size') . '' . hsc($stats['PAGESTATSMB']) . ' ' . $this->getLang('unit_mb') . '
' . $this->getLang('admin_total_media') . '' . hsc($stats['MEDIASTATSPAGE']) . '
' . $this->getLang('admin_media_size') . '' . hsc($stats['MEDIASTATSMB']) . ' ' . $this->getLang('unit_mb') . '
'; echo '
'; echo '

' . $this->getLang('admin_usage_title') . '

'; echo '
'; echo '

' . $this->getLang('admin_usage_text') . '

'; echo ''; echo '

' . $this->getLang('admin_nocache_note') . '

'; echo '
'; echo '

' . $this->getLang('admin_cache_title') . '

'; echo '
'; echo '

' . $this->getLang('admin_cache_text') . '

'; // Cache-Informationen anzeigen $cacheTime = $this->getConf('cacheTime'); echo '

'; if ($cacheTime > 0) { echo $this->getLang('admin_cache_time') . ' ' . $cacheTime . ' ' . $this->getLang('admin_cache_time_seconds') . ' (' . number_format($cacheTime / 3600, 1) . ' ' . $this->getLang('admin_cache_time_hours') . ')'; echo '
' . $this->getLang('admin_cache_time_config_hint') . ''; } else { echo $this->getLang('admin_cache_disabled'); echo '
' . $this->getLang('admin_cache_enable_hint') . ''; } echo '

'; // Cache leeren Formular $form = new Doku_Form(array('method' => 'post', 'id' => 'pagestats_form')); $form->addHidden('id', $ID); $form->addHidden('action', 'clearCache'); $form->addHidden('sectok', getSecurityToken()); $form->addElement(form_makeButton('submit', '', $this->getLang('admin_clear_cache'))); echo $form->getForm(); echo '
'; } }