Browse Source

Combine redundant textboxes in clear/view-cache-key staff tool

spaghetti 9 years ago
parent
commit
ded40f0ae8
1 changed files with 4 additions and 22 deletions
  1. 4
    22
      sections/tools/development/clear_cache.php

+ 4
- 22
sections/tools/development/clear_cache.php View File

@@ -7,11 +7,7 @@ View::show_header('Clear a cache key');
7 7
 
8 8
 //Make sure the form was sent
9 9
 if (!empty($_GET['key'])) {
10
-  if (isset($_GET['submit']) && $_GET['submit'] == 'Multi') {
11
-    $Keys = array_map('trim', preg_split('/\s+/', $_GET['key']));
12
-  } else {
13
-    $Keys = [trim($_GET['key'])];
14
-  }
10
+  $Keys = array_map('trim', preg_split('/\s+/', $_GET['key']));
15 11
 }
16 12
 if (isset($Keys) && $_GET['type'] == 'clear') {
17 13
   foreach ($Keys as $Key) {
@@ -31,22 +27,8 @@ $MultiKeyTooltip = 'Enter cache keys delimited by any amount of whitespace.';
31 27
     <h2>Clear a cache key</h2>
32 28
   </div>
33 29
   <table class="layout" cellpadding="2" cellspacing="1" border="0" align="center">
34
-    <tr>
35
-      <td>Key</td>
36
-      <td>
37
-        <form class="manage_form" name="cache" method="get" action="">
38
-          <input type="hidden" name="action" value="clear_cache" />
39
-          <select name="type">
40
-            <option value="view">View</option>
41
-            <option value="clear">Clear</option>
42
-          </select>
43
-          <input type="text" name="key" id="key" class="inputtext" value="<?=(isset($_GET['key']) && (isset($_GET['submit']) && $_GET['submit'] != 'Multi') ? display_str($_GET['key']) : '')?>" />
44
-          <input type="submit" name="submit" value="Single" class="submit" />
45
-        </form>
46
-      </td>
47
-    </tr>
48 30
     <tr class="tooltip" title="<?=$MultiKeyTooltip?>">
49
-      <td>Multi-key</td>
31
+      <td>Keys</td>
50 32
       <td>
51 33
         <form class="manage_form" name="cache" method="get" action="">
52 34
           <input type="hidden" name="action" value="clear_cache" />
@@ -54,8 +36,8 @@ $MultiKeyTooltip = 'Enter cache keys delimited by any amount of whitespace.';
54 36
             <option value="view">View</option>
55 37
             <option value="clear">Clear</option>
56 38
           </select>
57
-          <textarea type="text" name="key" id="key" class="inputtext"><?=((isset($_GET['key']) && (isset($_GET['submit']) && $_GET['submit'] == 'Multi')) ? display_str($_GET['key']) : '')?></textarea>
58
-          <input type="submit" name="submit" value="Multi" class="submit" />
39
+          <textarea type="text" name="key" id="key" class="inputtext"><?=((isset($_GET['key']) && (isset($_GET['submit']))) ? display_str($_GET['key']) : '')?></textarea>
40
+          <input type="submit" name="submit" class="submit" />
59 41
         </form>
60 42
       </td>
61 43
     </tr>

Loading…
Cancel
Save