Exemplo n.º 1
0
 /**
  * Adds export options common to all plugins.
  *
  * @param OptionsPropertyMainGroup $propertyGroup property group
  *
  * @return void
  */
 protected function addCommonOptions(OptionsPropertyMainGroup $propertyGroup)
 {
     $leaf = new BoolPropertyItem();
     $leaf->setName('show_color');
     $leaf->setText(__('Show color'));
     $propertyGroup->addProperty($leaf);
     $leaf = new BoolPropertyItem();
     $leaf->setName('show_keys');
     $leaf->setText(__('Only show keys'));
     $propertyGroup->addProperty($leaf);
 }
Exemplo n.º 2
0
 /**
  * Sets the import plugin properties.
  * Called in the constructor.
  *
  * @return OptionsPropertyMainGroup OptionsPropertyMainGroup object of the plugin
  */
 protected function setProperties()
 {
     $props = 'libraries/properties/';
     include_once "{$props}/plugins/ImportPluginProperties.class.php";
     include_once "{$props}/options/groups/OptionsPropertyRootGroup.class.php";
     include_once "{$props}/options/groups/OptionsPropertyMainGroup.class.php";
     include_once "{$props}/options/items/BoolPropertyItem.class.php";
     include_once "{$props}/options/items/TextPropertyItem.class.php";
     $importPluginProperties = new ImportPluginProperties();
     $importPluginProperties->setOptionsText(__('Options'));
     // create the root group that will be the options field for
     // $importPluginProperties
     // this will be shown as "Format specific options"
     $importSpecificOptions = new OptionsPropertyRootGroup();
     $importSpecificOptions->setName("Format Specific Options");
     // general options main group
     $generalOptions = new OptionsPropertyMainGroup();
     $generalOptions->setName("general_opts");
     // create common items and add them to the group
     $leaf = new BoolPropertyItem();
     $leaf->setName("replace");
     $leaf->setText(__('Replace table data with file'));
     $generalOptions->addProperty($leaf);
     $leaf = new TextPropertyItem();
     $leaf->setName("terminated");
     $leaf->setText(__('Columns separated with:'));
     $leaf->setSize(2);
     $leaf->setLen(2);
     $generalOptions->addProperty($leaf);
     $leaf = new TextPropertyItem();
     $leaf->setName("enclosed");
     $leaf->setText(__('Columns enclosed with:'));
     $leaf->setSize(2);
     $leaf->setLen(2);
     $generalOptions->addProperty($leaf);
     $leaf = new TextPropertyItem();
     $leaf->setName("escaped");
     $leaf->setText(__('Columns escaped with:'));
     $leaf->setSize(2);
     $leaf->setLen(2);
     $generalOptions->addProperty($leaf);
     $leaf = new TextPropertyItem();
     $leaf->setName("new_line");
     $leaf->setText(__('Lines terminated with:'));
     $leaf->setSize(2);
     $generalOptions->addProperty($leaf);
     // add the main group to the root group
     $importSpecificOptions->addProperty($generalOptions);
     // set the options for the import plugin property item
     $importPluginProperties->setOptions($importSpecificOptions);
     $this->properties = $importPluginProperties;
     return $generalOptions;
 }
