Tan Style sheet Improvements
[openemr.git] / phpmyadmin / schema_export.php
blobb28ae6758f7ff2ff64863951706e1dee5eb3dff3
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Schema export handler
6 * @package PhpMyAdmin
7 */
9 /**
10 * Gets some core libraries
12 require_once 'libraries/common.inc.php';
13 require 'libraries/StorageEngine.class.php';
15 /**
16 * get all variables needed for exporting relational schema
17 * in $cfgRelation
19 $cfgRelation = PMA_getRelationsParam();
21 require_once 'libraries/Index.class.php';
22 require_once 'libraries/pmd_common.php';
23 require_once 'libraries/plugin_interface.lib.php';
25 if (! isset($_REQUEST['export_type'])) {
26 PMA_Util::checkParameters(array('export_type'));
29 /**
30 * Include the appropriate Schema Class depending on $export_type
31 * default is PDF
33 PMA_processExportSchema($_REQUEST['export_type']);
35 /**
36 * get all the export options and verify
37 * call and include the appropriate Schema Class depending on $export_type
39 * @param string $export_type format of the export
41 * @return void
43 function PMA_processExportSchema($export_type)
45 /**
46 * default is PDF, otherwise validate it's only letters a-z
48 if (! isset($export_type) || ! preg_match('/^[a-zA-Z]+$/', $export_type)) {
49 $export_type = 'pdf';
52 // sanitize this parameter which will be used below in a file inclusion
53 $export_type = PMA_securePath($export_type);
55 // get the specific plugin
56 /* @var $export_plugin SchemaPlugin */
57 $export_plugin = PMA_getPlugin(
58 "schema",
59 $export_type,
60 'libraries/plugins/schema/'
63 // Check schema export type
64 if (! isset($export_plugin)) {
65 PMA_fatalError(__('Bad type!'));
68 $GLOBALS['dbi']->selectDb($GLOBALS['db']);
69 $export_plugin->exportSchema($GLOBALS['db']);