SchemaEps.class.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * PDF schema export code
  5. *
  6. * @package PhpMyAdmin-Schema
  7. * @subpackage EPS
  8. */
  9. if (! defined('PHPMYADMIN')) {
  10. exit;
  11. }
  12. /* Get the schema export interface */
  13. require_once 'libraries/plugins/SchemaPlugin.class.php';
  14. require_once 'libraries/plugins/schema/eps/Eps_Relation_Schema.class.php';
  15. /**
  16. * Handles the schema export for the EPS format
  17. *
  18. * @package PhpMyAdmin-Schema
  19. * @subpackage EPS
  20. */
  21. class SchemaEps extends SchemaPlugin
  22. {
  23. /**
  24. * Constructor
  25. */
  26. public function __construct()
  27. {
  28. $this->setProperties();
  29. }
  30. /**
  31. * Sets the schema export EPS properties
  32. *
  33. * @return void
  34. */
  35. protected function setProperties()
  36. {
  37. $props = 'libraries/properties/';
  38. include_once "$props/plugins/SchemaPluginProperties.class.php";
  39. include_once "$props/options/groups/OptionsPropertyRootGroup.class.php";
  40. include_once "$props/options/groups/OptionsPropertyMainGroup.class.php";
  41. include_once "$props/options/items/BoolPropertyItem.class.php";
  42. include_once "$props/options/items/SelectPropertyItem.class.php";
  43. $schemaPluginProperties = new SchemaPluginProperties();
  44. $schemaPluginProperties->setText('EPS');
  45. $schemaPluginProperties->setExtension('eps');
  46. $schemaPluginProperties->setMimeType('application/eps');
  47. // create the root group that will be the options field for
  48. // $schemaPluginProperties
  49. // this will be shown as "Format specific options"
  50. $exportSpecificOptions = new OptionsPropertyRootGroup();
  51. $exportSpecificOptions->setName("Format Specific Options");
  52. // specific options main group
  53. $specificOptions = new OptionsPropertyMainGroup();
  54. $specificOptions->setName("general_opts");
  55. // add options common to all plugins
  56. $this->addCommonOptions($specificOptions);
  57. // create leaf items and add them to the group
  58. $leaf = new BoolPropertyItem();
  59. $leaf->setName('all_tables_same_width');
  60. $leaf->setText(__('Same width for all tables'));
  61. $specificOptions->addProperty($leaf);
  62. $leaf = new SelectPropertyItem();
  63. $leaf->setName("orientation");
  64. $leaf->setText(__('Orientation'));
  65. $leaf->setValues(
  66. array(
  67. 'L' => __('Landscape'),
  68. 'P' => __('Portrait'),
  69. )
  70. );
  71. $specificOptions->addProperty($leaf);
  72. // add the main group to the root group
  73. $exportSpecificOptions->addProperty($specificOptions);
  74. // set the options for the schema export plugin property item
  75. $schemaPluginProperties->setOptions($exportSpecificOptions);
  76. $this->properties = $schemaPluginProperties;
  77. }
  78. /**
  79. * Exports the schema into EPS format.
  80. *
  81. * @param string $db database name
  82. *
  83. * @return bool Whether it succeeded
  84. */
  85. public function exportSchema($db)
  86. {
  87. $export = new PMA_Eps_Relation_Schema($db);
  88. $export->showOutput();
  89. }
  90. }