Exemplo n.º 3
0
 /**
  * Sets the export HTML-Word properties
  *
  * @return void
  */
 protected function setProperties()
 {
     $props = 'libraries/properties/';
     include_once "{$props}/plugins/ExportPluginProperties.class.php";
     include_once "{$props}/options/groups/OptionsPropertyRootGroup.class.php";
     include_once "{$props}/options/groups/OptionsPropertyMainGroup.class.php";
     include_once "{$props}/options/items/RadioPropertyItem.class.php";
     include_once "{$props}/options/items/TextPropertyItem.class.php";
     include_once "{$props}/options/items/BoolPropertyItem.class.php";
     $exportPluginProperties = new ExportPluginProperties();
     $exportPluginProperties->setText('Microsoft Word 2000');
     $exportPluginProperties->setExtension('doc');
     $exportPluginProperties->setMimeType('application/vnd.ms-word');
     $exportPluginProperties->setForceFile(true);
     $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");
     // what to dump (structure/data/both)
     $dumpWhat = new OptionsPropertyMainGroup();
     $dumpWhat->setName("dump_what");
     $dumpWhat->setText(__('Dump table'));
     // create primary items and add them to the group
     $leaf = new RadioPropertyItem();
     $leaf->setName("structure_or_data");
     $leaf->setValues(array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data')));
     $dumpWhat->addProperty($leaf);
     // add the main group to the root group
     $exportSpecificOptions->addProperty($dumpWhat);
     // data options main group
     $dataOptions = new OptionsPropertyMainGroup();
     $dataOptions->setName("dump_what");
     $dataOptions->setText(__('Data dump options'));
     $dataOptions->setForce('structure');
     // create primary items and add them to the group
     $leaf = new TextPropertyItem();
     $leaf->setName("null");
     $leaf->setText(__('Replace NULL with:'));
     $dataOptions->addProperty($leaf);
     $leaf = new BoolPropertyItem();
     $leaf->setName("columns");
     $leaf->setText(__('Put columns names in the first row'));
     $dataOptions->addProperty($leaf);
     // 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;
 }
 /**
  * Sets the export CSV for Excel properties
  *
  * @return void
  */
 protected function setProperties()
 {
     $props = 'libraries/properties/';
     include_once "{$props}/plugins/ExportPluginProperties.class.php";
     include_once "{$props}/options/groups/OptionsPropertyRootGroup.class.php";
     include_once "{$props}/options/groups/OptionsPropertyMainGroup.class.php";
     include_once "{$props}/options/items/TextPropertyItem.class.php";
     include_once "{$props}/options/items/BoolPropertyItem.class.php";
     include_once "{$props}/options/items/SelectPropertyItem.class.php";
     include_once "{$props}/options/items/HiddenPropertyItem.class.php";
     $exportPluginProperties = new ExportPluginProperties();
     $exportPluginProperties->setText('CSV for MS Excel');
     $exportPluginProperties->setExtension('csv');
     $exportPluginProperties->setMimeType('text/comma-separated-values');
     $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");
     // create primary items and add them to the group
     $leaf = new TextPropertyItem();
     $leaf->setName('null');
     $leaf->setText(__('Replace NULL with:'));
     $generalOptions->addProperty($leaf);
     $leaf = new BoolPropertyItem();
     $leaf->setName('removeCRLF');
     $leaf->setText(__('Remove carriage return/line feed characters within columns'));
     $generalOptions->addProperty($leaf);
     $leaf = new BoolPropertyItem();
     $leaf->setName('columns');
     $leaf->setText(__('Put columns names in the first row'));
     $generalOptions->addProperty($leaf);
     $leaf = new SelectPropertyItem();
     $leaf->setName('edition');
     $leaf->setValues(array('win' => 'Windows', 'mac_excel2003' => 'Excel 2003 / Macintosh', 'mac_excel2008' => 'Excel 2008 / Macintosh'));
     $leaf->setText(__('Excel edition:'));
     $generalOptions->addProperty($leaf);
     $leaf = new HiddenPropertyItem();
     $leaf->setName('structure_or_data');
     $generalOptions->addProperty($leaf);
     // add the main group to the root group
     $exportSpecificOptions->addProperty($generalOptions);
     // set the options for the export plugin property item
     $exportPluginProperties->setOptions($exportSpecificOptions);
     $this->properties = $exportPluginProperties;
 }
Exemplo n.º 5
0
 /**
  * Sets the export MediaWiki properties
  *
  * @return void
  */
 protected function setProperties()
 {
     $props = 'libraries/properties/';
     include_once "{$props}/plugins/ExportPluginProperties.class.php";
     include_once "{$props}/options/groups/OptionsPropertyRootGroup.class.php";
     include_once "{$props}/options/groups/OptionsPropertyMainGroup.class.php";
     include_once "{$props}/options/groups/OptionsPropertySubgroup.class.php";
     include_once "{$props}/options/items/MessageOnlyPropertyItem.class.php";
     include_once "{$props}/options/items/RadioPropertyItem.class.php";
     include_once "{$props}/options/items/BoolPropertyItem.class.php";
     $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)
     $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
     $leaf = new BoolPropertyItem();
     $leaf->setName("caption");
     $leaf->setText(__('Export table names'));
     $generalOptions->addProperty($leaf);
     // export table headers
     $leaf = new BoolPropertyItem();
     $leaf->setName("headers");
     $leaf->setText(__('Export table headers'));
     $generalOptions->addProperty($leaf);
     //add the main group to the root group
     $exportSpecificOptions->addProperty($generalOptions);
     // set the options for the export plugin property item
     $exportPluginProperties->setOptions($exportSpecificOptions);
     $this->properties = $exportPluginProperties;
 }
Exemplo n.º 6
0
 /**
  * Sets the import plugin properties.
  * Called in the constructor.
  *
  * @return void
  */
 protected function setProperties()
 {
     $this->_setCfgRelation(PMA_getRelationsParam());
     $cfgRelation = $this->_getCfgRelation();
     if ($GLOBALS['num_tables'] < 1 || !$cfgRelation['relwork'] || !$cfgRelation['commwork']) {
         return;
     }
     $props = 'libraries/properties/';
     include_once "{$props}/plugins/ImportPluginProperties.class.php";
     include_once "{$props}/options/groups/OptionsPropertyRootGroup.class.php";
     include_once "{$props}/options/groups/OptionsPropertyMainGroup.class.php";
     include_once "{$props}/options/items/TextPropertyItem.class.php";
     $importPluginProperties = new ImportPluginProperties();
     $importPluginProperties->setText('DocSQL');
     $importPluginProperties->setExtension('');
     $importPluginProperties->setOptionsText(__('Options'));
     // create the root group that will be the options field for
     // $importPluginProperties
     // this will be shown as "Format specific options"
     $importSpecificOptions = new OptionsPropertyRootGroup();
     $importSpecificOptions->setName("Format Specific Options");
     // general options main group
     $generalOptions = new OptionsPropertyMainGroup();
     $generalOptions->setName("general_opts");
     // create primary items and add them to the group
     $leaf = new TextPropertyItem();
     $leaf->setName("table");
     $leaf->setText(__('Table name'));
     $generalOptions->addProperty($leaf);
     // add the main group to the root group
     $importSpecificOptions->addProperty($generalOptions);
     // set the options for the import plugin property item
     $importPluginProperties->setOptions($importSpecificOptions);
     $this->properties = $importPluginProperties;
 }
