Merge pull request #1216 from ibennetch/4449

Bug 4449: Mediawiki export does not produce table header row; also fix related PHP warnings
This commit is contained in:
Michal Čihař 2014-06-10 08:58:00 +02:00
commit d2c184a3c6
3 changed files with 7 additions and 4 deletions

View File

@ -2,6 +2,7 @@ phpMyAdmin - ChangeLog
======================
4.2.4.0 (not yet released)
- bug #4449 Mediawiki export does not produce table header row; also fix related PHP warnings
4.2.3.0 (2014-06-08)
- bug #4423 Moving fields not working

View File

@ -64,6 +64,7 @@ if (!defined('TESTSUITE')) {
'htmlword_structure_or_data',
'htmlword_null',
'htmlword_columns',
'mediawiki_headers',
'mediawiki_structure_or_data',
'mediawiki_caption',
'pdf_report_title',

View File

@ -200,6 +200,7 @@ class ExportMediawiki extends ExportPlugin
$do_mime = false,
$dates = false
) {
$output = '';
switch($export_mode) {
case 'create_table':
$columns = $GLOBALS['dbi']->getColumns($db, $table);
@ -217,12 +218,12 @@ class ExportMediawiki extends ExportPlugin
. $this->_exportCRLF();
// Add the table name
if ($GLOBALS['mediawiki_caption']) {
if (isset($GLOBALS['mediawiki_caption'])) {
$output .= "|+'''" . $table . "'''" . $this->_exportCRLF();
}
// Add the table headers
if ($GLOBALS['mediawiki_headers']) {
if (isset($GLOBALS['mediawiki_headers'])) {
$output .= "|- style=\"background:#ffdead;\"" . $this->_exportCRLF();
$output .= "! style=\"background:#ffffff\" | "
. $this->_exportCRLF();
@ -293,12 +294,12 @@ class ExportMediawiki extends ExportPlugin
. $this->_exportCRLF();
// Add the table name
if ($GLOBALS['mediawiki_caption']) {
if (isset($GLOBALS['mediawiki_caption'])) {
$output .= "|+'''" . $table . "'''" . $this->_exportCRLF();
}
// Add the table headers
if ($GLOBALS['mediawiki_headers']) {
if (isset($GLOBALS['mediawiki_headers'])) {
// Get column names
$column_names = $GLOBALS['dbi']->getColumnNames($db, $table);