Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 34 lines (30 sloc) 1.181 kb
5bc419e @vrana Plugin tables filter
authored
1 <?php
2
3 /** Use filter in tables list
4 * @author Jakub Vrana, http://www.vrana.cz/
5 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
6 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
7 */
8 class AdminerTablesFilter {
9
10 function tablesPrint($tables) {
11 ?>
12 <script type="text/javascript">
13 function tablesFilter(value) {
14 var tables = document.getElementById('tables').getElementsByTagName('span');
15 for (var i = tables.length; i--; ) {
16 var a = tables[i].children[1];
17 var text = a.innerText || a.textContent;
18 tables[i].className = (text.indexOf(value) == -1 ? 'hidden' : '');
19 a.innerHTML = text.replace(value, '<b>' + value + '</b>');
20 }
21 }
22 </script>
23 <p class="jsonly"><input onkeyup="tablesFilter(this.value);">
24 <?php
25 echo "<p id='tables'>\n";
26 foreach ($tables as $table => $type) {
27 echo '<span><a href="' . h(ME) . 'select=' . urlencode($table) . '"' . bold($_GET["select"] == $table) . ">" . lang('select') . "</a> ";
28 echo '<a href="' . h(ME) . 'table=' . urlencode($table) . '"' . bold($_GET["table"] == $table) . ">" . h($table) . "</a><br></span>\n";
29 }
30 return true;
31 }
32
33 }
Something went wrong with that request. Please try again.