Exemplo n.º 7
0
 /**
  * Sets the export JSON properties
  *
  * @return void
  */
 protected function setProperties()
 {
     $props = 'libraries/properties/';
     include_once "{$props}/plugins/ExportPluginProperties.class.php";
     include_once "{$props}/options/groups/OptionsPropertyRootGroup.class.php";
     include_once "{$props}/options/groups/OptionsPropertyMainGroup.class.php";
     include_once "{$props}/options/items/HiddenPropertyItem.class.php";
     $exportPluginProperties = new ExportPluginProperties();
     $exportPluginProperties->setText('JSON');
     $exportPluginProperties->setExtension('json');
     $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");
     // create primary items and add them to the group
     $leaf = new HiddenPropertyItem();
     $leaf->setName("structure_or_data");
     $generalOptions->addProperty($leaf);
     // add the main group to the root group
     $exportSpecificOptions->addProperty($generalOptions);
     // set the options for the export plugin property item
     $exportPluginProperties->setOptions($exportSpecificOptions);
     $this->properties = $exportPluginProperties;
 }
Exemplo n.º 8
0
 /**
  * Sets the import plugin properties.
  * Called in the constructor.
  *
  * @return void
  */
 protected function setProperties()
 {
     $props = 'libraries/properties/';
     include_once "{$props}/plugins/ImportPluginProperties.class.php";
     include_once "{$props}/options/groups/OptionsPropertyRootGroup.class.php";
     include_once "{$props}/options/groups/OptionsPropertyMainGroup.class.php";
     include_once "{$props}/options/items/SelectPropertyItem.class.php";
     include_once "{$props}/options/items/BoolPropertyItem.class.php";
     $importPluginProperties = new ImportPluginProperties();
     $importPluginProperties->setText('SQL');
     $importPluginProperties->setExtension('sql');
     $importPluginProperties->setOptionsText(__('Options'));
     $compats = $GLOBALS['dbi']->getCompatibilities();
     if (count($compats) > 0) {
         $values = array();
         foreach ($compats as $val) {
             $values[$val] = $val;
         }
         // create the root group that will be the options field for
         // $importPluginProperties
         // this will be shown as "Format specific options"
         $importSpecificOptions = new OptionsPropertyRootGroup();
         $importSpecificOptions->setName("Format Specific Options");
         // general options main group
         $generalOptions = new OptionsPropertyMainGroup();
         $generalOptions->setName("general_opts");
         // create primary items and add them to the group
         $leaf = new SelectPropertyItem();
         $leaf->setName("compatibility");
         $leaf->setText(__('SQL compatibility mode:'));
         $leaf->setValues($values);
         $leaf->setDoc(array('manual_MySQL_Database_Administration', 'Server_SQL_mode'));
         $generalOptions->addProperty($leaf);
         $leaf = new BoolPropertyItem();
         $leaf->setName("no_auto_value_on_zero");
         $leaf->setText(__('Do not use <code>AUTO_INCREMENT</code> for zero values'));
         $leaf->setDoc(array('manual_MySQL_Database_Administration', 'Server_SQL_mode', 'sqlmode_no_auto_value_on_zero'));
         $generalOptions->addProperty($leaf);
         // add the main group to the root group
         $importSpecificOptions->addProperty($generalOptions);
         // set the options for the import plugin property item
         $importPluginProperties->setOptions($importSpecificOptions);
     }
     $this->properties = $importPluginProperties;
 }
 /**
  * Sets the import plugin properties.
  * Called in the constructor.
  *
  * @return void
  */
 protected function setProperties()
 {
     $props = 'libraries/properties/';
     include_once "{$props}/plugins/ImportPluginProperties.class.php";
     include_once "{$props}/options/groups/OptionsPropertyRootGroup.class.php";
     include_once "{$props}/options/groups/OptionsPropertyMainGroup.class.php";
     include_once "{$props}/options/items/BoolPropertyItem.class.php";
     $importPluginProperties = new ImportPluginProperties();
     $importPluginProperties->setText('OpenDocument Spreadsheet');
     $importPluginProperties->setExtension('ods');
     $importPluginProperties->setOptionsText(__('Options'));
     // create the root group that will be the options field for
     // $importPluginProperties
     // this will be shown as "Format specific options"
     $importSpecificOptions = new OptionsPropertyRootGroup();
     $importSpecificOptions->setName("Format Specific Options");
     // general options main group
     $generalOptions = new OptionsPropertyMainGroup();
     $generalOptions->setName("general_opts");
     // create primary items and add them to the group
     $leaf = new BoolPropertyItem();
     $leaf->setName("col_names");
     $leaf->setText(__('The first line of the file contains the table column names' . ' <i>(if this is unchecked, the first line will become part' . ' of the data)</i>'));
     $generalOptions->addProperty($leaf);
     $leaf = new BoolPropertyItem();
     $leaf->setName("empty_rows");
     $leaf->setText(__('Do not import empty rows'));
     $generalOptions->addProperty($leaf);
     $leaf = new BoolPropertyItem();
     $leaf->setName("recognize_percentages");
     $leaf->setText(__('Import percentages as proper decimals <i>(ex. 12.00% to .12)</i>'));
     $generalOptions->addProperty($leaf);
     $leaf = new BoolPropertyItem();
     $leaf->setName("recognize_currency");
     $leaf->setText(__('Import currencies <i>(ex. $5.00 to 5.00)</i>'));
     $generalOptions->addProperty($leaf);
     // add the main group to the root group
     $importSpecificOptions->addProperty($generalOptions);
     // set the options for the import plugin property item
     $importPluginProperties->setOptions($importSpecificOptions);
     $this->properties = $importPluginProperties;
 }
