Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeven Bansod <devenbansod.bits@gmail.com>2015-06-09 20:38:11 +0300
committerDeven Bansod <devenbansod.bits@gmail.com>2015-06-13 02:11:54 +0300
commitedad7fcb3ccf351b8a8aa4d6987f1cf8232aa5c9 (patch)
treec0a4e1bb28663c660cc615d6a81c8a7c03d4d230
parent5d35950556d541200e67d181d68af6d95aa6f4f2 (diff)
Replace script names as config options with plain english words
Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
-rw-r--r--doc/config.rst55
-rw-r--r--index.php8
-rw-r--r--libraries/Header.class.php4
-rw-r--r--libraries/Menu.class.php12
-rw-r--r--libraries/Util.class.php102
-rw-r--r--libraries/config.default.php56
-rw-r--r--libraries/config.values.php48
-rw-r--r--libraries/db_common.inc.php5
-rw-r--r--libraries/navigation/Nodes/Node_Database.class.php6
-rw-r--r--libraries/navigation/Nodes/Node_Table.class.php47
-rw-r--r--libraries/plugins/auth/AuthenticationConfig.class.php4
-rw-r--r--libraries/select_server.lib.php9
-rw-r--r--libraries/server_privileges.lib.php16
-rw-r--r--libraries/special_schema_links.lib.php60
-rw-r--r--libraries/sql_query_form.lib.php8
-rw-r--r--libraries/tbl_common.inc.php10
-rw-r--r--sql.php8
-rw-r--r--tbl_chart.php12
-rw-r--r--tbl_find_replace.php4
-rw-r--r--tbl_gis_visualization.php4
-rw-r--r--tbl_select.php4
-rw-r--r--tbl_zoom_select.php4
-rw-r--r--test/classes/PMA_Footer_test.php2
-rw-r--r--test/classes/PMA_Menu_test.php6
-rw-r--r--test/classes/dbi/DBIDrizzle_test.php2
-rw-r--r--test/classes/navigation/PMA_Node_DatabaseChild_test.php2
-rw-r--r--test/classes/navigation/PMA_Node_Database_test.php2
-rw-r--r--test/classes/navigation/PMA_Node_Table_test.php13
-rw-r--r--test/classes/plugin/auth/PMA_AuthenticationConfig_test.php1
-rw-r--r--test/libraries/PMA_build_html_for_db_test.php2
-rw-r--r--test/libraries/PMA_select_server_test.php6
-rw-r--r--test/libraries/PMA_server_databases_test.php2
-rw-r--r--test/libraries/PMA_server_privileges_test.php14
-rw-r--r--test/libraries/PMA_sql_query_form_test.php2
-rw-r--r--test/libraries/common/PMA_getDbLink_test.php17
-rw-r--r--test/theme.php12
36 files changed, 393 insertions, 176 deletions
diff --git a/doc/config.rst b/doc/config.rst
index 2537981489..b65799bb01 100644
--- a/doc/config.rst
+++ b/doc/config.rst
@@ -1598,16 +1598,16 @@ Navigation panel setup
.. config:option:: $cfg['NavigationTreeDefaultTabTable']
:type: string
- :default: ``'tbl_structure.php'``
+ :default: ``'structure'``
Defines the tab displayed by default when clicking the small icon next
to each table name in the navigation panel. Possible values:
- * ``tbl_structure.php``
- * ``tbl_sql.php``
- * ``tbl_select.php``
- * ``tbl_change.php``
- * ``sql.php``
+ * ``structure``
+ * ``sql``
+ * ``search``
+ * ``insert``
+ * ``browse``
.. config:option:: $cfg['NavigationTreeDefaultTabTable2']
@@ -1618,11 +1618,11 @@ Navigation panel setup
to each table name in the navigation panel. Possible values:
* ``(empty)``
- * ``tbl_structure.php``
- * ``tbl_sql.php``
- * ``tbl_select.php``
- * ``tbl_change.php``
- * ``sql.php``
+ * ``structure``
+ * ``sql``
+ * ``search``
+ * ``insert``
+ * ``browse``
.. config:option:: $cfg['NavigationTreeEnableExpansion']
@@ -1957,40 +1957,41 @@ Tabs display settings
.. config:option:: $cfg['DefaultTabServer']
:type: string
- :default: ``'index.php'``
+ :default: ``'welcome'``
Defines the tab displayed by default on server view. Possible values:
- * ``main.php`` (recommended for multi-user setups)
- * ``server_databases.php``,
- * ``server_status.php``
- * ``server_variables.php``
- * ``server_privileges.php``
+ * ``welcome`` (recommended for multi-user setups)
+ * ``databases``,
+ * ``status``
+ * ``variables``
+ * ``privileges``
.. config:option:: $cfg['DefaultTabDatabase']
:type: string
- :default: ``'db_structure.php'``
+ :default: ``'structure'``
Defines the tab displayed by default on database view. Possible
values:
- * ``db_structure.php``
- * ``db_sql.php``
- * ``db_search.php``.
+ * ``structure``
+ * ``sql``
+ * ``search``
+ * ``operations``
.. config:option:: $cfg['DefaultTabTable']
:type: string
- :default: ``'sql.php'``
+ :default: ``'browse'``
Defines the tab displayed by default on table view. Possible values:
- * ``tbl_structure.php``
- * ``tbl_sql.php``
- * ``tbl_select.php``
- * ``tbl_change.php``
- * ``sql.php``
+ * ``structure``
+ * ``sql``
+ * ``search``
+ * ``insert``
+ * ``browse``
PDF Options
-----------
diff --git a/index.php b/index.php
index bb4e12742a..5d27ef28c6 100644
--- a/index.php
+++ b/index.php
@@ -61,9 +61,13 @@ if (isset($_REQUEST['ajax_request']) && ! empty($_REQUEST['access_time'])) {
if (! empty($_REQUEST['db'])) {
$page = null;
if (! empty($_REQUEST['table'])) {
- $page = $GLOBALS['cfg']['DefaultTabTable'];
+ $page = PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabTable'], 'table'
+ );
} else {
- $page = $GLOBALS['cfg']['DefaultTabDatabase'];
+ $page = PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabDatabase'], 'database'
+ );
}
include $page;
exit;
diff --git a/libraries/Header.class.php b/libraries/Header.class.php
index 0a3ac7dc75..5d3b29d576 100644
--- a/libraries/Header.class.php
+++ b/libraries/Header.class.php
@@ -230,7 +230,9 @@ class PMA_Header
$params = array(
'common_query' => PMA_URL_getCommon(array(), 'text'),
- 'opendb_url' => $GLOBALS['cfg']['DefaultTabDatabase'],
+ 'opendb_url' => PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabDatabase'], 'database'
+ ),
'safari_browser' => PMA_USR_BROWSER_AGENT == 'SAFARI' ? 1 : 0,
'collation_connection' => $GLOBALS['collation_connection'],
'lang' => $GLOBALS['lang'],
diff --git a/libraries/Menu.class.php b/libraries/Menu.class.php
index 6a0f978713..e33f0ee348 100644
--- a/libraries/Menu.class.php
+++ b/libraries/Menu.class.php
@@ -191,7 +191,9 @@ class PMA_Menu
}
$retval .= sprintf(
$item,
- $GLOBALS['cfg']['DefaultTabServer'],
+ PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabServer'], 'server'
+ ),
PMA_URL_getCommon(),
htmlspecialchars($server_info),
__('Server')
@@ -208,7 +210,9 @@ class PMA_Menu
}
$retval .= sprintf(
$item,
- $GLOBALS['cfg']['DefaultTabDatabase'],
+ PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabDatabase'], 'database'
+ ),
PMA_URL_getCommon(array('db' => $this->_db)),
htmlspecialchars($this->_db),
__('Database')
@@ -231,7 +235,9 @@ class PMA_Menu
}
$retval .= sprintf(
$item,
- $GLOBALS['cfg']['DefaultTabTable'],
+ PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabTable'], 'table'
+ ),
PMA_URL_getCommon(
array(
'db' => $this->_db, 'table' => $this->_table
diff --git a/libraries/Util.class.php b/libraries/Util.class.php
index 4e94fc5e78..1bd3814842 100644
--- a/libraries/Util.class.php
+++ b/libraries/Util.class.php
@@ -2657,7 +2657,10 @@ class PMA_Util
$database = self::unescapeMysqlWildcards($database);
}
- return '<a href="' . $GLOBALS['cfg']['DefaultTabDatabase']
+ return '<a href="'
+ . PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabDatabase'], 'database'
+ )
. PMA_URL_getCommon(array('db' => $database)) . '" title="'
. htmlspecialchars(
sprintf(
@@ -3333,18 +3336,26 @@ class PMA_Util
* $cfg['NavigationTreeDefaultTabTable2'],
* $cfg['DefaultTabTable'] or $cfg['DefaultTabDatabase']
*
- * @return array
+ * @return string Title for the $cfg value
*/
public static function getTitleForTarget($target)
{
$mapping = array(
+ 'structure' => __('Structure'),
+ 'sql' => __('SQL'),
+ 'search' =>__('Search'),
+ 'insert' =>__('Insert'),
+ 'browse' => __('Browse'),
+ 'operations' => __('Operations'),
+
+ // For backward compatiblity
+
// Values for $cfg['DefaultTabTable']
'tbl_structure.php' => __('Structure'),
'tbl_sql.php' => __('SQL'),
'tbl_select.php' =>__('Search'),
'tbl_change.php' =>__('Insert'),
'sql.php' => __('Browse'),
-
// Values for $cfg['DefaultTabDatabase']
'db_structure.php' => __('Structure'),
'db_sql.php' => __('SQL'),
@@ -3355,6 +3366,91 @@ class PMA_Util
}
/**
+ * Get the script name corresponding to a plain English config word
+ * in order to append in links on navigation and main panel
+ *
+ * @param string $target a valid value for $cfg['NavigationTreeDefaultTabTable'],
+ * $cfg['NavigationTreeDefaultTabTable2'],
+ * $cfg['DefaultTabTable'], $cfg['DefaultTabDatabase'] or
+ * $cfg['DefaultTabServer']
+ * @param string $location one out of 'server', 'table', 'database'
+ *
+ * @return string script name corresponding to the config word
+ */
+ public static function getScriptNameForOption($target, $location)
+ {
+ $retval = '';
+
+ if ($location == 'server') {
+ // Values for $cfg['DefaultTabServer']
+ switch ($target) {
+ case 'welcome':
+ $retval = 'index.php';
+ break;
+ case 'databases':
+ $retval = 'server_databases.php';
+ break;
+ case 'status':
+ $retval = 'server_status.php';
+ break;
+ case 'variables':
+ $retval = 'server_variables.php';
+ break;
+ case 'privileges':
+ $retval = 'server_privileges.php';
+ break;
+ default:
+ $retval = $target;
+ }
+ } elseif ($location == 'database') {
+ // Values for $cfg['DefaultTabDatabase']
+ switch ($target) {
+ case 'structure':
+ $retval = 'db_structure.php';
+ break;
+ case 'sql':
+ $retval = 'db_sql.php';
+ break;
+ case 'search':
+ $retval = 'db_search.php';
+ break;
+ case 'operations':
+ $retval = 'db_operations.php';
+ break;
+ default:
+ $retval = $target;
+ }
+ } elseif ($location == 'table') {
+ // Values for $cfg['DefaultTabTable'],
+ // $cfg['NavigationTreeDefaultTabTable'] and
+ // $cfg['NavigationTreeDefaultTabTable2']
+ switch ($target) {
+ case 'structure':
+ $retval = 'tbl_structure.php';
+ break;
+ case 'sql':
+ $retval = 'tbl_sql.php';
+ break;
+ case 'search':
+ $retval = 'tbl_select.php';
+ break;
+ case 'insert':
+ $retval = 'tbl_change.php';
+ break;
+ case 'browse':
+ $retval = 'sql.php';
+ break;
+ default:
+ $retval = $target;
+ }
+ } else {
+ $retval = $target;
+ }
+
+ return $retval;
+ }
+
+ /**
* Formats user string, expanding @VARIABLES@, accepting strftime format
* string.
*
diff --git a/libraries/config.default.php b/libraries/config.default.php
index 648a4b7132..06cb63ebad 100644
--- a/libraries/config.default.php
+++ b/libraries/config.default.php
@@ -958,25 +958,25 @@ $cfg['NavigationTreeDisplayDbFilterMinimum'] = 30;
* target of the navigation panel quick access icon
*
* Possible values:
- * 'tbl_structure.php' = fields list
- * 'tbl_sql.php' = SQL form
- * 'tbl_select.php' = search page
- * 'tbl_change.php' = insert row page
- * 'sql.php' = browse page
+ * 'structure.php' = fields list
+ * 'sql' = SQL form
+ * 'search' = search page
+ * 'insert' = insert row page
+ * 'browse' = browse page
*
* @global string $cfg['NavigationTreeDefaultTabTable']
*/
-$cfg['NavigationTreeDefaultTabTable'] = 'tbl_structure.php';
+$cfg['NavigationTreeDefaultTabTable'] = 'structure';
/**
* target of the navigation panel quick second access icon
*
* Possible values:
- * 'tbl_structure.php' = fields list
- * 'tbl_sql.php' = SQL form
- * 'tbl_select.php' = search page
- * 'tbl_change.php' = insert row page
- * 'sql.php' = browse page
+ * 'structure' = fields list
+ * 'sql' = SQL form
+ * 'search' = search page
+ * 'insert' = insert row page
+ * 'browse' = browse page
* '' = no link
*
* @global string $cfg['NavigationTreeDefaultTabTable2']
@@ -1285,39 +1285,39 @@ $cfg['PropertiesNumColumns'] = 1;
/**
* Possible values:
- * 'index.php' = the welcome page
+ * 'welcome' = the welcome page
* (recommended for multiuser setups)
- * 'server_databases.php' = list of databases
- * 'server_status.php' = runtime information
- * 'server_variables.php' = MySQL server variables
- * 'server_privileges.php' = user management
+ * 'databases' = list of databases
+ * 'status' = runtime information
+ * 'variables' = MySQL server variables
+ * 'privileges' = user management
*
* @global string $cfg['DefaultTabServer']
*/
-$cfg['DefaultTabServer'] = 'index.php';
+$cfg['DefaultTabServer'] = 'welcome';
/**
* Possible values:
- * 'db_structure.php' = tables list
- * 'db_sql.php' = SQL form
- * 'db_search.php' = search query
- * 'db_operations.php' = operations on database
+ * 'structure' = tables list
+ * 'sql' = SQL form
+ * 'search' = search query
+ * 'operations' = operations on database
*
* @global string $cfg['DefaultTabDatabase']
*/
-$cfg['DefaultTabDatabase'] = 'db_structure.php';
+$cfg['DefaultTabDatabase'] = 'structure';
/**
* Possible values:
- * 'tbl_structure.php' = fields list
- * 'tbl_sql.php' = SQL form
- * 'tbl_select.php' = search page
- * 'tbl_change.php' = insert row page
- * 'sql.php' = browse page
+ * 'structure' = fields list
+ * 'sql' = SQL form
+ * 'search' = search page
+ * 'insert' = insert row page
+ * 'browse' = browse page
*
* @global string $cfg['DefaultTabTable']
*/
-$cfg['DefaultTabTable'] = 'sql.php';
+$cfg['DefaultTabTable'] = 'browse';
/**
* Whether to display image or text or both image and text in table row
diff --git a/libraries/config.values.php b/libraries/config.values.php
index ca811814b0..78e3880386 100644
--- a/libraries/config.values.php
+++ b/libraries/config.values.php
@@ -36,19 +36,19 @@ $cfg_db['OBGzip'] = array('auto', true, false);
$cfg_db['MemoryLimit'] = 'short_string';
$cfg_db['NavigationLogoLinkWindow'] = array('main', 'new');
$cfg_db['NavigationTreeDefaultTabTable'] = array(
- 'tbl_structure.php', // fields list
- 'tbl_sql.php', // SQL form
- 'tbl_select.php', // search page
- 'tbl_change.php', // insert row page
- 'sql.php' // browse page
+ 'structure' => __('Structure'), // fields list
+ 'sql' => __('SQL'), // SQL form
+ 'search' => __('Search'), // search page
+ 'insert' => __('Insert'), // insert row page
+ 'browse' => __('Browse') // browse page
);
$cfg_db['NavigationTreeDefaultTabTable2'] = array(
'', //don't display
- 'tbl_structure.php', // fields list
- 'tbl_sql.php', // SQL form
- 'tbl_select.php', // search page
- 'tbl_change.php', // insert row page
- 'sql.php' // browse page
+ 'structure' => __('Structure'), // fields list
+ 'sql' => __('SQL'), // SQL form
+ 'search' => __('Search'), // search page
+ 'insert' => __('Insert'), // insert row page
+ 'browse' => __('Browse') // browse page
);
$cfg_db['NavigationTreeDbSeparator'] = 'short_string';
$cfg_db['NavigationTreeTableSeparator'] = 'short_string';
@@ -99,24 +99,24 @@ $cfg_db['RelationalDisplay'] = array(
'D' => __('display column')
);
$cfg_db['DefaultTabServer'] = array(
- 'index.php', // the welcome page (recommended for multiuser setups)
- 'server_databases.php', // list of databases
- 'server_status.php', // runtime information
- 'server_variables.php', // MySQL server variables
- 'server_privileges.php' // user management
+ 'welcome' => __('Welcome'), // the welcome page (recommended for multiuser setups)
+ 'databases' => __('Databases'), // list of databases
+ 'status' => __('Status'), // runtime information
+ 'variables' => __('Variables'), // MySQL server variables
+ 'privileges' => __('Privileges') // user management
);
$cfg_db['DefaultTabDatabase'] = array(
- 'db_structure.php', // tables list
- 'db_sql.php', // SQL form
- 'db_search.php', // search query
- 'db_operations.php' // operations on database
+ 'structure' => __('Structure'), // tables list
+ 'sql' => __('SQL'), // SQL form
+ 'search' => __('Search'), // search query
+ 'operations' => __('Operations') // operations on database
);
$cfg_db['DefaultTabTable'] = array(
- 'tbl_structure.php', // fields list
- 'tbl_sql.php', // SQL form
- 'tbl_select.php', // search page
- 'tbl_change.php', // insert row page
- 'sql.php' // browse page
+ 'structure' => __('Structure'), // fields list
+ 'sql' => __('SQL'), // SQL form
+ 'search' => __('Search'), // search page
+ 'insert' => __('Insert'), // insert row page
+ 'browse' => __('Browse') // browse page
);
$cfg_db['InitialSlidersState'] = array(
'open' => __('Open'),
diff --git a/libraries/db_common.inc.php b/libraries/db_common.inc.php
index ac9c793466..e555784165 100644
--- a/libraries/db_common.inc.php
+++ b/libraries/db_common.inc.php
@@ -27,7 +27,10 @@ if ($db_is_system_schema) {
* Defines the urls to return to in case of error in a sql statement
*/
$err_url_0 = 'index.php' . PMA_URL_getCommon();
-$err_url = $cfg['DefaultTabDatabase']
+
+$err_url = PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabDatabase'], 'database'
+)
. PMA_URL_getCommon(array('db' => $db));
/** @var PMA_String $pmaString */
diff --git a/libraries/navigation/Nodes/Node_Database.class.php b/libraries/navigation/Nodes/Node_Database.class.php
index 2db8896ada..261ae3d0a6 100644
--- a/libraries/navigation/Nodes/Node_Database.class.php
+++ b/libraries/navigation/Nodes/Node_Database.class.php
@@ -40,8 +40,12 @@ class Node_Database extends Node
's_db.png',
__('Database operations')
);
+
+ $script_name = PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabDatabase'], 'database'
+ );
$this->links = array(
- 'text' => $GLOBALS['cfg']['DefaultTabDatabase']
+ 'text' => $script_name
. '?server=' . $GLOBALS['server']
. '&amp;db=%1$s&amp;token=' . $_SESSION[' PMA_token '],
'icon' => 'db_operations.php?server=' . $GLOBALS['server']
diff --git a/libraries/navigation/Nodes/Node_Table.class.php b/libraries/navigation/Nodes/Node_Table.class.php
index 10a521a52c..2d01059843 100644
--- a/libraries/navigation/Nodes/Node_Table.class.php
+++ b/libraries/navigation/Nodes/Node_Table.class.php
@@ -32,36 +32,39 @@ class Node_Table extends Node_DatabaseChild
{
parent::__construct($name, $type, $is_group);
$this->icon = array();
- $this->_addIcon($GLOBALS['cfg']['NavigationTreeDefaultTabTable']);
- $this->_addIcon($GLOBALS['cfg']['NavigationTreeDefaultTabTable2']);
- switch($GLOBALS['cfg']['DefaultTabTable']) {
- case 'tbl_structure.php':
- $this->title = __('Structure');
- break;
- case 'tbl_select.php':
- $this->title = __('Search');
- break;
- case 'tbl_change.php':
- $this->title = __('Insert');
- break;
- case 'tbl_sql.php':
- $this->title = __('SQL');
- break;
- case 'sql.php':
- $this->title = __('Browse');
- break;
- }
+ $this->_addIcon(
+ PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['NavigationTreeDefaultTabTable'], 'table'
+ )
+ );
+ $this->_addIcon(
+ PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['NavigationTreeDefaultTabTable2'], 'table'
+ )
+ );
+ $title = PMA_Util::getTitleForTarget(
+ $GLOBALS['cfg']['DefaultTabTable']
+ );
+ $this->title = $title;
+
+ $script_name = PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabTable'], 'table'
+ );
$this->links = array(
- 'text' => $GLOBALS['cfg']['DefaultTabTable']
+ 'text' => $script_name
. '?server=' . $GLOBALS['server']
. '&amp;db=%2$s&amp;table=%1$s'
. '&amp;pos=0&amp;token=' . $_SESSION[' PMA_token '],
'icon' => array(
- $GLOBALS['cfg']['NavigationTreeDefaultTabTable']
+ PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['NavigationTreeDefaultTabTable'], 'table'
+ )
. '?server=' . $GLOBALS['server']
. '&amp;db=%2$s&amp;table=%1$s&amp;token='
. $_SESSION[' PMA_token '],
- $GLOBALS['cfg']['NavigationTreeDefaultTabTable2']
+ PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['NavigationTreeDefaultTabTable2'], 'table'
+ )
. '?server=' . $GLOBALS['server']
. '&amp;db=%2$s&amp;table=%1$s&amp;token='
. $_SESSION[' PMA_token ']
diff --git a/libraries/plugins/auth/AuthenticationConfig.class.php b/libraries/plugins/auth/AuthenticationConfig.class.php
index 19a8ed2a16..f4ffd6e3d8 100644
--- a/libraries/plugins/auth/AuthenticationConfig.class.php
+++ b/libraries/plugins/auth/AuthenticationConfig.class.php
@@ -159,7 +159,9 @@ class AuthenticationConfig extends AuthenticationPlugin
<tr>
<td>' . "\n";
echo '<a href="'
- . $GLOBALS['cfg']['DefaultTabServer']
+ . PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabServer'], 'server'
+ )
. PMA_URL_getCommon(array()) . '" class="button disableAjax">'
. __('Retry to connect')
. '</a>' . "\n";
diff --git a/libraries/select_server.lib.php b/libraries/select_server.lib.php
index db06332f36..1fe4d691f5 100644
--- a/libraries/select_server.lib.php
+++ b/libraries/select_server.lib.php
@@ -31,7 +31,10 @@ function PMA_selectServer($not_only_options, $omit_fieldset)
if ($not_only_options) {
$retval .= '<form method="post" action="'
- . $GLOBALS['cfg']['DefaultTabServer'] . '" class="disableAjax">';
+ . PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabServer'], 'server'
+ )
+ . '" class="disableAjax">';
$retval .= PMA_getHiddenFields(array('token' => $_SESSION[' PMA_token ']));
if (! $omit_fieldset) {
@@ -84,7 +87,9 @@ function PMA_selectServer($not_only_options, $omit_fieldset)
} else {
$retval .= '<a class="disableAjax item" href="'
- . $GLOBALS['cfg']['DefaultTabServer']
+ . PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabServer'], 'server'
+ )
. PMA_URL_getCommon(array('server' => $key))
. '" >' . htmlspecialchars($label) . '</a>';
}
diff --git a/libraries/server_privileges.lib.php b/libraries/server_privileges.lib.php
index c6616df946..3019e9309b 100644
--- a/libraries/server_privileges.lib.php
+++ b/libraries/server_privileges.lib.php
@@ -2060,7 +2060,9 @@ function PMA_getHtmlForSpecificDbPrivileges($db)
. ' '
. sprintf(
__('Users having access to "%s"'),
- '<a href="' . $GLOBALS['cfg']['DefaultTabDatabase']
+ '<a href="' . PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabDatabase'], 'database'
+ )
. PMA_URL_getCommon(array('db' => $db)) . '">'
. htmlspecialchars($db)
. '</a>'
@@ -2124,7 +2126,9 @@ function PMA_getHtmlForSpecificTablePrivileges($db, $table)
. PMA_Util::getIcon('b_usrcheck.png')
. sprintf(
__('Users having access to "%s"'),
- '<a href="' . $GLOBALS['cfg']['DefaultTabTable']
+ '<a href="' . PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabTable'], 'table'
+ )
. PMA_URL_getCommon(
array(
'db' => $db,
@@ -2757,7 +2761,9 @@ function PMA_getChangeLoginInformationHtmlForm($username, $hostname)
function PMA_getLinkToDbAndTable($url_dbname, $dbname, $tablename)
{
$html_output = '[ ' . __('Database')
- . ' <a href="' . $GLOBALS['cfg']['DefaultTabDatabase']
+ . ' <a href="' . PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabDatabase'], 'database'
+ )
. PMA_URL_getCommon(
array(
'db' => $url_dbname,
@@ -2773,7 +2779,9 @@ function PMA_getLinkToDbAndTable($url_dbname, $dbname, $tablename)
if (/*overload*/mb_strlen($tablename)) {
$html_output .= ' [ ' . __('Table') . ' <a href="'
- . $GLOBALS['cfg']['DefaultTabTable']
+ . PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabTable'], 'table'
+ )
. PMA_URL_getCommon(
array(
'db' => $url_dbname,
diff --git a/libraries/special_schema_links.lib.php b/libraries/special_schema_links.lib.php
index 5e8c5e0231..7e29d25bba 100644
--- a/libraries/special_schema_links.lib.php
+++ b/libraries/special_schema_links.lib.php
@@ -65,7 +65,9 @@ $GLOBALS['special_schema_links'] = array(
'column_name' => 'Db'
),
),
- 'default_page' => $GLOBALS['cfg']['DefaultTabTable']
+ 'default_page' => PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabTable'], 'table'
+ )
),
'column_name' => array(
'link_param' => 'field',
@@ -116,7 +118,9 @@ $GLOBALS['special_schema_links'] = array(
'column_name' => 'database_name'
),
),
- 'default_page' => $GLOBALS['cfg']['DefaultTabTable']
+ 'default_page' => PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabTable'], 'table'
+ )
),
'index_name' => array(
'link_param' => 'index',
@@ -142,7 +146,9 @@ $GLOBALS['special_schema_links'] = array(
'column_name' => 'database_name'
),
),
- 'default_page' => $GLOBALS['cfg']['DefaultTabTable']
+ 'default_page' => PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabTable'], 'table'
+ )
),
),
'proc' => array(
@@ -232,7 +238,9 @@ $GLOBALS['special_schema_links'] = array(
'column_name' => 'Db'
),
),
- 'default_page' => $GLOBALS['cfg']['DefaultTabTable']
+ 'default_page' => PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabTable'], 'table'
+ )
),
),
'user' => array(
@@ -258,7 +266,9 @@ $GLOBALS['special_schema_links'] = array(
'column_name' => 'table_schema'
)
),
- 'default_page' => $GLOBALS['cfg']['DefaultTabTable']
+ 'default_page' => PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabTable'], 'table'
+ )
),
'column_name' => array(
'link_param' => 'field',
@@ -284,7 +294,9 @@ $GLOBALS['special_schema_links'] = array(
'column_name' => 'constraint_schema'
)
),
- 'default_page' => $GLOBALS['cfg']['DefaultTabTable']
+ 'default_page' => PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabTable'], 'table'
+ )
),
'column_name' => array(
'link_param' => 'field',
@@ -308,7 +320,9 @@ $GLOBALS['special_schema_links'] = array(
'column_name' => 'referenced_table_schema'
)
),
- 'default_page' => $GLOBALS['cfg']['DefaultTabTable']
+ 'default_page' => PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabTable'], 'table'
+ )
),
'referenced_column_name' => array(
'link_param' => 'field',
@@ -334,7 +348,9 @@ $GLOBALS['special_schema_links'] = array(
'column_name' => 'table_schema'
)
),
- 'default_page' => $GLOBALS['cfg']['DefaultTabTable']
+ 'default_page' => PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabTable'], 'table'
+ )
)
),
'processlist' => array(
@@ -358,7 +374,9 @@ $GLOBALS['special_schema_links'] = array(
'column_name' => 'constraint_schema'
)
),
- 'default_page' => $GLOBALS['cfg']['DefaultTabTable']
+ 'default_page' => PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabTable'], 'table'
+ )
),
'referenced_table_name' => array(
'link_param' => 'table',
@@ -368,7 +386,9 @@ $GLOBALS['special_schema_links'] = array(
'column_name' => 'constraint_schema'
)
),
- 'default_page' => $GLOBALS['cfg']['DefaultTabTable']
+ 'default_page' => PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabTable'], 'table'
+ )
)
),
'routines' => array(
@@ -390,7 +410,9 @@ $GLOBALS['special_schema_links'] = array(
'schemata' => array(
'schema_name' => array(
'link_param' => 'db',
- 'default_page' => $GLOBALS['cfg']['DefaultTabDatabase']
+ 'default_page' => PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabTable'], 'table'
+ )
)
),
'statistics' => array(
@@ -402,7 +424,9 @@ $GLOBALS['special_schema_links'] = array(
'column_name' => 'table_schema'
)
),
- 'default_page' => $GLOBALS['cfg']['DefaultTabTable']
+ 'default_page' => PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabTable'], 'table'
+ )
),
'column_name' => array(
'link_param' => 'field',
@@ -428,7 +452,9 @@ $GLOBALS['special_schema_links'] = array(
'column_name' => 'table_schema'
)
),
- 'default_page' => $GLOBALS['cfg']['DefaultTabTable']
+ 'default_page' => PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabTable'], 'table'
+ )
),
),
'table_constraints' => array(
@@ -440,7 +466,9 @@ $GLOBALS['special_schema_links'] = array(
'column_name' => 'table_schema'
)
),
- 'default_page' => $GLOBALS['cfg']['DefaultTabTable']
+ 'default_page' => PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabTable'], 'table'
+ )
),
),
'views' => array(
@@ -452,7 +480,9 @@ $GLOBALS['special_schema_links'] = array(
'column_name' => 'table_schema'
)
),
- 'default_page' => $GLOBALS['cfg']['DefaultTabTable']
+ 'default_page' => PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabTable'], 'table'
+ )
),
),
)
diff --git a/libraries/sql_query_form.lib.php b/libraries/sql_query_form.lib.php
index ecfa3b6e6b..700379f1ca 100644
--- a/libraries/sql_query_form.lib.php
+++ b/libraries/sql_query_form.lib.php
@@ -161,7 +161,9 @@ function PMA_getHtmlForSqlQueryFormInsert(
// prepare for db related
$db = $GLOBALS['db'];
// if you want navigation:
- $tmp_db_link = '<a href="' . $GLOBALS['cfg']['DefaultTabDatabase']
+ $tmp_db_link = '<a href="' . PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabDatabase'], 'database'
+ )
. PMA_URL_getCommon(array('db' => $db)) . '"';
$tmp_db_link .= '>'
. htmlspecialchars($db) . '</a>';
@@ -182,7 +184,9 @@ function PMA_getHtmlForSqlQueryFormInsert(
$db, $GLOBALS['table'], null, true
);
- $tmp_db_link = '<a href="' . $GLOBALS['cfg']['DefaultTabDatabase']
+ $tmp_db_link = '<a href="' . PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabDatabase'], 'database'
+ )
. PMA_URL_getCommon(array('db' => $db)) . '"';
$tmp_db_link .= '>'
. htmlspecialchars($db) . '</a>';
diff --git a/libraries/tbl_common.inc.php b/libraries/tbl_common.inc.php
index a2e7b260b2..850feacedd 100644
--- a/libraries/tbl_common.inc.php
+++ b/libraries/tbl_common.inc.php
@@ -35,9 +35,15 @@ $url_params['table'] = $table;
/**
* Defines the urls to return to in case of error in a sql statement
*/
-$err_url_0 = $cfg['DefaultTabDatabase']
+$err_url_0 = PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabDatabase'], 'database'
+)
. PMA_URL_getCommon(array('db' => $db));
-$err_url = $cfg['DefaultTabTable'] . PMA_URL_getCommon($url_params);
+
+$err_url = PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabTable'], 'table'
+)
+ . PMA_URL_getCommon($url_params);
/**
diff --git a/sql.php b/sql.php
index 6b972d4124..9c2e790552 100644
--- a/sql.php
+++ b/sql.php
@@ -54,9 +54,13 @@ if (! empty($goto)) {
}
} else {
if (empty($table)) {
- $goto = $cfg['DefaultTabDatabase'];
+ $goto = PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabDatabase'], 'database'
+ );
} else {
- $goto = $cfg['DefaultTabTable'];
+ $goto = PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabTable'], 'table'
+ );
}
$is_gotofile = true;
} // end if
diff --git a/tbl_chart.php b/tbl_chart.php
index aedeea0b82..5fff8f5236 100644
--- a/tbl_chart.php
+++ b/tbl_chart.php
@@ -80,17 +80,23 @@ $scripts->addFile('jqplot/plugins/jqplot.highlighter.js');
* Runs common work
*/
if (/*overload*/mb_strlen($GLOBALS['table'])) {
- $url_params['goto'] = $cfg['DefaultTabTable'];
+ $url_params['goto'] = PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabTable'], 'table'
+ );
$url_params['back'] = 'tbl_sql.php';
include 'libraries/tbl_common.inc.php';
include 'libraries/tbl_info.inc.php';
} elseif (/*overload*/mb_strlen($GLOBALS['db'])) {
- $url_params['goto'] = $cfg['DefaultTabDatabase'];
+ $url_params['goto'] = PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabDatabase'], 'database'
+ );
$url_params['back'] = 'sql.php';
include 'libraries/db_common.inc.php';
include 'libraries/db_info.inc.php';
} else {
- $url_params['goto'] = $cfg['DefaultTabServer'];
+ $url_params['goto'] = PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabServer'], 'server'
+ );
$url_params['back'] = 'sql.php';
include 'libraries/server_common.inc.php';
}
diff --git a/tbl_find_replace.php b/tbl_find_replace.php
index 39eefa48bb..ddc0cea937 100644
--- a/tbl_find_replace.php
+++ b/tbl_find_replace.php
@@ -54,7 +54,9 @@ if (isset($_POST['replace'])) {
}
if (! isset($goto)) {
- $goto = $GLOBALS['cfg']['DefaultTabTable'];
+ $goto = PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabTable'], 'table'
+ );
}
// Defines the url to return to in case of error in the next sql statement
$params = array('db' => $db, 'table' => $table);
diff --git a/tbl_gis_visualization.php b/tbl_gis_visualization.php
index 4be47b8391..cecabe35d2 100644
--- a/tbl_gis_visualization.php
+++ b/tbl_gis_visualization.php
@@ -10,7 +10,9 @@ require_once 'libraries/common.inc.php';
// Runs common work
require_once 'libraries/db_common.inc.php';
-$url_params['goto'] = $cfg['DefaultTabDatabase'];
+$url_params['goto'] = PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabDatabase'], 'database'
+);
$url_params['back'] = 'sql.php';
// Import visualization functions
diff --git a/tbl_select.php b/tbl_select.php
index 5366250331..914b547157 100644
--- a/tbl_select.php
+++ b/tbl_select.php
@@ -53,7 +53,9 @@ if (! isset($_POST['columnsToDisplay']) && ! isset($_POST['displayAllColumns']))
include_once 'libraries/tbl_info.inc.php';
if (! isset($goto)) {
- $goto = $GLOBALS['cfg']['DefaultTabTable'];
+ $goto = PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabTable'], 'table'
+ );
}
// Defines the url to return to in case of error in the next sql statement
$err_url = $goto . PMA_URL_getCommon(array('db' => $db, 'table' => $table));
diff --git a/tbl_zoom_select.php b/tbl_zoom_select.php
index 2f0e738abd..3efcfb574e 100644
--- a/tbl_zoom_select.php
+++ b/tbl_zoom_select.php
@@ -97,7 +97,9 @@ $url_query .= '&amp;goto=tbl_select.php&amp;back=tbl_select.php';
require_once './libraries/tbl_info.inc.php';
if (! isset($goto)) {
- $goto = $GLOBALS['cfg']['DefaultTabTable'];
+ $goto = PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabTable'], 'table'
+ );
}
// Defines the url to return to in case of error in the next sql statement
$err_url = $goto . PMA_URL_getCommon(array('db' => $db, 'table' => $table));
diff --git a/test/classes/PMA_Footer_test.php b/test/classes/PMA_Footer_test.php
index 85aece7d00..47968d9d1b 100644
--- a/test/classes/PMA_Footer_test.php
+++ b/test/classes/PMA_Footer_test.php
@@ -60,7 +60,7 @@ class PMA_Footer_Test extends PHPUnit_Framework_TestCase
$GLOBALS['PMA_Config']->enableBc();
$GLOBALS['collation_connection'] = 'utf8_general_ci';
$GLOBALS['cfg']['Server']['verbose'] = 'verbose host';
- $GLOBALS['cfg']['DefaultTabDatabase'] = 'db_structure.php';
+ $GLOBALS['cfg']['DefaultTabDatabase'] = 'structure';
$GLOBALS['server'] = '1';
$_GET['reload_left_frame'] = '1';
$GLOBALS['focus_querywindow'] = 'main_pane_left';
diff --git a/test/classes/PMA_Menu_test.php b/test/classes/PMA_Menu_test.php
index 0f5033f1c8..6682751e57 100644
--- a/test/classes/PMA_Menu_test.php
+++ b/test/classes/PMA_Menu_test.php
@@ -47,9 +47,9 @@ class PMA_Menu_Test extends PHPUnit_Framework_TestCase
$_SESSION['PMA_Theme'] = new PMA_Theme();
$GLOBALS['pmaThemePath'] = $_SESSION['PMA_Theme']->getPath();
$GLOBALS['pmaThemeImage'] = 'theme/';
- $GLOBALS['cfg']['DefaultTabServer'] = 'main.php';
- $GLOBALS['cfg']['DefaultTabDatabase'] = 'db_structure.php';
- $GLOBALS['cfg']['DefaultTabTable'] = 'sql.php';
+ $GLOBALS['cfg']['DefaultTabServer'] = 'welcome';
+ $GLOBALS['cfg']['DefaultTabDatabase'] = 'structure';
+ $GLOBALS['cfg']['DefaultTabTable'] = 'browse';
$GLOBALS['cfg']['OBGzip'] = false;
$GLOBALS['cfg']['NaturalOrder'] = true;
$GLOBALS['cfg']['TabsMode'] = 'both';
diff --git a/test/classes/dbi/DBIDrizzle_test.php b/test/classes/dbi/DBIDrizzle_test.php
index 3236667320..83d6c28fe6 100644
--- a/test/classes/dbi/DBIDrizzle_test.php
+++ b/test/classes/dbi/DBIDrizzle_test.php
@@ -69,7 +69,7 @@ class PMA_DBI_Drizzle_Test extends PHPUnit_Framework_TestCase
$GLOBALS['cfg']['Server']['ssl'] = false;
$GLOBALS['cfg']['MaxCharactersInDisplayedSQL'] = 1000;
$GLOBALS['cfg']['ActionLinksMode'] = "both";
- $GLOBALS['cfg']['DefaultTabDatabase'] = 'db_structure.php';
+ $GLOBALS['cfg']['DefaultTabDatabase'] = 'structure';
$GLOBALS['pmaThemeImage'] = 'image';
//$_SESSION
diff --git a/test/classes/navigation/PMA_Node_DatabaseChild_test.php b/test/classes/navigation/PMA_Node_DatabaseChild_test.php
index 0b643d1e33..b394ba36a4 100644
--- a/test/classes/navigation/PMA_Node_DatabaseChild_test.php
+++ b/test/classes/navigation/PMA_Node_DatabaseChild_test.php
@@ -38,7 +38,7 @@ class Node_DatabaseChildTest extends PHPUnit_Framework_TestCase
$_SESSION['PMA_Theme'] = new PMA_Theme();
$GLOBALS['pmaThemePath'] = $_SESSION['PMA_Theme']->getPath();
$GLOBALS['pmaThemeImage'] = 'theme/';
- $GLOBALS['cfg']['DefaultTabDatabase'] = 'db_structure.php';
+ $GLOBALS['cfg']['DefaultTabDatabase'] = 'structure';
$GLOBALS['server'] = 1;
$GLOBALS['cfg']['ServerDefault'] = 1;
$_SESSION['relation'][1]['navwork'] = true;
diff --git a/test/classes/navigation/PMA_Node_Database_test.php b/test/classes/navigation/PMA_Node_Database_test.php
index 26852e298d..834fb1faf0 100644
--- a/test/classes/navigation/PMA_Node_Database_test.php
+++ b/test/classes/navigation/PMA_Node_Database_test.php
@@ -26,7 +26,7 @@ class Node_Database_Test extends PHPUnit_Framework_TestCase
public function setup()
{
$GLOBALS['server'] = 0;
- $GLOBALS['cfg']['DefaultTabDatabase'] = 'db_structure.php';
+ $GLOBALS['cfg']['DefaultTabDatabase'] = 'structure';
$GLOBALS['cfg']['MaxNavigationItems'] = 250;
$_SESSION['PMA_Theme'] = PMA_Theme::load('./themes/pmahomme');
}
diff --git a/test/classes/navigation/PMA_Node_Table_test.php b/test/classes/navigation/PMA_Node_Table_test.php
index a92f099d13..2d15cf14f3 100644
--- a/test/classes/navigation/PMA_Node_Table_test.php
+++ b/test/classes/navigation/PMA_Node_Table_test.php
@@ -27,7 +27,8 @@ class Node_Table_Test extends PHPUnit_Framework_TestCase
{
$GLOBALS['server'] = 0;
$GLOBALS['cfg']['NavigationTreeDefaultTabTable'] = 'b_browse';
- $GLOBALS['cfg']['DefaultTabTable'] = 'sql.php';
+ $GLOBALS['cfg']['NavigationTreeDefaultTabTable2'] = '';
+ $GLOBALS['cfg']['DefaultTabTable'] = 'browse';
$GLOBALS['cfg']['MaxNavigationItems'] = 250;
$GLOBALS['cfg']['NavigationTreeEnableGrouping'] = true;
$GLOBALS['cfg']['NavigationTreeDbSeparator'] = '_';
@@ -80,11 +81,11 @@ class Node_Table_Test extends PHPUnit_Framework_TestCase
public function providerForTestIcon()
{
return array(
- array('tbl_structure.php', 'b_props'),
- array('tbl_select.php', 'b_search'),
- array('tbl_change.php', 'b_insrow'),
- array('tbl_sql.php', 'b_sql'),
- array('sql.php', 'b_browse'),
+ array('structure', 'b_props'),
+ array('search', 'b_search'),
+ array('insert', 'b_insrow'),
+ array('sql', 'b_sql'),
+ array('browse', 'b_browse'),
);
}
}
diff --git a/test/classes/plugin/auth/PMA_AuthenticationConfig_test.php b/test/classes/plugin/auth/PMA_AuthenticationConfig_test.php
index 4dd337d390..627568351f 100644
--- a/test/classes/plugin/auth/PMA_AuthenticationConfig_test.php
+++ b/test/classes/plugin/auth/PMA_AuthenticationConfig_test.php
@@ -35,6 +35,7 @@ class PMA_AuthenticationConfig_Test extends PHPUnit_Framework_TestCase
$GLOBALS['PMA_Config'] = new PMA_Config();
$GLOBALS['PMA_Config']->enableBc();
$GLOBALS['server'] = 0;
+ $GLOBALS['cfg']['DefaultTabServer'] = 'welcome';
$GLOBALS['token_provided'] = true;
$GLOBALS['token_mismatch'] = false;
$this->object = new AuthenticationConfig();
diff --git a/test/libraries/PMA_build_html_for_db_test.php b/test/libraries/PMA_build_html_for_db_test.php
index dd5b539e37..36424e3fcc 100644
--- a/test/libraries/PMA_build_html_for_db_test.php
+++ b/test/libraries/PMA_build_html_for_db_test.php
@@ -48,7 +48,7 @@ class PMA_BuildHtmlForDb_Test extends PHPUnit_Framework_TestCase
$GLOBALS['pmaThemePath'] = $_SESSION['PMA_Theme']->getPath();
$GLOBALS['pmaThemeImage'] = 'theme/';
- $GLOBALS['cfg']['DefaultTabDatabase'] = 'db_structure.php';
+ $GLOBALS['cfg']['DefaultTabDatabase'] = 'structure';
}
/**
diff --git a/test/libraries/PMA_select_server_test.php b/test/libraries/PMA_select_server_test.php
index 1651f66d1f..564084d342 100644
--- a/test/libraries/PMA_select_server_test.php
+++ b/test/libraries/PMA_select_server_test.php
@@ -69,7 +69,7 @@ class PMA_SelectServer_Test extends PHPUnit_Framework_TestCase
$not_only_options = false;
$omit_fieldset = false;
- $GLOBALS['cfg']['DefaultTabServer'] = "DefaultTabServer";
+ $GLOBALS['cfg']['DefaultTabServer'] = "welcome";
$GLOBALS['cfg']['Servers'] = array(
'0' => array(
@@ -119,7 +119,9 @@ class PMA_SelectServer_Test extends PHPUnit_Framework_TestCase
//$GLOBALS['cfg']['DefaultTabServer']
$this->assertContains(
- $GLOBALS['cfg']['DefaultTabServer'],
+ PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabServer'], 'server'
+ ),
$html
);
diff --git a/test/libraries/PMA_server_databases_test.php b/test/libraries/PMA_server_databases_test.php
index 37d8a5f9f0..e0842a6ad6 100644
--- a/test/libraries/PMA_server_databases_test.php
+++ b/test/libraries/PMA_server_databases_test.php
@@ -59,7 +59,7 @@ class PMA_ServerDatabases_Test extends PHPUnit_Framework_TestCase
$GLOBALS['cfg']['LimitChars'] = 100;
$GLOBALS['cfg']['DBG']['sql'] = false;
$GLOBALS['cfg']['ActionLinksMode'] = "both";
- $GLOBALS['cfg']['DefaultTabDatabase'] = 'db_structure.php';
+ $GLOBALS['cfg']['DefaultTabDatabase'] = 'structure';
$GLOBALS['table'] = "table";
$GLOBALS['replication_info']['master']['status'] = false;
diff --git a/test/libraries/PMA_server_privileges_test.php b/test/libraries/PMA_server_privileges_test.php
index 17657feb57..f8b88b498a 100644
--- a/test/libraries/PMA_server_privileges_test.php
+++ b/test/libraries/PMA_server_privileges_test.php
@@ -64,10 +64,10 @@ class PMA_ServerPrivileges_Test extends PHPUnit_Framework_TestCase
$GLOBALS['cfg']['LimitChars'] = 100;
$GLOBALS['cfg']['AllowThirdPartyFraming'] = false;
$GLOBALS['cfg']['ActionLinksMode'] = "both";
- $GLOBALS['cfg']['DefaultTabDatabase'] = 'db_structure.php';
+ $GLOBALS['cfg']['DefaultTabDatabase'] = 'structure';
$GLOBALS['cfg']['PmaAbsoluteUri'] = "PmaAbsoluteUri";
- $GLOBALS['cfg']['DefaultTabTable'] = "db_structure.php";
- $GLOBALS['cfg']['NavigationTreeDefaultTabTable'] = "db_structure.php";
+ $GLOBALS['cfg']['DefaultTabTable'] = "structure";
+ $GLOBALS['cfg']['NavigationTreeDefaultTabTable'] = "structure";
$GLOBALS['cfg']['Confirm'] = "Confirm";
$GLOBALS['cfg']['ShowHint'] = true;
@@ -1672,7 +1672,9 @@ class PMA_ServerPrivileges_Test extends PHPUnit_Framework_TestCase
$html
);
$this->assertContains(
- $GLOBALS['cfg']['DefaultTabDatabase'],
+ PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabDatabase'], 'database'
+ ),
$html
);
$item = PMA_URL_getCommon(
@@ -1696,7 +1698,9 @@ class PMA_ServerPrivileges_Test extends PHPUnit_Framework_TestCase
$html
);
$this->assertContains(
- $GLOBALS['cfg']['DefaultTabTable'],
+ PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabTable'], 'table'
+ ),
$html
);
$item = PMA_URL_getCommon(
diff --git a/test/libraries/PMA_sql_query_form_test.php b/test/libraries/PMA_sql_query_form_test.php
index a77e898828..3f97e9a883 100644
--- a/test/libraries/PMA_sql_query_form_test.php
+++ b/test/libraries/PMA_sql_query_form_test.php
@@ -57,7 +57,7 @@ class PMA_SqlQueryForm_Test extends PHPUnit_Framework_TestCase
$GLOBALS['cfg']['TextareaAutoSelect'] = true;
$GLOBALS['cfg']['TextareaRows'] = 100;
$GLOBALS['cfg']['TextareaCols'] = 11;
- $GLOBALS['cfg']['DefaultTabDatabase'] = "default_database";
+ $GLOBALS['cfg']['DefaultTabDatabase'] = "structure";
$GLOBALS['cfg']['RetainQueryBox'] = true;
$GLOBALS['cfg']['ActionLinksMode'] = 'both';
diff --git a/test/libraries/common/PMA_getDbLink_test.php b/test/libraries/common/PMA_getDbLink_test.php
index d108f1ab94..22f0d41830 100644
--- a/test/libraries/common/PMA_getDbLink_test.php
+++ b/test/libraries/common/PMA_getDbLink_test.php
@@ -62,7 +62,11 @@ class PMA_GetDbLink_Test extends PHPUnit_Framework_TestCase
$GLOBALS['db'] = 'test_db';
$database = $GLOBALS['db'];
$this->assertEquals(
- '<a href="' . $cfg['DefaultTabDatabase'] . '?db=' . $database
+ '<a href="'
+ . PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabDatabase'], 'database'
+ )
+ . '?db=' . $database
. '&amp;server=99&amp;lang=en&amp;token=token" '
. 'title="Jump to database &quot;'
. htmlspecialchars($database) . '&quot;.">'
@@ -81,7 +85,10 @@ class PMA_GetDbLink_Test extends PHPUnit_Framework_TestCase
global $cfg;
$database = 'test_database';
$this->assertEquals(
- '<a href="' . $cfg['DefaultTabDatabase'] . '?db=' . $database
+ '<a href="' . PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabDatabase'], 'database'
+ )
+ . '?db=' . $database
. '&amp;server=99&amp;lang=en&amp;token=token" title="Jump to database &quot;'
. htmlspecialchars($database) . '&quot;.">'
. htmlspecialchars($database) . '</a>',
@@ -99,7 +106,11 @@ class PMA_GetDbLink_Test extends PHPUnit_Framework_TestCase
global $cfg;
$database = 'test&data\'base';
$this->assertEquals(
- '<a href="' . $cfg['DefaultTabDatabase'] . '?db='
+ '<a href="'
+ . PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabDatabase'], 'database'
+ )
+ . '?db='
. htmlspecialchars(urlencode($database))
. '&amp;server=99&amp;lang=en&amp;token=token" title="Jump to database &quot;'
. htmlspecialchars($database) . '&quot;.">'
diff --git a/test/theme.php b/test/theme.php
index 02d0436640..24ff49ebbb 100644
--- a/test/theme.php
+++ b/test/theme.php
@@ -52,7 +52,9 @@ $item = '<a href="%1$s?%2$s" class="item">'
echo '<div id="serverinfo">' . "\n";
printf(
$item,
- $GLOBALS['cfg']['DefaultTabServer'],
+ PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabserver'], 'server'
+ ),
PMA_URL_getCommon(),
'Server',
__('Server'),
@@ -62,7 +64,9 @@ printf(
echo $separator;
printf(
$item,
- $GLOBALS['cfg']['DefaultTabDatabase'],
+ PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabDatabase'], 'database'
+ ),
'',
'Database',
__('Database'),
@@ -72,7 +76,9 @@ printf(
echo $separator;
printf(
$item,
- $GLOBALS['cfg']['DefaultTabTable'],
+ PMA_Util::getScriptNameForOption(
+ $GLOBALS['cfg']['DefaultTabTable'], 'table'
+ ),
'',
'Table',
(isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view']