diff --git a/index.php b/index.php index 87eac0acd8..ba59c03d5e 100644 --- a/index.php +++ b/index.php @@ -15,6 +15,7 @@ use PhpMyAdmin\RecentFavoriteTable; use PhpMyAdmin\Relation; use PhpMyAdmin\Response; use PhpMyAdmin\Sanitize; +use PhpMyAdmin\Server\Select; use PhpMyAdmin\ThemeManager; use PhpMyAdmin\Url; use PhpMyAdmin\Util; @@ -183,9 +184,8 @@ if ($server > 0 || count($cfg['Servers']) > 1 || ($server == 0 && count($cfg['Servers']) == 1))) ) { echo '
  • '; - include_once 'libraries/select_server.lib.php'; echo Util::getImage('s_host.png') , " " - , PMA_selectServer(true, true); + , Select::render(true, true); echo '
  • '; } diff --git a/libraries/classes/Navigation/NavigationHeader.php b/libraries/classes/Navigation/NavigationHeader.php index 2a6d5d8558..4af2e2c43a 100644 --- a/libraries/classes/Navigation/NavigationHeader.php +++ b/libraries/classes/Navigation/NavigationHeader.php @@ -8,6 +8,7 @@ namespace PhpMyAdmin\Navigation; use PhpMyAdmin\Sanitize; +use PhpMyAdmin\Server\Select; use PhpMyAdmin\Template; use PhpMyAdmin\Url; use PhpMyAdmin\Util; @@ -240,10 +241,9 @@ class NavigationHeader if ($GLOBALS['cfg']['NavigationDisplayServers'] && count($GLOBALS['cfg']['Servers']) > 1 ) { - include_once './libraries/select_server.lib.php'; $retval .= ''; $retval .= '
    '; - $retval .= PMA_selectServer(true, true); + $retval .= Select::render(true, true); $retval .= '
    '; $retval .= ''; } diff --git a/libraries/classes/Plugins/Auth/AuthenticationConfig.php b/libraries/classes/Plugins/Auth/AuthenticationConfig.php index 79a2242efc..9d53919249 100644 --- a/libraries/classes/Plugins/Auth/AuthenticationConfig.php +++ b/libraries/classes/Plugins/Auth/AuthenticationConfig.php @@ -10,6 +10,7 @@ namespace PhpMyAdmin\Plugins\Auth; use PhpMyAdmin\Plugins\AuthenticationPlugin; use PhpMyAdmin\Response; +use PhpMyAdmin\Server\Select; use PhpMyAdmin\Url; use PhpMyAdmin\Util; @@ -161,10 +162,9 @@ class AuthenticationConfig extends AuthenticationPlugin ' , "\n"; if (count($GLOBALS['cfg']['Servers']) > 1) { // offer a chance to login to other servers if the current one failed - include_once './libraries/select_server.lib.php'; echo '' , "\n"; echo ' ' , "\n"; - echo PMA_selectServer(true, true); + echo Select::render(true, true); echo ' ' , "\n"; echo '' , "\n"; } diff --git a/libraries/classes/Plugins/Auth/AuthenticationCookie.php b/libraries/classes/Plugins/Auth/AuthenticationCookie.php index 5831c9c0e4..78ef5a7ccc 100644 --- a/libraries/classes/Plugins/Auth/AuthenticationCookie.php +++ b/libraries/classes/Plugins/Auth/AuthenticationCookie.php @@ -14,6 +14,7 @@ use PhpMyAdmin\LanguageManager; use PhpMyAdmin\Message; use PhpMyAdmin\Plugins\AuthenticationPlugin; use PhpMyAdmin\Response; +use PhpMyAdmin\Server\Select; use PhpMyAdmin\Session; use PhpMyAdmin\Util; use PhpMyAdmin\Url; @@ -218,10 +219,7 @@ class AuthenticationCookie extends AuthenticationPlugin , 'elements[\'pma_servername\'].value = \'\'" '; } echo '>'; - - include_once './libraries/select_server.lib.php'; - echo PMA_selectServer(false, false); - + echo Select::render(false, false); echo ''; } else { echo ' '; + + if (! $omit_fieldset) { + $retval .= '
    '; + } + + $retval .= Url::getHiddenFields(array()); + $retval .= ' '; + + $retval .= ''; + if (! $omit_fieldset) { + $retval .= '
    '; + } + $retval .= ''; + } elseif ($list) { + $retval .= ''; + } + + return $retval; + } +} diff --git a/libraries/select_server.lib.php b/libraries/select_server.lib.php deleted file mode 100644 index 49bac63dd2..0000000000 --- a/libraries/select_server.lib.php +++ /dev/null @@ -1,115 +0,0 @@ -'; - - if (! $omit_fieldset) { - $retval .= '
    '; - } - - $retval .= Url::getHiddenFields(array()); - $retval .= ' '; - - $retval .= ''; - if (! $omit_fieldset) { - $retval .= '
    '; - } - $retval .= ''; - } elseif ($list) { - $retval .= ''; - } - - return $retval; -} diff --git a/test/libraries/PMA_select_server_test.php b/test/classes/Server/SelectTest.php similarity index 84% rename from test/libraries/PMA_select_server_test.php rename to test/classes/Server/SelectTest.php index 733b336a70..71bc09a248 100644 --- a/test/libraries/PMA_select_server_test.php +++ b/test/classes/Server/SelectTest.php @@ -1,28 +1,25 @@ assertContains( - PhpMyAdmin\Util::getScriptNameForOption( + Util::getScriptNameForOption( $GLOBALS['cfg']['DefaultTabServer'], 'server' ), $html