Exemplo n.º 10
0
 /**
  * Sets the export ODS properties
  *
  * @return void
  */
 protected function setProperties()
 {
     $props = 'libraries/properties/';
     include_once "{$props}/plugins/ExportPluginProperties.class.php";
     include_once "{$props}/options/groups/OptionsPropertyRootGroup.class.php";
     include_once "{$props}/options/groups/OptionsPropertyMainGroup.class.php";
     include_once "{$props}/options/items/TextPropertyItem.class.php";
     include_once "{$props}/options/items/BoolPropertyItem.class.php";
     include_once "{$props}/options/items/HiddenPropertyItem.class.php";
     $exportPluginProperties = new ExportPluginProperties();
     $exportPluginProperties->setText('OpenDocument Spreadsheet');
     $exportPluginProperties->setExtension('ods');
     $exportPluginProperties->setMimeType('application/vnd.oasis.opendocument.spreadsheet');
     $exportPluginProperties->setForceFile(true);
     $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");
     // create primary items and add them to the group
     $leaf = new TextPropertyItem();
     $leaf->setName("null");
     $leaf->setText(__('Replace NULL with:'));
     $generalOptions->addProperty($leaf);
     $leaf = new BoolPropertyItem();
     $leaf->setName("columns");
     $leaf->setText(__('Put columns names in the first row'));
     $generalOptions->addProperty($leaf);
     $leaf = new HiddenPropertyItem();
     $leaf->setName("structure_or_data");
     $generalOptions->addProperty($leaf);
     // add the main group to the root group
     $exportSpecificOptions->addProperty($generalOptions);
     // set the options for the export plugin property item
     $exportPluginProperties->setOptions($exportSpecificOptions);
     $this->properties = $exportPluginProperties;
 }
Exemplo n.º 11
0
 /**
  * Sets the export JSON properties
  *
  * @return void
  */
 protected function setProperties()
 {
     $props = 'libraries/properties/';
     include_once "{$props}/plugins/ExportPluginProperties.class.php";
     include_once "{$props}/options/groups/OptionsPropertyRootGroup.class.php";
     include_once "{$props}/options/groups/OptionsPropertyMainGroup.class.php";
     include_once "{$props}/options/items/HiddenPropertyItem.class.php";
     include_once "{$props}/options/items/BoolPropertyItem.class.php";
     $exportPluginProperties = new ExportPluginProperties();
     $exportPluginProperties->setText('JSON');
     $exportPluginProperties->setExtension('json');
     $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");
     // create primary items and add them to the group
     $leaf = new HiddenPropertyItem();
     $leaf->setName("structure_or_data");
     $generalOptions->addProperty($leaf);
     // JSON_PRETTY_PRINT is available since 5.4.0
     if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
         $leaf = new BoolPropertyItem();
         $leaf->setName('pretty_print');
         $leaf->setText(__('Output pretty-printed JSON (Use human-readable formatting)'));
         $generalOptions->addProperty($leaf);
     }
     // add the main group to the root group
     $exportSpecificOptions->addProperty($generalOptions);
     // set the options for the export plugin property item
     $exportPluginProperties->setOptions($exportSpecificOptions);
     $this->properties = $exportPluginProperties;
 }
Exemplo n.º 12
0
 /**
  * Sets the import plugin properties.
  * Called in the constructor.
  *
  * @return void
  */
 protected function setProperties()
 {
     if ($GLOBALS['cfg']['Import']['ldi_local_option'] == 'auto') {
         $GLOBALS['cfg']['Import']['ldi_local_option'] = false;
         $result = PMA_DBI_try_query('SHOW VARIABLES LIKE \'local\\_infile\';');
         if ($result != false && PMA_DBI_num_rows($result) > 0) {
             $tmp = PMA_DBI_fetch_row($result);
             if ($tmp[1] == 'ON') {
                 $GLOBALS['cfg']['Import']['ldi_local_option'] = true;
             }
         }
         PMA_DBI_free_result($result);
         unset($result);
     }
     $props = 'libraries/properties/';
     include_once "{$props}/plugins/ImportPluginProperties.class.php";
     include_once "{$props}/options/groups/OptionsPropertyRootGroup.class.php";
     include_once "{$props}/options/groups/OptionsPropertyMainGroup.class.php";
     include_once "{$props}/options/items/BoolPropertyItem.class.php";
     include_once "{$props}/options/items/TextPropertyItem.class.php";
     $importPluginProperties = new ImportPluginProperties();
     $importPluginProperties->setText('CSV using LOAD DATA');
     $importPluginProperties->setExtension('ldi');
     $importPluginProperties->setOptionsText(__('Options'));
     // create the root group that will be the options field for
     // $importPluginProperties
     // this will be shown as "Format specific options"
     $importSpecificOptions = new OptionsPropertyRootGroup();
     $importSpecificOptions->setName("Format Specific Options");
     // general options main group
     $generalOptions = new OptionsPropertyMainGroup();
     $generalOptions->setName("general_opts");
     // create primary items and add them to the group
     $leaf = new BoolPropertyItem();
     $leaf->setName("replace");
     $leaf->setText(__('Replace table data with file'));
     $generalOptions->addProperty($leaf);
     // add the main group to the root group
     $importSpecificOptions->addProperty($generalOptions);
     // set the options for the import plugin property item
     $importPluginProperties->setOptions($importSpecificOptions);
     $this->properties = $importPluginProperties;
 }
