Single place to define PDF schema form.
This commit is contained in:
@@ -631,72 +631,8 @@ if ($cfgRelation['pdfwork'] && $num_tables > 0) { ?>
|
|||||||
WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'';
|
WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'';
|
||||||
$test_rs = PMA_query_as_controluser($test_query, null, PMA_DBI_QUERY_STORE);
|
$test_rs = PMA_query_as_controluser($test_query, null, PMA_DBI_QUERY_STORE);
|
||||||
|
|
||||||
if ($test_rs && PMA_DBI_num_rows($test_rs) > 0) { ?>
|
if ($test_rs && PMA_DBI_num_rows($test_rs) > 0) {
|
||||||
<!-- PDF schema -->
|
include('./libraries/display_pdf_schema.lib.php');
|
||||||
<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
|
|
||||||
} // end if
|
} // end if
|
||||||
echo '<br /><a href="pdf_pages.php?' . $url_query . '">';
|
echo '<br /><a href="pdf_pages.php?' . $url_query . '">';
|
||||||
if ($cfg['PropertiesIconic']) {
|
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 == 'edcoord'
|
||||||
|| ($do == 'choosepage' && isset($chpage))
|
|| ($do == 'choosepage' && isset($chpage))
|
||||||
|| ($do == 'createpage' && isset($chpage)))) {
|
|| ($do == 'createpage' && isset($chpage)))) {
|
||||||
?>
|
include('./libraries/display_pdf_schema.lib.php');
|
||||||
<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
|
|
||||||
if ((isset($showwysiwyg) && $showwysiwyg == '1')) {
|
if ((isset($showwysiwyg) && $showwysiwyg == '1')) {
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
Reference in New Issue
Block a user