From 843fce6b5a677d91b2776ed596ac5a12ab6a36ec Mon Sep 17 00:00:00 2001 From: Rouslan Placella Date: Sat, 12 May 2012 17:44:51 +0100 Subject: [PATCH 1/4] Moved generation of print summary for queries to sql.php - allows better reuse of header_printview.inc.php --- libraries/header_printview.inc.php | 17 +---------------- sql.php | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/libraries/header_printview.inc.php b/libraries/header_printview.inc.php index 51f971467d..7dd16d2379 100644 --- a/libraries/header_printview.inc.php +++ b/libraries/header_printview.inc.php @@ -51,22 +51,7 @@ require_once './libraries/header_scripts.inc.php'; ?> - -

-

- :
- :
- :
- : phpMyAdmin  / MySQL 
- : ; -
- : - -

- - + " . __('SQL result') . ""; + echo "

"; + echo "" . __('Host') . ": $hostname
"; + echo "" . __('Database') . ": " . htmlspecialchars($db) . "
"; + echo "" . __('Generation Time') . ": " . PMA_localisedDate() . "
"; + echo "" . __('Generated by') . ": $versions
"; + echo "" . __('SQL query') . ": " . htmlspecialchars($full_sql_query) . ";"; + if (isset($num_rows)) { + echo "
"; + echo "" . __('Rows') . ": $num_rows"; + } + echo "

