Adminer";
}
/** Connection parameters
* @return array ($server, $username, $password)
*/
function credentials() {
return array(SERVER, $_GET["username"], get_password());
}
/** Get key used for permanent login
* @param bool
* @return string cryptic string which gets combined with password or false in case of an error
*/
function permanentLogin($create = false) {
return password_file($create);
}
/** Identifier of selected database
* @return string
*/
function database() {
// should be used everywhere instead of DB
return DB;
}
/** Get cached list of databases
* @param bool
* @return array
*/
function databases($flush = true) {
return get_databases($flush);
}
/** Get list of schemas
* @return array
*/
function schemas() {
return schemas();
}
/** Specify limit for waiting on some slow queries like DB list
* @return float number of seconds
*/
function queryTimeout() {
return 5;
}
/** Headers to send before HTML output
* @return bool true to send security headers
*/
function headers() {
return true;
}
/** Print HTML code inside
* @return bool true to link adminer.css if exists
*/
function head() {
global $jush;
?>
" autocapitalize="off">
" autocapitalize="off">
\n";
echo checkbox("auth[permanent]", 1, $_COOKIE["adminer_permanent"], lang('Permanent login')) . "\n";
}
/** Authorize the user
* @param string
* @param string
* @return bool
*/
function login($login, $password) {
return true;
}
/** Table caption used in navigation and headings
* @param array result of SHOW TABLE STATUS
* @return string HTML code, "" to ignore table
*/
function tableName($tableStatus) {
return h($tableStatus["Name"]);
}
/** Field caption used in select and edit
* @param array single field returned from fields()
* @param int order of column in select
* @return string HTML code, "" to ignore field
*/
function fieldName($field, $order = 0) {
return '' . h($field["field"]) . '';
}
/** Print links after select heading
* @param array result of SHOW TABLE STATUS
* @param string new item options, NULL for no new item
* @return null
*/
function selectLinks($tableStatus, $set = "") {
echo '
';
$links = array("select" => lang('Select data'));
if (support("table") || support("indexes")) {
$links["table"] = lang('Show structure');
}
if (support("table")) {
if (is_view($tableStatus)) {
$links["view"] = lang('Alter view');
} else {
$links["create"] = lang('Alter table');
}
}
if ($set !== null) {
$links["edit"] = lang('New item');
}
foreach ($links as $key => $val) {
echo " $val";
}
echo "\n";
}
/** Get foreign keys for table
* @param string
* @return array same format as foreign_keys()
*/
function foreignKeys($table) {
return foreign_keys($table);
}
/** Find backward keys for table
* @param string
* @param string
* @return array $return[$target_table]["keys"][$key_name][$target_column] = $source_column; $return[$target_table]["name"] = $this->tableName($target_table);
*/
function backwardKeys($table, $tableName) {
return array();
}
/** Print backward keys for row
* @param array result of $this->backwardKeys()
* @param array
* @return null
*/
function backwardKeysPrint($backwardKeys, $row) {
}
/** Query printed in select before execution
* @param string query to be executed
* @return string
*/
function selectQuery($query) {
global $jush;
return "
" // - required for IE9 inline edit
;
}
/** Description of a row in a table
* @param string
* @return string SQL expression, empty string for no description
*/
function rowDescription($table) {
return "";
}
/** Get descriptions of selected data
* @param array all data to print
* @param array
* @return array
*/
function rowDescriptions($rows, $foreignKeys) {
return $rows;
}
/** Get a link to use in select table
* @param string raw value of the field
* @param array single field returned from fields()
* @return string or null to create the default link
*/
function selectLink($val, $field) {
}
/** Value printed in select table
* @param string HTML-escaped value to print
* @param string link to foreign key
* @param array single field returned from fields()
* @param array original value before applying editVal() and escaping
* @return string
*/
function selectVal($val, $link, $field, $original) {
$return = ($val === null ? "NULL" : (preg_match("~char|binary~", $field["type"]) && !preg_match("~var~", $field["type"]) ? "$val" : $val));
if (preg_match('~blob|bytea|raw|file~', $field["type"]) && !is_utf8($val)) {
$return = lang('%d byte(s)', strlen($original));
}
return ($link ? "$return" : $return);
}
/** Value conversion used in select and edit
* @param string
* @param array single field returned from fields()
* @return string
*/
function editVal($val, $field) {
return $val;
}
/** Print columns box in select
* @param array result of selectColumnsProcess()[0]
* @param array selectable columns
* @return null
*/
function selectColumnsPrint($select, $columns) {
global $functions, $grouping;
print_fieldset("select", lang('Select'), $select);
$i = 0;
$select[""] = array();
foreach ($select as $key => $val) {
$val = $_GET["columns"][$key];
$column = select_input(" name='columns[$i][col]' onchange='" . ($key !== "" ? "selectFieldChange(this.form)" : "selectAddRow(this)") . ";'", $columns, $val["col"]);
echo "