diff --git a/NEWS b/NEWS index b04d2ef..1d3ccda 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ * new: xcache.admin.enable_auth = On == ChangeLog == + * #86: remove/edit variable in admin page * fixed #56: xcache_set segfaults when xcache.var_size=0 ======== diff --git a/admin/common-zh-simplified-utf-8.lang.php b/admin/common-zh-simplified-utf-8.lang.php index 8a38eb0..dc5d93d 100644 --- a/admin/common-zh-simplified-utf-8.lang.php +++ b/admin/common-zh-simplified-utf-8.lang.php @@ -92,10 +92,10 @@ $strings = array( => '位置', 'Module Info' => '模块信息', - '' - => '', - '' - => '', + 'Remove Selected' + => '删除所选', + 'Editing Variable %s' + => '正在编辑变量 %s', '' => '', ); diff --git a/admin/common-zh-traditional-utf-8.lang.php b/admin/common-zh-traditional-utf-8.lang.php index aaa32ab..cbc7af4 100644 --- a/admin/common-zh-traditional-utf-8.lang.php +++ b/admin/common-zh-traditional-utf-8.lang.php @@ -92,10 +92,10 @@ $strings = array( => '位置', 'Module Info' => '組元訊息', - '' - => '', - '' - => '', + 'Remove Selected' + => '移除所选', + 'Editing Variable %s' + => '正在编辑变量 %s', '' => '', ); diff --git a/admin/edit.php b/admin/edit.php new file mode 100644 index 0000000..1a89f47 --- /dev/null +++ b/admin/edit.php @@ -0,0 +1,25 @@ + diff --git a/admin/edit.tpl.php b/admin/edit.tpl.php new file mode 100644 index 0000000..b6a2ee0 --- /dev/null +++ b/admin/edit.tpl.php @@ -0,0 +1,13 @@ + + +
+
+ +
+ +
+
+ diff --git a/admin/footer.tpl.php b/admin/footer.tpl.php new file mode 100644 index 0000000..858142e --- /dev/null +++ b/admin/footer.tpl.php @@ -0,0 +1,9 @@ +
+ +
+ + + diff --git a/admin/header.tpl.php b/admin/header.tpl.php new file mode 100644 index 0000000..b398d0a --- /dev/null +++ b/admin/header.tpl.php @@ -0,0 +1,17 @@ + + + + + + +HEAD; +?> + + + <?php echo sprintf(_T("XCache %s Administration"), $xcache_version); ?> + + + +

diff --git a/admin/xcache.css b/admin/xcache.css index 27d3856..b648254 100644 --- a/admin/xcache.css +++ b/admin/xcache.css @@ -22,7 +22,7 @@ form {margin: 0; padding: 0} .percent { border: 1px solid black; width: 80%; height: 20px; } .percent div { font-size: 1px; line-height: 1px; width: 100%;} .percent .pavail { background: blue; } -.switcher, h1 { text-align: center; display: block; } +.switcher, h1, h2 { text-align: center; display: block; } .switcher * { color: blue; } .switcher a.active { font-weight: bold; font-size: 130%; color: black; } #help { display: block; float: right; } diff --git a/admin/xcache.php b/admin/xcache.php index 078f498..30318c2 100644 --- a/admin/xcache.php +++ b/admin/xcache.php @@ -100,6 +100,15 @@ if (!extension_loaded('XCache')) { $pcnt = xcache_count(XC_TYPE_PHP); $vcnt = xcache_count(XC_TYPE_VAR); +if ($_SERVER['REQUEST_METHOD'] == 'POST') { + $remove = @ $_POST['remove']; + if ($remove && is_array($remove)) { + foreach ($remove as $name) { + xcache_unset($name); + } + } +} + $moduleinfo = null; $type_none = -1; if (!isset($_GET['type'])) { diff --git a/admin/xcache.tpl.php b/admin/xcache.tpl.php index e2a89d3..54c825f 100644 --- a/admin/xcache.tpl.php +++ b/admin/xcache.tpl.php @@ -1,20 +1,4 @@ - - - - - - -HEAD; -?> - - - <?php echo sprintf(_T("XCache %s Administration"), $xcache_version); ?> - - - -

+ » ", _T("{$cachelist['type_name']} $listname"), ""; ?> +
+ @@ -165,6 +151,9 @@ if ($cachelist) { next(), ">"; ?> + + + @@ -205,9 +194,20 @@ if ($cachelist) { $dtime = age($entry['dtime']); } + if (!$isphp) { + echo << +ENTRY; + $uname = urlencode($entry['name']); + $namelink = "$name"; + } + else { + $namelink = $name; + } + echo <<{$entry['cache_name']} {$i} - + @@ -241,6 +241,8 @@ ENTRY; ?>
R {$name}{$namelink} {$entry['hits']} {$entry['refcount']} {$size}
+ "> +
-
- -
- - - +