Single place to define PDF schema form.
This commit is contained in:
@@ -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']) {
|
||||
|
71
libraries/display_pdf_schema.lib.php
Normal file
71
libraries/display_pdf_schema.lib.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<!-- 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>
|
||||
<?php
|
||||
if (isset($test_rs)) {
|
||||
?>
|
||||
<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 />
|
||||
<?php } else { ?>
|
||||
<input type="hidden" name="pdf_page_number" value="<?php echo htmlspecialchars($chpage); ?>" />
|
||||
<?php } ?>
|
||||
|
||||
<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>
|
||||
|
@@ -532,39 +532,7 @@ function resetDrag() {
|
||||
&& ($do == 'edcoord'
|
||||
|| ($do == 'choosepage' && isset($chpage))
|
||||
|| ($do == 'createpage' && isset($chpage)))) {
|
||||
?>
|
||||
<form method="post" action="pdf_schema.php" name="pdfoptions">
|
||||
<?php echo PMA_generate_common_hidden_inputs($db); ?>
|
||||
<input type="hidden" name="pdf_page_number" value="<?php echo htmlspecialchars($chpage); ?>" />
|
||||
|
||||
<?php echo '<br /><strong>' . __('Display PDF schema') . '</strong>'; ?>: <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 id="orientation_opt" name="orientation" <?php echo ($cfg['WYSIWYG-PDF'] ? 'onchange="refreshDragOption(\'pdflayout\');"' : ''); ?>>
|
||||
<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 id="paper_opt" name="paper" <?php echo ($cfg['WYSIWYG-PDF'] ? 'onchange="refreshDragOption(\'pdflayout\');"' : ''); ?>>
|
||||
<?php
|
||||
foreach ($cfg['PDFPageSizes'] AS $key => $val) {
|
||||
echo '<option value="' . $val . '"';
|
||||
if ($val == $cfg['PDFDefaultPageSize']) {
|
||||
echo ' selected="selected"';
|
||||
}
|
||||
echo ' >' . $val . '</option>' . "\n";
|
||||
}
|
||||
?>
|
||||
</select><br />
|
||||
<input type="submit" value="<?php echo __('Go'); ?>" />
|
||||
</form>
|
||||
<?php
|
||||
include('./libraries/display_pdf_schema.lib.php');
|
||||
if ((isset($showwysiwyg) && $showwysiwyg == '1')) {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
|
Reference in New Issue
Block a user