diff --git a/ChangeLog b/ChangeLog index c4acd4ca0..f3314bdb7 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,7 +5,10 @@ phpMyAdmin - Changelog $Id$ $Source$ -2004-04-24 Robin Johnson +2002-04-24 Alexander M. Turek + * libraries/*: $cfg system changes. + +2002-04-24 Robin Johnson * *.php3 NOT tbl_*.php, Documentation.*: $cfg system changes. 2002-04-23 Marc Delisle diff --git a/libraries/auth/config.auth.lib.php3 b/libraries/auth/config.auth.lib.php3 index e2c928dc1..54be7b752 100644 --- a/libraries/auth/config.auth.lib.php3 +++ b/libraries/auth/config.auth.lib.php3 @@ -68,7 +68,7 @@ if (!defined('PMA_CONFIG_AUTH_INCLUDED')) { function PMA_auth_fails() { global $php_errormsg; - global $connect_func, $server_port, $server_socket, $cfgServer; + global $connect_func, $server_port, $server_socket, $cfg; global $right_font_family, $font_size, $font_bigger; if (mysql_error()) { @@ -79,9 +79,9 @@ if (!defined('PMA_CONFIG_AUTH_INCLUDED')) { $conn_error = 'Cannot connect: invalid settings.'; } $local_query = $connect_func . '(' - . $cfgServer['host'] . $server_port . $server_socket . ', ' - . $cfgServer['user'] . ', ' - . $cfgServer['password'] . ')'; + . $cfg['Server']['host'] . $server_port . $server_socket . ', ' + . $cfg['Server']['user'] . ', ' + . $cfg['Server']['password'] . ')'; // Defines the charset to be used header('Content-Type: text/html; charset=' . $GLOBALS['charset']); @@ -100,7 +100,7 @@ h1 {font-family: ; font-size: - +

diff --git a/libraries/auth/cookie.auth.lib.php3 b/libraries/auth/cookie.auth.lib.php3 index b6cef26cb..73f5f61dc 100644 --- a/libraries/auth/cookie.auth.lib.php3 +++ b/libraries/auth/cookie.auth.lib.php3 @@ -14,7 +14,7 @@ if (!defined('PMA_COOKIE_AUTH_INCLUDED')) { // Gets the default font sizes PMA_setFontSizes(); // Defines the cookie path and whether the server is using https or not - $pma_uri_parts = parse_url($cfgPmaAbsoluteUri); + $pma_uri_parts = parse_url($cfg['PmaAbsoluteUri']); $cookie_path = substr($pma_uri_parts['path'], 0, strrpos($pma_uri_parts['path'], '/')); $is_https = ($pma_uri_parts['scheme'] == 'https') ? 1 : 0; @@ -55,14 +55,14 @@ if (!defined('PMA_COOKIE_AUTH_INCLUDED')) { function PMA_auth() { global $right_font_family, $font_size, $font_bigger; - global $cfgServers, $available_languages; + global $cfg, $available_languages; global $lang, $server; global $HTTP_COOKIE_VARS; // Tries to get the username from cookie whatever are the values of the // 'register_globals' and the 'variables_order' directives if last login // should be recalled, else skip the IE autocomplete feature. - if ($GLOBALS['cfgLoginCookieRecall']) { + if ($cfg['LoginCookieRecall']) { if (!empty($GLOBALS['pma_cookie_username'])) { $default_user = $GLOBALS['pma_cookie_username']; } @@ -104,14 +104,14 @@ input.textfield {font-family: ; font-size: - +


@@ -165,7 +165,7 @@ input.textfield {font-family: ; font-size: 1) { + if (count($cfg['Servers']) > 1) { echo "\n"; ?> @@ -175,8 +175,8 @@ input.textfield {font-family: ; font-size: ; font-size: '; } echo "\n"; @@ -347,37 +347,37 @@ if (uname.value == '') { */ function PMA_auth_set_user() { - global $cfgServers, $server, $cfgServer; + global $cfg, $server; global $PHP_AUTH_USER, $PHP_AUTH_PW; global $from_cookie; // Ensures the valid 'only_db' setting is used - if ($cfgServer['user'] != $PHP_AUTH_USER) { - $servers_cnt = count($cfgServers); + if ($cfg['Server']['user'] != $PHP_AUTH_USER) { + $servers_cnt = count($cfg['Servers']); for ($i = 1; $i <= $servers_cnt; $i++) { - if (isset($cfgServers[$i]) - && ($cfgServers[$i]['host'] == $cfgServer['host'] && $cfgServers[$i]['user'] == $PHP_AUTH_USER)) { + if (isset($cfg['Servers'][$i]) + && ($cfg['Servers'][$i]['host'] == $cfg['Server']['host'] && $cfg['Servers'][$i]['user'] == $PHP_AUTH_USER)) { $server = $i; - $cfgServer = $cfgServers[$i]; + $cfg['Server'] = $cfg['Servers'][$i]; break; } } // end for } // end if - $cfgServer['user'] = $PHP_AUTH_USER; - $cfgServer['password'] = $PHP_AUTH_PW; + $cfg['Server']['user'] = $PHP_AUTH_USER; + $cfg['Server']['password'] = $PHP_AUTH_PW; // Set cookies if required (once per session) if (!$from_cookie) { // Duration = one month for username setcookie('pma_cookie_username', - $cfgServer['user'], + $cfg['Server']['user'], time() + (60 * 60 * 24 * 30), $GLOBALS['cookie_path'], '' , $GLOBALS['is_https']); // Duration = till the browser is closed for password setcookie('pma_cookie_password', - $cfgServer['password'], + $cfg['Server']['password'], 0, $GLOBALS['cookie_path'], '', $GLOBALS['is_https']); diff --git a/libraries/auth/http.auth.lib.php3 b/libraries/auth/http.auth.lib.php3 index 81e7a0178..abdac92a6 100644 --- a/libraries/auth/http.auth.lib.php3 +++ b/libraries/auth/http.auth.lib.php3 @@ -25,7 +25,7 @@ if (!defined('PMA_HTTP_AUTH_INCLUDED')) { { global $right_font_family, $font_size, $font_bigger; - header('WWW-Authenticate: Basic realm="phpMyAdmin ' . sprintf($GLOBALS['strRunning'], (empty($GLOBALS['cfgServer']['verbose']) ? str_replace('\'', '\\\'',$GLOBALS['cfgServer']['host']) : str_replace('\'', '\\\'', $GLOBALS['cfgServer']['verbose']))) . '"'); + header('WWW-Authenticate: Basic realm="phpMyAdmin ' . sprintf($GLOBALS['strRunning'], (empty($GLOBALS['cfg']['Server']['verbose']) ? str_replace('\'', '\\\'',$GLOBALS['cfg']['Server']['host']) : str_replace('\'', '\\\'', $GLOBALS['cfg']['Server']['verbose']))) . '"'); header('HTTP/1.0 401 Unauthorized'); header('status: 401 Unauthorized'); @@ -46,7 +46,7 @@ h1 {font-family: ; font-size: - +

@@ -220,24 +220,24 @@ h1 {font-family: ; font-size: Your config file version is not supported any longer!

' . "\n"; + include('./footer.inc.php3'); + exit(); } - if (!isset($cfgShowFunctionFields)) { - $cfgShowFunctionFields = TRUE; - } - if (!isset($cfgZipDump)) { - $cfgZipDump = (isset($cfgGZipDump) ? $cfgGZipDump : TRUE); - } - if (!isset($cfgLeftBgColor)) { - $cfgLeftBgColor = '#D0DCE0'; - } - if (!isset($cfgLeftPointerColor)) { - $cfgLeftPointerColor = ''; - } - if (!isset($cfgRightBgColor)) { - $cfgRightBgColor = '#F5F5F5'; - } - if (!isset($cfgBrowsePointerColor)) { - $cfgBrowsePointerColor = ''; - } - if (!isset($cfgBrowseMarkerColor)) { - $cfgBrowseMarkerColor = (!empty($cfgBrowsePointerColor) && !empty($cfgBrowseMarkRow)) - ? '#FFCC99' - : ''; - } - if (!isset($cfgTextareaCols)) { - $cfgTextareaCols = 40; - } - if (!isset($cfgTextareaRows)) { - $cfgTextareaRows = 7; - } - if (!isset($cfgDefaultDisplay)) { - $cfgDefaultDisplay = 'horizontal'; - } - if (!isset($cfgRepeatCells)) { - $cfgRepeatCells = 100; - } - if (!isset($cfgLeftFrameLight)) { - $cfgLeftFrameLight = TRUE; - } + // rabus: The new backwards compatibility code will follow soon... /** * Gets constants that defines the PHP, MySQL... releases. @@ -373,11 +309,11 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){ /** - * $cfgPmaAbsoluteUri is a required directive else cookies won't be set - * properly and, depending on browsers, inserting or updating a record + * $cfg['PmaAbsoluteUri'] is a required directive else cookies won't be + * set properly and, depending on browsers, inserting or updating a * record might fail */ - if (empty($cfgPmaAbsoluteUri)) { + if (empty($cfg['PmaAbsoluteUri'])) { if (empty($GLOBALS['is_header_sent'])) { include('./header.inc.php3'); } @@ -387,78 +323,78 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){ } // Adds a trailing slash et the end of the phpMyAdmin uri if it does not // exist - else if (substr($cfgPmaAbsoluteUri, -1) != '/') { - $cfgPmaAbsoluteUri .= '/'; + else if (substr($cfg['PmaAbsoluteUri'], -1) != '/') { + $cfg['PmaAbsoluteUri'] .= '/'; } /** * Use mysql_connect() or mysql_pconnect()? */ - $connect_func = ($cfgPersistentConnections) ? 'mysql_pconnect' : 'mysql_connect'; + $connect_func = ($cfg['PersistentConnections']) ? 'mysql_pconnect' : 'mysql_connect'; $dblist = array(); /** * Gets the valid servers list and parameters */ - reset($cfgServers); - while (list($key, $val) = each($cfgServers)) { + reset($cfg['Servers']); + while (list($key, $val) = each($cfg['Servers'])) { // Don't use servers with no hostname if (empty($val['host'])) { - unset($cfgServers[$key]); + unset($cfg['Servers'][$key]); } } - if (empty($server) || !isset($cfgServers[$server]) || !is_array($cfgServers[$server])) { - $server = $cfgServerDefault; + if (empty($server) || !isset($cfg['Servers'][$server]) || !is_array($cfg['Servers'][$server])) { + $server = $cfg['ServerDefault']; } /** - * If no server is selected, make sure that $cfgServer is empty (so that - * nothing will work), and skip server authentication. + * If no server is selected, make sure that $cfg['Server'] is empty (so + * that nothing will work), and skip server authentication. * We do NOT exit here, but continue on without logging into any server. * This way, the welcome page will still come up (with no server info) and * present a choice of servers in the case that there are multiple servers - * and '$cfgServerDefault = 0' is set. + * and '$cfg['ServerDefault'] = 0' is set. */ if ($server == 0) { - $cfgServer = array(); + $cfg['Server'] = array(); } /** - * Otherwise, set up $cfgServer and do the usual login stuff. + * Otherwise, set up $cfg['Server'] and do the usual login stuff. */ - else if (isset($cfgServers[$server])) { - $cfgServer = $cfgServers[$server]; + else if (isset($cfg['Servers'][$server])) { + $cfgServer = $cfg['Servers'][$server]; // Check how the config says to connect to the server - $server_port = (empty($cfgServer['port'])) + $server_port = (empty($cfg['Server']['port'])) ? '' - : ':' . $cfgServer['port']; - if (strtolower($cfgServer['connect_type']) == 'tcp') { - $cfgServer['socket'] = ''; + : ':' . $cfg['Server']['port']; + if (strtolower($cfg['Server']['connect_type']) == 'tcp') { + $cfg['Server']['socket'] = ''; } - $server_socket = (empty($cfgServer['socket']) || PMA_PHP_INT_VERSION < 30010) + $server_socket = (empty($cfg['Server']['socket']) || PMA_PHP_INT_VERSION < 30010) ? '' - : ':' . $cfgServer['socket']; + : ':' . $cfg['Server']['socket']; // Ensures compatibility with old config files - if (!isset($cfgServer['auth_type'])) { - $cfgServer['auth_type'] = (isset($cfgServer['adv_auth']) && $cfgServer['adv_auth']) + if (!isset($cfg['Server']['auth_type'])) { + $cfg['Server']['auth_type'] = (isset($cfg['Server']['adv_auth']) && $cfg['Server']['adv_auth']) ? 'http' : 'config'; } - if (isset($cfgServer['stduser'])) { - $cfgServer['controluser'] = $cfgServer['stduser']; - $cfgServer['controlpass'] = $cfgServer['stdpass']; + if (isset($cfg['Server']['stduser'])) { + $cfg['Server']['controluser'] = $cfg['Server']['stduser']; + $cfg['Server']['controlpass'] = $cfg['Server']['stdpass']; } - // Gets the authentication library that fits the cfgServer settings + // Gets the authentication library that fits the $cfg['Server'] settings // and run authentication - include('./libraries/auth/' . $cfgServer['auth_type'] . '.auth.lib.php3'); + include('./libraries/auth/' . $cfg['Server']['auth_type'] . '.auth.lib.php3'); if (!PMA_auth_check()) { PMA_auth(); } else { @@ -466,11 +402,11 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){ } // The user can work with only some databases - if (isset($cfgServer['only_db']) && $cfgServer['only_db'] != '') { - if (is_array($cfgServer['only_db'])) { - $dblist = $cfgServer['only_db']; + if (isset($cfg['Server']['only_db']) && $cfg['Server']['only_db'] != '') { + if (is_array($cfg['Server']['only_db'])) { + $dblist = $cfg['Server']['only_db']; } else { - $dblist[] = $cfgServer['only_db']; + $dblist[] = $cfg['Server']['only_db']; } } // end if @@ -482,11 +418,11 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){ // get the privileges list for the current user but the true user link // must be open after this one so it would be default one for all the // scripts) - if ($cfgServer['controluser'] != '') { + if ($cfg['Server']['controluser'] != '') { $dbh = @$connect_func( - $cfgServer['host'] . $server_port . $server_socket, - $cfgServer['controluser'], - $cfgServer['controlpass'] + $cfg['Server']['host'] . $server_port . $server_socket, + $cfg['Server']['controluser'], + $cfg['Server']['controlpass'] ); if ($dbh == FALSE) { if (mysql_error()) { @@ -497,18 +433,18 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){ $conn_error = 'Cannot connect: invalid settings.'; } $local_query = $connect_func . '(' - . $cfgServer['host'] . $server_port . $server_socket . ', ' - . $cfgServer['controluser'] . ', ' - . $cfgServer['stdpass'] . ')'; + . $cfg['Server']['host'] . $server_port . $server_socket . ', ' + . $cfg['Server']['controluser'] . ', ' + . $cfg['Server']['stdpass'] . ')'; PMA_mysqlDie($conn_error, $local_query, FALSE); } // end if } // end if // Connects to the server (validates user's login) $userlink = @$connect_func( - $cfgServer['host'] . $server_port . $server_socket, - $cfgServer['user'], - $cfgServer['password'] + $cfg['Server']['host'] . $server_port . $server_socket, + $cfg['Server']['user'], + $cfg['Server']['password'] ); if ($userlink == FALSE) { PMA_auth_fails(); @@ -520,7 +456,7 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){ // If controluser isn't defined, use the current user settings to get // his rights - if ($cfgServer['controluser'] == '') { + if ($cfg['Server']['controluser'] == '') { $dbh = $userlink; } @@ -587,7 +523,7 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){ if (!$dblist_cnt) { $auth_query = 'SELECT User, Select_priv ' . 'FROM mysql.user ' - . 'WHERE User = \'' . PMA_sqlAddslashes($cfgServer['user']) . '\''; + . 'WHERE User = \'' . PMA_sqlAddslashes($cfg['Server']['user']) . '\''; $rs = mysql_query($auth_query, $dbh); // Debug: or PMA_mysqlDie('', $auth_query, FALSE); } // end } // end if (!$dblist_cnt) @@ -611,7 +547,7 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){ // 1. get allowed dbs from the "mysql.db" table // lem9: User can be blank (anonymous user) - $local_query = 'SELECT DISTINCT Db FROM mysql.db WHERE Select_priv = \'Y\' AND (User = \'' . PMA_sqlAddslashes($cfgServer['user']) . '\' OR User = \'\')'; + $local_query = 'SELECT DISTINCT Db FROM mysql.db WHERE Select_priv = \'Y\' AND (User = \'' . PMA_sqlAddslashes($cfg['Server']['user']) . '\' OR User = \'\')'; $rs = mysql_query($local_query, $dbh); // Debug: or PMA_mysqlDie('', $local_query, FALSE); if (@mysql_numrows($rs)) { // Will use as associative array of the following 2 code @@ -672,7 +608,7 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){ } // end if // 2. get allowed dbs from the "mysql.tables_priv" table - $local_query = 'SELECT DISTINCT Db FROM mysql.tables_priv WHERE Table_priv LIKE \'%Select%\' AND User = \'' . PMA_sqlAddslashes($cfgServer['user']) . '\''; + $local_query = 'SELECT DISTINCT Db FROM mysql.tables_priv WHERE Table_priv LIKE \'%Select%\' AND User = \'' . PMA_sqlAddslashes($cfg['Server']['user']) . '\''; $rs = mysql_query($local_query, $dbh); // Debug: or PMA_mysqlDie('', $local_query, FALSE); if (@mysql_numrows($rs)) { while ($row = mysql_fetch_array($rs)) { @@ -891,18 +827,18 @@ window.parent.frames['nav'].location.replace(''); echo "\n"; ?>
- +
- - ' . "\n"; } // end if - $bgcolor = ($foo % 2) ? $GLOBALS['cfgBgcolorOne'] : $GLOBALS['cfgBgcolorTwo']; + $bgcolor = ($foo % 2) ? $GLOBALS['cfg']['BgcolorOne'] : $GLOBALS['cfg']['BgcolorTwo']; if ($disp_direction == 'horizontal') { // loic1: pointer code part $on_mouse = ''; - if ($GLOBALS['cfgBrowsePointerColor'] != '') { - $on_mouse = ' onmouseover="setPointer(this, \'over\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfgBrowsePointerColor'] . '\', \'' . $GLOBALS['cfgBrowseMarkerColor'] . '\')"' - . ' onmouseout="setPointer(this, \'out\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfgBrowsePointerColor'] . '\', \'' . $GLOBALS['cfgBrowseMarkerColor'] . '\')"'; + if ($GLOBALS['cfg']['BrowsePointerColor'] != '') { + $on_mouse = ' onmouseover="setPointer(this, \'over\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\')"' + . ' onmouseout="setPointer(this, \'out\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\')"'; } - if ($GLOBALS['cfgBrowseMarkerColor'] != '') { - $on_mouse .= ' onmousedown="setPointer(this, \'click\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfgBrowsePointerColor'] . '\', \'' . $GLOBALS['cfgBrowseMarkerColor'] . '\')"'; + if ($GLOBALS['cfg']['BrowseMarkerColor'] != '') { + $on_mouse .= ' onmousedown="setPointer(this, \'click\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\')"'; } ?> > @@ -883,7 +883,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ } // end if (1.2.2) // 1.3 Displays the links at left if required - if ($GLOBALS['cfgModifyDeleteAtLeft'] + if ($GLOBALS['cfg']['ModifyDeleteAtLeft'] && ($disp_direction == 'horizontal')) { if (!empty($edit_url)) { ?> @@ -936,10 +936,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ } else { $vertical_display['data'][$foo][$i] = ' ' . "\n"; } - } else if ($GLOBALS['cfgShowBlob'] == FALSE && eregi('BLOB', $meta->type)) { + } else if ($GLOBALS['cfg']['ShowBlob'] == FALSE && eregi('BLOB', $meta->type)) { // loic1 : mysql_fetch_fields returns BLOB in place of TEXT // fields type, however TEXT fields must be displayed even - // if $cfgShowBlob is false -> get the true type of the + // if $cfg['ShowBlob'] is false -> get the true type of the // fields. $field_flags = mysql_field_flags($dt_result, $i); if (eregi('BINARY', $field_flags)) { @@ -949,8 +949,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ || (function_exists('is_null') && is_null($row[$pointer]))) { $vertical_display['data'][$foo][$i] = ' ' . "\n"; } else if ($row[$pointer] != '') { - if (strlen($row[$pointer]) > $GLOBALS['cfgLimitChars'] && ($dontlimitchars != 1)) { - $row[$pointer] = substr($row[$pointer], 0, $GLOBALS['cfgLimitChars']) . '...'; + if (strlen($row[$pointer]) > $GLOBALS['cfg']['LimitChars'] && ($dontlimitchars != 1)) { + $row[$pointer] = substr($row[$pointer], 0, $GLOBALS['cfg']['LimitChars']) . '...'; } // loic1: displays all space characters, 4 space // characters for tabulations and / @@ -970,10 +970,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ // loic1: support blanks in the key $relation_id = $row[$pointer]; - // loic1: Cut text/blob fields even if $cfgShowBlob is true + // loic1: Cut text/blob fields even if $cfg['ShowBlob'] is true if (eregi('BLOB', $meta->type)) { - if (strlen($row[$pointer]) > $GLOBALS['cfgLimitChars'] && ($dontlimitchars != 1)) { - $row[$pointer] = substr($row[$pointer], 0, $GLOBALS['cfgLimitChars']) . '...'; + if (strlen($row[$pointer]) > $GLOBALS['cfg']['LimitChars'] && ($dontlimitchars != 1)) { + $row[$pointer] = substr($row[$pointer], 0, $GLOBALS['cfg']['LimitChars']) . '...'; } } // loic1: displays special characters from binaries @@ -1022,7 +1022,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ } // end for (2) // 3. Displays the modify/delete links on the right if required - if ($GLOBALS['cfgModifyDeleteAtRight'] + if ($GLOBALS['cfg']['ModifyDeleteAtRight'] && ($disp_direction == 'horizontal')) { if (!empty($edit_url)) { ?> @@ -1105,7 +1105,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ reset($vertical_display); // Displays "edit" link at top if required - if ($GLOBALS['cfgModifyDeleteAtLeft'] && is_array($vertical_display['edit'])) { + if ($GLOBALS['cfg']['ModifyDeleteAtLeft'] && is_array($vertical_display['edit'])) { echo '' . "\n"; echo $vertical_display['textbtn']; reset($vertical_display['edit']); @@ -1122,7 +1122,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ } // end if // Displays "delete" link at top if required - if ($GLOBALS['cfgModifyDeleteAtLeft'] && is_array($vertical_display['delete'])) { + if ($GLOBALS['cfg']['ModifyDeleteAtLeft'] && is_array($vertical_display['delete'])) { echo '' . "\n"; if (!is_array($vertical_display['edit'])) { echo $vertical_display['textbtn']; @@ -1160,7 +1160,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ } // end while // Displays "edit" link at bottom if required - if ($GLOBALS['cfgModifyDeleteAtRight'] && is_array($vertical_display['edit'])) { + if ($GLOBALS['cfg']['ModifyDeleteAtRight'] && is_array($vertical_display['edit'])) { echo '' . "\n"; echo $vertical_display['textbtn']; reset($vertical_display['edit']); @@ -1177,7 +1177,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ } // end if // Displays "delete" link at bottom if required - if ($GLOBALS['cfgModifyDeleteAtRight'] && is_array($vertical_display['delete'])) { + if ($GLOBALS['cfg']['ModifyDeleteAtRight'] && is_array($vertical_display['delete'])) { echo '' . "\n"; if (!is_array($vertical_display['edit'])) { echo $vertical_display['textbtn']; @@ -1236,7 +1236,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ */ function PMA_displayTable(&$dt_result, &$the_disp_mode) { - global $lang, $server, $cfgServer, $db, $table; + global $lang, $server, $cfg, $db, $table; global $goto; global $sql_query, $num_rows, $unlim_num_rows, $pos, $fields_meta, $fields_cnt; global $vertical_display, $disp_direction, $repeat_cells; @@ -1261,8 +1261,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ $pos_next = 0; $pos_prev = 0; } else { - $pos_next = $pos + $GLOBALS['cfgMaxRows']; - $pos_prev = $pos - $GLOBALS['cfgMaxRows']; + $pos_next = $pos + $GLOBALS['cfg']['MaxRows']; + $pos_prev = $pos - $GLOBALS['cfg']['MaxRows']; if ($pos_prev < 0) { $pos_prev = 0; } @@ -1313,7 +1313,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ // init map $map = array(); - if (!empty($cfgServer['relation'])) { + if (!empty($cfg['Server']['relation'])) { // find tables // $tabs = '(\'' . join('\',\'', spliti('`? *((on [^,]+)?,|(NATURAL )?(inner|left|right)( outer)? join) *`?', // eregi_replace('^.*FROM +`?|`? *(on [^,]+)?(WHERE.*)?$', '', $sql_query))) . '\')'; @@ -1322,7 +1322,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ $tabs = '(\'' . join('\',\'', split($pattern, $target)) . '\')'; $local_query = 'SELECT src_column, dest_table, dest_column' - . ' FROM ' . $cfgServer['relation'] + . ' FROM ' . $cfg['Server']['relation'] . ' WHERE src_table IN ' . $tabs; $result = @mysql_query($local_query); if ($result) { @@ -1335,7 +1335,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ // 3. ----- Displays the results table ----- ?> -
+
+ '); */ function PMA_showDocuShort($link) { - if (!empty($GLOBALS['cfgManualBaseShort'])) { - return '[' . $GLOBALS['strDocu'] . ']'; + if (!empty($GLOBALS['cfg']['ManualBaseShort'])) { + return '[' . $GLOBALS['strDocu'] . ']'; } } // end of the 'PMA_showDocuShort()' function diff --git a/libraries/display_tbl.lib.php3 b/libraries/display_tbl.lib.php3 index dea9a604b..d71b13616 100644 --- a/libraries/display_tbl.lib.php3 +++ b/libraries/display_tbl.lib.php3 @@ -206,7 +206,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ // Move to the beginning or to the previous page if ($pos > 0 && $session_max_rows != 'all') { // loic1: patch #474210 from Gosha Sakovich - part 1 - if ($GLOBALS['cfgNavigationBarIconic']) { + if ($GLOBALS['cfg']['NavigationBarIconic']) { $caption1 = '<<'; $caption2 = ' < '; $title1 = ' title="' . $GLOBALS['strPos1'] . '"'; @@ -268,7 +268,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ - +
@@ -293,7 +293,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ if (($pos + $session_max_rows < $unlim_num_rows) && $num_rows >= $session_max_rows && $session_max_rows != 'all') { // loic1: patch #474210 from Gosha Sakovich - part 2 - if ($GLOBALS['cfgNavigationBarIconic']) { + if ($GLOBALS['cfg']['NavigationBarIconic']) { $caption3 = ' > '; $caption4 = '>>'; $title3 = ' title="' . $GLOBALS['strNext'] . '"'; @@ -343,7 +343,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ } // end move toward // Show all the records if allowed - if ($GLOBALS['cfgShowAll'] && ($num_rows < $unlim_num_rows)) { + if ($GLOBALS['cfg']['ShowAll'] && ($num_rows < $unlim_num_rows)) { echo "\n"; ?>
@@ -479,7 +479,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ // ... at the left column of the result table header if possible // and required - else if ($GLOBALS['cfgModifyDeleteAtLeft'] && $is_display['text_btn'] == '1') { + else if ($GLOBALS['cfg']['ModifyDeleteAtLeft'] && $is_display['text_btn'] == '1') { $vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1; if ($disp_direction == 'horizontal') { echo "\n"; @@ -499,7 +499,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ } // ... else if no button, displays empty(ies) col(s) if required - else if ($GLOBALS['cfgModifyDeleteAtLeft'] + else if ($GLOBALS['cfg']['ModifyDeleteAtLeft'] && ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn')) { $vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1; if ($disp_direction == 'horizontal') { @@ -562,11 +562,11 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ // 2.1.4 Do define the sorting url if (!$is_in_sort) { // loic1: patch #455484 ("Smart" order) - $cfgOrder = strtoupper($GLOBALS['cfgOrder']); - if ($cfgOrder == 'SMART') { - $cfgOrder = (eregi('time|date', $fields_meta[$i]->type)) ? 'DESC' : 'ASC'; + $cfg['Order'] = strtoupper($GLOBALS['cfg']['Order']); + if ($cfg['Order'] == 'SMART') { + $cfg['Order'] = (eregi('time|date', $fields_meta[$i]->type)) ? 'DESC' : 'ASC'; } - $sort_order = ' ORDER BY ' . $sort_tbl . PMA_backquote($fields_meta[$i]->name) . ' ' . $cfgOrder; + $sort_order = ' ORDER BY ' . $sort_tbl . PMA_backquote($fields_meta[$i]->name) . ' ' . $cfg['Order']; $order_img = ''; } else if (substr($sql_order, -3) == 'ASC' && $is_in_sort) { @@ -627,7 +627,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ // 3. Displays the full/partial text button (part 2) at the right // column of the result table header if possible and required... - if ($GLOBALS['cfgModifyDeleteAtRight'] + if ($GLOBALS['cfg']['ModifyDeleteAtRight'] && ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn') && $is_display['text_btn'] == '1') { $vertical_display['emptyafter'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1; @@ -649,7 +649,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ } // ... else if no button, displays empty cols if required - else if ($GLOBALS['cfgModifyDeleteAtRight'] + else if ($GLOBALS['cfg']['ModifyDeleteAtRight'] && ($is_display['edit_lnk'] == 'nn' && $is_display['del_lnk'] == 'nn')) { $vertical_display['emptyafter'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1; if ($disp_direction == 'horizontal') { @@ -764,17 +764,17 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){ echo '
 NULL
+