/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * Test for HiddenPropertyItem::getItemType * * @return void */ public function testGetItemTypeHidden() { $object = new HiddenPropertyItem(); $this->assertEquals("hidden", $object->getItemType()); }