PMA\libraries\plugins\export\ExportOdt::exportStructure PHP Method

exportStructure() public method

Outputs table's structure
public exportStructure ( string $db, string $table, string $crlf, string $error_url, string $export_mode, string $export_type, boolean $do_relation = false, boolean $do_comments = false, boolean $do_mime = false, boolean $dates = false, array $aliases = [] ) : boolean
$db string database name
$table string table name
$crlf string the end of line sequence
$error_url string the url to go back in case of error
$export_mode string 'create_table', 'triggers', 'create_view', 'stand_in'
$export_type string 'server', 'database', 'table'
$do_relation boolean whether to include relation comments
$do_comments boolean whether to include the pmadb-style column comments as comments in the structure; this is deprecated but the parameter is left here because export.php calls PMA_exportStructure() also for other
$do_mime boolean whether to include mime comments
$dates boolean whether to include creation/update/check dates
$aliases array Aliases of db/table/columns
return boolean Whether it succeeded
    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);
        switch ($export_mode) {
            case 'create_table':
                $GLOBALS['odt_buffer'] .= '<text:h text:outline-level="2" text:style-name="Heading_2"' . ' text:is-list-header="true">' . __('Table structure for table') . ' ' . htmlspecialchars($table_alias) . '</text:h>';
                $this->getTableDef($db, $table, $crlf, $error_url, $do_relation, $do_comments, $do_mime, $dates, true, false, $aliases);
                break;
            case 'triggers':
                $triggers = $GLOBALS['dbi']->getTriggers($db, $table, $aliases);
                if ($triggers) {
                    $GLOBALS['odt_buffer'] .= '<text:h text:outline-level="2" text:style-name="Heading_2"' . ' text:is-list-header="true">' . __('Triggers') . ' ' . htmlspecialchars($table_alias) . '</text:h>';
                    $this->getTriggers($db, $table);
                }
                break;
            case 'create_view':
                $GLOBALS['odt_buffer'] .= '<text:h text:outline-level="2" text:style-name="Heading_2"' . ' text:is-list-header="true">' . __('Structure for view') . ' ' . htmlspecialchars($table_alias) . '</text:h>';
                $this->getTableDef($db, $table, $crlf, $error_url, $do_relation, $do_comments, $do_mime, $dates, true, true, $aliases);
                break;
            case 'stand_in':
                $GLOBALS['odt_buffer'] .= '<text:h text:outline-level="2" text:style-name="Heading_2"' . ' text:is-list-header="true">' . __('Stand-in structure for view') . ' ' . htmlspecialchars($table_alias) . '</text:h>';
                // export a stand-in definition to resolve view dependencies
                $this->getTableDefStandIn($db, $table, $crlf, $aliases);
        }
        // end switch
        return true;
    }