Single place to define PDF schema form.

This commit is contained in:
Michal Čihař
2010-05-31 14:05:41 +02:00
parent 3865f1a81f
commit c6a28b42e6
3 changed files with 76 additions and 101 deletions

View File

@@ -121,7 +121,7 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) {
if ($this_what != 'nocopy') {
// keep the triggers from the original db+table
// (third param is empty because delimiters are only intended
// (third param is empty because delimiters are only intended
// for importing via the mysql client or our Import feature)
$triggers = PMA_DBI_get_triggers($db, $each_table, '');
@@ -141,7 +141,7 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) {
}
unset($trigger);
}
unset($triggers);
unset($triggers);
// this does not apply to a rename operation
if (isset($GLOBALS['add_constraints']) && !empty($GLOBALS['sql_constraints_query'])) {
@@ -631,72 +631,8 @@ if ($cfgRelation['pdfwork'] && $num_tables > 0) { ?>
WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'';
$test_rs = PMA_query_as_controluser($test_query, null, PMA_DBI_QUERY_STORE);
if ($test_rs && PMA_DBI_num_rows($test_rs) > 0) { ?>
<!-- PDF schema -->
<form method="post" action="pdf_schema.php">
<fieldset>
<legend>
<?php
echo PMA_generate_common_hidden_inputs($db);
if ($cfg['PropertiesIconic']) {
echo '<img class="icon" src="' . $pmaThemeImage . 'b_view.png"'
.' alt="" width="16" height="16" />';
}
echo __('Display PDF schema');
?>:
</legend>
<label for="pdf_page_number_opt"><?php echo __('Page number:'); ?></label>
<select name="pdf_page_number" id="pdf_page_number_opt">
<?php
while ($pages = @PMA_DBI_fetch_assoc($test_rs)) {
echo ' <option value="' . $pages['page_nr'] . '">'
. $pages['page_nr'] . ': ' . htmlspecialchars($pages['page_descr']) . '</option>' . "\n";
} // end while
PMA_DBI_free_result($test_rs);
unset($test_rs);
?>
</select><br />
<input type="checkbox" name="show_grid" id="show_grid_opt" />
<label for="show_grid_opt"><?php echo __('Show grid'); ?></label><br />
<input type="checkbox" name="show_color" id="show_color_opt"
checked="checked" />
<label for="show_color_opt"><?php echo __('Show color'); ?></label><br />
<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 />
<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 />
<input type="checkbox" name="with_doc" id="with_doc" checked="checked" />
<label for="with_doc"><?php echo __('Data Dictionary'); ?></label><br />
<input type="checkbox" name="show_keys" id="show_keys" />
<label for="show_keys"><?php echo __('Only show keys'); ?></label><br />
<label for="orientation_opt"><?php echo __('Data Dictionary Format'); ?></label>
<select name="orientation" id="orientation_opt">
<option value="L"><?php echo __('Landscape');?></option>
<option value="P"><?php echo __('Portrait');?></option>
</select><br />
<label for="paper_opt"><?php echo __('Paper size'); ?></label>
<select name="paper" id="paper_opt">
<?php
foreach ($cfg['PDFPageSizes'] AS $key => $val) {
echo '<option value="' . $val . '"';
if ($val == $cfg['PDFDefaultPageSize']) {
echo ' selected="selected"';
}
echo ' >' . $val . '</option>' . "\n";
}
?>
</select>
</fieldset>
<fieldset class="tblFooters">
<input type="submit" value="<?php echo __('Go'); ?>" />
</fieldset>
</form>
<?php
if ($test_rs && PMA_DBI_num_rows($test_rs) > 0) {
include('./libraries/display_pdf_schema.lib.php');
} // end if
echo '<br /><a href="pdf_pages.php?' . $url_query . '">';
if ($cfg['PropertiesIconic']) {