コード例 #1
0
 /**
  * Sets the export YAML 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('YAML');
     $exportPluginProperties->setExtension('yml');
     $exportPluginProperties->setMimeType('text/yaml');
     $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 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;
 }
コード例 #2
0
 /**
  * Sets the export HTML-Word 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/RadioPropertyItem.class.php";
     include_once "{$props}/options/items/TextPropertyItem.class.php";
     include_once "{$props}/options/items/BoolPropertyItem.class.php";
     $exportPluginProperties = new ExportPluginProperties();
     $exportPluginProperties->setText('Microsoft Word 2000');
     $exportPluginProperties->setExtension('doc');
     $exportPluginProperties->setMimeType('application/vnd.ms-word');
     $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");
     // what to dump (structure/data/both)
     $dumpWhat = new OptionsPropertyMainGroup();
     $dumpWhat->setName("dump_what");
     $dumpWhat->setText(__('Dump table'));
     // create primary items and add them to the group
     $leaf = new RadioPropertyItem();
     $leaf->setName("structure_or_data");
     $leaf->setValues(array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data')));
     $dumpWhat->addProperty($leaf);
     // add the main group to the root group
     $exportSpecificOptions->addProperty($dumpWhat);
     // data options main group
     $dataOptions = new OptionsPropertyMainGroup();
     $dataOptions->setName("dump_what");
     $dataOptions->setText(__('Data dump options'));
     $dataOptions->setForce('structure');
     // create primary items and add them to the group
     $leaf = new TextPropertyItem();
     $leaf->setName("null");
     $leaf->setText(__('Replace NULL with:'));
     $dataOptions->addProperty($leaf);
     $leaf = new BoolPropertyItem();
     $leaf->setName("columns");
     $leaf->setText(__('Put columns names in the first row'));
     $dataOptions->addProperty($leaf);
     // add the main group to the root group
     $exportSpecificOptions->addProperty($dataOptions);
     // set the options for the export plugin property item
     $exportPluginProperties->setOptions($exportSpecificOptions);
     $this->properties = $exportPluginProperties;
 }
コード例 #3
0
 /**
  * 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/RadioPropertyItem.class.php";
     include_once "{$props}/options/items/TextPropertyItem.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 TextPropertyItem();
     $leaf->setName("report_title");
     $leaf->setText(__('Report title:'));
     $generalOptions->addProperty($leaf);
     // add the group to the root group
     $exportSpecificOptions->addProperty($generalOptions);
     // what to dump (structure/data/both) main group
     $dumpWhat = new OptionsPropertyMainGroup();
     $dumpWhat->setName("dump_what");
     $dumpWhat->setText(__('Dump table'));
     $leaf = new RadioPropertyItem();
     $leaf->setName("structure_or_data");
     $leaf->setValues(array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data')));
     $dumpWhat->addProperty($leaf);
     // add the group to the root group
     $exportSpecificOptions->addProperty($dumpWhat);
     // set the options for the export plugin property item
     $exportPluginProperties->setOptions($exportSpecificOptions);
     $this->properties = $exportPluginProperties;
 }
コード例 #4
0
ファイル: ExportPdf.class.php プロジェクト: yxwzaxns/sakura
 /**
  * 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;
 }
コード例 #5
0
 /**
  * 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;
 }
コード例 #6
0
 /**
  * Sets the export ODT properties
  *
  * @return void
  */
 protected function setProperties()
 {
     global $plugin_param;
     $hide_structure = false;
     if ($plugin_param['export_type'] == 'table' && !$plugin_param['single_table']) {
         $hide_structure = true;
     }
     $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";
     include_once "{$props}/options/items/RadioPropertyItem.class.php";
     $exportPluginProperties = new ExportPluginProperties();
     $exportPluginProperties->setText('OpenDocument Text');
     $exportPluginProperties->setExtension('odt');
     $exportPluginProperties->setMimeType('application/vnd.oasis.opendocument.text');
     $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");
     // what to dump (structure/data/both) main group
     $dumpWhat = new OptionsPropertyMainGroup();
     $dumpWhat->setName("general_opts");
     $dumpWhat->setText(__('Dump table'));
     // create primary items and add them to the group
     $leaf = new RadioPropertyItem();
     $leaf->setName("structure_or_data");
     $leaf->setValues(array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data')));
     $dumpWhat->addProperty($leaf);
     // add the main group to the root group
     $exportSpecificOptions->addProperty($dumpWhat);
     // structure options main group
     if (!$hide_structure) {
         $structureOptions = new OptionsPropertyMainGroup();
         $structureOptions->setName("structure");
         $structureOptions->setText(__('Object creation options'));
         $structureOptions->setForce('data');
         // create primary items and add them to the group
         if (!empty($GLOBALS['cfgRelation']['relation'])) {
             $leaf = new BoolPropertyItem();
             $leaf->setName("relation");
             $leaf->setText(__('Display foreign key relationships'));
             $structureOptions->addProperty($leaf);
         }
         $leaf = new BoolPropertyItem();
         $leaf->setName("comments");
         $leaf->setText(__('Display comments'));
         $structureOptions->addProperty($leaf);
         if (!empty($GLOBALS['cfgRelation']['mimework'])) {
             $leaf = new BoolPropertyItem();
             $leaf->setName("mime");
             $leaf->setText(__('Display MIME types'));
             $structureOptions->addProperty($leaf);
         }
         // add the main group to the root group
         $exportSpecificOptions->addProperty($structureOptions);
     }
     // data options main group
     $dataOptions = new OptionsPropertyMainGroup();
     $dataOptions->setName("data");
     $dataOptions->setText(__('Data dump options'));
     $dataOptions->setForce('structure');
     // create primary items and add them to the group
     $leaf = new BoolPropertyItem();
     $leaf->setName("columns");
     $leaf->setText(__('Put columns names in the first row'));
     $dataOptions->addProperty($leaf);
     $leaf = new TextPropertyItem();
     $leaf->setName('null');
     $leaf->setText(__('Replace NULL with:'));
     $dataOptions->addProperty($leaf);
     // add the main group to the root group
     $exportSpecificOptions->addProperty($dataOptions);
     // set the options for the export plugin property item
     $exportPluginProperties->setOptions($exportSpecificOptions);
     $this->properties = $exportPluginProperties;
 }