Merge remote-tracking branch 'origin/master'

This commit is contained in:
Pootle server 2011-10-04 22:40:14 +02:00
commit 3c240c5beb
3 changed files with 57 additions and 12 deletions

View File

@ -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

View File

@ -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(
'<img alt="%s" src="%s"%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
<label for="<?php echo htmlspecialchars($path) ?>"><?php echo $name ?></label>
<?php if (!empty($opts['doc']) || !empty($opts['wiki'])) { ?>
<span class="doc">
<?php if (!empty($opts['doc'])) { ?><a href="<?php echo $base_dir . $opts['doc'] ?>" target="documentation"><?php echo PMA_getImage('b_help.png', __('Documentation')); ?></a><?php } ?>
<?php if (!empty($opts['wiki'])){ ?><a href="<?php echo $opts['wiki'] ?>" target="wiki"><?php echo PMA_getImage('b_info.png', __('Wiki')) ?></a><?php } ?>
<?php if (!empty($opts['doc'])) { ?><a href="<?php echo $base_dir . $opts['doc'] ?>" target="documentation"><?php echo $icons['help']; ?></a><?php } ?>
<?php if (!empty($opts['wiki'])){ ?><a href="<?php echo $opts['wiki'] ?>" target="wiki"><?php echo $icons['info']; ?></a><?php } ?>
</span>
<?php } ?>
<?php if ($option_is_disabled) { ?>
@ -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']) {
?>
<a class="userprefs-comment" title="<?php echo htmlspecialchars($opts['userprefs_comment']) ?>"><?php echo PMA_getImage('b_tblops.png', __('Comment')); ?></a>
<a class="userprefs-comment" title="<?php echo htmlspecialchars($opts['userprefs_comment']) ?>"><?php echo $icons['tblops']; ?></a>
<?php
}
if (isset($opts['setvalue']) && $opts['setvalue']) {
?>
<a class="set-value" href="#<?php echo htmlspecialchars("$path={$opts['setvalue']}") ?>" title="<?php echo sprintf(__('Set value: %s'), htmlspecialchars($opts['setvalue'])) ?>" style="display:none"><?php echo PMA_getImage('b_edit.png'); ?></a>
<a class="set-value" href="#<?php echo htmlspecialchars("$path={$opts['setvalue']}") ?>" title="<?php echo sprintf(__('Set value: %s'), htmlspecialchars($opts['setvalue'])) ?>" style="display:none"><?php echo $icons['edit']; ?></a>
<?php
}
if (isset($opts['show_restore_default']) && $opts['show_restore_default']) {
?>
<a class="restore-default" href="#<?php echo $path ?>" title="<?php echo __('Restore default value') ?>" style="display:none"><?php echo PMA_getImage('s_reload.png'); ?></a>
<a class="restore-default" href="#<?php echo $path ?>" title="<?php echo __('Restore default value') ?>" style="display:none"><?php echo $icons['reload']; ?></a>
<?php
}
// this must match with displayErrors() in scripts/config.js

View File

@ -92,15 +92,27 @@ if ($GLOBALS['cfg']['LeftDisplayLogo']) {
if ($GLOBALS['cfg']['MainPageIconic']) {
echo PMA_getImage('b_docs.png', __('phpMyAdmin documentation'));
} else {
echo '<br />' . __('phpMyAdmin documentation');
}
echo '</a>';
echo ' ' . PMA_showMySQLDocu('', '', true) . "\n";
$documentation_link = PMA_showMySQLDocu('', '', true);
if ($GLOBALS['cfg']['MainPageIconic']) {
echo $documentation_link . "\n";
} else {
preg_match('/<a[^>]*>/', $documentation_link, $matches);
$link = $matches[0];
echo substr($link, 0, strlen($link) - 1) . ' title="' . __('Documentation') . '" >'
. '<br />' . __('Documentation') . '</a>';
}
$params = array('uniqid' => uniqid());
if (!empty($GLOBALS['db'])) {
$params['db'] = $GLOBALS['db'];
}
echo '<a href="navigation.php?' . PMA_generate_common_url($params) . '" target="frame_navigation">';
echo '<a href="navigation.php?' . PMA_generate_common_url($params)
. '" title="' . __('Reload navigation frame') . '" target="frame_navigation">';
if ($GLOBALS['cfg']['MainPageIconic']) {
echo PMA_getImage('s_reload', __('Reload navigation frame'));
} else {