Unify print button code and factor it out to function
This commit is contained in:
parent
848f057c49
commit
3dc06f4f70
@ -269,22 +269,7 @@ foreach ($tables as $table) {
|
||||
/**
|
||||
* Displays the footer
|
||||
*/
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
function printPage()
|
||||
{
|
||||
document.getElementById('print').style.visibility = 'hidden';
|
||||
// Do print the page
|
||||
if (typeof(window.print) != 'undefined') {
|
||||
window.print();
|
||||
}
|
||||
document.getElementById('print').style.visibility = '';
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
<?php
|
||||
echo '<br /><br /><input type="button" id="print" value="' . __('Print') . '" onclick="printPage()" />';
|
||||
PMA_printButton();
|
||||
|
||||
require './libraries/footer.inc.php';
|
||||
?>
|
||||
|
||||
@ -244,24 +244,7 @@ if ($num_tables == 0) {
|
||||
/**
|
||||
* Displays the footer
|
||||
*/
|
||||
?>
|
||||
PMA_printButton();
|
||||
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
function printPage()
|
||||
{
|
||||
// Do print the page
|
||||
if (typeof(window.print) != 'undefined') {
|
||||
window.print();
|
||||
}
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
<br /><br />
|
||||
|
||||
<input type="button" class="print_ignore"
|
||||
id="print" value="<?php echo __('Print'); ?>" onclick="printPage()" />
|
||||
|
||||
<?php
|
||||
require './libraries/footer.inc.php';
|
||||
?>
|
||||
|
||||
@ -3780,4 +3780,16 @@ function PMA_analyzeLimitClause($limit_clause)
|
||||
'length' => trim($start_and_length[1])
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Outputs HTML code for print button.
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
function PMA_printButton()
|
||||
{
|
||||
echo '<p class="print_ignore">';
|
||||
echo '<input type="button" id="print" value="' . __('Print') . '" />';
|
||||
echo '</p>';
|
||||
}
|
||||
?>
|
||||
|
||||
@ -443,11 +443,7 @@ foreach ($the_tables as $key => $table) {
|
||||
/**
|
||||
* Displays the footer
|
||||
*/
|
||||
?>
|
||||
PMA_printButton();
|
||||
|
||||
<p class="print_ignore">
|
||||
<input type="button" id="print" value="<?php echo __('Print'); ?>" /></p>
|
||||
|
||||
<?php
|
||||
require './libraries/footer.inc.php';
|
||||
?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user