/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }