public function exportStructure($db, $table, $crlf, $error_url, $export_mode, $export_type, $do_relation = false, $do_comments = false, $do_mime = false, $dates = false, $aliases = array())
{
$db_alias = $db;
$table_alias = $table;
$this->initAlias($aliases, $db_alias, $table_alias);
$output = '';
switch ($export_mode) {
case 'create_table':
$columns = $GLOBALS['dbi']->getColumns($db, $table);
$columns = array_values($columns);
$row_cnt = count($columns);
// Print structure comment
$output = $this->_exportComment("Table structure for " . PMA\libraries\Util::backquote($table_alias));
// Begin the table construction
$output .= "{| class=\"wikitable\" style=\"text-align:center;\"" . $this->_exportCRLF();
// Add the table name
if (isset($GLOBALS['mediawiki_caption'])) {
$output .= "|+'''" . $table_alias . "'''" . $this->_exportCRLF();
}
// Add the table headers
if (isset($GLOBALS['mediawiki_headers'])) {
$output .= "|- style=\"background:#ffdead;\"" . $this->_exportCRLF();
$output .= "! style=\"background:#ffffff\" | " . $this->_exportCRLF();
for ($i = 0; $i < $row_cnt; ++$i) {
$col_as = $columns[$i]['Field'];
if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) {
$col_as = $aliases[$db]['tables'][$table]['columns'][$col_as];
}
$output .= " | " . $col_as . $this->_exportCRLF();
}
}
// Add the table structure
$output .= "|-" . $this->_exportCRLF();
$output .= "! Type" . $this->_exportCRLF();
for ($i = 0; $i < $row_cnt; ++$i) {
$output .= " | " . $columns[$i]['Type'] . $this->_exportCRLF();
}
$output .= "|-" . $this->_exportCRLF();
$output .= "! Null" . $this->_exportCRLF();
for ($i = 0; $i < $row_cnt; ++$i) {
$output .= " | " . $columns[$i]['Null'] . $this->_exportCRLF();
}
$output .= "|-" . $this->_exportCRLF();
$output .= "! Default" . $this->_exportCRLF();
for ($i = 0; $i < $row_cnt; ++$i) {
$output .= " | " . $columns[$i]['Default'] . $this->_exportCRLF();
}
$output .= "|-" . $this->_exportCRLF();
$output .= "! Extra" . $this->_exportCRLF();
for ($i = 0; $i < $row_cnt; ++$i) {
$output .= " | " . $columns[$i]['Extra'] . $this->_exportCRLF();
}
$output .= "|}" . str_repeat($this->_exportCRLF(), 2);
break;
}
// end switch
return PMA_exportOutputHandler($output);
}