Skip to content

Commit

Permalink
Use new contructor for Group() objects
Browse files Browse the repository at this point in the history
This safes us next calls to setName and setText.

Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Jan 5, 2016
1 parent 4975ef2 commit ca59f50
Show file tree
Hide file tree
Showing 24 changed files with 158 additions and 148 deletions.
8 changes: 4 additions & 4 deletions libraries/plugins/export/ExportCodegen.php
Expand Up @@ -86,12 +86,12 @@ protected function setProperties()
// 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");
$exportSpecificOptions = new OptionsPropertyRootGroup(
"Format Specific Options"
);

// general options main group
$generalOptions = new OptionsPropertyMainGroup();
$generalOptions->setName("general_opts");
$generalOptions = new OptionsPropertyMainGroup("general_opts");
// create primary items and add them to the group
$leaf = new HiddenPropertyItem("structure_or_data");
$generalOptions->addProperty($leaf);
Expand Down
8 changes: 4 additions & 4 deletions libraries/plugins/export/ExportCsv.php
Expand Up @@ -50,12 +50,12 @@ protected function setProperties()
// 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");
$exportSpecificOptions = new OptionsPropertyRootGroup(
"Format Specific Options"
);

// general options main group
$generalOptions = new OptionsPropertyMainGroup();
$generalOptions->setName("general_opts");
$generalOptions = new OptionsPropertyMainGroup("general_opts");
// create leaf items and add them to the group
$leaf = new TextPropertyItem(
"separator",
Expand Down
8 changes: 4 additions & 4 deletions libraries/plugins/export/ExportExcel.php
Expand Up @@ -40,12 +40,12 @@ protected function setProperties()
// 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");
$exportSpecificOptions = new OptionsPropertyRootGroup(
"Format Specific Options"
);

// general options main group
$generalOptions = new OptionsPropertyMainGroup();
$generalOptions->setName("general_opts");
$generalOptions = new OptionsPropertyMainGroup("general_opts");
// create primary items and add them to the group
$leaf = new TextPropertyItem(
'null',
Expand Down
17 changes: 9 additions & 8 deletions libraries/plugins/export/ExportHtmlword.php
Expand Up @@ -51,13 +51,14 @@ protected function setProperties()
// 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");
$exportSpecificOptions = new OptionsPropertyRootGroup(
"Format Specific Options"
);

// what to dump (structure/data/both)
$dumpWhat = new OptionsPropertyMainGroup();
$dumpWhat->setName("dump_what");
$dumpWhat->setText(__('Dump table'));
$dumpWhat = new OptionsPropertyMainGroup(
"dump_what", __('Dump table')
);
// create primary items and add them to the group
$leaf = new RadioPropertyItem("structure_or_data");
$leaf->setValues(
Expand All @@ -72,9 +73,9 @@ protected function setProperties()
$exportSpecificOptions->addProperty($dumpWhat);

// data options main group
$dataOptions = new OptionsPropertyMainGroup();
$dataOptions->setName("dump_what");
$dataOptions->setText(__('Data dump options'));
$dataOptions = new OptionsPropertyMainGroup(
"dump_what", __('Data dump options')
);
$dataOptions->setForce('structure');
// create primary items and add them to the group
$leaf = new TextPropertyItem(
Expand Down
8 changes: 4 additions & 4 deletions libraries/plugins/export/ExportJson.php
Expand Up @@ -48,12 +48,12 @@ protected function setProperties()
// 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");
$exportSpecificOptions = new OptionsPropertyRootGroup(
"Format Specific Options"
);

// general options main group
$generalOptions = new OptionsPropertyMainGroup();
$generalOptions->setName("general_opts");
$generalOptions = new OptionsPropertyMainGroup("general_opts");
// create primary items and add them to the group
$leaf = new HiddenPropertyItem("structure_or_data");
$generalOptions->addProperty($leaf);
Expand Down
26 changes: 13 additions & 13 deletions libraries/plugins/export/ExportLatex.php
Expand Up @@ -74,12 +74,12 @@ protected function setProperties()
// 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");
$exportSpecificOptions = new OptionsPropertyRootGroup(
"Format Specific Options"
);

// general options main group
$generalOptions = new OptionsPropertyMainGroup();
$generalOptions->setName("general_opts");
$generalOptions = new OptionsPropertyMainGroup("general_opts");
// create primary items and add them to the group
$leaf = new BoolPropertyItem(
"caption",
Expand All @@ -90,9 +90,9 @@ protected function setProperties()
$exportSpecificOptions->addProperty($generalOptions);

// what to dump (structure/data/both) main group
$dumpWhat = new OptionsPropertyMainGroup();
$dumpWhat->setName("dump_what");
$dumpWhat->setText(__('Dump table'));
$dumpWhat = new OptionsPropertyMainGroup(
"dump_what", __('Dump table')
);
// create primary items and add them to the group
$leaf = new RadioPropertyItem("structure_or_data");
$leaf->setValues(
Expand All @@ -108,9 +108,9 @@ protected function setProperties()

// structure options main group
if (!$hide_structure) {
$structureOptions = new OptionsPropertyMainGroup();
$structureOptions->setName("structure");
$structureOptions->setText(__('Object creation options'));
$structureOptions = new OptionsPropertyMainGroup(
"structure", __('Object creation options')
);
$structureOptions->setForce('data');
// create primary items and add them to the group
$leaf = new TextPropertyItem(
Expand Down Expand Up @@ -155,9 +155,9 @@ protected function setProperties()
}

// data options main group
$dataOptions = new OptionsPropertyMainGroup();
$dataOptions->setName("data");
$dataOptions->setText(__('Data dump options'));
$dataOptions = new OptionsPropertyMainGroup(
"data", __('Data dump options')
);
$dataOptions->setForce('structure');
// create primary items and add them to the group
$leaf = new BoolPropertyItem(
Expand Down
17 changes: 9 additions & 8 deletions libraries/plugins/export/ExportMediawiki.php
Expand Up @@ -49,18 +49,19 @@ protected function setProperties()
// 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");
$exportSpecificOptions = new OptionsPropertyRootGroup(
"Format Specific Options"
);

// general options main group
$generalOptions = new OptionsPropertyMainGroup();
$generalOptions->setName("general_opts");
$generalOptions->setText(__('Dump table'));
$generalOptions = new OptionsPropertyMainGroup(
"general_opts", __('Dump table')
);

// what to dump (structure/data/both)
$subgroup = new OptionsPropertySubgroup();
$subgroup->setName("dump_table");
$subgroup->setText("Dump table");
$subgroup = new OptionsPropertySubgroup(
"dump_table", __("Dump table")
);
$leaf = new RadioPropertyItem('structure_or_data');
$leaf->setValues(
array(
Expand Down
8 changes: 4 additions & 4 deletions libraries/plugins/export/ExportOds.php
Expand Up @@ -55,12 +55,12 @@ protected function setProperties()
// 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");
$exportSpecificOptions = new OptionsPropertyRootGroup(
"Format Specific Options"
);

// general options main group
$generalOptions = new OptionsPropertyMainGroup();
$generalOptions->setName("general_opts");
$generalOptions = new OptionsPropertyMainGroup("general_opts");
// create primary items and add them to the group
$leaf = new TextPropertyItem(
"null",
Expand Down
23 changes: 12 additions & 11 deletions libraries/plugins/export/ExportOdt.php
Expand Up @@ -64,13 +64,14 @@ protected function setProperties()
// 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");
$exportSpecificOptions = new OptionsPropertyRootGroup(
"Format Specific Options"
);

// what to dump (structure/data/both) main group
$dumpWhat = new OptionsPropertyMainGroup();
$dumpWhat->setName("general_opts");
$dumpWhat->setText(__('Dump table'));
$dumpWhat = new OptionsPropertyMainGroup(
"general_opts", __('Dump table')
);
// create primary items and add them to the group
$leaf = new RadioPropertyItem("structure_or_data");
$leaf->setValues(
Expand All @@ -86,9 +87,9 @@ protected function setProperties()

// structure options main group
if (!$hide_structure) {
$structureOptions = new OptionsPropertyMainGroup();
$structureOptions->setName("structure");
$structureOptions->setText(__('Object creation options'));
$structureOptions = new OptionsPropertyMainGroup(
"structure", __('Object creation options')
);
$structureOptions->setForce('data');
// create primary items and add them to the group
if (!empty($GLOBALS['cfgRelation']['relation'])) {
Expand All @@ -115,9 +116,9 @@ protected function setProperties()
}

// data options main group
$dataOptions = new OptionsPropertyMainGroup();
$dataOptions->setName("data");
$dataOptions->setText(__('Data dump options'));
$dataOptions = new OptionsPropertyMainGroup(
"data", __('Data dump options')
);
$dataOptions->setForce('structure');
// create primary items and add them to the group
$leaf = new BoolPropertyItem(
Expand Down
14 changes: 7 additions & 7 deletions libraries/plugins/export/ExportPdf.php
Expand Up @@ -88,12 +88,12 @@ protected function setProperties()
// 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");
$exportSpecificOptions = new OptionsPropertyRootGroup(
"Format Specific Options"
);

// general options main group
$generalOptions = new OptionsPropertyMainGroup();
$generalOptions->setName("general_opts");
$generalOptions = new OptionsPropertyMainGroup("general_opts");
// create primary items and add them to the group
$leaf = new TextPropertyItem(
"report_title",
Expand All @@ -104,9 +104,9 @@ protected function setProperties()
$exportSpecificOptions->addProperty($generalOptions);

// what to dump (structure/data/both) main group
$dumpWhat = new OptionsPropertyMainGroup();
$dumpWhat->setName("dump_what");
$dumpWhat->setText(__('Dump table'));
$dumpWhat = new OptionsPropertyMainGroup(
"dump_what", __('Dump table')
);
$leaf = new RadioPropertyItem("structure_or_data");
$leaf->setValues(
array(
Expand Down
8 changes: 4 additions & 4 deletions libraries/plugins/export/ExportPhparray.php
Expand Up @@ -48,12 +48,12 @@ protected function setProperties()
// 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");
$exportSpecificOptions = new OptionsPropertyRootGroup(
"Format Specific Options"
);

// general options main group
$generalOptions = new OptionsPropertyMainGroup();
$generalOptions->setName("general_opts");
$generalOptions = new OptionsPropertyMainGroup("general_opts");
// create primary items and add them to the group
$leaf = new HiddenPropertyItem("structure_or_data");
$generalOptions->addProperty($leaf);
Expand Down
29 changes: 14 additions & 15 deletions libraries/plugins/export/ExportSql.php
Expand Up @@ -76,16 +76,15 @@ protected function setProperties()
// 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");
$exportSpecificOptions = new OptionsPropertyRootGroup(
"Format Specific Options"
);

// general options main group
$generalOptions = new OptionsPropertyMainGroup();
$generalOptions->setName("general_opts");
$generalOptions = new OptionsPropertyMainGroup("general_opts");

// comments
$subgroup = new OptionsPropertySubgroup();
$subgroup->setName("include_comments");
$subgroup = new OptionsPropertySubgroup("include_comments");
$leaf = new BoolPropertyItem(
'include_comments',
__(
Expand Down Expand Up @@ -194,9 +193,9 @@ protected function setProperties()
}

// what to dump (structure/data/both)
$subgroup = new OptionsPropertySubgroup();
$subgroup->setName("dump_table");
$subgroup->setText("Dump table");
$subgroup = new OptionsPropertySubgroup(
"dump_table", __("Dump table")
);
$leaf = new RadioPropertyItem('structure_or_data');
$leaf->setValues(
array(
Expand All @@ -213,9 +212,9 @@ protected function setProperties()

// structure options main group
if (!$hide_structure) {
$structureOptions = new OptionsPropertyMainGroup();
$structureOptions->setName("structure");
$structureOptions->setText(__('Object creation options'));
$structureOptions = new OptionsPropertyMainGroup(
"structure", __('Object creation options')
);
$structureOptions->setForce('data');

// begin SQL Statements
Expand Down Expand Up @@ -331,9 +330,9 @@ protected function setProperties()
}

// begin Data options
$dataOptions = new OptionsPropertyMainGroup();
$dataOptions->setName("data");
$dataOptions->setText(__('Data creation options'));
$dataOptions = new OptionsPropertyMainGroup(
"data", __('Data creation options')
);
$dataOptions->setForce('structure');
$leaf = new BoolPropertyItem(
"truncate",
Expand Down
17 changes: 9 additions & 8 deletions libraries/plugins/export/ExportTexytext.php
Expand Up @@ -50,13 +50,14 @@ protected function setProperties()
// 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");
$exportSpecificOptions = new OptionsPropertyRootGroup(
"Format Specific Options"
);

// what to dump (structure/data/both) main group
$dumpWhat = new OptionsPropertyMainGroup();
$dumpWhat->setName("general_opts");
$dumpWhat->setText(__('Dump table'));
$dumpWhat = new OptionsPropertyMainGroup(
"general_opts", __('Dump table')
);
// create primary items and add them to the group
$leaf = new RadioPropertyItem("structure_or_data");
$leaf->setValues(
Expand All @@ -71,9 +72,9 @@ protected function setProperties()
$exportSpecificOptions->addProperty($dumpWhat);

// data options main group
$dataOptions = new OptionsPropertyMainGroup();
$dataOptions->setName("data");
$dataOptions->setText(__('Data dump options'));
$dataOptions = new OptionsPropertyMainGroup(
"data", __('Data dump options')
);
$dataOptions->setForce('structure');
// create primary items and add them to the group
$leaf = new BoolPropertyItem(
Expand Down

0 comments on commit ca59f50

Please sign in to comment.