2 /* vim: set expandtab sw=4 ts=4 sts=4: */
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 .= '&goto=schema_edit.php';
19 require_once './libraries/db_info.inc.php';
22 * Includ settings for relation stuff
23 * get all variables needed for exporting relational schema
26 require_once './libraries/relation.lib.php';
27 $cfgRelation = PMA_getRelationsParam();
30 * This is to avoid "Command out of sync" errors. Before switching this to
31 * a value of 0 (for MYSQLI_USE_RESULT), please check the logic
32 * to free results wherever needed.
34 $query_default_option = PMA_DBI_QUERY_STORE
;
37 * Now in ./libraries/relation.lib.php we check for all tables
38 * that we need, but if we don't find them we are quiet about it
39 * so people can't work without relational variables.
40 * This page is absolutely useless if you didn't set up your tables
41 * correctly, so it is a good place to see which tables we can and
44 if (! $cfgRelation['relwork']) {
45 echo sprintf(__('<b>%s</b> table not found or not set in %s'), 'relation', 'config.inc.php') . '<br />' . "\n"
46 . PMA_showDocu('relation') . "\n";
47 require_once './libraries/footer.inc.php';
50 if (! $cfgRelation['displaywork']) {
51 echo sprintf(__('<b>%s</b> table not found or not set in %s'), 'table_info', 'config.inc.php') . '<br />' . "\n"
52 . PMA_showDocu('table_info') . "\n";
53 require_once './libraries/footer.inc.php';
56 if (! isset($cfgRelation['table_coords'])){
57 echo sprintf(__('<b>%s</b> table not found or not set in %s'), 'table_coords', 'config.inc.php') . '<br />' . "\n"
58 . PMA_showDocu('table_coords') . "\n";
59 require_once './libraries/footer.inc.php';
61 if (! isset($cfgRelation['pdf_pages'])) {
62 echo sprintf(__('<b>%s</b> table not found or not set in %s'), 'pdf_page', 'config.inc.php') . '<br />' . "\n"
63 . PMA_showDocu('pdf_pages') . "\n";
64 require_once './libraries/footer.inc.php';
67 if ($cfgRelation['pdfwork']) {
70 * User object created for presenting the HTML options
71 * so, user can interact with it and perform export of relations schema
74 require_once './libraries/schema/User_Schema.class.php';
75 $user_schema = new PMA_User_Schema();
78 * This function will process the user defined pages
79 * and tables which will be exported as Relational schema
80 * you can set the table positions on the paper via scratchboard
81 * for table positions, put the x,y co-ordinates
83 * @param string $do It tells what the Schema is supposed to do
84 * create and select a page, generate schema etc
86 if(isset($_REQUEST['do'])){
87 $user_schema->setAction($_REQUEST['do']);
88 $user_schema->processUserChoice();
92 * Show some possibility to select a page for the export of relation schema
93 * Lists all pages created before and can select and edit from them
96 $user_schema->selectPage();
99 * Create a new page where relations will be drawn
102 $user_schema->showCreatePageDialog($db);
105 * After selection of page or creating a page
106 * It will show you the list of tables
107 * A dashboard will also be shown where you can position the tables
110 $user_schema->showTableDashBoard();
112 if (isset($_REQUEST['do'])
113 && ($_REQUEST['do'] == 'edcoord'
114 ||
($_REQUEST['do']== 'selectpage' && isset($user_schema->chosenPage
) && $user_schema->chosenPage
!= 0)
115 ||
($_REQUEST['do'] == 'createpage' && isset($user_schema->chosenPage
) && $user_schema->chosenPage
!= 0))) {
118 * show Export schema generation options
120 $user_schema->displaySchemaGenerationOptions();
122 if ((isset($showwysiwyg) && $showwysiwyg == '1')) {
124 <script type
="text/javascript">
126 ToggleDragDrop('pdflayout');
132 } // end if ($cfgRelation['pdfwork'])
135 * Displays the footer
138 require_once './libraries/footer.inc.php';