/**
  * Sets the export ODS properties
  *
  * @return void
  */
 protected function setProperties()
 {
     $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;
 }
 /**
  * Sets the export CodeGen properties
  *
  * @return void
  */
 protected function setProperties()
 {
     $exportPluginProperties = new ExportPluginProperties();
     $exportPluginProperties->setText('CodeGen');
     $exportPluginProperties->setExtension('cs');
     $exportPluginProperties->setMimeType('text/cs');
     $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);
     $leaf = new SelectPropertyItem();
     $leaf->setName("format");
     $leaf->setText(__('Format:'));
     $leaf->setValues($this->_getCgFormats());
     $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;
 }
Пример #3
0
 /**
  * Sets the export JSON properties
  *
  * @return void
  */
 protected function setProperties()
 {
     $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;
 }
Пример #4
0
 /**
  * Sets the export CSV properties
  *
  * @return void
  */
 protected function setProperties()
 {
     $exportPluginProperties = new ExportPluginProperties();
     $exportPluginProperties->setText('CSV');
     $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 leaf items and add them to the group
     $leaf = new TextPropertyItem();
     $leaf->setName("separator");
     $leaf->setText(__('Columns separated with:'));
     $generalOptions->addProperty($leaf);
     $leaf = new TextPropertyItem();
     $leaf->setName("enclosed");
     $leaf->setText(__('Columns enclosed with:'));
     $generalOptions->addProperty($leaf);
     $leaf = new TextPropertyItem();
     $leaf->setName("escaped");
     $leaf->setText(__('Columns escaped with:'));
     $generalOptions->addProperty($leaf);
     $leaf = new TextPropertyItem();
     $leaf->setName("terminated");
     $leaf->setText(__('Lines terminated with:'));
     $generalOptions->addProperty($leaf);
     $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 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;
 }
 /**
  * Sets the export CSV for Excel properties
  *
  * @return void
  */
 protected function setProperties()
 {
     $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;
 }
Пример #6
0
 /**
  * Sets the export XML properties
  *
  * @return void
  */
 protected function setProperties()
 {
     // 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
     $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);
     $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;
 }
 /**
  * Test for PMA\libraries\properties\options\items\HiddenPropertyItem::getItemType
  *
  * @return void
  */
 public function testGetItemTypeHidden()
 {
     $object = new HiddenPropertyItem();
     $this->assertEquals("hidden", $object->getItemType());
 }