Not really used directly anymore.
[phpmyadmin/blinky.git] / pdf_pages.php
blobdc9c64e1ad8123106f7d59df4e71c1049ae8ce14
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @version $Id$
6 * @package phpMyAdmin
7 */
9 /**
10 * 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 /**
17 * Settings for relation stuff
19 require_once './libraries/relation.lib.php';
20 $cfgRelation = PMA_getRelationsParam();
22 // This is to avoid "Command out of sync" errors. Before switching this to
23 // a value of 0 (for MYSQLI_USE_RESULT), please check the logic
24 // to free results wherever needed.
25 $query_default_option = PMA_DBI_QUERY_STORE;
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 work without.
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 . '<a href="./Documentation.html#relation" target="documentation">' . __('Documentation') . '</a>' . "\n";
38 require_once './libraries/footer.inc.php';
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 . '<a href="./Documentation.html#table_info" target="documentation">' . __('Documentation') . '</a>' . "\n";
44 require_once './libraries/footer.inc.php';
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 . '<a href="./Documentation.html#table_coords" target="documentation">' . __('Documentation') . '</a>' . "\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 . '<a href="./Documentation.html#pdf_pages" target="documentation">' . __('Documentation') . '</a>' . "\n";
55 exit();
58 if ($cfgRelation['pdfwork']) {
59 // Now is the time to work on all changes
60 if (isset($do)) {
61 switch ($do) {
62 case 'choosepage':
63 if ($action_choose=="1") {
64 $ch_query = 'DELETE FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_coords'])
65 . ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
66 . ' AND pdf_page_number = \'' . PMA_sqlAddslashes($chpage) . '\'';
67 PMA_query_as_controluser($ch_query, FALSE, $query_default_option);
69 $ch_query = 'DELETE FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['pdf_pages'])
70 . ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
71 . ' AND page_nr = \'' . PMA_sqlAddslashes($chpage) . '\'';
72 PMA_query_as_controluser($ch_query, FALSE, $query_default_option);
74 unset($chpage);
76 break;
77 case 'createpage':
78 $pdf_page_number = PMA_REL_create_page($newpage, $cfgRelation, $db, $query_default_option);
80 // A u t o m a t i c l a y o u t
81 // ================================
82 if (isset($auto_layout_internal) || isset($auto_layout_foreign)) {
83 $all_tables = array();
86 if (isset($auto_layout_foreign)) {
87 // get the tables list
88 $tables = PMA_DBI_get_tables_full($db);
89 // find the ones who support FOREIGN KEY; it's not
90 // important that we group together InnoDB tables
91 // and PBXT tables, as this logic is just to put
92 // the tables on the layout, not to determine relations
93 $foreignkey_tables = array();
94 foreach($tables as $table_name => $table_properties) {
95 if (PMA_foreignkey_supported($table_properties['ENGINE'])) {
96 $foreignkey_tables[] = $table_name;
99 $all_tables = $foreignkey_tables;
100 // could be improved by finding the tables which have the
101 // most references keys and placing them at the beginning
102 // of the array (so that they are all center of schema)
103 unset($tables, $foreignkey_tables);
104 } // endif auto_layout_foreign
106 if (isset($auto_layout_internal)) {
107 // get the tables that have relations, by descending
108 // number of links
109 $master_tables = 'SELECT COUNT(master_table), master_table'
110 . ' FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['relation'])
111 . ' WHERE master_db = \'' . $db . '\''
112 . ' GROUP BY master_table'
113 . ' ORDER BY ' . PMA_backquote('COUNT(master_table)') . ' DESC ';
114 $master_tables_rs = PMA_query_as_controluser($master_tables, FALSE, $query_default_option);
115 if ($master_tables_rs && PMA_DBI_num_rows($master_tables_rs) > 0) {
116 // first put all the master tables at beginning
117 // of the list, so they are near the center of
118 // the schema
119 while (list(, $master_table) = PMA_DBI_fetch_row($master_tables_rs)) {
120 $all_tables[] = $master_table;
123 // then for each master, add its foreigns into an array
124 // of foreign tables, if not already there
125 // (a foreign might be foreign for more than
126 // one table, and might be a master itself)
128 $foreign_tables = array();
129 foreach ($all_tables AS $master_table) {
130 $foreigners = PMA_getForeigners($db, $master_table);
131 foreach ($foreigners AS $foreigner) {
132 if (!in_array($foreigner['foreign_table'], $foreign_tables)) {
133 $foreign_tables[] = $foreigner['foreign_table'];
138 // then merge the arrays
139 foreach ($foreign_tables AS $foreign_table) {
140 if (!in_array($foreign_table, $all_tables)) {
141 $all_tables[] = $foreign_table;
144 } // endif there are master tables
145 } // endif auto_layout_internal
147 if (isset($auto_layout_internal) || isset($auto_layout_foreign)) {
148 // now generate the coordinates for the schema,
149 // in a clockwise spiral
151 $pos_x = 300;
152 $pos_y = 300;
153 $delta = 110;
154 $delta_mult = 1.10;
155 $direction = "right";
156 foreach ($all_tables AS $current_table) {
158 // save current table's coordinates
159 $insert_query = 'INSERT INTO ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_coords']) . ' '
160 . '(db_name, table_name, pdf_page_number, x, y) '
161 . 'VALUES (\'' . PMA_sqlAddslashes($db) . '\', \'' . PMA_sqlAddslashes($current_table) . '\',' . $pdf_page_number . ',' . $pos_x . ',' . $pos_y . ')';
162 PMA_query_as_controluser($insert_query, FALSE, $query_default_option);
164 // compute for the next table
165 switch ($direction) {
166 case 'right':
167 $pos_x += $delta;
168 $direction = "down";
169 $delta *= $delta_mult;
170 break;
171 case 'down':
172 $pos_y += $delta;
173 $direction = "left";
174 $delta *= $delta_mult;
175 break;
176 case 'left':
177 $pos_x -= $delta;
178 $direction = "up";
179 $delta *= $delta_mult;
180 break;
181 case 'up':
182 $pos_y -= $delta;
183 $direction = "right";
184 $delta *= $delta_mult;
185 break;
186 } // end switch
187 } // end foreach
188 } // end if some auto-layout to do
190 $chpage = $pdf_page_number;
192 break;
194 case 'edcoord':
195 for ($i = 0; $i < $c_table_rows; $i++) {
196 $arrvalue = 'c_table_' . $i;
197 $arrvalue = $$arrvalue;
198 if (!isset($arrvalue['x']) || $arrvalue['x'] == '') {
199 $arrvalue['x'] = 0;
201 if (!isset($arrvalue['y']) || $arrvalue['y'] == '') {
202 $arrvalue['y'] = 0;
204 if (isset($arrvalue['name']) && $arrvalue['name'] != '--') {
205 $test_query = 'SELECT * FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_coords'])
206 . ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
207 . ' AND table_name = \'' . PMA_sqlAddslashes($arrvalue['name']) . '\''
208 . ' AND pdf_page_number = \'' . PMA_sqlAddslashes($chpage) . '\'';
209 $test_rs = PMA_query_as_controluser($test_query, FALSE, $query_default_option);
210 if ($test_rs && PMA_DBI_num_rows($test_rs) > 0) {
211 if (isset($arrvalue['delete']) && $arrvalue['delete'] == 'y') {
212 $ch_query = 'DELETE FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_coords'])
213 . ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
214 . ' AND table_name = \'' . PMA_sqlAddslashes($arrvalue['name']) . '\''
215 . ' AND pdf_page_number = \'' . PMA_sqlAddslashes($chpage) . '\'';
216 } else {
217 $ch_query = 'UPDATE ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_coords']) . ' '
218 . 'SET x = ' . $arrvalue['x'] . ', y= ' . $arrvalue['y']
219 . ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
220 . ' AND table_name = \'' . PMA_sqlAddslashes($arrvalue['name']) . '\''
221 . ' AND pdf_page_number = \'' . PMA_sqlAddslashes($chpage) . '\'';
223 } else {
224 $ch_query = 'INSERT INTO ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_coords']) . ' '
225 . '(db_name, table_name, pdf_page_number, x, y) '
226 . 'VALUES (\'' . PMA_sqlAddslashes($db) . '\', \'' . PMA_sqlAddslashes($arrvalue['name']) . '\', \'' . PMA_sqlAddslashes($chpage) . '\',' . $arrvalue['x'] . ',' . $arrvalue['y'] . ')';
228 PMA_query_as_controluser($ch_query, FALSE, $query_default_option);
229 } // end if
230 } // end for
231 break;
232 case 'deleteCrap':
233 foreach ($delrow AS $current_row) {
234 $d_query = 'DELETE FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_coords']) . ' ' . "\n"
235 . ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'' . "\n"
236 . ' AND table_name = \'' . PMA_sqlAddslashes($current_row) . '\'' . "\n"
237 . ' AND pdf_page_number = \'' . PMA_sqlAddslashes($chpage) . '\'';
238 PMA_query_as_controluser($d_query, FALSE, $query_default_option);
240 break;
241 } // end switch
242 } // end if (isset($do))
244 // We will need an array of all tables in this db
245 $selectboxall = array('--');
246 $alltab_rs = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($db) . ';', null, PMA_DBI_QUERY_STORE);
247 while ($val = @PMA_DBI_fetch_row($alltab_rs)) {
248 $selectboxall[] = $val[0];
251 // Now first show some possibility to choose a page for the pdf
252 $page_query = 'SELECT * FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['pdf_pages'])
253 . ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'';
254 $page_rs = PMA_query_as_controluser($page_query, FALSE, $query_default_option);
256 if ($page_rs && PMA_DBI_num_rows($page_rs) > 0) {
258 <form method="get" action="pdf_pages.php" name="selpage">
259 <fieldset>
260 <legend>
261 <?php echo __('Please choose a page to edit') . "\n"; ?>
262 </legend>
263 <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
264 <input type="hidden" name="do" value="choosepage" />
265 <select name="chpage" onchange="this.form.submit()">
266 <?php
267 while ($curr_page = PMA_DBI_fetch_assoc($page_rs)) {
268 echo "\n" . ' '
269 . '<option value="' . $curr_page['page_nr'] . '"';
270 if (isset($chpage) && $chpage == $curr_page['page_nr']) {
271 echo ' selected="selected"';
273 echo '>' . $curr_page['page_nr'] . ': ' . htmlspecialchars($curr_page['page_descr']) . '</option>';
274 } // end while
275 echo "\n";
277 </select>
278 <?php
279 $choices = array(
280 '0' => __('Edit'),
281 '1' => __('Delete'));
282 PMA_display_html_radio('action_choose', $choices, '0', false);
283 unset($choices);
285 <input type="submit" value="<?php echo __('Go'); ?>" /><br />
286 </fieldset>
287 </form>
288 <?php
290 echo "\n";
292 // Possibility to create a new page:
294 <form method="post" action="pdf_pages.php" name="crpage">
295 <fieldset>
296 <legend>
297 <?php echo __('Create a page') . "\n"; ?>
298 </legend>
299 <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
300 <input type="hidden" name="do" value="createpage" />
301 <input type="text" name="newpage" size="20" maxlength="50" />
302 <input type="checkbox" name="auto_layout_internal" />
303 <?php echo '(' . __('Automatic layout') . ' / ' . __('Internal relations') . ')';
304 if (PMA_StorageEngine::isValid('InnoDB') || PMA_StorageEngine::isValid('PBXT')) {
305 echo '<input type="checkbox" name="auto_layout_foreign" />'
306 . '(' . __('Automatic layout') . ' / FOREIGN KEY)';
309 <input type="submit" value="<?php echo __('Go'); ?>" />
310 </fieldset>
311 </form>
312 <?php
313 // Now if we already have chosen a page number then we should show the
314 // tables involved
315 if (isset($chpage) && $chpage > 0) {
316 echo "\n";
318 <hr />
320 <h2><?php echo __('Select Tables') ;?></h2>
322 <?php
323 $page_query = 'SELECT * FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_coords'])
324 . ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
325 . ' AND pdf_page_number = \'' . PMA_sqlAddslashes($chpage) . '\'';
326 $page_rs = PMA_query_as_controluser($page_query, FALSE, $query_default_option);
327 $array_sh_page = array();
328 $draginit = '';
329 $reset_draginit = '';
330 $i = 0;
331 while ($temp_sh_page = @PMA_DBI_fetch_assoc($page_rs)) {
332 $array_sh_page[] = $temp_sh_page;
335 // Display WYSIWYG-PDF parts?
336 if ($cfg['WYSIWYG-PDF']) {
337 if (!isset($_POST['with_field_names']) && !isset($_POST['showwysiwyg'])) {
338 $with_field_names = TRUE;
341 <script type="text/javascript" src="./js/dom-drag.js"></script>
342 <form method="post" action="pdf_pages.php" name="dragdrop">
343 <input type="button" name="dragdrop" value="<?php echo __('Toggle scratchboard'); ?>" onclick="ToggleDragDrop('pdflayout');" />
344 <input type="button" name="dragdropreset" value="<?php echo __('Reset'); ?>" onclick="resetDrag();" />
345 </form>
346 <div id="pdflayout" class="pdflayout" style="visibility: hidden;">
347 <?php
348 foreach ($array_sh_page AS $key => $temp_sh_page) {
349 $drag_x = $temp_sh_page['x'];
350 $drag_y = $temp_sh_page['y'];
352 $draginit .= ' Drag.init(getElement("table_' . $i . '"), null, 0, parseInt(myid.style.width)-2, 0, parseInt(myid.style.height)-5);' . "\n";
353 $draginit .= ' getElement("table_' . $i . '").onDrag = function (x, y) { document.edcoord.elements["c_table_' . $i . '[x]"].value = parseInt(x); document.edcoord.elements["c_table_' . $i . '[y]"].value = parseInt(y) }' . "\n";
354 $draginit .= ' getElement("table_' . $i . '").style.left = "' . $drag_x . 'px";' . "\n";
355 $draginit .= ' getElement("table_' . $i . '").style.top = "' . $drag_y . 'px";' . "\n";
356 $reset_draginit .= ' getElement("table_' . $i . '").style.left = "2px";' . "\n";
357 $reset_draginit .= ' getElement("table_' . $i . '").style.top = "' . (15 * $i) . 'px";' . "\n";
358 $reset_draginit .= ' document.edcoord.elements["c_table_' . $i . '[x]"].value = "2"' . "\n";
359 $reset_draginit .= ' document.edcoord.elements["c_table_' . $i . '[y]"].value = "' . (15 * $i) . '"' . "\n";
361 $local_query = 'SHOW FIELDS FROM '
362 . PMA_backquote($temp_sh_page['table_name'])
363 . ' FROM ' . PMA_backquote($db);
364 $fields_rs = PMA_DBI_query($local_query);
365 unset($local_query);
366 $fields_cnt = PMA_DBI_num_rows($fields_rs);
368 echo '<div id="table_' . $i . '" class="pdflayout_table"><u>' . $temp_sh_page['table_name'] . '</u>';
369 if (isset($with_field_names)) {
370 while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
371 echo '<br />' . htmlspecialchars($row['Field']) . "\n";
374 echo '</div>' . "\n";
375 PMA_DBI_free_result($fields_rs);
376 unset($fields_rs);
378 $i++;
381 </div>
382 <script type="text/javascript">
383 //<![CDATA[
384 function PDFinit() {
385 refreshLayout();
386 myid = getElement('pdflayout');
387 <?php echo $draginit; ?>
390 function resetDrag() {
391 <?php echo $reset_draginit; ?>
393 //]]>
394 </script>
395 <?php
396 } // end if WYSIWYG-PDF
399 <form method="post" action="pdf_pages.php" name="edcoord">
400 <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
401 <input type="hidden" name="chpage" value="<?php echo htmlspecialchars($chpage); ?>" />
402 <input type="hidden" name="do" value="edcoord" />
403 <table border="0">
404 <tr>
405 <th><?php echo __('Table'); ?></th>
406 <th><?php echo __('Delete'); ?></th>
407 <th>X</th>
408 <th>Y</th>
409 </tr>
410 <?php
411 if (isset($ctable)) {
412 unset($ctable);
416 $i = 0;
417 $odd_row = true;
418 foreach ($array_sh_page AS $dummy_sh_page => $sh_page) {
419 $_mtab = $sh_page['table_name'];
420 $tabExist[$_mtab] = FALSE;
421 echo "\n" . ' <tr class="';
422 if ($odd_row) {
423 echo 'odd';
424 } else {
425 echo 'even';
427 echo '">';
428 $odd_row != $odd_row;
429 echo "\n" . ' <td>'
430 . "\n" . ' <select name="c_table_' . $i . '[name]">';
431 foreach ($selectboxall AS $key => $value) {
432 echo "\n" . ' <option value="' . htmlspecialchars($value) . '"';
433 if ($value == $sh_page['table_name']) {
434 echo ' selected="selected"';
435 $tabExist[$_mtab] = TRUE;
437 echo '>' . htmlspecialchars($value) . '</option>';
438 } // end while
439 echo "\n" . ' </select>'
440 . "\n" . ' </td>';
441 echo "\n" . ' <td>'
442 . "\n" . ' <input type="checkbox" name="c_table_' . $i . '[delete]" value="y" />' . __('Delete');
443 echo "\n" . ' </td>';
444 echo "\n" . ' <td>'
445 . "\n" . ' <input type="text" ' . ($cfg['WYSIWYG-PDF'] ? 'onchange="dragPlace(' . $i . ', \'x\', this.value)"' : '') . ' name="c_table_' . $i . '[x]" value="' . $sh_page['x'] . '" />';
446 echo "\n" . ' </td>';
447 echo "\n" . ' <td>'
448 . "\n" . ' <input type="text" ' . ($cfg['WYSIWYG-PDF'] ? 'onchange="dragPlace(' . $i . ', \'y\', this.value)"' : '') . ' name="c_table_' . $i . '[y]" value="' . $sh_page['y'] . '" />';
449 echo "\n" . ' </td>';
450 echo "\n" . ' </tr>';
451 $i++;
452 } // end while
453 // Do one more empty row
454 echo "\n" . ' <tr class="';
455 if ($odd_row) {
456 echo 'odd';
457 } else {
458 echo 'even';
460 $odd_row != $odd_row;
461 echo '">';
462 echo "\n" . ' <td>'
463 . "\n" . ' <select name="c_table_' . $i . '[name]">';
464 foreach ($selectboxall AS $key => $value) {
465 echo "\n" . ' <option value="' . htmlspecialchars($value) . '">' . htmlspecialchars($value) . '</option>';
467 echo "\n" . ' </select>'
468 . "\n" . ' </td>';
469 echo "\n" . ' <td>'
470 . "\n" . ' <input type="checkbox" name="c_table_' . $i . '[delete]" value="y" />' . __('Delete');
471 echo "\n" . ' </td>';
472 echo "\n" . ' <td>'
473 . "\n" . ' <input type="text" name="c_table_' . $i . '[x]" value="' . (isset($sh_page['x'])?$sh_page['x']:'') . '" />';
474 echo "\n" . ' </td>';
475 echo "\n" . ' <td>'
476 . "\n" . ' <input type="text" name="c_table_' . $i . '[y]" value="' . (isset($sh_page['y'])?$sh_page['y']:'') . '" />';
477 echo "\n" . ' </td>';
478 echo "\n" . ' </tr>';
479 echo "\n" . ' </table>' . "\n";
481 echo "\n" . ' <input type="hidden" name="c_table_rows" value="' . ($i + 1) . '" />';
482 echo ($cfg['WYSIWYG-PDF'] ? "\n" . ' <input type="hidden" id="showwysiwyg" name="showwysiwyg" value="' . ((isset($showwysiwyg) && $showwysiwyg == '1') ? '1' : '0') . '" />' : '');
483 echo "\n" . ' <input type="checkbox" name="with_field_names" ' . (isset($with_field_names) ? 'checked="checked"' : ''). ' />' . __('Column names') . '<br />';
484 echo "\n" . ' <input type="submit" value="' . __('Save') . '" />';
485 echo "\n" . '</form>' . "\n\n";
486 } // end if
488 // Check if there are tables that need to be deleted,
489 // if there are, ask the user for allowance
490 $_strtrans = '';
491 $_strname = '';
492 $shoot = FALSE;
493 if (!empty($tabExist) && is_array($tabExist)) {
494 foreach ($tabExist AS $key => $value) {
495 if (!$value) {
496 $_strtrans .= '<input type="hidden" name="delrow[]" value="' . htmlspecialchars($key) . '" />' . "\n";
497 $_strname .= '<li>' . htmlspecialchars($key) . '</li>' . "\n";
498 $shoot = TRUE;
501 if ($shoot) {
502 echo '<form action="pdf_pages.php" method="post">' . "\n"
503 . PMA_generate_common_hidden_inputs($db, $table)
504 . '<input type="hidden" name="do" value="deleteCrap" />' . "\n"
505 . '<input type="hidden" name="chpage" value="' . htmlspecialchars($chpage) . '" />' . "\n"
506 . __('The current page has references to tables that no longer exist. Would you like to delete those references?')
507 . '<ul>' . "\n"
508 . $_strname
509 . '</ul>' . "\n"
510 . $_strtrans
511 . '<input type="submit" value="' . __('Go') . '" />' . "\n"
512 . '</form>';
515 // ------------------------------------
516 // d i s p l a y p d f s c h e m a
517 // ------------------------------------
519 if (isset($do)
520 && ($do == 'edcoord'
521 || ($do == 'choosepage' && isset($chpage))
522 || ($do == 'createpage' && isset($chpage)))) {
524 <form method="post" action="pdf_schema.php" name="pdfoptions">
525 <?php echo PMA_generate_common_hidden_inputs($db); ?>
526 <input type="hidden" name="pdf_page_number" value="<?php echo htmlspecialchars($chpage); ?>" />
528 <?php echo '<br /><strong>' . __('Display PDF schema') . '</strong>'; ?>:&nbsp;<br />
529 <input type="checkbox" name="show_grid" id="show_grid_opt" /><label for="show_grid_opt"><?php echo __('Show grid'); ?></label><br />
530 <input type="checkbox" name="show_color" id="show_color_opt" checked="checked" /><label for="show_color_opt"><?php echo __('Show color'); ?></label><br />
531 <input type="checkbox" name="show_table_dimension" id="show_table_dim_opt" /><label for="show_table_dim_opt"><?php echo __('Show dimension of tables'); ?></label><br />
532 <input type="checkbox" name="all_tab_same_wide" id="all_tab_same_wide" /><label for="all_tab_same_wide"><?php echo __('Display all tables with the same width'); ?></label><br />
533 <input type="checkbox" name="with_doc" id="with_doc" checked="checked" /><label for="with_doc"><?php echo __('Data Dictionary'); ?></label><br />
534 <input type="checkbox" name="show_keys" id="show_keys" /><label for="show_keys"><?php echo __('Only show keys'); ?></label><br />
535 <label for="orientation_opt"><?php echo __('Data Dictionary Format'); ?></label>
536 <select id="orientation_opt" name="orientation" <?php echo ($cfg['WYSIWYG-PDF'] ? 'onchange="refreshDragOption(\'pdflayout\');"' : ''); ?>>
537 <option value="L"><?php echo __('Landscape');?></option>
538 <option value="P"><?php echo __('Portrait');?></option>
539 </select><br />
541 <label for="paper_opt"><?php echo __('Paper size'); ?></label>
542 <select id="paper_opt" name="paper" <?php echo ($cfg['WYSIWYG-PDF'] ? 'onchange="refreshDragOption(\'pdflayout\');"' : ''); ?>>
543 <?php
544 foreach ($cfg['PDFPageSizes'] AS $key => $val) {
545 echo '<option value="' . $val . '"';
546 if ($val == $cfg['PDFDefaultPageSize']) {
547 echo ' selected="selected"';
549 echo ' >' . $val . '</option>' . "\n";
552 </select><br />
553 &nbsp;&nbsp;<input type="submit" value="<?php echo __('Go'); ?>" />
554 </form>
555 <?php
556 if ((isset($showwysiwyg) && $showwysiwyg == '1')) {
558 <script type="text/javascript">
559 //<![CDATA[
560 ToggleDragDrop('pdflayout');
561 //]]>
562 </script>
563 <?php
565 } // end if
566 } // end if ($cfgRelation['pdfwork'])
570 * Displays the footer
572 echo "\n";
573 require_once './libraries/footer.inc.php';