From 854d198191299b4b248268ada1dd96b96aaf0703 Mon Sep 17 00:00:00 2001 From: Alex Marin Date: Tue, 24 Jul 2012 16:21:04 +0300 Subject: [PATCH 1/7] remove unused variable --- db_operations.php | 1 - 1 file changed, 1 deletion(-) 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) ) ); From 6b7331e9efa0e8b38da1a04d8b10a65060f44c76 Mon Sep 17 00:00:00 2001 From: Alex Marin Date: Tue, 24 Jul 2012 16:45:38 +0300 Subject: [PATCH 2/7] oop: use properties for ExportMediawiki --- .../ExportMediawiki.class.php | 95 ++++++++++--------- 1 file changed, 49 insertions(+), 46 deletions(-) rename libraries/plugins/export/{todo_change_properties => }/ExportMediawiki.class.php (78%) 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..3bbf8e8d21 100644 --- a/libraries/plugins/export/todo_change_properties/ExportMediawiki.class.php +++ b/libraries/plugins/export/ExportMediawiki.class.php @@ -35,59 +35,62 @@ 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"); // 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(); + $leaf = new MessageOnlyPropertyItem(); + $leaf->setText(__('Dump table')); + $subgroup->setSubgroupHeader($leaf); + $leaf = new RadioPropertyItem(); + $leaf->setName('structure_or_data'); + $leaf->setValues(array( + 'structure' => __('structure'), + 'data' => __('data'), + 'structure_and_data' => __('structure and data') + )); + $subgroup->addProperty($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; } /** From aef3d70ac802bbfbd7b1e474f51d860ffa207795 Mon Sep 17 00:00:00 2001 From: Alex Marin Date: Wed, 25 Jul 2012 11:02:54 +0300 Subject: [PATCH 3/7] oop: fix properties for ExportMediawiki --- libraries/plugin_interface.lib.php | 80 ++++++++++++------- .../plugins/export/ExportMediawiki.class.php | 7 +- 2 files changed, 54 insertions(+), 33 deletions(-) diff --git a/libraries/plugin_interface.lib.php b/libraries/plugin_interface.lib.php index 873945ef68..f387cd2407 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 .= '
    '; } - $ret .= '
      '; } + + if ($properties == null) { + $properties = $propertyGroup->getProperties(); + } + if (! strpos(get_class($propertyGroup), "PropertyItem")) foreach ($propertyGroup->getProperties() as $propertyItem) { $property_class = get_class($propertyItem); // if the property is a subgroup, we deal with it recursively - if (strpos("group", $property_class)) { + if (strpos($property_class, "Subgroup")) { // for subgroups // each subgroup can have a header, which may also be a form element $subgroup_header = $propertyItem->getSubgroupHeader(); + if (isset($subgroup_header)) { + $ret .= PMA_pluginGetOneOption( + $section, + $plugin_name, + $subgroup_header + ); + } + + $ret .= '
    • getName() . '">'; + } else { + $ret .= '>'; + } + $ret .= PMA_pluginGetOneOption( $section, $plugin_name, $propertyItem, true - ) . '
    • '; - } else { - $ret .= '>'; - } + ); } else { // single property item switch ($property_class) { @@ -365,22 +385,24 @@ function PMA_pluginGetOneOption( $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/ExportMediawiki.class.php b/libraries/plugins/export/ExportMediawiki.class.php index 3bbf8e8d21..b6d86478d4 100644 --- a/libraries/plugins/export/ExportMediawiki.class.php +++ b/libraries/plugins/export/ExportMediawiki.class.php @@ -59,12 +59,10 @@ class ExportMediawiki extends ExportPlugin // general options main group $generalOptions = new OptionsPropertyMainGroup(); $generalOptions->setName("general_opts"); + $generalOptions->setText(__('Dump table')); // what to dump (structure/data/both) $subgroup = new OptionsPropertySubgroup(); - $leaf = new MessageOnlyPropertyItem(); - $leaf->setText(__('Dump table')); - $subgroup->setSubgroupHeader($leaf); $leaf = new RadioPropertyItem(); $leaf->setName('structure_or_data'); $leaf->setValues(array( @@ -80,12 +78,13 @@ class ExportMediawiki extends ExportPlugin $leaf->setName("caption"); $leaf->setText(__('Export table names')); $generalOptions->addProperty($leaf); + // 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 + //add the main group to the root group $exportSpecificOptions->addProperty($generalOptions); // set the options for the export plugin property item From 54213e16a8a7fd2f71d0f309ded1a9d7018b5038 Mon Sep 17 00:00:00 2001 From: Alex Marin Date: Wed, 25 Jul 2012 11:55:44 +0300 Subject: [PATCH 4/7] oop: use properties without subgroups for ExportSql --- .../ExportSql.class.php | 679 +++++++++--------- 1 file changed, 339 insertions(+), 340 deletions(-) rename libraries/plugins/export/{todo_change_properties => }/ExportSql.class.php (78%) diff --git a/libraries/plugins/export/todo_change_properties/ExportSql.class.php b/libraries/plugins/export/ExportSql.class.php similarity index 78% rename from libraries/plugins/export/todo_change_properties/ExportSql.class.php rename to libraries/plugins/export/ExportSql.class.php index 46e1d94943..b682988b8f 100644 --- a/libraries/plugins/export/todo_change_properties/ExportSql.class.php +++ b/libraries/plugins/export/ExportSql.class.php @@ -128,376 +128,375 @@ 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/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' - ) - ); - if (! empty($GLOBALS['cfgRelation']['relation'])) { - $this->properties['options'][] = array( - 'type' => 'bool', - 'name' => 'relation', - 'text' => __('Display foreign key relationships') - ); - } - if (! empty($GLOBALS['cfgRelation']['mimework'])) { - $this->properties['options'][] = array( - 'type' => 'bool', - 'name' => 'mime', - 'text' => __('Display MIME types') - ); - } - $this->properties['options'][] = array( - 'type' => 'end_subgroup' - ); - /* end comments */ + // 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"); - /* 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' - ) - ); + // general options main group + $generalOptions = new OptionsPropertyMainGroup(); + $generalOptions->setName("general_opts"); - /* 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' - ) - ); - /* compatibility maximization */ + +// /* 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' +// ) +// ); +// if (! empty($GLOBALS['cfgRelation']['relation'])) { +// $this->properties['options'][] = array( +// 'type' => 'bool', +// 'name' => 'relation', +// 'text' => __('Display foreign key relationships') +// ); +// } +// if (! empty($GLOBALS['cfgRelation']['mimework'])) { +// $this->properties['options'][] = array( +// 'type' => 'bool', +// 'name' => 'mime', +// 'text' => __('Display MIME types') +// ); +// } +// $this->properties['options'][] = array( +// 'type' => 'end_subgroup' +// ); +// /* end comments */ + + // 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 + $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 $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(); + $leaf = new RadioPropertyItem(); + $leaf->setName('structure_or_data'); + $leaf->setValues(array( + 'structure' => __('structure'), + 'data' => __('data'), + 'structure_and_data' => __('structure and data') + )); + $subgroup->addProperty($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:') - ) - ); - if ($plugin_param['export_type'] == 'table') { - if (PMA_Table::isView($GLOBALS['db'], $GLOBALS['table'])) { - $drop_clause = 'DROP VIEW'; - } else { - $drop_clause = 'DROP TABLE'; - } - } else { - if (PMA_DRIZZLE) { - $drop_clause = 'DROP TABLE'; - } else { - $drop_clause = 'DROP TABLE / VIEW / PROCEDURE' - . ' / FUNCTION'; - if (PMA_MYSQL_INT_VERSION > 50100) { - $drop_clause .= ' / EVENT'; - } - } - } - $this->properties['options'][] = array( - 'type' => 'bool', - 'name' => 'drop_table', - 'text' => sprintf(__('Add %s statement'), $drop_clause) - ); - // 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' : '') - ) - ); - } +// // begin SQL Statements +// $this->properties['options'][] = array( +// 'type' => 'begin_subgroup', +// 'subgroup_header' => array( +// 'type' => 'message_only', +// 'name' => 'add_statements', +// 'text' => __('Add statements:') +// ) +// ); +// if ($plugin_param['export_type'] == 'table') { +// if (PMA_Table::isView($GLOBALS['db'], $GLOBALS['table'])) { +// $drop_clause = 'DROP VIEW'; +// } else { +// $drop_clause = 'DROP TABLE'; +// } +// } else { +// if (PMA_DRIZZLE) { +// $drop_clause = 'DROP TABLE'; +// } else { +// $drop_clause = 'DROP TABLE / VIEW / PROCEDURE' +// . ' / FUNCTION'; +// if (PMA_MYSQL_INT_VERSION > 50100) { +// $drop_clause .= ' / EVENT'; +// } +// } +// } +// $this->properties['options'][] = array( +// 'type' => 'bool', +// 'name' => 'drop_table', +// 'text' => sprintf(__('Add %s statement'), $drop_clause) +// ); +// // 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' : '') +// ) +// ); +// } +// +// /* 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 */ +// +// $this->properties['options'][] = array( +// 'type' => 'end_subgroup' +// ); +// /* end SQL statements */ - /* 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 */ + $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' => 'end_subgroup' - ); - /* end SQL statements */ + $structureOptions->addProperty($leaf); - $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)' - ) - ); - - $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:') - ) - ); - // 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' - ) - ); - } - $this->properties['options'][] = array( - 'type' => 'bool', - 'name' => 'ignore', - 'text' => __('INSERT IGNORE statements'), - 'doc' => array( - 'manual_MySQL_Database_Administration', - 'insert' - ) - ); - $this->properties['options'][] = array( - 'type' => 'end_subgroup' - ); - /* end SQL statements */ - /* 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' - ) - ); + // begin Data options + $dataOptions = new OptionsPropertyMainGroup(); + $dataOptions->setName("data"); + $dataOptions->setText(__('Data creation options')); + $dataOptions->setForce('structure'); - /* 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:') - ) - ); - $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' - ); + $leaf = new BoolPropertyItem(); + $leaf->setName("truncate"); + $leaf->setText(__('Truncate table before insert')); + $dataOptions->addProperty($leaf); - /* Max length of query */ - $this->properties['options'][] = array( - 'type' => 'text', - 'name' => 'max_query_size', - 'text' => __('Maximal length of created query') - ); +// /* begin SQL statements */ +// $this->properties['options'][] = array( +// 'type' => 'begin_subgroup', +// 'subgroup_header' => array( +// 'type' => 'message_only', +// 'text' => __('Instead of INSERT statements, use:') +// ) +// ); +// // 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' +// ) +// ); +// } +// $this->properties['options'][] = array( +// 'type' => 'bool', +// 'name' => 'ignore', +// 'text' => __('INSERT IGNORE statements'), +// 'doc' => array( +// 'manual_MySQL_Database_Administration', +// 'insert' +// ) +// ); +// $this->properties['options'][] = array( +// 'type' => 'end_subgroup' +// ); +// /* end SQL statements */ - /* 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)' - ) - ); + // 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:') +// ) +// ); +// $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' +// ); + + // 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 + $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 +780,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 +922,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 +971,7 @@ class ExportSql extends ExportPlugin $view = false ) { $this->initSpecificVariables(); - + $sql_drop_table = $this->_getSqlDropTable(); $sql_backquotes = $this->_getSqlBackquotes(); $sql_constraints = $this->_getSqlConstraints(); @@ -1413,9 +1412,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() From e304e790326acf30934f0c839674f96e83dbc9c6 Mon Sep 17 00:00:00 2001 From: Alex Marin Date: Wed, 25 Jul 2012 14:05:36 +0300 Subject: [PATCH 5/7] oop: fix display for subgroups of properties --- libraries/plugin_interface.lib.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libraries/plugin_interface.lib.php b/libraries/plugin_interface.lib.php index f387cd2407..f4b9888f32 100644 --- a/libraries/plugin_interface.lib.php +++ b/libraries/plugin_interface.lib.php @@ -244,10 +244,10 @@ function PMA_pluginGetOneOption( if ($properties == null) { + $not_subgroup_header = true; $properties = $propertyGroup->getProperties(); } - if (! strpos(get_class($propertyGroup), "PropertyItem")) - foreach ($propertyGroup->getProperties() as $propertyItem) { + foreach ($properties as $propertyItem) { $property_class = get_class($propertyItem); // if the property is a subgroup, we deal with it recursively if (strpos($property_class, "Subgroup")) { @@ -382,7 +382,8 @@ function PMA_pluginGetOneOption( $ret .= ''; } else { // end main group - $ret .= '
