add missing space
[phpmyadmin.git] / schema_edit.php
blob498ccb7afb535dc521a994b90b8a6be555bf5816
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @package PhpMyAdmin
6 */
8 /**
9 * Gets some core libraries
12 require_once 'libraries/common.inc.php';
13 require_once 'libraries/db_common.inc.php';
14 require 'libraries/StorageEngine.class.php';
16 $active_page = 'db_operations.php';
17 require_once 'libraries/db_common.inc.php';
18 $url_query .= '&amp;goto=schema_edit.php';
19 require_once 'libraries/db_info.inc.php';
21 /**
22 * get all variables needed for exporting relational schema
23 * in $cfgRelation
25 $cfgRelation = PMA_getRelationsParam();
27 /**
28 * Now in ./libraries/relation.lib.php we check for all tables
29 * that we need, but if we don't find them we are quiet about it
30 * so people can't work without relational variables.
31 * This page is absolutely useless if you didn't set up your tables
32 * correctly, so it is a good place to see which tables we can and
33 * complain ;-)
35 if (! $cfgRelation['relwork']) {
36 echo sprintf(__('<b>%s</b> table not found or not set in %s'), 'relation', 'config.inc.php') . '<br />' . "\n"
37 . PMA_Util::showDocu('config', 'cfg_Servers_relation') . "\n";
38 exit;
41 if (! $cfgRelation['displaywork']) {
42 echo sprintf(__('<b>%s</b> table not found or not set in %s'), 'table_info', 'config.inc.php') . '<br />' . "\n"
43 . PMA_Util::showDocu('config', 'cfg_Servers_table_info') . "\n";
44 exit;
47 if (! isset($cfgRelation['table_coords'])) {
48 echo sprintf(__('<b>%s</b> table not found or not set in %s'), 'table_coords', 'config.inc.php') . '<br />' . "\n"
49 . PMA_Util::showDocu('config', 'cfg_Servers_table_coords') . "\n";
50 exit;
52 if (! isset($cfgRelation['pdf_pages'])) {
53 echo sprintf(__('<b>%s</b> table not found or not set in %s'), 'pdf_page', 'config.inc.php') . '<br />' . "\n"
54 . PMA_Util::showDocu('config', 'cfg_Servers_pdf_pages') . "\n";
55 exit;
58 if ($cfgRelation['pdfwork']) {
60 /**
61 * User object created for presenting the HTML options
62 * so, user can interact with it and perform export of relations schema
65 include_once 'libraries/schema/User_Schema.class.php';
66 $user_schema = new PMA_User_Schema();
68 /**
69 * This function will process the user defined pages
70 * and tables which will be exported as Relational schema
71 * you can set the table positions on the paper via scratchboard
72 * for table positions, put the x,y co-ordinates
74 * @param string $do It tells what the Schema is supposed to do
75 * create and select a page, generate schema etc
77 if (isset($_REQUEST['do'])) {
78 $user_schema->setAction($_REQUEST['do']);
79 $user_schema->processUserChoice();
82 /**
83 * Show some possibility to select a page for the export of relation schema
84 * Lists all pages created before and can select and edit from them
87 $user_schema->selectPage();
89 /**
90 * Create a new page where relations will be drawn
93 $user_schema->showCreatePageDialog($db);
95 /**
96 * After selection of page or creating a page
97 * It will show you the list of tables
98 * A dashboard will also be shown where you can position the tables
101 $user_schema->showTableDashBoard();
103 if (isset($_REQUEST['do'])
104 && ($_REQUEST['do'] == 'edcoord'
105 || ($_REQUEST['do']== 'selectpage' && isset($user_schema->chosenPage) && $user_schema->chosenPage != 0)
106 || ($_REQUEST['do'] == 'createpage' && isset($user_schema->chosenPage) && $user_schema->chosenPage != 0))
110 * show Export schema generation options
112 $user_schema->displaySchemaGenerationOptions();
114 if ((isset($showwysiwyg) && $showwysiwyg == '1')) {
116 <script type="text/javascript">
117 //<![CDATA[
118 ToggleDragDrop('pdflayout');
119 //]]>
120 </script>
121 <?php
123 } // end if
124 } // end if ($cfgRelation['pdfwork'])