Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 52 lines (42 sloc) 1.205 kb
70b72075 » jakubvrana
2009-07-20 Customization example
1 <?php
c64c4fd1 » jakubvrana
2009-07-27 Adminer class
2 function adminer_object() {
70b72075 » jakubvrana
2009-07-20 Customization example
3
c64c4fd1 » jakubvrana
2009-07-27 Adminer class
4 class AdminerCds extends Adminer {
5
6 function name() {
7 // custom name in title and heading
8 return 'CDs';
9 }
10
11 function credentials() {
12 // ODBC user without password on localhost
13 return array('localhost', 'ODBC', '');
14 }
15
16 function database() {
17 // will be escaped by Adminer
18 return 'adminer_test';
19 }
20
21 function login($login, $password) {
22 // username: 'admin', password: anything
23 return ($login == 'admin');
24 }
25
6c97b806 » jakubvrana
2009-07-27 Display only first five columns in Editor example
26 function tableName($tableStatus) {
c64c4fd1 » jakubvrana
2009-07-27 Adminer class
27 // tables without comments would return empty string and will be ignored by Adminer
689699aa » jakubvrana
2009-07-28 Shortcut for htmlspecialchars
28 return h($tableStatus["Comment"]);
c64c4fd1 » jakubvrana
2009-07-27 Adminer class
29 }
30
6c97b806 » jakubvrana
2009-07-27 Display only first five columns in Editor example
31 function fieldName($field, $order = 0) {
014373ca »
2010-11-02 Hide hashes in select
32 if ($order && ereg('_(md5|sha1)$', $field["field"])) {
33 return ""; // hide hashes in select
34 }
a9b2ac91 »
2011-07-01 Display searched columns
35 // display only column with comments, first five of them plus searched columns
36 if ($order < 5) {
37 return h($field["comment"]);
38 }
39 foreach ((array) $_GET["where"] as $key => $where) {
40 if ($where["col"] == $field["field"] && ($key >= 0 || $where["val"] != "")) {
41 return h($field["comment"]);
42 }
43 }
44 return "";
c64c4fd1 » jakubvrana
2009-07-27 Adminer class
45 }
46
116c8736 » jakubvrana
2009-07-21 Ignore tables and fields with empty name
47 }
48
c64c4fd1 » jakubvrana
2009-07-27 Adminer class
49 return new AdminerCds;
70b72075 » jakubvrana
2009-07-20 Customization example
50 }
51
1e92cfed » jakubvrana
2009-07-24 Don't compile editor for example
52 include "./index.php";
Something went wrong with that request. Please try again.