diff --git a/db_operations.php b/db_operations.php index d58a8d2f84..8f6d027797 100644 --- a/db_operations.php +++ b/db_operations.php @@ -142,7 +142,6 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) { "sql", 'libraries/plugins/export/', array( - 'export_type' => $export_type, 'single_table' => isset($single_table) ) ); diff --git a/libraries/plugin_interface.lib.php b/libraries/plugin_interface.lib.php index 873945ef68..f4b9888f32 100644 --- a/libraries/plugin_interface.lib.php +++ b/libraries/plugin_interface.lib.php @@ -228,33 +228,53 @@ function PMA_pluginGetOneOption( $ret = "\n"; if (! $is_subgroup) { - // for main groups - $ret .= '
'; - if ($propertyGroup->getText() != null) { - $ret .= '

' . PMA_getString($propertyGroup->getText()) . '

'; + // for subgroup headers + if (strpos(get_class($propertyGroup), "PropertyItem")) { + $properties = array($propertyGroup); + } else { + // for main groups + $ret .= '
'; + if ($propertyGroup->getText() != null) { + $ret .= '

' . PMA_getString($propertyGroup->getText()) . '

'; + } + $ret .= '
'; + if ($not_subgroup_header) + $ret .= '
'; } - $doc = $propertyItem->getDoc(); - if (isset($doc)) { - if (count($doc) == 3) { - $ret .= PMA_CommonFunctions::getInstance()->showMySQLDocu( - $doc[0], - $doc[1], - false, - $doc[2] - ); - } elseif (count($doc) == 1) { - $ret .= PMA_CommonFunctions::getInstance()->showDocu($doc[0]); - } else { - $ret .= PMA_CommonFunctions::getInstance()->showMySQLDocu( - $doc[0], - $doc[1] - ); + if (method_exists($propertyGroup, "getDoc")){ + $doc = $propertyGroup->getDoc(); + if ($doc != null) { + if (count($doc) == 3) { + $ret .= PMA_CommonFunctions::getInstance()->showMySQLDocu( + $doc[0], + $doc[1], + false, + $doc[2] + ); + } elseif (count($doc) == 1) { + $ret .= PMA_CommonFunctions::getInstance()->showDocu($doc[0]); + } else { + $ret .= PMA_CommonFunctions::getInstance()->showMySQLDocu( + $doc[0], + $doc[1] + ); + } } } diff --git a/libraries/plugins/export/todo_change_properties/ExportMediawiki.class.php b/libraries/plugins/export/ExportMediawiki.class.php similarity index 78% rename from libraries/plugins/export/todo_change_properties/ExportMediawiki.class.php rename to libraries/plugins/export/ExportMediawiki.class.php index eed2ad2c92..47388bfbc1 100644 --- a/libraries/plugins/export/todo_change_properties/ExportMediawiki.class.php +++ b/libraries/plugins/export/ExportMediawiki.class.php @@ -35,59 +35,63 @@ class ExportMediawiki extends ExportPlugin */ protected function setProperties() { - $this->properties = array( - 'text' => __('MediaWiki Table'), - 'extension' => 'mediawiki', - 'mime_type' => 'text/plain', - 'options' => array(), - 'options_text' => __('Options') - ); + $props = 'libraries/properties/'; + require_once "$props/plugins/ExportPluginProperties.class.php"; + require_once "$props/options/groups/OptionsPropertyRootGroup.class.php"; + require_once "$props/options/groups/OptionsPropertyMainGroup.class.php"; + require_once "$props/options/groups/OptionsPropertySubgroup.class.php"; + require_once "$props/options/items/MessageOnlyPropertyItem.class.php"; + require_once "$props/options/items/RadioPropertyItem.class.php"; + require_once "$props/options/items/BoolPropertyItem.class.php"; - // general options - $this->properties['options'][] = array( - 'type' => 'begin_group', - 'name' => 'general_opts' - ); + $exportPluginProperties = new ExportPluginProperties(); + $exportPluginProperties->setText('MediaWiki Table'); + $exportPluginProperties->setExtension('mediawiki'); + $exportPluginProperties->setMimeType('text/plain'); + $exportPluginProperties->setOptionsText(__('Options')); + + // create the root group that will be the options field for + // $exportPluginProperties + // this will be shown as "Format specific options" + $exportSpecificOptions = new OptionsPropertyRootGroup(); + $exportSpecificOptions->setName("Format Specific Options"); + + // general options main group + $generalOptions = new OptionsPropertyMainGroup(); + $generalOptions->setName("general_opts"); + $generalOptions->setText(__('Dump table')); // what to dump (structure/data/both) - $this->properties['options'][] = array( - 'type' => 'begin_subgroup', - 'subgroup_header' => array( - 'type' => 'message_only', - 'text' => __('Dump table') - ) - ); - $this->properties['options'][] = array( - 'type' => 'radio', - 'name' => 'structure_or_data', - 'values' => array( - 'structure' => __('structure'), - 'data' => __('data'), - 'structure_and_data' => __('structure and data') - ) - ); - $this->properties['options'][] = array( - 'type' => 'end_subgroup' - ); + $subgroup = new OptionsPropertySubgroup(); + $subgroup->setName("dump_table"); + $subgroup->setText("Dump table"); + $leaf = new RadioPropertyItem(); + $leaf->setName('structure_or_data'); + $leaf->setValues(array( + 'structure' => __('structure'), + 'data' => __('data'), + 'structure_and_data' => __('structure and data') + )); + $subgroup->setSubgroupHeader($leaf); + $generalOptions->addProperty($subgroup); // export table name - $this->properties['options'][] = array( - 'type' => 'bool', - 'name' => 'caption', - 'text' => __('Export table names') - ); + $leaf = new BoolPropertyItem(); + $leaf->setName("caption"); + $leaf->setText(__('Export table names')); + $generalOptions->addProperty($leaf); // export table headers - $this->properties['options'][] = array( - 'type' => 'bool', - 'name' => 'headers', - 'text' => __('Export table headers') - ); + $leaf = new BoolPropertyItem(); + $leaf->setName("caption"); + $leaf->setText(__('Export table headers')); + $generalOptions->addProperty($leaf); + //add the main group to the root group + $exportSpecificOptions->addProperty($generalOptions); - // end general options - $this->properties['options'][] = array( - 'type' => 'end_group' - ); + // set the options for the export plugin property item + $exportPluginProperties->setOptions($exportSpecificOptions); + $this->properties = $exportPluginProperties; } /** diff --git a/libraries/plugins/export/todo_change_properties/ExportSql.class.php b/libraries/plugins/export/ExportSql.class.php similarity index 81% rename from libraries/plugins/export/todo_change_properties/ExportSql.class.php rename to libraries/plugins/export/ExportSql.class.php index 46e1d94943..788b002f00 100644 --- a/libraries/plugins/export/todo_change_properties/ExportSql.class.php +++ b/libraries/plugins/export/ExportSql.class.php @@ -128,165 +128,160 @@ class ExportSql extends ExportPlugin $hide_structure = true; $hide_sql = true; } + if (! $hide_sql) { - $this->properties = array( - 'text' => __('SQL'), - 'extension' => 'sql', - 'mime_type' => 'text/x-sql', - 'options' => array(), - 'options_text' => __('Options') - ); + $props = 'libraries/properties/'; + require_once "$props/plugins/ExportPluginProperties.class.php"; + require_once "$props/options/groups/OptionsPropertyRootGroup.class.php"; + require_once "$props/options/groups/OptionsPropertyMainGroup.class.php"; + require_once "$props/options/groups/OptionsPropertySubgroup.class.php"; + require_once "$props/options/items/BoolPropertyItem.class.php"; + require_once "$props/options/items/MessageOnlyPropertyItem.class.php"; + require_once "$props/options/items/RadioPropertyItem.class.php"; + require_once "$props/options/items/SelectPropertyItem.class.php"; + require_once "$props/options/items/TextPropertyItem.class.php"; - $this->properties['options'][] = array( - 'type' => 'begin_group', - 'name' => 'general_opts' - ); + $exportPluginProperties = new ExportPluginProperties(); + $exportPluginProperties->setText('SQL'); + $exportPluginProperties->setExtension('sql'); + $exportPluginProperties->setMimeType('text/x-sql'); + $exportPluginProperties->setOptionsText(__('Options')); - /* comments */ - $this->properties['options'][] = array( - 'type' => 'begin_subgroup', - 'subgroup_header' => array( - 'type' => 'bool', - 'name' => 'include_comments', - 'text' => __( - 'Display comments (includes info such as export' - . ' timestamp, PHP version, and server version)' - ) - ) - ); - $this->properties['options'][] = array( - 'type' => 'text', - 'name' => 'header_comment', - 'text' => __('Additional custom header comment (\n splits lines):') - ); - $this->properties['options'][] = array( - 'type' => 'bool', - 'name' => 'dates', - 'text' => __( - 'Include a timestamp of when databases were created, last' - . ' updated, and last checked' - ) - ); + // create the root group that will be the options field for + // $exportPluginProperties + // this will be shown as "Format specific options" + $exportSpecificOptions = new OptionsPropertyRootGroup(); + $exportSpecificOptions->setName("Format Specific Options"); + + // general options main group + $generalOptions = new OptionsPropertyMainGroup(); + $generalOptions->setName("general_opts"); + + // comments + $subgroup = new OptionsPropertySubgroup(); + $subgroup->setName("include_comments"); + $leaf = new BoolPropertyItem(); + $leaf->setName('include_comments'); + $leaf->setText(__( + 'Display comments (includes info such as export' + . ' timestamp, PHP version, and server version)' + )); + $subgroup->setSubgroupHeader($leaf); + + $leaf = new TextPropertyItem(); + $leaf->setName('header_comment'); + $leaf->setText(__( + 'Additional custom header comment (\n splits lines):' + )); + $subgroup->addProperty($leaf); + $leaf = new BoolPropertyItem(); + $leaf->setName('dates'); + $leaf->setText(__( + 'Include a timestamp of when databases were created, last' + . ' updated, and last checked' + )); + $subgroup->addProperty($leaf); if (! empty($GLOBALS['cfgRelation']['relation'])) { - $this->properties['options'][] = array( - 'type' => 'bool', - 'name' => 'relation', - 'text' => __('Display foreign key relationships') - ); + $leaf = new BoolPropertyItem(); + $leaf->setName('relation'); + $leaf->setText(__('Display foreign key relationships')); + $subgroup->addProperty($leaf); } if (! empty($GLOBALS['cfgRelation']['mimework'])) { - $this->properties['options'][] = array( - 'type' => 'bool', - 'name' => 'mime', - 'text' => __('Display MIME types') - ); + $leaf = new BoolPropertyItem(); + $leaf->setName('mime'); + $leaf->setText(__('Display MIME types')); + $subgroup->addProperty($leaf); } - $this->properties['options'][] = array( - 'type' => 'end_subgroup' - ); - /* end comments */ + $generalOptions->addProperty($subgroup); - /* enclose in a transaction */ - $this->properties['options'][] = array( - 'type' => 'bool', - 'name' => 'use_transaction', - 'text' => __('Enclose export in a transaction'), - 'doc' => array( - 'programs', - 'mysqldump', - 'option_mysqldump_single-transaction' - ) - ); + // enclose in a transaction + $leaf = new BoolPropertyItem(); + $leaf->setName("use_transaction"); + $leaf->setText(__('Enclose export in a transaction')); + $leaf->setDoc(array( + 'programs', + 'mysqldump', + 'option_mysqldump_single-transaction' + )); + $generalOptions->addProperty($leaf); - /* disable foreign key checks */ - $this->properties['options'][] = array( - 'type' => 'bool', - 'name' => 'disable_fk', - 'text' => __('Disable foreign key checks'), - 'doc' => array( - 'manual_MySQL_Database_Administration', - 'server-system-variables', - 'sysvar_foreign_key_checks' - ) - ); + // disable foreign key checks + $leaf = new BoolPropertyItem(); + $leaf->setName("disable_fk"); + $leaf->setText(__('Disable foreign key checks')); + $leaf->setDoc(array( + 'manual_MySQL_Database_Administration', + 'server-system-variables', + 'sysvar_foreign_key_checks' + )); + $generalOptions->addProperty($leaf); - /* compatibility maximization */ + // compatibility maximization $compats = PMA_DBI_getCompatibilities(); if (count($compats) > 0) { $values = array(); foreach ($compats as $val) { $values[$val] = $val; } - $this->properties['options'][] = array( - 'type' => 'select', - 'name' => 'compatibility', - 'text' => __( - 'Database system or older MySQL server to maximize output' - . ' compatibility with:' - ), - 'values' => $values, - 'doc' => array( - 'manual_MySQL_Database_Administration', - 'Server_SQL_mode' - ) - ); + + $leaf = new SelectPropertyItem(); + $leaf->setName("compatibility"); + $leaf->setText(__( + 'Database system or older MySQL server to maximize output' + . ' compatibility with:' + )); + $leaf->setValues($values); + $leaf->setDoc(array( + 'manual_MySQL_Database_Administration', + 'Server_SQL_mode' + )); + $generalOptions->addProperty($leaf); + unset($values); } - /* server export options */ + // server export options if ($plugin_param['export_type'] == 'server') { - $this->properties['options'][] = array( - 'type' => 'bool', - 'name' => 'drop_database', - 'text' => sprintf( - __('Add %s statement'), 'DROP DATABASE' - ) - ); + $leaf = new BoolPropertyItem(); + $leaf->setName("drop_database"); + $leaf->setText(sprintf( + __('Add %s statement'), 'DROP DATABASE' + )); + $generalOptions->addProperty($leaf); } - /* what to dump (structure/data/both) */ - $this->properties['options'][] = array( - 'type' => 'begin_subgroup', - 'subgroup_header' => array( - 'type' => 'message_only', - 'text' => __('Dump table') - ) - ); - $this->properties['options'][] = array( - 'type' => 'radio', - 'name' => 'structure_or_data', - 'values' => array( - 'structure' => __('structure'), - 'data' => __('data'), - 'structure_and_data' => __('structure and data') - ) - ); - $this->properties['options'][] = array( - 'type' => 'end_subgroup' - ); + // what to dump (structure/data/both) + $subgroup = new OptionsPropertySubgroup(); + $subgroup->setName("dump_table"); + $subgroup->setText("Dump table"); + $leaf = new RadioPropertyItem(); + $leaf->setName('structure_or_data'); + $leaf->setValues(array( + 'structure' => __('structure'), + 'data' => __('data'), + 'structure_and_data' => __('structure and data') + )); + $subgroup->setSubgroupHeader($leaf); + $generalOptions->addProperty($subgroup); - $this->properties['options'][] = array( - 'type' => 'end_group' - ); + // add the main group to the root group + $exportSpecificOptions->addProperty($generalOptions); - /* begin Structure options */ + + // structure options main group if (! $hide_structure) { - $this->properties['options'][] = array( - 'type' => 'begin_group', - 'name' => 'structure', - 'text' => __('Object creation options'), - 'force' => 'data' - ); + $structureOptions = new OptionsPropertyMainGroup(); + $structureOptions->setName("structure"); + $structureOptions->setText(__('Object creation options')); + $structureOptions->setForce('data'); - /* begin SQL Statements */ - $this->properties['options'][] = array( - 'type' => 'begin_subgroup', - 'subgroup_header' => array( - 'type' => 'message_only', - 'name' => 'add_statements', - 'text' => __('Add statements:') - ) - ); + // begin SQL Statements + $subgroup = new OptionsPropertySubgroup(); + $leaf = new MessageOnlyPropertyItem(); + $leaf->setName('add_statements'); + $leaf->setText(__('Add statements:')); + $subgroup->setSubgroupHeader($leaf); if ($plugin_param['export_type'] == 'table') { if (PMA_Table::isView($GLOBALS['db'], $GLOBALS['table'])) { $drop_clause = 'DROP VIEW'; @@ -304,200 +299,168 @@ class ExportSql extends ExportPlugin } } } - $this->properties['options'][] = array( - 'type' => 'bool', - 'name' => 'drop_table', - 'text' => sprintf(__('Add %s statement'), $drop_clause) - ); + $leaf = new BoolPropertyItem(); + $leaf->setName('drop_table'); + $leaf->setText(sprintf(__('Add %s statement'), $drop_clause)); + $subgroup->addProperty($leaf); // Drizzle doesn't support procedures and functions if (! PMA_DRIZZLE) { - $this->properties['options'][] = array( - 'type' => 'bool', - 'name' => 'procedure_function', - 'text' => sprintf( - __('Add %s statement'), - 'CREATE PROCEDURE / FUNCTION' - . (PMA_MYSQL_INT_VERSION > 50100 - ? ' / EVENT' : '') - ) - ); + $leaf = new BoolPropertyItem(); + $leaf->setName('procedure_function'); + $leaf->setText(sprintf( + __('Add %s statement'), + 'CREATE PROCEDURE / FUNCTION' + . (PMA_MYSQL_INT_VERSION > 50100 + ? ' / EVENT' : '') + )); + $subgroup->addProperty($leaf); } - /* begin CREATE TABLE statements*/ - $this->properties['options'][] = array( - 'type' => 'begin_subgroup', - 'subgroup_header' => array( - 'type' => 'bool', - 'name' => 'create_table_statements', - 'text' => __('CREATE TABLE options:') - ) - ); - $this->properties['options'][] = array( - 'type' => 'bool', - 'name' => 'if_not_exists', - 'text' => 'IF NOT EXISTS' - ); - $this->properties['options'][] = array( - 'type' => 'bool', - 'name' => 'auto_increment', - 'text' => 'AUTO_INCREMENT' - ); - $this->properties['options'][] = array( - 'type' => 'end_subgroup' - ); - /* end CREATE TABLE statements */ + // begin CREATE TABLE statements + $subgroup_create_table = new OptionsPropertySubgroup(); + $leaf = new BoolPropertyItem(); + $leaf->setName('create_table_statements'); + $leaf->setText(__('CREATE TABLE options:')); + $subgroup_create_table->setSubgroupHeader($leaf); + $leaf = new BoolPropertyItem(); + $leaf->setName('if_not_exists'); + $leaf->setText('IF NOT EXISTS'); + $subgroup_create_table->addProperty($leaf); + $leaf = new BoolPropertyItem(); + $leaf->setName('auto_increment'); + $leaf->setText('AUTO_INCREMENT'); + $subgroup_create_table->addProperty($leaf); + $subgroup->addProperty($subgroup_create_table); + $structureOptions->addProperty($subgroup); - $this->properties['options'][] = array( - 'type' => 'end_subgroup' - ); - /* end SQL statements */ + $leaf = new BoolPropertyItem(); + $leaf->setName("backquotes"); + $leaf->setText(__( + 'Enclose table and column names with backquotes ' + . '(Protects column and table names formed with' + . ' special characters or keywords)' + )); - $this->properties['options'][] = array( - 'type' => 'bool', - 'name' => 'backquotes', - 'text' => __( - 'Enclose table and column names with backquotes ' - . '(Protects column and table names formed with' - . ' special characters or keywords)' - ) - ); + $structureOptions->addProperty($leaf); - $this->properties['options'][] = array( - 'type' => 'end_group' - ); + // add the main group to the root group + $exportSpecificOptions->addProperty($structureOptions); } - /* end Structure options */ - /* begin Data options */ - $this->properties['options'][] = array( - 'type' => 'begin_group', - 'name' => 'data', - 'text' => __('Data dump options'), - 'force' => 'structure' - ); - $this->properties['options'][] = array( - 'type' => 'bool', - 'name' => 'truncate', - 'text' => __('Truncate table before insert') - ); - /* begin SQL statements */ - $this->properties['options'][] = array( - 'type' => 'begin_subgroup', - 'subgroup_header' => array( - 'type' => 'message_only', - 'text' => __('Instead of INSERT statements, use:') - ) - ); + + // begin Data options + $dataOptions = new OptionsPropertyMainGroup(); + $dataOptions->setName("data"); + $dataOptions->setText(__('Data creation options')); + $dataOptions->setForce('structure'); + $leaf = new BoolPropertyItem(); + $leaf->setName("truncate"); + $leaf->setText(__('Truncate table before insert')); + $dataOptions->addProperty($leaf); + + // begin SQL Statements + $subgroup = new OptionsPropertySubgroup(); + $leaf = new MessageOnlyPropertyItem(); + $leaf->setText(__('Instead of INSERT statements, use:')); + $subgroup->setSubgroupHeader($leaf); // Not supported in Drizzle if (! PMA_DRIZZLE) { - $this->properties['options'][] = array( - 'type' => 'bool', - 'name' => 'delayed', - 'text' => __('INSERT DELAYED statements'), - 'doc' => array( - 'manual_MySQL_Database_Administration', - 'insert_delayed' - ) - ); + $leaf = new BoolPropertyItem(); + $leaf->setName("delayed"); + $leaf->setText(__('INSERT DELAYED statements')); + $leaf->setDoc(array( + 'manual_MySQL_Database_Administration', + 'insert_delayed' + )); + $subgroup->addProperty($leaf); } - $this->properties['options'][] = array( - 'type' => 'bool', - 'name' => 'ignore', - 'text' => __('INSERT IGNORE statements'), - 'doc' => array( + $leaf = new BoolPropertyItem(); + $leaf->setName("ignore"); + $leaf->setText(__('INSERT IGNORE statements')); + $leaf->setDoc(array( 'manual_MySQL_Database_Administration', 'insert' - ) - ); - $this->properties['options'][] = array( - 'type' => 'end_subgroup' - ); - /* end SQL statements */ + )); + $subgroup->addProperty($leaf); + $dataOptions->addProperty($subgroup); - /* Function to use when dumping data */ - $this->properties['options'][] = array( - 'type' => 'select', - 'name' => 'type', - 'text' => __('Function to use when dumping data:'), - 'values' => array( - 'INSERT' => 'INSERT', - 'UPDATE' => 'UPDATE', - 'REPLACE' => 'REPLACE' - ) - ); + // Function to use when dumping dat + $leaf = new SelectPropertyItem(); + $leaf->setName("type"); + $leaf->setText(__('Function to use when dumping data:')); + $leaf->setValues(array( + 'INSERT' => 'INSERT', + 'UPDATE' => 'UPDATE', + 'REPLACE' => 'REPLACE' + )); + $dataOptions->addProperty($leaf); /* Syntax to use when inserting data */ - $this->properties['options'][] = array( - 'type' => 'begin_subgroup', - 'subgroup_header' => array( - 'type' => 'message_only', - 'text' => __('Syntax to use when inserting data:') + $subgroup = new OptionsPropertySubgroup(); + $leaf = new MessageOnlyPropertyItem(); + $leaf->setText(__('Syntax to use when inserting data:')); + $subgroup->setSubgroupHeader($leaf); + $leaf = new RadioPropertyItem(); + $leaf->setName("insert_syntax"); + $leaf->setText(__('INSERT IGNORE statements')); + $leaf->setValues(array( + 'complete' => __( + 'include column names in every INSERT statement' + . '
      Example: INSERT INTO' + . ' tbl_name (col_A,col_B,col_C) VALUES (1,2,3)' + ), + 'extended' => __( + 'insert multiple rows in every INSERT statement' + . '
      Example: INSERT INTO' + . ' tbl_name VALUES (1,2,3), (4,5,6), (7,8,9)' + ), + 'both' => __( + 'both of the above
      Example:' + . ' INSERT INTO tbl_name (col_A,col_B) VALUES (1,2,3),' + . ' (4,5,6), (7,8,9)' + ), + 'none' => __( + 'neither of the above
      Example:' + . ' INSERT INTO tbl_name VALUES (1,2,3)' ) - ); - $this->properties['options'][] = array( - 'type' => 'radio', - 'name' => 'insert_syntax', - 'values' => array( - 'complete' => __( - 'include column names in every INSERT statement' - . '
      Example: INSERT INTO' - . ' tbl_name (col_A,col_B,col_C) VALUES (1,2,3)' - ), - 'extended' => __( - 'insert multiple rows in every INSERT statement' - . '
      Example: INSERT INTO' - . ' tbl_name VALUES (1,2,3), (4,5,6), (7,8,9)' - ), - 'both' => __( - 'both of the above
      Example:' - . ' INSERT INTO tbl_name (col_A,col_B) VALUES (1,2,3),' - . ' (4,5,6), (7,8,9)' - ), - 'none' => __( - 'neither of the above
      Example:' - . ' INSERT INTO tbl_name VALUES (1,2,3)' - ) - ) - ); - $this->properties['options'][] = array( - 'type' => 'end_subgroup' - ); + )); + $subgroup->addProperty($leaf); + $dataOptions->addProperty($subgroup); - /* Max length of query */ - $this->properties['options'][] = array( - 'type' => 'text', - 'name' => 'max_query_size', - 'text' => __('Maximal length of created query') - ); + // Max length of query + $leaf = new TextPropertyItem(); + $leaf->setName("max_query_size"); + $leaf->setText(__('Maximal length of created query')); + $dataOptions->addProperty($leaf); - /* Dump binary columns in hexadecimal */ - $this->properties['options'][] = array( - 'type' => 'bool', - 'name' => 'hex_for_blob', - 'text' => __( - 'Dump binary columns in hexadecimal notation' - . ' (for example, "abc" becomes 0x616263)' - ) - ); + // Dump binary columns in hexadecimal + $leaf = new BoolPropertyItem(); + $leaf->setName("hex_for_blob"); + $leaf->setText(__( + 'Dump binary columns in hexadecimal notation' + . ' (for example, "abc" becomes 0x616263)' + )); + $dataOptions->addProperty($leaf); // Drizzle works only with UTC timezone if (! PMA_DRIZZLE) { - /* Dump time in UTC */ - $this->properties['options'][] = array( - 'type' => 'bool', - 'name' => 'utc_time', - 'text' => __( - 'Dump TIMESTAMP columns in UTC (enables TIMESTAMP columns' - . ' to be dumped and reloaded between servers in different' - . ' time zones)' - ) - ); + // Dump time in UTC + $leaf = new BoolPropertyItem(); + $leaf->setName("utc_time"); + $leaf->setText(__( + 'Dump TIMESTAMP columns in UTC (enables TIMESTAMP columns' + . ' to be dumped and reloaded between servers in different' + . ' time zones)' + )); + $dataOptions->addProperty($leaf); } - $this->properties['options'][] = array( - 'type' => 'end_group' - ); - /* end Data options */ + // add the main group to the root group + $exportSpecificOptions->addProperty($dataOptions); + + // set the options for the export plugin property item + $exportPluginProperties->setOptions($exportSpecificOptions); + $this->properties = $exportPluginProperties; } } @@ -781,10 +744,10 @@ class ExportSql extends ExportPlugin public function exportDBCreate($db) { global $crlf; - + $common_functions = PMA_CommonFunctions::getInstance(); $this->setCrlf($crlf); - + if (isset($GLOBALS['sql_drop_database'])) { if (! PMA_exportOutputHandler( 'DROP DATABASE ' @@ -923,7 +886,7 @@ class ExportSql extends ExportPlugin */ public function getTableDefStandIn($db, $view, $crlf) { - + $common_functions = PMA_CommonFunctions::getInstance(); $create_query = ''; if (! empty($GLOBALS['sql_drop_table'])) { @@ -972,7 +935,7 @@ class ExportSql extends ExportPlugin $view = false ) { $this->initSpecificVariables(); - + $sql_drop_table = $this->_getSqlDropTable(); $sql_backquotes = $this->_getSqlBackquotes(); $sql_constraints = $this->_getSqlConstraints(); @@ -1413,9 +1376,9 @@ class ExportSql extends ExportPlugin $mime = false, $dates = false ) { - + $common_functions = PMA_CommonFunctions::getInstance(); - + $formatted_table_name = (isset($GLOBALS['sql_backquotes'])) ? $common_functions->backquote($table) : '\'' . $table . '\''; $dump = $this->_possibleCRLF()