"; } else { $GLOBALS['js_include'][] = 'functions.js'; From b06b622dde9a903b9555fb3bbd382f15e049a979 Mon Sep 17 00:00:00 2001 From: Rouslan Placella Date: Sat, 12 May 2012 17:45:26 +0100 Subject: [PATCH 2/4] Use print.css in header_printview.inc.php --- db_printview.php | 4 +-- libraries/header_meta_style.inc.php | 2 +- libraries/header_printview.inc.php | 4 +-- print.css | 49 +++++++++++++++++++++-------- tbl_printview.php | 4 +-- 5 files changed, 41 insertions(+), 22 deletions(-) diff --git a/db_printview.php b/db_printview.php index 751b953c40..7a7bfc6b6b 100644 --- a/db_printview.php +++ b/db_printview.php @@ -13,9 +13,7 @@ require_once 'libraries/common.inc.php'; /** * Gets the variables sent or posted to this script, then displays headers */ -$print_view = true; -define('PMA_DISPLAY_HEADING', 0); -require_once 'libraries/header.inc.php'; +require_once 'libraries/header_printview.inc.php'; PMA_checkParameters(array('db')); diff --git a/libraries/header_meta_style.inc.php b/libraries/header_meta_style.inc.php index eb010a9bea..63cb8d15e8 100644 --- a/libraries/header_meta_style.inc.php +++ b/libraries/header_meta_style.inc.php @@ -44,7 +44,7 @@ if ($GLOBALS['text_dir'] == 'ltr') { echo 'phpMyAdmin'; } ?> - + diff --git a/libraries/header_printview.inc.php b/libraries/header_printview.inc.php index 7dd16d2379..fc02fc5ce0 100644 --- a/libraries/header_printview.inc.php +++ b/libraries/header_printview.inc.php @@ -44,8 +44,8 @@ if ($text_dir == 'ltr') { -<?php echo __('SQL result'); ?> - phpMyAdmin <?php echo PMA_VERSION ?> - +<?php echo __('Print view'); ?> - phpMyAdmin <?php echo PMA_VERSION ?> + diff --git a/print.css b/print.css index 632a7553ee..1aa2f98279 100644 --- a/print.css +++ b/print.css @@ -1,11 +1,14 @@ -.print_ignore { +.nowrap { + white-space: nowrap; +} + +.hide { display: none; } body, table, th, td { - color: #000000; - background-color: #ffffff; - font-size: 8pt; + color: #000; + background-color: #fff; } img { @@ -13,9 +16,7 @@ img { } table, th, td { - border-width: 0.1em; - border-color: #000000; - border-style: solid; + border: .1em solid #000; } table { @@ -32,15 +33,30 @@ th { background-color: #e5e5e5; } +th.vtop, td.vtop { + vertical-align: top; +} + +th.vbottom, td.vbottom { + vertical-align: bottom; +} + @media print { .print_ignore { display: none; } + .nowrap { + white-space: nowrap; + } + + .hide { + display: none; + } + body, table, th, td { - color: #000000; - background-color: #ffffff; - font-size: 8pt; + color: #000; + background-color: #fff; } img { @@ -48,9 +64,7 @@ th { } table, th, td { - border-width: 1px; - border-color: #000000; - border-style: solid; + border: .1em solid #000; } table { @@ -66,4 +80,13 @@ th { font-weight: bold; background-color: #e5e5e5; } + + th.vtop, td.vtop { + vertical-align: top; + } + + th.vbottom, td.vbottom { + vertical-align: bottom; + } } + diff --git a/tbl_printview.php b/tbl_printview.php index ea16713fa6..8db2904e39 100644 --- a/tbl_printview.php +++ b/tbl_printview.php @@ -13,10 +13,8 @@ require_once 'libraries/common.inc.php'; /** * Gets the variables sent or posted to this script, then displays headers */ -$print_view = true; -define('PMA_DISPLAY_HEADING', 0); if (! isset($selected_tbl)) { - include_once 'libraries/header.inc.php'; + include_once 'libraries/header_printview.inc.php'; } require 'libraries/tbl_common.inc.php'; From 7b3ffe10cbcc63441fb3201b12658fdafa5b2780 Mon Sep 17 00:00:00 2001 From: Rouslan Placella Date: Sat, 12 May 2012 17:52:05 +0100 Subject: [PATCH 3/4] Moved parameters check out of the header file --- libraries/header_printview.inc.php | 5 ----- sql.php | 2 ++ 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/libraries/header_printview.inc.php b/libraries/header_printview.inc.php index fc02fc5ce0..47188ad472 100644 --- a/libraries/header_printview.inc.php +++ b/libraries/header_printview.inc.php @@ -14,11 +14,6 @@ if (! defined('PHPMYADMIN')) { require_once './libraries/ob.lib.php'; PMA_outBufferPre(); -// Check parameters - -PMA_checkParameters(array('db', 'full_sql_query')); - - // For re-usability, moved http-headers // to a separate file. It can now be included by libraries/header.inc.php, // querywindow.php. diff --git a/sql.php b/sql.php index 4499b2e175..151dd46f97 100644 --- a/sql.php +++ b/sql.php @@ -909,6 +909,8 @@ if ((0 == $num_rows && 0 == $unlim_num_rows) || $is_affected) { unset($show_query); } if (isset($printview) && $printview == '1') { + PMA_checkParameters(array('db', 'full_sql_query')); + include_once 'libraries/header_printview.inc.php'; $hostname = ''; From b134b96a686fcb0adb3e3a0d546ae9f6473cf8ab Mon Sep 17 00:00:00 2001 From: Rouslan Placella Date: Sat, 12 May 2012 18:08:38 +0100 Subject: [PATCH 4/4] Dropped theme-overridable print stylesheets --- libraries/Theme.class.php | 2 +- themes/original/css/theme_print.css.php | 52 ------------------------- themes/pmahomme/css/theme_print.css.php | 52 ------------------------- 3 files changed, 1 insertion(+), 105 deletions(-) delete mode 100644 themes/original/css/theme_print.css.php delete mode 100644 themes/pmahomme/css/theme_print.css.php diff --git a/libraries/Theme.class.php b/libraries/Theme.class.php index 96176b7522..3315fca26a 100644 --- a/libraries/Theme.class.php +++ b/libraries/Theme.class.php @@ -57,7 +57,7 @@ class PMA_Theme * @var array valid css types * @access protected */ - var $types = array('left', 'right', 'print'); + var $types = array('left', 'right'); /** * @var integer last modification time for info file diff --git a/themes/original/css/theme_print.css.php b/themes/original/css/theme_print.css.php deleted file mode 100644 index 3d8551f93d..0000000000 --- a/themes/original/css/theme_print.css.php +++ /dev/null @@ -1,52 +0,0 @@ - -/* For printview */ -body, table, th, td { - color: #000; - background: #fff; -} - -img { - border: 0; -} - -table, th, td { - border: .1em solid #000; -} - -table { - border-collapse: collapse; - border-spacing: 0; -} - -th, td { - padding: .2em; -} - -th.vtop, td.vtop { - vertical-align: top; -} - -th.vbottom, td.vbottom { - vertical-align: bottom; -} - -th { - font-weight: bold; - background: #e5e5e5; -} - -.nowrap { - white-space: nowrap; -} - -.hide { - display: none; -} diff --git a/themes/pmahomme/css/theme_print.css.php b/themes/pmahomme/css/theme_print.css.php deleted file mode 100644 index 59ba3db069..0000000000 --- a/themes/pmahomme/css/theme_print.css.php +++ /dev/null @@ -1,52 +0,0 @@ - -/* For printview */ -body, table, th, td { - color: #000; - background: #fff; -} - -img { - border: 0; -} - -table, th, td { - border: .1em solid #000; -} - -table { - border-collapse: collapse; - border-spacing: 0; -} - -th, td { - padding: .2em; -} - -th.vtop, td.vtop { - vertical-align: top; -} - -th.vbottom, td.vbottom { - vertical-align: bottom; -} - -th { - font-weight: bold; - background: #e5e5e5; -} - -.nowrap { - white-space: nowrap; -} - -.hide { - display: none; -}