Exemplo n.º 13
0
 /**
  * Sets the export SQL properties
  *
  * @return void
  */
 protected function setProperties()
 {
     global $plugin_param;
     $hide_sql = false;
     $hide_structure = false;
     if ($plugin_param['export_type'] == 'table' && !$plugin_param['single_table']) {
         $hide_structure = true;
         $hide_sql = true;
     }
     if (!$hide_sql) {
         $props = 'libraries/properties/';
         include_once "{$props}/plugins/ExportPluginProperties.class.php";
         include_once "{$props}/options/groups/OptionsPropertyRootGroup.class.php";
         include_once "{$props}/options/groups/OptionsPropertyMainGroup.class.php";
         include_once "{$props}/options/groups/OptionsPropertySubgroup.class.php";
         include_once "{$props}/options/items/BoolPropertyItem.class.php";
         include_once "{$props}/options/items/MessageOnlyPropertyItem.class.php";
         include_once "{$props}/options/items/RadioPropertyItem.class.php";
         include_once "{$props}/options/items/SelectPropertyItem.class.php";
         include_once "{$props}/options/items/TextPropertyItem.class.php";
         $exportPluginProperties = new ExportPluginProperties();
         $exportPluginProperties->setText('SQL');
         $exportPluginProperties->setExtension('sql');
         $exportPluginProperties->setMimeType('text/x-sql');
         $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");
         // comments
         $subgroup = new OptionsPropertySubgroup();
         $subgroup->setName("include_comments");
         $leaf = new BoolPropertyItem();
         $leaf->setName('include_comments');
         $leaf->setText(__('Display comments <i>(includes info such as export' . ' timestamp, PHP version, and server version)</i>'));
         $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'])) {
             $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();
         $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;
             }
             $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
         if ($plugin_param['export_type'] == 'server') {
             $leaf = new BoolPropertyItem();
             $leaf->setName("drop_database");
             $leaf->setText(sprintf(__('Add %s statement'), '<code>DROP DATABASE</code>'));
             $generalOptions->addProperty($leaf);
         }
         // 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);
         // add the main group to the root group
         $exportSpecificOptions->addProperty($generalOptions);
         // structure options main group
         if (!$hide_structure) {
             $structureOptions = new OptionsPropertyMainGroup();
             $structureOptions->setName("structure");
             $structureOptions->setText(__('Object creation options'));
             $structureOptions->setForce('data');
             // 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') {
                 $leaf = new BoolPropertyItem();
                 $leaf->setName('create_database');
                 $create_clause = '<code>CREATE DATABASE / USE</code>';
                 $leaf->setText(sprintf(__('Add %s statement'), $create_clause));
                 $subgroup->addProperty($leaf);
             }
             if ($plugin_param['export_type'] == 'table') {
                 if (PMA_Table::isView($GLOBALS['db'], $GLOBALS['table'])) {
                     $drop_clause = '<code>DROP VIEW</code>';
                 } else {
                     $drop_clause = '<code>DROP TABLE</code>';
                 }
             } else {
                 if (PMA_DRIZZLE) {
                     $drop_clause = '<code>DROP TABLE</code>';
                 } else {
                     $drop_clause = '<code>DROP TABLE / VIEW / PROCEDURE' . ' / FUNCTION</code>';
                     if (PMA_MYSQL_INT_VERSION > 50100) {
                         $drop_clause .= '<code> / EVENT</code>';
                     }
                 }
             }
             $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'), '<code>CREATE PROCEDURE / FUNCTION' . (PMA_MYSQL_INT_VERSION > 50100 ? ' / EVENT</code>' : '</code>')));
                 $subgroup->addProperty($leaf);
             }
             // begin CREATE TABLE statements
             $subgroup_create_table = new OptionsPropertySubgroup();
             $leaf = new BoolPropertyItem();
             $leaf->setName('create_table_statements');
             $leaf->setText(__('<code>CREATE TABLE</code> options:'));
             $subgroup_create_table->setSubgroupHeader($leaf);
             $leaf = new BoolPropertyItem();
             $leaf->setName('if_not_exists');
             $leaf->setText('<code>IF NOT EXISTS</code>');
             $subgroup_create_table->addProperty($leaf);
             $leaf = new BoolPropertyItem();
             $leaf->setName('auto_increment');
             $leaf->setText('<code>AUTO_INCREMENT</code>');
             $subgroup_create_table->addProperty($leaf);
             $subgroup->addProperty($subgroup_create_table);
             $structureOptions->addProperty($subgroup);
             $leaf = new BoolPropertyItem();
             $leaf->setName("backquotes");
             $leaf->setText(__('Enclose table and column names with backquotes ' . '<i>(Protects column and table names formed with' . ' special characters or keywords)</i>'));
             $structureOptions->addProperty($leaf);
             // add the main group to the root group
             $exportSpecificOptions->addProperty($structureOptions);
         }
         // 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 <code>INSERT</code> statements, use:'));
         $subgroup->setSubgroupHeader($leaf);
         // Not supported in Drizzle
         if (!PMA_DRIZZLE) {
             $leaf = new BoolPropertyItem();
             $leaf->setName("delayed");
             $leaf->setText(__('<code>INSERT DELAYED</code> statements'));
             $leaf->setDoc(array('manual_MySQL_Database_Administration', 'insert_delayed'));
             $subgroup->addProperty($leaf);
         }
         $leaf = new BoolPropertyItem();
         $leaf->setName("ignore");
         $leaf->setText(__('<code>INSERT IGNORE</code> statements'));
         $leaf->setDoc(array('manual_MySQL_Database_Administration', 'insert'));
         $subgroup->addProperty($leaf);
         $dataOptions->addProperty($subgroup);
         // 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 */
         $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(__('<code>INSERT IGNORE</code> statements'));
         $leaf->setValues(array('complete' => __('include column names in every <code>INSERT</code> statement' . ' <br /> &nbsp; &nbsp; &nbsp; Example: <code>INSERT INTO' . ' tbl_name (col_A,col_B,col_C) VALUES (1,2,3)</code>'), 'extended' => __('insert multiple rows in every <code>INSERT</code> statement' . '<br /> &nbsp; &nbsp; &nbsp; Example: <code>INSERT INTO' . ' tbl_name VALUES (1,2,3), (4,5,6), (7,8,9)</code>'), 'both' => __('both of the above<br /> &nbsp; &nbsp; &nbsp; Example:' . ' <code>INSERT INTO tbl_name (col_A,col_B) VALUES (1,2,3),' . ' (4,5,6), (7,8,9)</code>'), 'none' => __('neither of the above<br /> &nbsp; &nbsp; &nbsp; Example:' . ' <code>INSERT INTO tbl_name VALUES (1,2,3)</code>')));
         $subgroup->addProperty($leaf);
         $dataOptions->addProperty($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' . ' <i>(for example, "abc" becomes 0x616263)</i>'));
         $dataOptions->addProperty($leaf);
         // Drizzle works only with UTC timezone
         if (!PMA_DRIZZLE) {
             // Dump time in UTC
             $leaf = new BoolPropertyItem();
             $leaf->setName("utc_time");
             $leaf->setText(__('Dump TIMESTAMP columns in UTC <i>(enables TIMESTAMP columns' . ' to be dumped and reloaded between servers in different' . ' time zones)</i>'));
             $dataOptions->addProperty($leaf);
         }
         // 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;
     }
 }
