Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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