Skip to content
Newer
Older
100644 133 lines (111 sloc) 4.04 KB
7660295 @hiddenpearls Schema Classes structure, PDF and SVG
hiddenpearls authored
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 *
e56949f @nijel Use package name PhpMyAdmin
nijel authored
5 * @package PhpMyAdmin
7660295 @hiddenpearls Schema Classes structure, PDF and SVG
hiddenpearls authored
6 */
7
8 /**
9 * Gets some core libraries
10 */
11
b2fd866 Leading ./ paths for includes can be omitted, part 2
Jo Michael authored
12 require_once 'libraries/common.inc.php';
13 require_once 'libraries/db_common.inc.php';
14 require 'libraries/StorageEngine.class.php';
7660295 @hiddenpearls Schema Classes structure, PDF and SVG
hiddenpearls authored
15
16 $active_page = 'db_operations.php';
b2fd866 Leading ./ paths for includes can be omitted, part 2
Jo Michael authored
17 require_once 'libraries/db_common.inc.php';
f84659e @nijel Better file name for schema edit page.
nijel authored
18 $url_query .= '&amp;goto=schema_edit.php';
b2fd866 Leading ./ paths for includes can be omitted, part 2
Jo Michael authored
19 require_once 'libraries/db_info.inc.php';
7660295 @hiddenpearls Schema Classes structure, PDF and SVG
hiddenpearls authored
20
21 /**
188c7b8 @hiddenpearls User_Schema class : removed tabs + commented code + organized structu…
hiddenpearls authored
22 * Includ settings for relation stuff
b0a1084 @nijel Remove not needed param from PMA_REL_create_page
nijel authored
23 * get all variables needed for exporting relational schema
188c7b8 @hiddenpearls User_Schema class : removed tabs + commented code + organized structu…
hiddenpearls authored
24 * in $cfgRelation
7660295 @hiddenpearls Schema Classes structure, PDF and SVG
hiddenpearls authored
25 */
b2fd866 Leading ./ paths for includes can be omitted, part 2
Jo Michael authored
26 require_once 'libraries/relation.lib.php';
7660295 @hiddenpearls Schema Classes structure, PDF and SVG
hiddenpearls authored
27 $cfgRelation = PMA_getRelationsParam();
28
29 /**
30 * Now in ./libraries/relation.lib.php we check for all tables
31 * that we need, but if we don't find them we are quiet about it
188c7b8 @hiddenpearls User_Schema class : removed tabs + commented code + organized structu…
hiddenpearls authored
32 * so people can't work without relational variables.
7660295 @hiddenpearls Schema Classes structure, PDF and SVG
hiddenpearls authored
33 * This page is absolutely useless if you didn't set up your tables
34 * correctly, so it is a good place to see which tables we can and
35 * complain ;-)
36 */
e6211f0 @lem9 Other replacements for easier reading
lem9 authored
37 if (! $cfgRelation['relwork']) {
7660295 @hiddenpearls Schema Classes structure, PDF and SVG
hiddenpearls authored
38 echo sprintf(__('<b>%s</b> table not found or not set in %s'), 'relation', 'config.inc.php') . '<br />' . "\n"
39 . PMA_showDocu('relation') . "\n";
b2fd866 Leading ./ paths for includes can be omitted, part 2
Jo Michael authored
40 include_once 'libraries/footer.inc.php';
7660295 @hiddenpearls Schema Classes structure, PDF and SVG
hiddenpearls authored
41 }
42
e6211f0 @lem9 Other replacements for easier reading
lem9 authored
43 if (! $cfgRelation['displaywork']) {
7660295 @hiddenpearls Schema Classes structure, PDF and SVG
hiddenpearls authored
44 echo sprintf(__('<b>%s</b> table not found or not set in %s'), 'table_info', 'config.inc.php') . '<br />' . "\n"
45 . PMA_showDocu('table_info') . "\n";
b2fd866 Leading ./ paths for includes can be omitted, part 2
Jo Michael authored
46 include_once 'libraries/footer.inc.php';
7660295 @hiddenpearls Schema Classes structure, PDF and SVG
hiddenpearls authored
47 }
48
25bda8e @nijel Fix spacing on opening code block
nijel authored
49 if (! isset($cfgRelation['table_coords'])) {
7660295 @hiddenpearls Schema Classes structure, PDF and SVG
hiddenpearls authored
50 echo sprintf(__('<b>%s</b> table not found or not set in %s'), 'table_coords', 'config.inc.php') . '<br />' . "\n"
51 . PMA_showDocu('table_coords') . "\n";
b2fd866 Leading ./ paths for includes can be omitted, part 2
Jo Michael authored
52 include_once 'libraries/footer.inc.php';
7660295 @hiddenpearls Schema Classes structure, PDF and SVG
hiddenpearls authored
53 }
13b3195 @lem9 For easier reading, replace "!isset" with "! isset"
lem9 authored
54 if (! isset($cfgRelation['pdf_pages'])) {
7660295 @hiddenpearls Schema Classes structure, PDF and SVG
hiddenpearls authored
55 echo sprintf(__('<b>%s</b> table not found or not set in %s'), 'pdf_page', 'config.inc.php') . '<br />' . "\n"
56 . PMA_showDocu('pdf_pages') . "\n";
b2fd866 Leading ./ paths for includes can be omitted, part 2
Jo Michael authored
57 include_once 'libraries/footer.inc.php';
7660295 @hiddenpearls Schema Classes structure, PDF and SVG
hiddenpearls authored
58 }
59
60 if ($cfgRelation['pdfwork']) {
61
188c7b8 @hiddenpearls User_Schema class : removed tabs + commented code + organized structu…
hiddenpearls authored
62 /**
63 * User object created for presenting the HTML options
64 * so, user can interact with it and perform export of relations schema
65 */
cc4ace1 @hiddenpearls Export Relation Schema: fixing notices
hiddenpearls authored
66
b2fd866 Leading ./ paths for includes can be omitted, part 2
Jo Michael authored
67 include_once 'libraries/schema/User_Schema.class.php';
188c7b8 @hiddenpearls User_Schema class : removed tabs + commented code + organized structu…
hiddenpearls authored
68 $user_schema = new PMA_User_Schema();
69
70 /**
ba99240 @hiddenpearls export_relation_schema.php: commenting improved
hiddenpearls authored
71 * This function will process the user defined pages
72 * and tables which will be exported as Relational schema
73 * you can set the table positions on the paper via scratchboard
74 * for table positions, put the x,y co-ordinates
b0a1084 @nijel Remove not needed param from PMA_REL_create_page
nijel authored
75 *
ba99240 @hiddenpearls export_relation_schema.php: commenting improved
hiddenpearls authored
76 * @param string $do It tells what the Schema is supposed to do
b0a1084 @nijel Remove not needed param from PMA_REL_create_page
nijel authored
77 * create and select a page, generate schema etc
188c7b8 @hiddenpearls User_Schema class : removed tabs + commented code + organized structu…
hiddenpearls authored
78 */
25bda8e @nijel Fix spacing on opening code block
nijel authored
79 if (isset($_REQUEST['do'])) {
cc4ace1 @hiddenpearls Export Relation Schema: fixing notices
hiddenpearls authored
80 $user_schema->setAction($_REQUEST['do']);
b34b104 @lem9 Improve function naming and remove vulgar term
lem9 authored
81 $user_schema->processUserChoice();
b0a1084 @nijel Remove not needed param from PMA_REL_create_page
nijel authored
82 }
188c7b8 @hiddenpearls User_Schema class : removed tabs + commented code + organized structu…
hiddenpearls authored
83
84 /**
ba99240 @hiddenpearls export_relation_schema.php: commenting improved
hiddenpearls authored
85 * Show some possibility to select a page for the export of relation schema
86 * Lists all pages created before and can select and edit from them
188c7b8 @hiddenpearls User_Schema class : removed tabs + commented code + organized structu…
hiddenpearls authored
87 */
88
89 $user_schema->selectPage();
90
91 /**
b0a1084 @nijel Remove not needed param from PMA_REL_create_page
nijel authored
92 * Create a new page where relations will be drawn
188c7b8 @hiddenpearls User_Schema class : removed tabs + commented code + organized structu…
hiddenpearls authored
93 */
94
b34b104 @lem9 Improve function naming and remove vulgar term
lem9 authored
95 $user_schema->showCreatePageDialog($db);
188c7b8 @hiddenpearls User_Schema class : removed tabs + commented code + organized structu…
hiddenpearls authored
96
97 /**
b0a1084 @nijel Remove not needed param from PMA_REL_create_page
nijel authored
98 * After selection of page or creating a page
99 * It will show you the list of tables
188c7b8 @hiddenpearls User_Schema class : removed tabs + commented code + organized structu…
hiddenpearls authored
100 * A dashboard will also be shown where you can position the tables
101 */
102
103 $user_schema->showTableDashBoard();
7660295 @hiddenpearls Schema Classes structure, PDF and SVG
hiddenpearls authored
104
5a884f2 @hiddenpearls export_relation_schema.php: improved documentation
hiddenpearls authored
105 if (isset($_REQUEST['do'])
106 && ($_REQUEST['do'] == 'edcoord'
cc9f99d @lem9 Typo "choosen" -> "chosen"
lem9 authored
107 || ($_REQUEST['do']== 'selectpage' && isset($user_schema->chosenPage) && $user_schema->chosenPage != 0)
108 || ($_REQUEST['do'] == 'createpage' && isset($user_schema->chosenPage) && $user_schema->chosenPage != 0))) {
188c7b8 @hiddenpearls User_Schema class : removed tabs + commented code + organized structu…
hiddenpearls authored
109
b0a1084 @nijel Remove not needed param from PMA_REL_create_page
nijel authored
110 /**
188c7b8 @hiddenpearls User_Schema class : removed tabs + commented code + organized structu…
hiddenpearls authored
111 * show Export schema generation options
112 */
7660295 @hiddenpearls Schema Classes structure, PDF and SVG
hiddenpearls authored
113 $user_schema->displaySchemaGenerationOptions();
188c7b8 @hiddenpearls User_Schema class : removed tabs + commented code + organized structu…
hiddenpearls authored
114
7660295 @hiddenpearls Schema Classes structure, PDF and SVG
hiddenpearls authored
115 if ((isset($showwysiwyg) && $showwysiwyg == '1')) {
07cee82 @hiddenpearls User Schema Class: big switch into several methods + reduce global va…
hiddenpearls authored
116 ?>
117 <script type="text/javascript">
118 //<![CDATA[
119 ToggleDragDrop('pdflayout');
120 //]]>
121 </script>
188c7b8 @hiddenpearls User_Schema class : removed tabs + commented code + organized structu…
hiddenpearls authored
122 <?php
123 }
7660295 @hiddenpearls Schema Classes structure, PDF and SVG
hiddenpearls authored
124 } // end if
125 } // end if ($cfgRelation['pdfwork'])
126
127 /**
128 * Displays the footer
129 */
130 echo "\n";
b2fd866 Leading ./ paths for includes can be omitted, part 2
Jo Michael authored
131 require_once 'libraries/footer.inc.php';
f84659e @nijel Better file name for schema edit page.
nijel authored
132 ?>
Something went wrong with that request. Please try again.