Adminer - Prispôsobenie

Adminer i Editor poskytujú podporu pro rozšírenie. Časť východzej funkcionality Admineru je možné prepísať vlastným kódom. Jediné, čo k tomu potrebujete, je definovať funkciu adminer_object, ktorá vracia objekt rozširujúci základnú triedu Adminer. Potom už len vložte pôvodný adminer.php alebo editor.php:

<?php
function adminer_object() {
	
	class AdminerSoftware extends Adminer {
		
		function name() {
			// custom name in title and heading
			return 'Software';
		}
		
		function permanentLogin() {
			// key used for permanent login
			return "460e08434fe2b6807257a47bb4384850";
		}
		
		function credentials() {
			// server, username and password for connecting to database
			return array('localhost', 'ODBC', '');
		}
		
		function database() {
			// database name, will be escaped by Adminer
			return 'software';
		}
		
		function login($login, $password) {
			// validate user submitted credentials
			return ($login == 'admin' && $password == '');
		}
		
		function tableName($tableStatus) {
			// tables without comments would return empty string and will be ignored by Adminer
			return h($tableStatus["Comment"]);
		}
		
		function fieldName($field, $order = 0) {
			// only columns with comments will be displayed and only the first five in select
			return ($order <= 5 && !ereg('_(md5|sha1)$', $field["field"]) ? h($field["comment"]) : "");
		}
		
	}
	
	return new AdminerSoftware;
}

include "./editor.php";

To create an Adminer Editor customization for other drivers than MySQL, you have to define own loginForm method and fill the auth[driver] field value by your driver (pgsql, sqlite, ...).

Prehľad API

Adminer screenshot with extension methods

Objekt môže prepísať následujúcimi metódami:

Je možné používať nasledujúce globálne funkcie.

Min_DB:

Min_Result:

Funkcie špecifické pre ovládač:

Adminer specific functions:

Editor specific functions: