Exemplo n.º 1
0
 /**
  * Sets the import plugin properties.
  * Called in the constructor.
  *
  * @return void
  */
 protected function setProperties()
 {
     $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("Format Specific Options");
     // general options main group
     $generalOptions = new OptionsPropertyMainGroup("general_opts");
     // create primary items and add them to the group
     $leaf = new BoolPropertyItem("col_names", __('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("empty_rows", __('Do not import empty rows'));
     $generalOptions->addProperty($leaf);
     $leaf = new BoolPropertyItem("recognize_percentages", __('Import percentages as proper decimals <i>(ex. 12.00% to .12)</i>'));
     $generalOptions->addProperty($leaf);
     $leaf = new BoolPropertyItem("recognize_currency", __('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.º 2
0
 /**
  * Sets the import plugin properties.
  * Called in the constructor.
  *
  * @return \PMA\libraries\properties\options\groups\OptionsPropertyMainGroup PMA\libraries\properties\options\groups\OptionsPropertyMainGroup object of the plugin
  */
 protected function setProperties()
 {
     $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("Format Specific Options");
     // general options main group
     $generalOptions = new OptionsPropertyMainGroup("general_opts");
     // create common items and add them to the group
     $leaf = new BoolPropertyItem("replace", __('Update data when duplicate keys found on import (add ON DUPLICATE ' . 'KEY UPDATE)'));
     $generalOptions->addProperty($leaf);
     $leaf = new TextPropertyItem("terminated", __('Columns separated with:'));
     $leaf->setSize(2);
     $generalOptions->addProperty($leaf);
     $leaf = new TextPropertyItem("enclosed", __('Columns enclosed with:'));
     $leaf->setSize(2);
     $leaf->setLen(2);
     $generalOptions->addProperty($leaf);
     $leaf = new TextPropertyItem("escaped", __('Columns escaped with:'));
     $leaf->setSize(2);
     $leaf->setLen(2);
     $generalOptions->addProperty($leaf);
     $leaf = new TextPropertyItem("new_line", __('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 import plugin properties.
  * Called in the constructor.
  *
  * @return void
  */
 protected function setProperties()
 {
     $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("Format Specific Options");
         // general options main group
         $generalOptions = new OptionsPropertyMainGroup("general_opts");
         // create primary items and add them to the group
         $leaf = new SelectPropertyItem("compatibility", __('SQL compatibility mode:'));
         $leaf->setValues($values);
         $leaf->setDoc(array('manual_MySQL_Database_Administration', 'Server_SQL_mode'));
         $generalOptions->addProperty($leaf);
         $leaf = new BoolPropertyItem("no_auto_value_on_zero", __('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;
 }
Exemplo n.º 4
0
 /**
  * Sets the import plugin properties.
  * Called in the constructor.
  *
  * @return void
  */
 protected function setProperties()
 {
     $importPluginProperties = new ImportPluginProperties();
     $importPluginProperties->setText(__('ESRI Shape File'));
     $importPluginProperties->setExtension('shp');
     $importPluginProperties->setOptions(array());
     $importPluginProperties->setOptionsText(__('Options'));
     $this->properties = $importPluginProperties;
 }
Exemplo n.º 5
0
 /**
  * Sets the import plugin properties.
  * Called in the constructor.
  *
  * @return void
  */
 protected function setProperties()
 {
     $importPluginProperties = new ImportPluginProperties();
     $importPluginProperties->setText(__('XML'));
     $importPluginProperties->setExtension('xml');
     $importPluginProperties->setMimeType('text/xml');
     $importPluginProperties->setOptions(array());
     $importPluginProperties->setOptionsText(__('Options'));
     $this->properties = $importPluginProperties;
 }
Exemplo n.º 6
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);
     }
     $importPluginProperties = new ImportPluginProperties();
     $importPluginProperties->setText(__('MediaWiki Table'));
     $importPluginProperties->setExtension('txt');
     $importPluginProperties->setMimeType('text/plain');
     $importPluginProperties->setOptions(array());
     $importPluginProperties->setOptionsText(__('Options'));
     $this->properties = $importPluginProperties;
 }