diff --git a/libraries/plugins/export/todo_change_properties/ExportPhparray.class.php b/libraries/plugins/export/ExportPhparray.class.php similarity index 76% rename from libraries/plugins/export/todo_change_properties/ExportPhparray.class.php rename to libraries/plugins/export/ExportPhparray.class.php index f739fd21a4..c1116d3906 100644 --- a/libraries/plugins/export/todo_change_properties/ExportPhparray.class.php +++ b/libraries/plugins/export/ExportPhparray.class.php @@ -35,27 +35,37 @@ class ExportPhparray extends ExportPlugin */ protected function setProperties() { - $this->properties = array( - 'text' => __('PHP array'), - 'extension' => 'php', - 'mime_type' => 'text/plain', - 'options' => array(), - 'options_text' => __('Options') - ); + $props = 'libraries/properties/'; + require_once "$props/plugins/ExportPluginProperties.class.php"; + require_once "$props/options/groups/OptionsPropertyRootGroup.class.php"; + require_once "$props/options/groups/OptionsPropertyMainGroup.class.php"; + require_once "$props/options/items/HiddenPropertyItem.class.php"; - $this->properties['options'] = array( - array( - 'type' => 'begin_group', - 'name' => 'general_opts' - ), - array( - 'type' => 'hidden', - 'name' => 'structure_or_data', - ), - array( - 'type' => 'end_group' - ) - ); + $exportPluginProperties = new ExportPluginProperties(); + $exportPluginProperties->setText('PHP array'); + $exportPluginProperties->setExtension('php'); + $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; } /**