bug #3504567 [mime] Description of the transformation missing in the tooltip

This commit is contained in:
Madhura Jayaratne 2012-03-15 00:31:13 +05:30
parent 3cdb0e565a
commit 33d1a8dce2
4 changed files with 32 additions and 12 deletions

View File

@ -74,6 +74,7 @@ phpMyAdmin - ChangeLog
- bug #3423717 [core] Improved detection of SSL connection
+ FULLTEXT support for InnoDB, starting with MySQL 5.6.4
- bug #3497151 [interface] Duplicate inline query edit box
- bug #3504567 [mime] Description of the transformation missing in the tooltip
3.4.11.0 (not yet released)
- bug #3486970 [import] Exception on XML import

View File

@ -531,8 +531,7 @@ for ($i = 0; $i < $num_fields; $i++) {
if (is_array($available_mime['transformation'])) {
foreach ($available_mime['transformation'] AS $mimekey => $transform) {
$checked = (isset($row['Field']) && isset($mime_map[$row['Field']]['transformation']) && (preg_match('@' . preg_quote($available_mime['transformation_file'][$mimekey]) . '3?@i', $mime_map[$row['Field']]['transformation'])) ? 'selected ' : '');
$tooltip = 'strTransformation_' . strtolower(str_replace('.inc.php', '', $available_mime['transformation_file'][$mimekey]));
$tooltip = isset($$tooltip) ? $$tooltip : sprintf(str_replace('<br />', ' ', __('No description is available for this transformation.<br />Please ask the author what %s does.')), 'PMA_transformation_' . $tooltip . '()');
$tooltip = PMA_getTransformationDescription($available_mime['transformation_file'][$mimekey], false);
$content_cells[$i][$ci] .= '<option value="' . $available_mime['transformation_file'][$mimekey] . '" ' . $checked . ' title="' . htmlspecialchars($tooltip) . '">' . htmlspecialchars($transform) . '</option>';
}
}

View File

@ -117,6 +117,35 @@ function PMA_getAvailableMIMEtypes()
return $stack;
}
/**
* Returns the description of the transformation
*
* @param string $file transformation file
* @param string $html_formatted whether the description should be formatted as HTML
*
* @return the description of the transformation
*/
function PMA_getTransformationDescription($file, $html_formatted = true)
{
include_once './libraries/transformations/' . $file;
$func = strtolower(str_replace('.inc.php', '', $file));
$funcname = 'PMA_transformation_' . $func . '_info';
$desc = sprintf(__('No description is available for this transformation.<br />Please ask the author what %s does.'), 'PMA_transformation_' . $func . '()');
if ($html_formatted) {
$desc = '<i>' . $desc . '</i>';
} else {
$desc = str_replace('<br />', ' ', $desc);
}
if (function_exists($funcname)) {
$desc_arr = $funcname();
if (isset($desc_arr['info'])) {
$desc = $desc_arr['info'];
}
}
return $desc;
}
/**
* Gets the mimetypes for all columns of a table
*

View File

@ -51,16 +51,7 @@ foreach ($types['mimetype'] as $key => $mimetype) {
<?php
$odd_row = true;
foreach ($types['transformation'] as $key => $transform) {
$func = strtolower(str_ireplace('.inc.php', '', $types['transformation_file'][$key]));
include './libraries/transformations/' . $types['transformation_file'][$key];
$funcname = 'PMA_transformation_' . $func . '_info';
$desc = '<i>' . sprintf(__('No description is available for this transformation.<br />Please ask the author what %s does.'), 'PMA_transformation_' . $func . '()') . '</i>';
if (function_exists($funcname)) {
$desc_arr = $funcname();
if (isset($desc_arr['info'])) {
$desc = $desc_arr['info'];
}
}
$desc = PMA_getTransformationDescription($types['transformation_file'][$key]);
?>
<tr class="<?php echo $odd_row ? 'odd' : 'even'; ?>">
<td><?php echo $transform; ?></td>