From 4a4105c5496cf2febf23cf8b912d31793feb5173 Mon Sep 17 00:00:00 2001 From: Phil Wareham Date: Thu, 20 Jul 2017 14:54:51 +0100 Subject: [PATCH] Layout cleanup and Textpack support --- etc_cache.php | 50 +++++++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/etc_cache.php b/etc_cache.php index 41c82df..c9d14d0 100644 --- a/etc_cache.php +++ b/etc_cache.php @@ -17,7 +17,7 @@ // 1 = Plugin help is in raw HTML. Not recommended. # $plugin['allow_html_help'] = 1; -$plugin['version'] = '0.2.6-beta'; +$plugin['version'] = '0.2.6-beta2'; $plugin['author'] = 'Oleg Loukianov'; $plugin['author_uri'] = 'www.iut-fbleau.fr/projet/etc/'; $plugin['description'] = 'Events-driven cache'; @@ -54,17 +54,14 @@ // #@language ISO-LANGUAGE-CODE // abc_string_name => Localized String -/** Uncomment me, if you need a textpack -$plugin['textpack'] = <<< EOT -#@admin -#@language en-gb -abc_sample_string => Sample String -abc_one_more => One more -#@language de-de -abc_sample_string => Beispieltext -abc_one_more => Noch einer +$plugin['textpack'] = << Cache +etc_cache_heading => Cached items +etc_cache_cached_at => Cached at +etc_cache_filter => Filter EOT; -**/ + // End of textpack if (!defined('txpinterface')) @@ -169,7 +166,7 @@ class etc_Cache public function __construct() { add_privs('etc_cache', '1,2'); - register_tab('extensions', 'etc_cache', 'Cache'); + register_tab('extensions', 'etc_cache', gTxt('etc_cache_tab')); register_callback(array($this, 'update'), 'site.update'); register_callback(array($this, 'tab'), 'etc_cache'); } @@ -257,8 +254,7 @@ public function tab($event, $step) { echo n.'
'. n.tag( - hed('Cached items', 1, array('class' => 'txp-heading')). - graf('('.$prefs['lastmod'].')', array('class' => 'information')), + hed(gTxt('etc_cache_heading'), 1, array('class' => 'txp-heading')), 'div', array('class' => 'txp-layout-1col') ); @@ -270,12 +266,12 @@ public function tab($event, $step) { n.tag_start('table', array('class' => 'txp-list--no-options')). n.tag_start('thead'). tr( - n.''.dLink('etc_cache', 'save', 'save', 'Delete').''. + n.''.dLink('etc_cache', 'save', 'save', 'Delete').n.''. n.'ID'. - n.''.gTxt('time').''. + n.''.gTxt('etc_cache_cached_at').''. n.'URL'. n.''.gTxt('reset').''. - n.'Filter'. + n.''.gTxt('etc_cache_filter').''. n.'Actions' ). n.tag_end('thead'). @@ -289,8 +285,9 @@ public function tab($event, $step) { $days = $diff->format('%d'); $diff = (!$days ? '' : "$days day".($days == 1 ? '' : 's'). ' ').$diff->format('%H:%I hours old'); - echo '
'.n.''; - echo n.''. + echo n.''. + n.''. + n.''. n.tag( span(gTxt('delete'), array('class' => 'ui-icon ui-icon-close')), 'button', @@ -302,10 +299,17 @@ public function tab($event, $step) { 'title' => gTxt('delete'), 'aria-label' => gTxt('delete'), ) - )."".doSpecial($id)."".doSpecial($time)."".fInput('text', 'url', $url)."".fInput('text', 'reset', $reset)."".fInput('text', 'filter', $filter).""; - echo '', fInput('submit', 'save', gTxt('update')), fInput('submit', 'save', gTxt('save')), ''; - echo sInput('save'), hInput('id', $id), tInput(); - echo n.''.n.'
'; + ).''. + n.''.doSpecial($id).''. + n.''.doSpecial($time).' ('.$diff.')'. + n.''.fInput('text', 'url', $url, '', '', '', INPUT_REGULAR).n.''. + n.''.fInput('text', 'reset', $reset, '', '', '', INPUT_REGULAR).n.''. + n.''.fInput('text', 'filter', $filter, '', '', '', INPUT_REGULAR).n.''. + n.''.fInput('submit', 'save', gTxt('update')).fInput('submit', 'save', gTxt('save')).n.''. + sInput('save'). + hInput('id', $id). + tInput(). + n.''.n.''; } echo n.tag_end('tbody').