Propagate MIME-type to plugin functions.

This commit is contained in:
Garvin Hicking
2003-11-06 17:02:19 +00:00
parent ac0c6d5344
commit 5255b8841f
4 changed files with 12 additions and 6 deletions

View File

@@ -16,14 +16,17 @@ $Source$
Fix empty table rows in vertical display (kept Mozilla from displaying
borders in this printmode). Adjusted layout a tiny-weeny bit to let
the comments of a field fit the whole space.
* libraries/display_tbl.lib.php3, libraries/transformations/TEMPLATE,
Documentation.html: Propagate current MIME-type to plugin functions.
Thanks for noticing (again), Thiemo. :)
2003-11-06 Michal Cihar <nijel@users.sourceforge.net>
* libraries/export/xml.php3: Add xml header with encoding information
* libraries/export/xml.php3: Add xml header with encoding information
(bug #836630).
2003-11-05 Garvin Hicking <me@supergarv.de>
* libraries/common.lib.php3, footer.inc.php3: Bug #831181: Do not
store queries with errors in history, also when coming from the
* libraries/common.lib.php3, footer.inc.php3: Bug #831181: Do not
store queries with errors in history, also when coming from the
database SQL tab.
* libraries/common.lib.php3: Bug #835854. The MySQL-error messages
are now put inside a <code> HTML-container, not <pre>. This allows

View File

@@ -553,7 +553,7 @@ $cfg['PmaAbsoluteUri'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://'
database list. But <span class="important">it does not replace the
privileges rules of the MySQL database server</span>. If set, it just
means only these databases will be displayed but
<span class="important">not at all other databases can't be used.</span>
<span class="important">not that all other databases can't be used.</span>
<br /><br />
An example of using more that one database:
<tt>$cfg['Servers'][$i]['only_db'] = array('db1', 'db2'); </tt>
@@ -2141,7 +2141,8 @@ To create a new, empty mimetype please see libraries/transformations/template_ge
<li><b>$meta</b> - Contains an object with field information to your column. The data is drawn from the output of the
<a href="http://www.php.net/mysql_fetch_field">mysql_fetch_field()</a> function. This means, all object properties described
on the <a href="http://www.php.net/mysql_fetch_field">manual page</a> are available in this variable and can be used to
transform a field accordingly to unsigned/zerofill/not_null/... properties.</li>
transform a field accordingly to unsigned/zerofill/not_null/... properties.<br />
The $meta-&gt;mimetype variable contains the original MIME-type of the field (i.e. 'text/plain', 'image/jpeg' etc.)</li>
</ol>
<!-- FAQ -->

View File

@@ -1244,7 +1244,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
if (defined('PMA_TRANSFORMATION_' . strtoupper($transformfunction_name)) && function_exists('PMA_transformation_' . $transformfunction_name)) {
$transform_function = 'PMA_transformation_' . $transformfunction_name;
$transform_options = PMA_transformation_getOptions((isset($GLOBALS['mime_map'][$meta->name]['transformation_options']) ? $GLOBALS['mime_map'][$meta->name]['transformation_options'] : ''));
$transform_options = PMA_transformation_getOptions((isset($GLOBALS['mime_map'][$meta->name]['transformation_options']) ? $GLOBALS['mime_map'][$meta->name]['transformation_options'] : ''));
$meta->mimetype = str_replace('_', '/', $GLOBALS['mime_map'][$meta->name]['mimetype']);
}
} // end if file_exists
} // end if transformation is set

View File

@@ -23,6 +23,7 @@ if (!defined('PMA_TRANSFORMATION_[ENTER_FILENAME_HERE]')){
// You can evaluate the propagated $meta Object. It's contained fields are described in http://www.php.net/mysql_fetch_field.
// This stored information can be used to get the field information about the transformed field.
// $meta->mimetype contains the original MimeType of the field (i.e. 'text/plain', 'image/jpeg' etc.)
return $buffer;
}