Exemplo n.º 14
0
 /**
  * Sets the export XML properties
  *
  * @return void
  */
 protected function setProperties()
 {
     $props = 'libraries/properties/';
     include_once "{$props}/plugins/ExportPluginProperties.class.php";
     include_once "{$props}/options/groups/OptionsPropertyRootGroup.class.php";
     include_once "{$props}/options/groups/OptionsPropertyMainGroup.class.php";
     include_once "{$props}/options/items/HiddenPropertyItem.class.php";
     include_once "{$props}/options/items/BoolPropertyItem.class.php";
     // create the export plugin property item
     $exportPluginProperties = new ExportPluginProperties();
     $exportPluginProperties->setText('XML');
     $exportPluginProperties->setExtension('xml');
     $exportPluginProperties->setMimeType('text/xml');
     $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");
     // create primary items and add them to the group
     $leaf = new HiddenPropertyItem();
     $leaf->setName("structure_or_data");
     $generalOptions->addProperty($leaf);
     // add the main group to the root group
     $exportSpecificOptions->addProperty($generalOptions);
     // export structure main group
     $structure = new OptionsPropertyMainGroup();
     $structure->setName("structure");
     $structure->setText(__('Object creation options (all are recommended)'));
     // create primary items and add them to the group
     if (!PMA_DRIZZLE) {
         $leaf = new BoolPropertyItem();
         $leaf->setName("export_events");
         $leaf->setText(__('Events'));
         $structure->addProperty($leaf);
         $leaf = new BoolPropertyItem();
         $leaf->setName("export_functions");
         $leaf->setText(__('Functions'));
         $structure->addProperty($leaf);
         $leaf = new BoolPropertyItem();
         $leaf->setName("export_procedures");
         $leaf->setText(__('Procedures'));
         $structure->addProperty($leaf);
     }
     $leaf = new BoolPropertyItem();
     $leaf->setName("export_tables");
     $leaf->setText(__('Tables'));
     $structure->addProperty($leaf);
     if (!PMA_DRIZZLE) {
         $leaf = new BoolPropertyItem();
         $leaf->setName("export_triggers");
         $leaf->setText(__('Triggers'));
         $structure->addProperty($leaf);
         $leaf = new BoolPropertyItem();
         $leaf->setName("export_views");
         $leaf->setText(__('Views'));
         $structure->addProperty($leaf);
     }
     $exportSpecificOptions->addProperty($structure);
     // data main group
     $data = new OptionsPropertyMainGroup();
     $data->setName("data");
     $data->setText(__('Data dump options'));
     // create primary items and add them to the group
     $leaf = new BoolPropertyItem();
     $leaf->setName("export_contents");
     $leaf->setText(__('Export contents'));
     $data->addProperty($leaf);
     $exportSpecificOptions->addProperty($data);
     // set the options for the export plugin property item
     $exportPluginProperties->setOptions($exportSpecificOptions);
     $this->properties = $exportPluginProperties;
 }
