Upgraded phpmyadmin to 4.0.4 (All Languages) - No modifications yet
[openemr.git] / phpmyadmin / libraries / plugins / export / ExportExcel.class.php
blob1bb1060d25740c42b3e655c63092b5069fa980a5
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Class for exporting CSV dumps of tables for excel
6 * @package PhpMyAdmin-Export
7 * @subpackage CSV-Excel
8 */
9 if (! defined('PHPMYADMIN')) {
10 exit;
13 /* Extend the export CSV class */
14 require_once 'libraries/plugins/export/ExportCsv.class.php';
16 /**
17 * Handles the export for the CSV-Excel format
19 * @package PhpMyAdmin-Export
20 * @subpackage CSV-Excel
22 class ExportExcel extends ExportCsv
24 /**
25 * Sets the export CSV for Excel properties
27 * @return void
29 protected function setProperties()
31 $props = 'libraries/properties/';
32 include_once "$props/plugins/ExportPluginProperties.class.php";
33 include_once "$props/options/groups/OptionsPropertyRootGroup.class.php";
34 include_once "$props/options/groups/OptionsPropertyMainGroup.class.php";
35 include_once "$props/options/items/TextPropertyItem.class.php";
36 include_once "$props/options/items/BoolPropertyItem.class.php";
37 include_once "$props/options/items/SelectPropertyItem.class.php";
38 include_once "$props/options/items/HiddenPropertyItem.class.php";
40 $exportPluginProperties = new ExportPluginProperties();
41 $exportPluginProperties->setText('CSV for MS Excel');
42 $exportPluginProperties->setExtension('csv');
43 $exportPluginProperties->setMimeType('text/comma-separated-values');
44 $exportPluginProperties->setOptionsText(__('Options'));
46 // create the root group that will be the options field for
47 // $exportPluginProperties
48 // this will be shown as "Format specific options"
49 $exportSpecificOptions = new OptionsPropertyRootGroup();
50 $exportSpecificOptions->setName("Format Specific Options");
52 // general options main group
53 $generalOptions = new OptionsPropertyMainGroup();
54 $generalOptions->setName("general_opts");
55 // create primary items and add them to the group
56 $leaf = new TextPropertyItem();
57 $leaf->setName('null');
58 $leaf->setText(__('Replace NULL with:'));
59 $generalOptions->addProperty($leaf);
60 $leaf = new BoolPropertyItem();
61 $leaf->setName('removeCRLF');
62 $leaf->setText(
63 __('Remove carriage return/line feed characters within columns')
65 $generalOptions->addProperty($leaf);
66 $leaf = new BoolPropertyItem();
67 $leaf->setName('columns');
68 $leaf->setText(__('Put columns names in the first row'));
69 $generalOptions->addProperty($leaf);
70 $leaf = new SelectPropertyItem();
71 $leaf->setName('edition');
72 $leaf->setValues(
73 array(
74 'win' => 'Windows',
75 'mac_excel2003' => 'Excel 2003 / Macintosh',
76 'mac_excel2008' => 'Excel 2008 / Macintosh'
79 $leaf->setText(__('Excel edition:'));
80 $generalOptions->addProperty($leaf);
81 $leaf = new HiddenPropertyItem();
82 $leaf->setName('structure_or_data');
83 $generalOptions->addProperty($leaf);
84 // add the main group to the root group
85 $exportSpecificOptions->addProperty($generalOptions);
87 // set the options for the export plugin property item
88 $exportPluginProperties->setOptions($exportSpecificOptions);
89 $this->properties = $exportPluginProperties;
92 /**
93 * This method is called when any PluginManager to which the observer
94 * is attached calls PluginManager::notify()
96 * @param SplSubject $subject The PluginManager notifying the observer
97 * of an update.
99 * @return void
101 public function update (SplSubject $subject)