diff --git a/ChangeLog b/ChangeLog index 8ced7db55b..69ac90ee46 100644 --- a/ChangeLog +++ b/ChangeLog @@ -51,6 +51,7 @@ phpMyAdmin - ChangeLog - bug #3356456 [interface] Interface problems for queries having LIMIT clauses 3.4.7.0 (not yet released) +- bug #3418610 [interface] Links in navigation when $cfg['MainPageIconic'] = false 3.4.6.0 (not yet released) - patch #3404173 InnoDB comment display with tooltips/aliases diff --git a/libraries/config/FormDisplay.tpl.php b/libraries/config/FormDisplay.tpl.php index a9e509a21a..58d6d3e789 100644 --- a/libraries/config/FormDisplay.tpl.php +++ b/libraries/config/FormDisplay.tpl.php @@ -124,14 +124,46 @@ function display_fieldset_top($title = '', $description = '', $errors = null, $a function display_input($path, $name, $description = '', $type, $value, $value_is_default = true, $opts = null) { global $_FormDisplayGroup; - static $base_dir, $img_path; + static $base_dir; // Relative path to the root phpMyAdmin folder + static $icons; // An array of IMG tags used further below in the function $is_setup_script = defined('PMA_SETUP'); - if ($base_dir === null) { + if ($base_dir === null) { // if the static variables have not been initialised $base_dir = $is_setup_script ? '../' : ''; - $img_path = $is_setup_script - ? '../' . ltrim($GLOBALS['cfg']['ThemePath'], './') . '/original/img/' - : $_SESSION['PMA_Theme']->img_path; + $icons = array(); + // Icon definitions: + // The same indexes will be used in the $icons array. + // The first element contains the filename and the second + // element is used for the "alt" and "title" attributes. + $icon_init = array( + 'edit' => array('b_edit.png', ''), + 'help' => array('b_help.png', __('Documentation')), + 'info' => array('b_info.png', __('Wiki')), + 'reload' => array('s_reload.png', ''), + 'tblops' => array('b_tblops.png', '') + ); + if ($is_setup_script) { + // When called from the setup script, we don't have access to the + // sprite-aware PMA_getImage() function because the PMA_theme class + // has not been loaded, so we generate the img tags manually. + foreach ($icon_init as $k => $v) { + $title = ''; + if (! empty($v[1])) { + $title = ' title="' . $v[1] . '"'; + } + $icons[$k] = sprintf( + '%s', + $v[1], + ".{$GLOBALS['cfg']['ThemePath']}/original/img/{$v[0]}", + $title + ); + } + } else { + // In this case we just use PMA_getImage() because it's available + foreach ($icon_init as $k => $v) { + $icons[$k] = PMA_getImage($v[0], $v[1]); + } + } } $has_errors = isset($opts['errors']) && !empty($opts['errors']); $option_is_disabled = !$is_setup_script && isset($opts['userprefs_allow']) && !$opts['userprefs_allow']; @@ -159,8 +191,8 @@ function display_input($path, $name, $description = '', $type, $value, $value_is - - + + @@ -234,17 +266,17 @@ function display_input($path, $name, $description = '', $type, $value, $value_is } if ($is_setup_script && isset($opts['userprefs_comment']) && $opts['userprefs_comment']) { ?> - + - " title="" style="display:none"> + " title="" style="display:none"> - + ' . __('phpMyAdmin documentation'); } echo ''; - echo ' ' . PMA_showMySQLDocu('', '', true) . "\n"; + + $documentation_link = PMA_showMySQLDocu('', '', true); + if ($GLOBALS['cfg']['MainPageIconic']) { + echo $documentation_link . "\n"; + } else { + preg_match('/]*>/', $documentation_link, $matches); + $link = $matches[0]; + echo substr($link, 0, strlen($link) - 1) . ' title="' . __('Documentation') . '" >' + . '
' . __('Documentation') . ''; + } $params = array('uniqid' => uniqid()); if (!empty($GLOBALS['db'])) { $params['db'] = $GLOBALS['db']; } - echo ''; + echo ''; if ($GLOBALS['cfg']['MainPageIconic']) { echo PMA_getImage('s_reload', __('Reload navigation frame')); } else {