Exemplo n.º 15
0
 /**
  * Sets the export PDF properties
  *
  * @return void
  */
 protected function setProperties()
 {
     $props = 'libraries/properties/';
     include_once "{$props}/plugins/ExportPluginProperties.class.php";
     include_once "{$props}/options/groups/OptionsPropertyRootGroup.class.php";
     include_once "{$props}/options/groups/OptionsPropertyMainGroup.class.php";
     include_once "{$props}/options/items/MessageOnlyPropertyItem.class.php";
     include_once "{$props}/options/items/TextPropertyItem.class.php";
     include_once "{$props}/options/items/HiddenPropertyItem.class.php";
     $exportPluginProperties = new ExportPluginProperties();
     $exportPluginProperties->setText('PDF');
     $exportPluginProperties->setExtension('pdf');
     $exportPluginProperties->setMimeType('application/pdf');
     $exportPluginProperties->setForceFile(true);
     $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");
     // create primary items and add them to the group
     $leaf = new MessageOnlyPropertyItem();
     $leaf->setName("explanation");
     $leaf->setText(__('(Generates a report containing the data of a single table)'));
     $generalOptions->addProperty($leaf);
     $leaf = new TextPropertyItem();
     $leaf->setName("report_title");
     $leaf->setText(__('Report title:'));
     $generalOptions->addProperty($leaf);
     $leaf = new HiddenPropertyItem();
     $leaf->setName("structure_or_data");
     $generalOptions->addProperty($leaf);
     // add the main group to the root group
     $exportSpecificOptions->addProperty($generalOptions);
     // set the options for the export plugin property item
     $exportPluginProperties->setOptions($exportSpecificOptions);
     $this->properties = $exportPluginProperties;
 }
