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
 
7
 
8
 //Make sure the form was sent
8
 //Make sure the form was sent
9
 if (!empty($_GET['key'])) {
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
 if (isset($Keys) && $_GET['type'] == 'clear') {
12
 if (isset($Keys) && $_GET['type'] == 'clear') {
17
   foreach ($Keys as $Key) {
13
   foreach ($Keys as $Key) {
31
     <h2>Clear a cache key</h2>
27
     <h2>Clear a cache key</h2>
32
   </div>
28
   </div>
33
   <table class="layout" cellpadding="2" cellspacing="1" border="0" align="center">
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
     <tr class="tooltip" title="<?=$MultiKeyTooltip?>">
30
     <tr class="tooltip" title="<?=$MultiKeyTooltip?>">
49
-      <td>Multi-key</td>
31
+      <td>Keys</td>
50
       <td>
32
       <td>
51
         <form class="manage_form" name="cache" method="get" action="">
33
         <form class="manage_form" name="cache" method="get" action="">
52
           <input type="hidden" name="action" value="clear_cache" />
34
           <input type="hidden" name="action" value="clear_cache" />
54
             <option value="view">View</option>
36
             <option value="view">View</option>
55
             <option value="clear">Clear</option>
37
             <option value="clear">Clear</option>
56
           </select>
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
         </form>
41
         </form>
60
       </td>
42
       </td>
61
     </tr>
43
     </tr>

Loading…
Cancel
Save