Merge pull request #62 from roccivic/fix-printview

Dropped theme-overridable printview stylesheets
This commit is contained in:
Michal Čihař 2012-05-14 01:58:59 -07:00
commit 78becba94c
9 changed files with 72 additions and 148 deletions

View File

@ -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'));

View File

@ -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

View File

@ -44,7 +44,7 @@ if ($GLOBALS['text_dir'] == 'ltr') {
echo 'phpMyAdmin';
}
?></title>
<link rel="stylesheet" type="text/css" href="<?php echo defined('PMA_PATH_TO_BASEDIR') ? PMA_PATH_TO_BASEDIR : ''; ?>phpmyadmin.css.php<?php echo PMA_generate_common_url(array('server' => $GLOBALS['server'])); ?>&amp;js_frame=<?php echo isset($print_view) ? 'print' : 'right'; ?>&amp;nocache=<?php echo $GLOBALS['PMA_Config']->getThemeUniqueValue(); ?>" />
<link rel="stylesheet" type="text/css" href="<?php echo defined('PMA_PATH_TO_BASEDIR') ? PMA_PATH_TO_BASEDIR : ''; ?>phpmyadmin.css.php<?php echo PMA_generate_common_url(array('server' => $GLOBALS['server'])); ?>&amp;js_frame=right&amp;nocache=<?php echo $GLOBALS['PMA_Config']->getThemeUniqueValue(); ?>" />
<link rel="stylesheet" type="text/css" href="<?php echo defined('PMA_PATH_TO_BASEDIR') ? PMA_PATH_TO_BASEDIR : ''; ?>print.css" media="print" />
<link rel="stylesheet" type="text/css" href="<?php echo $GLOBALS['pmaThemePath']; ?>/jquery/jquery-ui-1.8.16.custom.css" />
<meta name="robots" content="noindex,nofollow" />

View File

@ -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.
@ -44,29 +39,14 @@ if ($text_dir == 'ltr') {
<meta charset="utf-8" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<title><?php echo __('SQL result'); ?> - phpMyAdmin <?php echo PMA_VERSION ?></title>
<link rel="stylesheet" type="text/css" href="phpmyadmin.css.php?<?php echo PMA_generate_common_url('', ''); ?>&amp;js_frame=print&amp;nocache=<?php echo $GLOBALS['PMA_Config']->getThemeUniqueValue(); ?>" />
<title><?php echo __('Print view'); ?> - phpMyAdmin <?php echo PMA_VERSION ?></title>
<link rel="stylesheet" type="text/css" href="print.css" />
<?php
require_once './libraries/header_scripts.inc.php';
?>
</head>
<body bgcolor="#ffffff">
<h1><?php echo __('SQL result'); ?></h1>
<p>
<strong><?php echo __('Host'); ?>:</strong> <?php echo $cfg['Server']['verbose'] ? $cfg['Server']['verbose'] : $cfg['Server']['host'] . ((!empty($cfg['Server']['port'])) ? ':' . $cfg['Server']['port'] : ''); ?><br />
<strong><?php echo __('Database'); ?>:</strong> <?php echo htmlspecialchars($db); ?><br />
<strong><?php echo __('Generation Time'); ?>:</strong> <?php echo PMA_localisedDate(); ?><br />
<strong><?php echo __('Generated by'); ?>:</strong> phpMyAdmin&nbsp;<?php echo PMA_VERSION; ?>&nbsp;/ MySQL&nbsp;<?php echo PMA_MYSQL_STR_VERSION; ?><br />
<strong><?php echo __('SQL query'); ?>:</strong> <?php echo htmlspecialchars($full_sql_query); ?>;
<?php if (isset($num_rows)) {
?><br />
<strong><?php echo __('Rows'); ?>:</strong> <?php echo $num_rows; ?>
<?php
} ?>
</p>
<body>
<?php
/**

View File

@ -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;
}
}

29
sql.php
View File

@ -909,7 +909,36 @@ 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 = '';
if ($cfg['Server']['verbose']) {
$hostname = $cfg['Server']['verbose'];
} else {
$hostname = $cfg['Server']['host'];
if (! empty($cfg['Server']['port'])) {
$hostname .= $cfg['Server']['port'];
}
}
$versions = "phpMyAdmin&nbsp;" . PMA_VERSION;
$versions .= "&nbsp;/&nbsp;";
$versions .= "MySQL&nbsp;" . PMA_MYSQL_STR_VERSION;
echo "<h1>" . __('SQL result') . "</h1>";
echo "<p>";
echo "<strong>" . __('Host') . ":</strong> $hostname<br />";
echo "<strong>" . __('Database') . ":</strong> " . htmlspecialchars($db) . "<br />";
echo "<strong>" . __('Generation Time') . ":</strong> " . PMA_localisedDate() . "<br />";
echo "<strong>" . __('Generated by') . ":</strong> $versions<br />";
echo "<strong>" . __('SQL query') . ":</strong> " . htmlspecialchars($full_sql_query) . ";";
if (isset($num_rows)) {
echo "<br />";
echo "<strong>" . __('Rows') . ":</strong> $num_rows";
}
echo "</p>";
} else {
$GLOBALS['js_include'][] = 'functions.js';

View File

@ -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';

View File

@ -1,52 +0,0 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* print css file from theme Original
*
* @package PhpMyAdmin-theme
* @subpackage Original
*/
?>
/* 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;
}

View File

@ -1,52 +0,0 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* print css file from theme Original
*
* @package PhpMyAdmin-theme
* @subpackage PMAHomme
*/
?>
/* 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;
}