'; + if ($not_subgroup_header) + $ret .= ''; } if (method_exists($propertyGroup, "getDoc")){ From 2082fe24715ec47a5de3afcd8369a56d2f083204 Mon Sep 17 00:00:00 2001 From: Alex Marin Date: Wed, 25 Jul 2012 14:07:19 +0300 Subject: [PATCH 6/7] oop: fix properties subgroup for ExportMediawiki --- libraries/plugins/export/ExportMediawiki.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/plugins/export/ExportMediawiki.class.php b/libraries/plugins/export/ExportMediawiki.class.php index b6d86478d4..47388bfbc1 100644 --- a/libraries/plugins/export/ExportMediawiki.class.php +++ b/libraries/plugins/export/ExportMediawiki.class.php @@ -63,6 +63,8 @@ class ExportMediawiki extends ExportPlugin // 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( @@ -70,7 +72,7 @@ class ExportMediawiki extends ExportPlugin 'data' => __('data'), 'structure_and_data' => __('structure and data') )); - $subgroup->addProperty($leaf); + $subgroup->setSubgroupHeader($leaf); $generalOptions->addProperty($subgroup); // export table name From 503e1a8b1aebe23c3ab40d1690171d8041dc9709 Mon Sep 17 00:00:00 2001 From: Alex Marin Date: Wed, 25 Jul 2012 14:09:55 +0300 Subject: [PATCH 7/7] oop: add properties subgroups for ExportSql --- libraries/plugins/export/ExportSql.class.php | 340 +++++++++---------- 1 file changed, 152 insertions(+), 188 deletions(-) diff --git a/libraries/plugins/export/ExportSql.class.php b/libraries/plugins/export/ExportSql.class.php index b682988b8f..788b002f00 100644 --- a/libraries/plugins/export/ExportSql.class.php +++ b/libraries/plugins/export/ExportSql.class.php @@ -136,6 +136,7 @@ class ExportSql extends ExportPlugin 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"; @@ -156,51 +157,43 @@ class ExportSql extends ExportPlugin $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); - -// /* 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' -// ) -// ); -// if (! empty($GLOBALS['cfgRelation']['relation'])) { -// $this->properties['options'][] = array( -// 'type' => 'bool', -// 'name' => 'relation', -// 'text' => __('Display foreign key relationships') -// ); -// } -// if (! empty($GLOBALS['cfgRelation']['mimework'])) { -// $this->properties['options'][] = array( -// 'type' => 'bool', -// 'name' => 'mime', -// 'text' => __('Display MIME types') -// ); -// } -// $this->properties['options'][] = array( -// 'type' => 'end_subgroup' -// ); -// /* end comments */ + $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'])) { + $leaf = new BoolPropertyItem(); + $leaf->setName('relation'); + $leaf->setText(__('Display foreign key relationships')); + $subgroup->addProperty($leaf); + } + if (! empty($GLOBALS['cfgRelation']['mimework'])) { + $leaf = new BoolPropertyItem(); + $leaf->setName('mime'); + $leaf->setText(__('Display MIME types')); + $subgroup->addProperty($leaf); + } + $generalOptions->addProperty($subgroup); // enclose in a transaction $leaf = new BoolPropertyItem(); @@ -260,6 +253,8 @@ class ExportSql extends ExportPlugin // 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( @@ -267,7 +262,7 @@ class ExportSql extends ExportPlugin 'data' => __('data'), 'structure_and_data' => __('structure and data') )); - $subgroup->addProperty($leaf); + $subgroup->setSubgroupHeader($leaf); $generalOptions->addProperty($subgroup); // add the main group to the root group @@ -281,79 +276,62 @@ class ExportSql extends ExportPlugin $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:') -// ) -// ); -// if ($plugin_param['export_type'] == 'table') { -// if (PMA_Table::isView($GLOBALS['db'], $GLOBALS['table'])) { -// $drop_clause = 'DROP VIEW'; -// } else { -// $drop_clause = 'DROP TABLE'; -// } -// } else { -// if (PMA_DRIZZLE) { -// $drop_clause = 'DROP TABLE'; -// } else { -// $drop_clause = 'DROP TABLE / VIEW / PROCEDURE' -// . ' / FUNCTION'; -// if (PMA_MYSQL_INT_VERSION > 50100) { -// $drop_clause .= ' / EVENT'; -// } -// } -// } -// $this->properties['options'][] = array( -// 'type' => 'bool', -// 'name' => 'drop_table', -// 'text' => sprintf(__('Add %s statement'), $drop_clause) -// ); -// // 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' : '') -// ) -// ); -// } -// -// /* 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 */ -// -// $this->properties['options'][] = array( -// 'type' => 'end_subgroup' -// ); -// /* end SQL 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'; + } else { + $drop_clause = 'DROP TABLE'; + } + } else { + if (PMA_DRIZZLE) { + $drop_clause = 'DROP TABLE'; + } else { + $drop_clause = 'DROP TABLE / VIEW / PROCEDURE' + . ' / FUNCTION'; + if (PMA_MYSQL_INT_VERSION > 50100) { + $drop_clause .= ' / EVENT'; + } + } + } + $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) { + $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 + $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); $leaf = new BoolPropertyItem(); $leaf->setName("backquotes"); @@ -375,45 +353,36 @@ class ExportSql extends ExportPlugin $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 */ -// $this->properties['options'][] = array( -// 'type' => 'begin_subgroup', -// 'subgroup_header' => array( -// 'type' => 'message_only', -// 'text' => __('Instead of INSERT statements, use:') -// ) -// ); -// // 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' -// ) -// ); -// } -// $this->properties['options'][] = array( -// 'type' => 'bool', -// 'name' => 'ignore', -// 'text' => __('INSERT IGNORE statements'), -// 'doc' => array( -// 'manual_MySQL_Database_Administration', -// 'insert' -// ) -// ); -// $this->properties['options'][] = array( -// 'type' => 'end_subgroup' -// ); -// /* end SQL statements */ + // 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) { + $leaf = new BoolPropertyItem(); + $leaf->setName("delayed"); + $leaf->setText(__('INSERT DELAYED statements')); + $leaf->setDoc(array( + 'manual_MySQL_Database_Administration', + 'insert_delayed' + )); + $subgroup->addProperty($leaf); + } + $leaf = new BoolPropertyItem(); + $leaf->setName("ignore"); + $leaf->setText(__('INSERT IGNORE statements')); + $leaf->setDoc(array( + 'manual_MySQL_Database_Administration', + 'insert' + )); + $subgroup->addProperty($leaf); + $dataOptions->addProperty($subgroup); // Function to use when dumping dat $leaf = new SelectPropertyItem(); @@ -426,42 +395,37 @@ class ExportSql extends ExportPlugin )); $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:') -// ) -// ); -// $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' -// ); + /* 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)' + ) + )); + $subgroup->addProperty($leaf); + $dataOptions->addProperty($subgroup); // Max length of query $leaf = new TextPropertyItem();