Exemplo n.º 16
0
 /**
  * Sets the export PDF properties
  *
  * @return void
  */
 protected function setProperties()
 {
     $props = 'libraries/properties/';
     include_once "{$props}/plugins/ExportPluginProperties.class.php";
     include_once "{$props}/options/groups/OptionsPropertyRootGroup.class.php";
     include_once "{$props}/options/groups/OptionsPropertyMainGroup.class.php";
     include_once "{$props}/options/items/RadioPropertyItem.class.php";
     include_once "{$props}/options/items/TextPropertyItem.class.php";
     $exportPluginProperties = new ExportPluginProperties();
     $exportPluginProperties->setText('PDF');
     $exportPluginProperties->setExtension('pdf');
     $exportPluginProperties->setMimeType('application/pdf');
     $exportPluginProperties->setForceFile(true);
     $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");
     // create primary items and add them to the group
     $leaf = new TextPropertyItem();
     $leaf->setName("report_title");
     $leaf->setText(__('Report title:'));
     $generalOptions->addProperty($leaf);
     // add the group to the root group
     $exportSpecificOptions->addProperty($generalOptions);
     // what to dump (structure/data/both) main group
     $dumpWhat = new OptionsPropertyMainGroup();
     $dumpWhat->setName("dump_what");
     $dumpWhat->setText(__('Dump table'));
     $leaf = new RadioPropertyItem();
     $leaf->setName("structure_or_data");
     $leaf->setValues(array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data')));
     $dumpWhat->addProperty($leaf);
     // add the group to the root group
     $exportSpecificOptions->addProperty($dumpWhat);
     // set the options for the export plugin property item
     $exportPluginProperties->setOptions($exportSpecificOptions);
     $this->properties = $exportPluginProperties;
 }
 /**
  * Sets the export Latex properties
  *
  * @return void
  */
 protected function setProperties()
 {
     global $plugin_param;
     $hide_structure = false;
     if ($plugin_param['export_type'] == 'table' && !$plugin_param['single_table']) {
         $hide_structure = true;
     }
     $props = 'libraries/properties/';
     include_once "{$props}/plugins/ExportPluginProperties.class.php";
     include_once "{$props}/options/groups/OptionsPropertyRootGroup.class.php";
     include_once "{$props}/options/groups/OptionsPropertyMainGroup.class.php";
     include_once "{$props}/options/items/BoolPropertyItem.class.php";
     include_once "{$props}/options/items/RadioPropertyItem.class.php";
     include_once "{$props}/options/items/TextPropertyItem.class.php";
     $exportPluginProperties = new ExportPluginProperties();
     $exportPluginProperties->setText('LaTeX');
     $exportPluginProperties->setExtension('tex');
     $exportPluginProperties->setMimeType('application/x-tex');
     $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");
     // create primary items and add them to the group
     $leaf = new BoolPropertyItem();
     $leaf->setName("caption");
     $leaf->setText(__('Include table caption'));
     $generalOptions->addProperty($leaf);
     // add the main group to the root group
     $exportSpecificOptions->addProperty($generalOptions);
     // what to dump (structure/data/both) main group
     $dumpWhat = new OptionsPropertyMainGroup();
     $dumpWhat->setName("dump_what");
     $dumpWhat->setText(__('Dump table'));
     // create primary items and add them to the group
     $leaf = new RadioPropertyItem();
     $leaf->setName("structure_or_data");
     $leaf->setValues(array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data')));
     $dumpWhat->addProperty($leaf);
     // add the main group to the root group
     $exportSpecificOptions->addProperty($dumpWhat);
     // structure options main group
     if (!$hide_structure) {
         $structureOptions = new OptionsPropertyMainGroup();
         $structureOptions->setName("structure");
         $structureOptions->setText(__('Object creation options'));
         $structureOptions->setForce('data');
         // create primary items and add them to the group
         $leaf = new TextPropertyItem();
         $leaf->setName("structure_caption");
         $leaf->setText(__('Table caption:'));
         $leaf->setDoc('faq6-27');
         $structureOptions->addProperty($leaf);
         $leaf = new TextPropertyItem();
         $leaf->setName("structure_continued_caption");
         $leaf->setText(__('Table caption (continued):'));
         $leaf->setDoc('faq6-27');
         $structureOptions->addProperty($leaf);
         $leaf = new TextPropertyItem();
         $leaf->setName("structure_label");
         $leaf->setText(__('Label key:'));
         $leaf->setDoc('faq6-27');
         $structureOptions->addProperty($leaf);
         if (!empty($GLOBALS['cfgRelation']['relation'])) {
             $leaf = new BoolPropertyItem();
             $leaf->setName("relation");
             $leaf->setText(__('Display foreign key relationships'));
             $structureOptions->addProperty($leaf);
         }
         $leaf = new BoolPropertyItem();
         $leaf->setName("comments");
         $leaf->setText(__('Display comments'));
         $structureOptions->addProperty($leaf);
         if (!empty($GLOBALS['cfgRelation']['mimework'])) {
             $leaf = new BoolPropertyItem();
             $leaf->setName("mime");
             $leaf->setText(__('Display MIME types'));
             $structureOptions->addProperty($leaf);
         }
         // add the main group to the root group
         $exportSpecificOptions->addProperty($structureOptions);
     }
     // data options main group
     $dataOptions = new OptionsPropertyMainGroup();
     $dataOptions->setName("data");
     $dataOptions->setText(__('Data dump options'));
     $dataOptions->setForce('structure');
     // create primary items and add them to the group
     $leaf = new BoolPropertyItem();
     $leaf->setName("columns");
     $leaf->setText(__('Put columns names in the first row:'));
     $dataOptions->addProperty($leaf);
     $leaf = new TextPropertyItem();
     $leaf->setName("data_caption");
     $leaf->setText(__('Table caption:'));
     $leaf->setDoc('faq6-27');
     $dataOptions->addProperty($leaf);
     $leaf = new TextPropertyItem();
     $leaf->setName("data_continued_caption");
     $leaf->setText(__('Table caption (continued):'));
     $leaf->setDoc('faq6-27');
     $dataOptions->addProperty($leaf);
     $leaf = new TextPropertyItem();
     $leaf->setName("data_label");
     $leaf->setText(__('Label key:'));
     $leaf->setDoc('faq6-27');
     $dataOptions->addProperty($leaf);
     $leaf = new TextPropertyItem();
     $leaf->setName('null');
     $leaf->setText(__('Replace NULL with:'));
     $dataOptions->addProperty($leaf);
     // 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;
 }
Exemplo n.º 18
0
 /**
  * Sets the import plugin properties.
  * Called in the constructor.
  *
  * @return void
  */
 protected function setProperties()
 {
     $this->_setAnalyze(false);
     if ($GLOBALS['plugin_param'] !== 'table') {
         $this->_setAnalyze(true);
     }
     $props = 'libraries/properties/';
     include_once "{$props}/plugins/ImportPluginProperties.class.php";
     include_once "{$props}/options/groups/OptionsPropertyRootGroup.class.php";
     include_once "{$props}/options/groups/OptionsPropertyMainGroup.class.php";
     include_once "{$props}/options/items/BoolPropertyItem.class.php";
     include_once "{$props}/options/items/TextPropertyItem.class.php";
     $importPluginProperties = new ImportPluginProperties();
     $importPluginProperties->setText('CSV');
     $importPluginProperties->setExtension('csv');
     $importPluginProperties->setOptionsText(__('Options'));
     // create the root group that will be the options field for
     // $importPluginProperties
     // this will be shown as "Format specific options"
     $importSpecificOptions = new OptionsPropertyRootGroup();
     $importSpecificOptions->setName("Format Specific Options");
     // general options main group
     $generalOptions = new OptionsPropertyMainGroup();
     $generalOptions->setName("general_opts");
     // create primary items and add them to the group
     $leaf = new BoolPropertyItem();
     $leaf->setName("replace");
     $leaf->setText(__('Replace table data with file'));
     $generalOptions->addProperty($leaf);
     $leaf = new TextPropertyItem();
     $leaf->setName("terminated");
     $leaf->setText(__('Columns separated with:'));
     $leaf->setSize(2);
     $leaf->setLen(2);
     $generalOptions->addProperty($leaf);
     $leaf = new TextPropertyItem();
     $leaf->setName("enclosed");
     $leaf->setText(__('Columns enclosed with:'));
     $leaf->setSize(2);
     $leaf->setLen(2);
     $generalOptions->addProperty($leaf);
     $leaf = new TextPropertyItem();
     $leaf->setName("escaped");
     $leaf->setText(__('Columns escaped with:'));
     $leaf->setSize(2);
     $leaf->setLen(2);
     $generalOptions->addProperty($leaf);
     $leaf = new TextPropertyItem();
     $leaf->setName("new_line");
     $leaf->setText(__('Lines terminated with:'));
     $leaf->setSize(2);
     $generalOptions->addProperty($leaf);
     if ($GLOBALS['plugin_param'] !== 'table') {
         $leaf = new BoolPropertyItem();
         $leaf->setName("col_names");
         $leaf->setText(__('The first line of the file contains the table column names' . ' <i>(if this is unchecked, the first line will become part' . ' of the data)</i>'));
         $generalOptions->addProperty($leaf);
     } else {
         $hint = new PMA_Message(__('If the data in each row of the file is not' . ' in the same order as in the database, list the corresponding' . ' column names here. Column names must be separated by commas' . ' and not enclosed in quotations.'));
         $leaf = new TextPropertyItem();
         $leaf->setName("columns");
         $leaf->setText(__('Column names: ') . PMA_CommonFunctions::getInstance()->showHint($hint));
         $generalOptions->addProperty($leaf);
     }
     // add the main group to the root group
     $importSpecificOptions->addProperty($generalOptions);
     // set the options for the import plugin property item
     $importPluginProperties->setOptions($importSpecificOptions);
     $this->properties = $importPluginProperties;
 }