1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-08 07:36:44 +02:00

PHP: Use namespace

This commit is contained in:
Jakub Vrana
2025-03-05 11:28:53 +01:00
parent 5a708df6ca
commit 52c5392089
111 changed files with 230 additions and 20 deletions

View File

@@ -1,4 +1,6 @@
<?php
namespace Adminer;
add_driver("clickhouse", "ClickHouse (alpha)");
if (isset($_GET["clickhouse"])) {

View File

@@ -1,4 +1,6 @@
<?php
namespace Adminer;
add_driver("elastic", "Elasticsearch 7 (beta)");
if (isset($_GET["elastic"])) {

View File

@@ -1,4 +1,6 @@
<?php
namespace Adminer;
add_driver("elastic5", "Elasticsearch 5 (beta)");
if (isset($_GET["elastic5"])) {

View File

@@ -3,6 +3,8 @@
* @author Steve Krämer
*/
namespace Adminer;
add_driver('firebird', 'Firebird (alpha)');
if (isset($_GET["firebird"])) {

View File

@@ -1,4 +1,6 @@
<?php
namespace Adminer;
add_driver("simpledb", "SimpleDB");
if (isset($_GET["simpledb"])) {

View File

@@ -30,7 +30,7 @@ class AdminerEditCalendar {
function head() {
echo $this->prepend;
if ($this->langPath && function_exists('get_lang')) { // since Adminer 3.2.0
if ($this->langPath) {
$lang = get_lang();
$lang = ($lang == "zh" ? "zh-CN" : ($lang == "zh-tw" ? "zh-TW" : $lang));
if ($lang != "en" && file_exists(sprintf($this->langPath, $lang))) {

View File

@@ -19,13 +19,10 @@ class AdminerTinymce {
}
function head() {
$lang = "en";
if (function_exists('get_lang')) { // since Adminer 3.2.0
$lang = get_lang();
$lang = ($lang == "zh" ? "zh-cn" : ($lang == "zh-tw" ? "zh" : $lang));
if (!file_exists(dirname($this->path) . "/langs/$lang.js")) {
$lang = "en";
}
$lang = get_lang();
$lang = ($lang == "zh" ? "zh-cn" : ($lang == "zh-tw" ? "zh" : $lang));
if (!file_exists(dirname($this->path) . "/langs/$lang.js")) {
$lang = "en";
}
echo script_src($this->path);
?>

View File

@@ -52,11 +52,8 @@ class AdminerWymeditor {
function editInput($table, $field, $attrs, $value) {
static $lang = "";
if (!$lang && preg_match("~text~", $field["type"]) && preg_match("~_html~", $field["field"])) {
$lang = "en";
if (function_exists('get_lang')) { // since Adminer 3.2.0
$lang = get_lang();
$lang = ($lang == "zh" || $lang == "zh-tw" ? "zh_cn" : $lang);
}
$lang = get_lang();
$lang = ($lang == "zh" || $lang == "zh-tw" ? "zh_cn" : $lang);
return "<textarea$attrs id='fields-" . h($field["field"]) . "' rows='12' cols='50'>" . h($value) . "</textarea>" . script("
jQuery('#fields-" . js_escape($field["field"]) . "').wymeditor({ updateSelector: '#form [type=\"submit\"]', lang: '$lang'" . ($this->options ? ", $this->options" : "") . " });
");