Hooray for stylesheets.

This commit is contained in:
Garvin Hicking
2003-03-10 13:48:10 +00:00
parent 88579ba476
commit 35702c9861
16 changed files with 3530 additions and 3608 deletions

View File

@@ -6,6 +6,23 @@ $Id$
$Source$ $Source$
2003-03-10 Garvin Hicking <me@supergarv.de> 2003-03-10 Garvin Hicking <me@supergarv.de>
* header.inc.php3, header_printview.inc.php3, index.php3,
left.php3, queryframe.php3, querywindow.php3,
transformation_wrapper.php3, css/phpmyadmin.css.php3,
libraries/common.lib.php3, libraries/db_table_exists.lib.php3,
libraries/functions.js, libraries/header_http.inc.php3,
libraries/header_meta_style.inc.php3, libraries/left.js
libraries/sqlparser.lib.php3:
Massive code-cleanup. Put all stylesheets into new central file
css/phpmyadmin.css.php3. To reduce overhead in this file, the
common.lib.php3 has a new variable to determine whether the full
code structure or only those codes needed for the stylesheet class
is parsed. This is to prevent duplicated code, even though it looks
somehow ugly. The stylesheet is now embedded via a <link rel>-
directive and should also be able to be cached by the browser.
See patch #699454.
Also some unneccessary code was removed from querywindow/wrapper.
* tbl_change.php3: Patch #697541 to prevent non-associative MySQL * tbl_change.php3: Patch #697541 to prevent non-associative MySQL
fieldnames to be mapped to false keys for display. fieldnames to be mapped to false keys for display.

206
css/phpmyadmin.css.php3 Normal file
View File

@@ -0,0 +1,206 @@
<?php
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
chdir('..');
$is_minimum_common = TRUE;
require('./libraries/grab_globals.lib.php3');
require('./libraries/common.lib.php3');
// Gets the default font sizes
// garvin: TODO: Should be optimized to not include the whole common.lib.php3 bunch
// but only functions used to determine browser heritage.
PMA_setFontSizes();
$ctype = 'css';
require('./libraries/header_http.inc.php3');
if (!isset($js_frame)) {
$js_frame = 'left';
}
if ($js_frame == 'left') {
/************************************************************************************
* LEFT FRAME
************************************************************************************/
/**
* Add styles for positioned layers
*/
if (isset($num_dbs) && $num_dbs == '0') {
?>
/* No layer effects neccessary */
div {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000}
input {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>}
select {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>; background-color: #ffffff; color: #000000}
.heada {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000}
.parent {font-family: <?php echo $left_font_family; ?>; color: #000000; text-decoration: none}
.item, .item:active, .item:hover, .tblItem, .tblItem:active {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_smaller; ?>; color: #333399; text-decoration: none}
.tblItem:hover {color: #FF0000; text-decoration: underline}
<?php
} else {
if (isset($js_capable) && $js_capable != '0') {
// Brian Birtles : This is not the ideal method of doing this
// but under the 7th June '00 Mozilla build (and many before
// it) Mozilla did not treat text between <style> tags as
// style information unless it was written with the one call
// to write().
if (isset($js_isDOM) && $js_isDOM != '0') {
?>
/* Layer effects neccessary: capable && is_DOM is set. We found a recent CSS-Browser */
div {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000}
.heada {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000}
.headaCnt {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_smaller; ?>; color: #000000}
.parent {font-family: <?php echo $left_font_family; ?>; color: #000000; text-decoration: none; display: block}
.child {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_smaller; ?>; color: #333399; text-decoration: none; display: none}
.item, .item:active, .item:hover, .tblItem, .tblItem:active {font-size: <?php echo $font_smaller; ?>; color: #333399; text-decoration: none}
.tblItem:hover {color: #FF0000; text-decoration: underline}'
<?php
} else {
?>
/* Layer effeccts neccessary: capable, but no is_DOM. We found an older CSS-Browser */
div {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000}
.heada {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000}
.headaCnt {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_smaller; ?>; color: #000000}
<?php
if (isset($js_isIE4) && $js_isIE4 != '0') {
?>
/* Additional effects for IE4 */
.parent {font-family: <?php echo $left_font_family; ?>; color: #000000; text-decoration: none; display: block}
.child {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_smaller; ?>; color: #333399; text-decoration: none; display: none}
.item, .item:active, .item:hover, .tblItem, .tblItem:active {font-size: <?php echo $font_smaller; ?>; color: #333399; text-decoration: none}
.tblItem:hover {color: #FF0000; text-decoration: underline}
<?php
}
else {
?>
/* Additional effects for NON-IE4 */
.parent {font-family: <?php echo $left_font_family; ?>; color: #000000; text-decoration: none; position: absolute; visibility: hidden}
.child {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_smaller; ?>; color: #333399; position: absolute; visibility: hidden}
.item, .tblItem {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_smaller; ?>; color: #333399; text-decoration: none}
<?php
}
}
} else {
?>
/* Additional effects for left frame not required or not possible because of lacking CSS-capability. */
div {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000}
.heada {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000}
.headaCnt {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_smaller; ?>; color: #000000}
.parent {font-family: <?php echo $left_font_family; ?>; color: #000000; text-decoration: none}
.child {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_smaller; ?>; color: #333399; text-decoration: none}
.item, .item:active, .item:hover, .tblItem, .tblItem:active {font-size: <?php echo $font_smaller; ?>; color: #333399; text-decoration: none}
.tblItem:hover {color: #FF0000; text-decoration: underline}
<?php
}
}
?>
/* Always enabled stylesheets (left frame) */
body {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>}
<?php
} elseif ($js_frame == 'print') {
/************************************************************************************
* PRINT VIEW
************************************************************************************/
?>
/* For printview */
body {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000; background-color: #ffffff}
h1 {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_biggest; ?>; font-weight: bold}
table {border-width:1px; border-color:#000000; border-style:solid; border-collapse:collapse; border-spacing:0}
th {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; font-weight: bold; color: #000000; background-color: #ffffff; border-width:1px; border-color:#000000; border-style:solid; padding:2px}
td {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000; background-color: #ffffff; border-width:1px; border-color:#000000; border-style:solid; padding:2px}
<?php
} else {
/************************************************************************************
* RIGHT FRAME
************************************************************************************/
?>
/* Always enabled stylesheets (right frame) */
body {
font-family: <?php echo $right_font_family; ?>;
font-size: <?php echo $font_size; ?>;
color: #000000;
<?php
if ($GLOBALS['cfg']['RightBgImage'] == '') {
echo ' background-image: url(\'./images/vertical_line.png\');' . "\n"
. ' background-repeat: repeat-y;' . "\n";
} else {
echo ' background-image: url(\'' . $GLOBALS['cfg']['RightBgImage'] . '\');' . "\n";
} // end if... else...
?>
background-color: <?php echo $GLOBALS['cfg']['RightBgColor'] . "\n"; ?>
}
pre, tt {font-size: <?php echo $font_size; ?>}
th {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; font-weight: bold; color: #000000; background-color: <?php echo $GLOBALS['cfg']['ThBgcolor']; ?>}
td {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>}
form {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>}
input {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>}
input.textfield {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000; background-color: #FFFFFF}
select {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000; background-color: #FFFFFF}
textarea {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000; background-color: #FFFFFF}
h1 {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_biggest; ?>; font-weight: bold}
h2 {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_bigger; ?>; font-weight: bold}
h3 {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; font-weight: bold}
a:link {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; text-decoration: none; color: #0000FF}
a:visited {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; text-decoration: none; color: #0000FF}
a:hover {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; text-decoration: underline; color: #FF0000}
a.nav:link {font-family: <?php echo $right_font_family; ?>; color: #000000}
a.nav:visited {font-family: <?php echo $right_font_family; ?>; color: #000000}
a.nav:hover {font-family: <?php echo $right_font_family; ?>; color: #FF0000}
a.h1:link {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_biggest; ?>; font-weight: bold; color: #000000}
a.h1:active {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_biggest; ?>; font-weight: bold; color: #000000}
a.h1:visited {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_biggest; ?>; font-weight: bold; color: #000000}
a.h1:hover {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_biggest; ?>; font-weight: bold; color: #FF0000}
a.h2:link {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_bigger; ?>; font-weight: bold; color: #000000}
a.h2:active {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_bigger; ?>; font-weight: bold; color: #000000}
a.h2:visited {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_bigger; ?>; font-weight: bold; color: #000000}
a.h2:hover {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_bigger; ?>; font-weight: bold; color: #FF0000}
a.drop:link {font-family: <?php echo $right_font_family; ?>; color: #ff0000}
a.drop:visited {font-family: <?php echo $right_font_family; ?>; color: #ff0000}
a.drop:hover {font-family: <?php echo $right_font_family; ?>; color: #ffffff; background-color:#ff0000; text-decoration: none}
dfn {font-style: normal}
dfn:hover {font-style: normal; cursor: help}
.nav {font-family: <?php echo $right_font_family; ?>; color: #000000}
.warning {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; font-weight: bold; color: #FF0000}
td.topline {font-size: 1px}
td.tab {
border-top: 1px solid #999;
border-right: 1px solid #666;
border-left: 1px solid #999;
border-bottom: none;
border-radius: 2px;
-moz-border-radius: 2px;
}
table.tabs {
border-top: none;
border-right: none;
border-left: none;
border-bottom: 1px solid #666;
}
.print{font-family:arial;font-size:8pt;}
.syntax {font-family: sans-serif; font-size: <?php echo $font_smaller; ?>;}
.syntax_comment {}
.syntax_digit {}
.syntax_digit_hex {}
.syntax_digit_integer {}
.syntax_digit_float {}
.syntax_punct {}
.syntax_alpha {text-transform: lowercase;}
.syntax_alpha_columnType {text-transform: uppercase;}
.syntax_alpha_columnAttrib {text-transform: uppercase;}
.syntax_alpha_reservedWord {text-transform: uppercase; font-weight: bold;}
.syntax_alpha_functionName {text-transform: uppercase;}
.syntax_alpha_identifier {}
.syntax_alpha_variable {}
.syntax_quote {}
.syntax_quote_backtick {}
<?php
echo PMA_SQP_buildCssData();
}
?>

View File

@@ -18,135 +18,13 @@ if ($GLOBALS['cfg']['OBGzip']) {
} }
} }
// garvin: For re-usability, moved http-headers and stylesheets
// to a seperate file. It can now be included by header.inc.php3,
// queryframe.php3, querywindow.php3.
/** include('./libraries/header_http.inc.php3');
* Sends http headers include('./libraries/header_meta_style.inc.php3');
*/
// Don't use cache (required for Opera)
$GLOBALS['now'] = gmdate('D, d M Y H:i:s') . ' GMT';
header('Expires: ' . $GLOBALS['now']); // rfc2616 - Section 14.21
header('Last-Modified: ' . $GLOBALS['now']);
header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
header('Pragma: no-cache'); // HTTP/1.0
// Define the charset to be used
header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
/**
* Sends the beginning of the html page then returns to the calling script
*/
// Gets the font sizes to use
PMA_setFontSizes();
// Defines the cell alignment values depending on text direction
if ($GLOBALS['text_dir'] == 'ltr') {
$GLOBALS['cell_align_left'] = 'left';
$GLOBALS['cell_align_right'] = 'right';
} else {
$GLOBALS['cell_align_left'] = 'right';
$GLOBALS['cell_align_right'] = 'left';
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $GLOBALS['available_languages'][$GLOBALS['lang']][2]; ?>" lang="<?php echo $GLOBALS['available_languages'][$GLOBALS['lang']][2]; ?>" dir="<?php echo $GLOBALS['text_dir']; ?>">
<head>
<title>phpMyAdmin</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $GLOBALS['charset']; ?>" />
<?php
if (!empty($GLOBALS['cfg']['PmaAbsoluteUri'])) {
echo '<base href="' . $GLOBALS['cfg']['PmaAbsoluteUri'] . '" />' . "\n";
}
?>
<style type="text/css">
<!--
body {
font-family: <?php echo $GLOBALS['right_font_family']; ?>;
font-size: <?php echo $GLOBALS['font_size']; ?>;
color: #000000;
<?php
if ($GLOBALS['cfg']['RightBgImage'] == '') {
echo ' background-image: url(\'./images/vertical_line.png\');' . "\n"
. ' background-repeat: repeat-y;' . "\n";
} else {
echo ' background-image: url(\'' . $GLOBALS['cfg']['RightBgImage'] . '\');' . "\n";
} // end if... else...
?>
background-color: <?php echo $GLOBALS['cfg']['RightBgColor'] . "\n"; ?>
}
pre, tt {font-size: <?php echo $GLOBALS['font_size']; ?>}
th {font-family: <?php echo $GLOBALS['right_font_family']; ?>; font-size: <?php echo $GLOBALS['font_size']; ?>; font-weight: bold; color: #000000; background-color: <?php echo $GLOBALS['cfg']['ThBgcolor']; ?>}
td {font-family: <?php echo $GLOBALS['right_font_family']; ?>; font-size: <?php echo $GLOBALS['font_size']; ?>}
form {font-family: <?php echo $GLOBALS['right_font_family']; ?>; font-size: <?php echo $GLOBALS['font_size']; ?>}
input {font-family: <?php echo $GLOBALS['right_font_family']; ?>; font-size: <?php echo $GLOBALS['font_size']; ?>}
input.textfield {font-family: <?php echo $GLOBALS['right_font_family']; ?>; font-size: <?php echo $GLOBALS['font_size']; ?>; color: #000000; background-color: #FFFFFF}
select {font-family: <?php echo $GLOBALS['right_font_family']; ?>; font-size: <?php echo $GLOBALS['font_size']; ?>; color: #000000; background-color: #FFFFFF}
textarea {font-family: <?php echo $GLOBALS['right_font_family']; ?>; font-size: <?php echo $GLOBALS['font_size']; ?>; color: #000000; background-color: #FFFFFF}
h1 {font-family: <?php echo $GLOBALS['right_font_family']; ?>; font-size: <?php echo $GLOBALS['font_biggest']; ?>; font-weight: bold}
h2 {font-family: <?php echo $GLOBALS['right_font_family']; ?>; font-size: <?php echo $GLOBALS['font_bigger']; ?>; font-weight: bold}
h3 {font-family: <?php echo $GLOBALS['right_font_family']; ?>; font-size: <?php echo $GLOBALS['font_size']; ?>; font-weight: bold}
a:link {font-family: <?php echo $GLOBALS['right_font_family']; ?>; font-size: <?php echo $GLOBALS['font_size']; ?>; text-decoration: none; color: #0000FF}
a:visited {font-family: <?php echo $GLOBALS['right_font_family']; ?>; font-size: <?php echo $GLOBALS['font_size']; ?>; text-decoration: none; color: #0000FF}
a:hover {font-family: <?php echo $GLOBALS['right_font_family']; ?>; font-size: <?php echo $GLOBALS['font_size']; ?>; text-decoration: underline; color: #FF0000}
a.nav:link {font-family: <?php echo $GLOBALS['right_font_family']; ?>; color: #000000}
a.nav:visited {font-family: <?php echo $GLOBALS['right_font_family']; ?>; color: #000000}
a.nav:hover {font-family: <?php echo $GLOBALS['right_font_family']; ?>; color: #FF0000}
a.h1:link {font-family: <?php echo $GLOBALS['right_font_family']; ?>; font-size: <?php echo $GLOBALS['font_biggest']; ?>; font-weight: bold; color: #000000}
a.h1:active {font-family: <?php echo $GLOBALS['right_font_family']; ?>; font-size: <?php echo $GLOBALS['font_biggest']; ?>; font-weight: bold; color: #000000}
a.h1:visited {font-family: <?php echo $GLOBALS['right_font_family']; ?>; font-size: <?php echo $GLOBALS['font_biggest']; ?>; font-weight: bold; color: #000000}
a.h1:hover {font-family: <?php echo $GLOBALS['right_font_family']; ?>; font-size: <?php echo $GLOBALS['font_biggest']; ?>; font-weight: bold; color: #FF0000}
a.h2:link {font-family: <?php echo $GLOBALS['right_font_family']; ?>; font-size: <?php echo $GLOBALS['font_bigger']; ?>; font-weight: bold; color: #000000}
a.h2:active {font-family: <?php echo $GLOBALS['right_font_family']; ?>; font-size: <?php echo $GLOBALS['font_bigger']; ?>; font-weight: bold; color: #000000}
a.h2:visited {font-family: <?php echo $GLOBALS['right_font_family']; ?>; font-size: <?php echo $GLOBALS['font_bigger']; ?>; font-weight: bold; color: #000000}
a.h2:hover {font-family: <?php echo $GLOBALS['right_font_family']; ?>; font-size: <?php echo $GLOBALS['font_bigger']; ?>; font-weight: bold; color: #FF0000}
a.drop:link {font-family: <?php echo $GLOBALS['right_font_family']; ?>; color: #ff0000}
a.drop:visited {font-family: <?php echo $GLOBALS['right_font_family']; ?>; color: #ff0000}
a.drop:hover {font-family: <?php echo $GLOBALS['right_font_family']; ?>; color: #ffffff; background-color:#ff0000; text-decoration: none}
dfn {font-style: normal}
dfn:hover {font-style: normal; cursor: help}
.nav {font-family: <?php echo $GLOBALS['right_font_family']; ?>; color: #000000}
.warning {font-family: <?php echo $GLOBALS['right_font_family']; ?>; font-size: <?php echo $GLOBALS['font_size']; ?>; font-weight: bold; color: #FF0000}
td.topline {font-size: 1px}
td.tab {
border-top: 1px solid #999;
border-right: 1px solid #666;
border-left: 1px solid #999;
border-bottom: none;
border-radius: 2px;
-moz-border-radius: 2px;
}
table.tabs {
border-top: none;
border-right: none;
border-left: none;
border-bottom: 1px solid #666;
}
.print{font-family:arial;font-size:8pt;}
.syntax {font-family: sans-serif; font-size: <?php echo $font_smaller; ?>;}
.syntax_comment {}
.syntax_digit {}
.syntax_digit_hex {}
.syntax_digit_integer {}
.syntax_digit_float {}
.syntax_punct {}
.syntax_alpha {text-transform: lowercase;}
.syntax_alpha_columnType {text-transform: uppercase;}
.syntax_alpha_columnAttrib {text-transform: uppercase;}
.syntax_alpha_reservedWord {text-transform: uppercase; font-weight: bold;}
.syntax_alpha_functionName {text-transform: uppercase;}
.syntax_alpha_identifier {}
.syntax_alpha_variable {}
.syntax_quote {}
.syntax_quote_backtick {}
<?php
echo PMA_SQP_buildCssData();
?>
//-->
</style>
<?php
$title = ''; $title = '';
if (isset($GLOBALS['db'])) { if (isset($GLOBALS['db'])) {
$title .= str_replace('\'', '\\\'', $GLOBALS['db']); $title .= str_replace('\'', '\\\'', $GLOBALS['db']);
@@ -246,7 +124,7 @@ if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
} }
?> ?>
if (top.frames.queryframe) { if (top.frames.queryframe && top.frames.queryframe.document && top.frames.queryframe.document.queryframeform) {
top.frames.queryframe.document.queryframeform.db.value = "<?php echo (isset($db) ? htmlspecialchars($db) : ''); ?>"; top.frames.queryframe.document.queryframeform.db.value = "<?php echo (isset($db) ? htmlspecialchars($db) : ''); ?>";
top.frames.queryframe.document.queryframeform.table.value = "<?php echo (isset($table) ? htmlspecialchars($table) : ''); ?>"; top.frames.queryframe.document.queryframeform.table.value = "<?php echo (isset($table) ? htmlspecialchars($table) : ''); ?>";
} }

View File

@@ -15,18 +15,11 @@ if ($cfg['OBGzip']) {
} }
/** // garvin: For re-usability, moved http-headers
* Sends http headers // to a seperate file. It can now be included by header.inc.php3,
*/ // queryframe.php3, querywindow.php3.
// Don't use cache (required for Opera)
$now = gmdate('D, d M Y H:i:s') . ' GMT';
header('Expires: ' . $now); // rfc2616 - Section 14.21
header('Last-Modified: ' . $now);
header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
header('Pragma: no-cache'); // HTTP/1.0
// Define the charset to be used
header('Content-Type: text/html; charset=' . $charset);
include('./libraries/header_http.inc.php3');
/** /**
* Sends the beginning of the html page then returns to the calling script * Sends the beginning of the html page then returns to the calling script
@@ -49,14 +42,7 @@ if ($text_dir == 'ltr') {
<head> <head>
<title><?php echo $strSQLResult; ?> - phpMyAdmin <?php echo PMA_VERSION ?></title> <title><?php echo $strSQLResult; ?> - phpMyAdmin <?php echo PMA_VERSION ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" /> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" />
<style type="text/css"> <link rel="stylesheet" type="text/css" href="./css/phpmyadmin.css.php3?js_frame=print" />
<!--
body {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000; background-color: #ffffff}
h1 {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_biggest; ?>; font-weight: bold}
table {border-width:1px; border-color:#000000; border-style:solid; border-collapse:collapse; border-spacing:0}
th {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; font-weight: bold; color: #000000; background-color: #ffffff; border-width:1px; border-color:#000000; border-style:solid; padding:2px}
td {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000; background-color: #ffffff; border-width:1px; border-color:#000000; border-style:solid; padding:2px}
//-->
</style> </style>
</head> </head>

View File

@@ -55,11 +55,7 @@ if ($cfg['QueryHistoryDB'] && $cfgRelation['historywork']) {
<head> <head>
<title>phpMyAdmin <?php echo PMA_VERSION; ?> - <?php echo $HTTP_HOST; ?></title> <title>phpMyAdmin <?php echo PMA_VERSION; ?> - <?php echo $HTTP_HOST; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $GLOBALS['charset']; ?>" /> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $GLOBALS['charset']; ?>" />
<style type="text/css"> <link rel="stylesheet" type="text/css" href="./css/phpmyadmin.css.php3?js_frame=right" />
<!--
body {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>}
//-->
</style>
</head> </head>
<frameset cols="<?php echo $cfg['LeftWidth']; ?>,*" rows="*"> <frameset cols="<?php echo $cfg['LeftWidth']; ?>,*" rows="*">

View File

@@ -40,18 +40,11 @@ if ($server > 0) {
} }
/** // garvin: For re-usability, moved http-headers
* Send http headers // to a seperate file. It can now be included by header.inc.php3,
*/ // queryframe.php3, querywindow.php3.
// Don't use cache (required for Opera)
$now = gmdate('D, d M Y H:i:s') . ' GMT';
header('Expires: ' . $now);
header('Last-Modified: ' . $now);
header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
header('Pragma: no-cache'); // HTTP/1.0
// Define the charset to be used
header('Content-Type: text/html; charset=' . $charset);
include('./libraries/header_http.inc.php3');
/** /**
* Displays the frame * Displays the frame
@@ -98,69 +91,31 @@ if ($num_dbs > 1 && !$cfg['LeftFrameLight']) {
} }
} // end if... else if... } // end if... else if...
} // end if } // end if
var fontFamily = '<?php echo $left_font_family; ?>';
var fontSize = '<?php echo $font_size; ?>';
var fontBig = '<?php echo $font_bigger; ?>';
var fontSmall = '<?php echo $font_smaller; ?>';
var isServer = <?php echo ($server > 0) ? 'true' : 'false'; ?>; var isServer = <?php echo ($server > 0) ? 'true' : 'false'; ?>;
document.writeln('<link rel="stylesheet" type="text/css" href="./css/phpmyadmin.css.php3?js_frame=left&amp;js_capable=' + capable + '&amp;js_isDOM=' + isDOM + '&amp;js_isIE4=' + isIE4 + '" />');
//--> //-->
</script> </script>
<script src="libraries/left.js" type="text/javascript" language="javascript1.2"></script>
<noscript> <noscript>
<style type="text/css"> <link rel="stylesheet" type="text/css" href="./css/phpmyadmin.css.php3?js_frame=left&amp;js_capable=0&amp;js_isDOM=0&amp;js_isIE4=0" />
<!--
div {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000}
.heada {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000}
.headaCnt {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_smaller; ?>; color: #000000}
.parent {font-family: <?php echo $left_font_family; ?>; color: #000000; text-decoration: none}
.child {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_smaller; ?>; color: #333399; text-decoration: none}
.item, .item:active, .item:hover, .tblItem, .tblItem:active {color: #333399; text-decoration: none}
.tblItem:hover {color: #FF0000; text-decoration: underline}
//-->
</style>
</noscript> </noscript>
<style type="text/css"> <script src="libraries/left.js" type="text/javascript" language="javascript1.2"></script>
<!--
body {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>}
//-->
</style>
<?php <?php
} // end if ($num_dbs > 1) } // end if ($num_dbs > 1)
else if ($num_dbs == 1) { else if ($num_dbs == 1) {
echo "\n"; echo "\n";
?> ?>
<style type="text/css"> <link rel="stylesheet" type="text/css" href="./css/phpmyadmin.css.php3?js_frame=left&amp;js_capable=0&amp;js_isDOM=0&amp;js_isIE4=0" />
<!--
body {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>}
div {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000}
.heada {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000}
.headaCnt {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_smaller; ?>; color: #000000}
.parent {font-family: <?php echo $left_font_family; ?>; color: #000000; text-decoration: none}
.child {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_smaller; ?>; color: #333399; text-decoration: none}
.item, .item:active, .item:hover, .tblItem, .tblItem:active {font-size: <?php echo $font_smaller; ?>; color: #333399; text-decoration: none}
.tblItem:hover {color: #FF0000; text-decoration: underline}
//-->
</style>
<?php <?php
} // end if ($num_dbs == 1) } // end if ($num_dbs == 1)
else { else {
echo "\n"; echo "\n";
?> ?>
<style type="text/css"> <link rel="stylesheet" type="text/css" href="./css/phpmyadmin.css.php3?js_frame=left&amp;num_dbs=0" />
<!--
body {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>}
div {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000}
input {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>}
select {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>; background-color: #ffffff; color: #000000}
.heada {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000}
.parent {font-family: <?php echo $left_font_family; ?>; color: #000000; text-decoration: none}
.item, .item:active, .item:hover, .tblItem, .tblItem:active {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_smaller; ?>; color: #333399; text-decoration: none}
.tblItem:hover {color: #FF0000; text-decoration: underline}
//-->
</style>
<?php <?php
} // end if ($num_dbs < 1) } // end if ($num_dbs < 1)

View File

@@ -57,6 +57,13 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')) {
* - other functions, respecting dependencies * - other functions, respecting dependencies
*/ */
/**
* Minimum inclusion? (i.e. for the stylesheet builder)
*/
if (!isset($is_minimum_common)) {
$is_minimum_common = FALSE;
}
/** /**
* Avoids undefined variables in PHP3 * Avoids undefined variables in PHP3
@@ -101,6 +108,7 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')) {
<head> <head>
<title>phpMyAdmin</title> <title>phpMyAdmin</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" /> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" />
<style type="text/css"> <style type="text/css">
<!-- <!--
body {font-family: sans-serif; font-size: small; color: #000000; background-color: #F5F5F5} body {font-family: sans-serif; font-size: small; color: #000000; background-color: #F5F5F5}
@@ -134,6 +142,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
include('./libraries/config_import.lib.php3'); include('./libraries/config_import.lib.php3');
} }
if ($is_minimum_common == FALSE) {
/** /**
* Includes the language file if it hasn't been included yet * Includes the language file if it hasn't been included yet
*/ */
@@ -145,6 +154,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
* Include MySQL wrappers. * Include MySQL wrappers.
*/ */
include('./libraries/mysql_wrappers.lib.php3'); include('./libraries/mysql_wrappers.lib.php3');
}
/** /**
* Gets constants that defines the PHP version number. * Gets constants that defines the PHP version number.
@@ -153,6 +163,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
*/ */
include('./libraries/defines_php.lib.php3'); include('./libraries/defines_php.lib.php3');
if ($is_minimum_common == FALSE) {
/** /**
* Define $is_upload * Define $is_upload
*/ */
@@ -165,6 +176,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
* Charset conversion. * Charset conversion.
*/ */
include('./libraries/charset_conversion.lib.php3'); include('./libraries/charset_conversion.lib.php3');
}
/** /**
* Gets constants that defines the MySQL version number. * Gets constants that defines the MySQL version number.
@@ -175,21 +187,32 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
*/ */
include('./libraries/defines.lib.php3'); include('./libraries/defines.lib.php3');
if ($is_minimum_common == FALSE) {
/** /**
* String handling * String handling
*/ */
include('./libraries/string.lib.php3'); include('./libraries/string.lib.php3');
}
if ($is_minimum_common == FALSE) {
/** /**
* SQL Parser data and code * SQL Parser data
*/ */
include('./libraries/sqlparser.data.php3'); include('./libraries/sqlparser.data.php3');
}
/**
* SQL Parser code
*/
include('./libraries/sqlparser.lib.php3'); include('./libraries/sqlparser.lib.php3');
if ($is_minimum_common == FALSE) {
/** /**
* SQL Validator interface code * SQL Validator interface code
*/ */
include('./libraries/sqlvalidator.lib.php3'); include('./libraries/sqlvalidator.lib.php3');
}
// If zlib output compression is set in the php configuration file, no // If zlib output compression is set in the php configuration file, no
// output buffering should be run // output buffering should be run
@@ -198,6 +221,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
$cfg['OBGzip'] = FALSE; $cfg['OBGzip'] = FALSE;
} }
if ($is_minimum_common == FALSE) {
/** /**
* Include URL/hidden inputs generating. * Include URL/hidden inputs generating.
*/ */
@@ -239,7 +263,6 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
} }
/** /**
* Add slashes before "'" and "\" characters so a value containing them can * Add slashes before "'" and "\" characters so a value containing them can
* be used in a sql comparison. * be used in a sql comparison.
@@ -248,8 +271,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
* @param boolean whether the string will be used in a 'LIKE' clause * @param boolean whether the string will be used in a 'LIKE' clause
* (it then requires two more escaped sequences) or not * (it then requires two more escaped sequences) or not
* @param boolean whether to treat cr/lfs as escape-worthy entities * @param boolean whether to treat cr/lfs as escape-worthy entities
(converts \n to \\n, \r to \\r) * (converts \n to \\n, \r to \\r)
* *
* @return string the slashed string * @return string the slashed string
* *
@@ -454,7 +476,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
return ($i < $max) ? $i : -1; return ($i < $max) ? $i : -1;
} // end of the 'PMA_isInto()' function } // end of the 'PMA_isInto()' function
}
/** /**
* Determines the font sizes to use depending on the os and browser of the * Determines the font sizes to use depending on the os and browser of the
@@ -540,6 +562,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
} // end of the 'PMA_setFontSizes()' function } // end of the 'PMA_setFontSizes()' function
if ($is_minimum_common == FALSE) {
/** /**
* $cfg['PmaAbsoluteUri'] is a required directive else cookies won't be * $cfg['PmaAbsoluteUri'] is a required directive else cookies won't be
* set properly and, depending on browsers, inserting or updating a * set properly and, depending on browsers, inserting or updating a
@@ -1816,6 +1839,6 @@ if (typeof(document.getElementById) != 'undefined'
return (ereg_replace('/+', '/', $tmp_file) == $filename); return (ereg_replace('/+', '/', $tmp_file) == $filename);
} // end of the 'is_uploaded_file()' emulated function } // end of the 'is_uploaded_file()' emulated function
} // end if } // end if
} // end if: minimal common.lib needed?
} // $__PMA_COMMON_LIB__ } // $__PMA_COMMON_LIB__
?> ?>

View File

@@ -13,7 +13,9 @@ if (!isset($is_db) || !$is_db) {
$is_db = @PMA_mysql_select_db($db); $is_db = @PMA_mysql_select_db($db);
} }
if (empty($db) || !$is_db) { if (empty($db) || !$is_db) {
if (!isset($is_transformation_wrapper)) {
header('Location: ' . $cfg['PmaAbsoluteUri'] . 'main.php3?' . PMA_generate_common_url('', '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1'); header('Location: ' . $cfg['PmaAbsoluteUri'] . 'main.php3?' . PMA_generate_common_url('', '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
}
exit(); exit();
} }
} // end if (ensures db exists) } // end if (ensures db exists)
@@ -24,7 +26,9 @@ if (!isset($is_table) || !$is_table) {
} }
if (empty($table) if (empty($table)
|| !($is_table && @mysql_numrows($is_table))) { || !($is_table && @mysql_numrows($is_table))) {
if (!isset($is_transformation_wrapper)) {
header('Location: ' . $cfg['PmaAbsoluteUri'] . 'db_details.php3?' . PMA_generate_common_url($db, '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1'); header('Location: ' . $cfg['PmaAbsoluteUri'] . 'db_details.php3?' . PMA_generate_common_url($db, '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
}
exit(); exit();
} else if (isset($is_table)) { } else if (isset($is_table)) {
mysql_free_result($is_table); mysql_free_result($is_table);

View File

@@ -0,0 +1,23 @@
<?php
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
/**
* Sends http headers
*/
// Don't use cache (required for Opera)
$ctype = (isset($ctype) ? $ctype : 'html');
if ($ctype == 'css') {
header('Content-Type: text/css; charset=ISO-8859-1');
} else {
$GLOBALS['now'] = gmdate('D, d M Y H:i:s') . ' GMT';
header('Expires: ' . $GLOBALS['now']); // rfc2616 - Section 14.21
header('Last-Modified: ' . $GLOBALS['now']);
header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
header('Pragma: no-cache'); // HTTP/1.0
if (!isset($is_transformation_wrapper)) {
// Define the charset to be used
header('Content-Type: text/' . $ctype . '; charset=' . $GLOBALS['charset']);
}
}
?>

View File

@@ -0,0 +1,31 @@
<?php
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
/**
* Sends the beginning of the html page then returns to the calling script
*/
// Gets the font sizes to use
PMA_setFontSizes();
// Defines the cell alignment values depending on text direction
if ($GLOBALS['text_dir'] == 'ltr') {
$GLOBALS['cell_align_left'] = 'left';
$GLOBALS['cell_align_right'] = 'right';
} else {
$GLOBALS['cell_align_left'] = 'right';
$GLOBALS['cell_align_right'] = 'left';
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $GLOBALS['available_languages'][$GLOBALS['lang']][2]; ?>" lang="<?php echo $GLOBALS['available_languages'][$GLOBALS['lang']][2]; ?>" dir="<?php echo $GLOBALS['text_dir']; ?>">
<head>
<title>phpMyAdmin</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $GLOBALS['charset']; ?>" />
<?php
if (!empty($GLOBALS['cfg']['PmaAbsoluteUri'])) {
echo '<base href="' . $GLOBALS['cfg']['PmaAbsoluteUri'] . '" />' . "\n";
}
?>
<link rel="stylesheet" type="text/css" href="./css/phpmyadmin.css.php3?js_frame=right" />

View File

@@ -252,64 +252,4 @@ function hilightBase(el, theColor)
return true; return true;
} // end of the 'hilightBase()' function } // end of the 'hilightBase()' function
/**
* Add styles for positioned layers
*/
if (capable) {
// Brian Birtles : This is not the ideal method of doing this
// but under the 7th June '00 Mozilla build (and many before
// it) Mozilla did not treat text between <style> tags as
// style information unless it was written with the one call
// to write().
if (isDOM) {
var lstyle = '<style type="text\/css">'
+ '<!--'
+ 'div {font-family: ' + fontFamily + '; font-size: ' + fontSize + '; color: #000000}'
+ '.heada {font-family: ' + fontFamily + '; font-size: ' + fontSize + '; color: #000000}'
+ '.headaCnt {font-family: ' + fontFamily + '; font-size: ' + fontSmall + '; color: #000000}'
+ '.parent {font-family: ' + fontFamily + '; color: #000000; text-decoration: none; display: block}'
+ '.child {font-family: ' + fontFamily + '; font-size: ' + fontSmall + '; color: #333399; text-decoration: none; display: none}'
+ '.item, .item:active, .item:hover, .tblItem, .tblItem:active {font-size: ' + fontSmall + '; color: #333399; text-decoration: none}'
+ '.tblItem:hover {color: #FF0000; text-decoration: underline}'
+ '\/\/-->'
+ '<\/style>';
document.write(lstyle);
}
else {
document.writeln('<style type="text\/css">');
document.writeln('<!--');
document.writeln('div {font-family: ' + fontFamily + '; font-size: ' + fontSize + '; color: #000000}');
document.writeln('.heada {font-family: ' + fontFamily + '; font-size: ' + fontSize + '; color: #000000}');
document.writeln('.headaCnt {font-family: ' + fontFamily + '; font-size: ' + fontSmall + '; color: #000000}');
if (isIE4) {
document.writeln('.parent {font-family: ' + fontFamily + '; color: #000000; text-decoration: none; display: block}');
document.writeln('.child {font-family: ' + fontFamily + '; font-size: ' + fontSmall + '; color: #333399; text-decoration: none; display: none}');
document.writeln('.item, .item:active, .item:hover, .tblItem, .tblItem:active {font-size: ' + fontSmall + '; color: #333399; text-decoration: none}');
document.writeln('.tblItem:hover {color: #FF0000; text-decoration: underline}');
}
else { // NS4 case
document.writeln('.parent {font-family: ' + fontFamily + '; color: #000000; text-decoration: none; position: absolute; visibility: hidden}');
document.writeln('.child {font-family: ' + fontFamily + '; font-size: ' + fontSmall + '; color: #333399; position: absolute; visibility: hidden}');
document.writeln('.item, .tblItem {font-family: ' + fontFamily + '; font-size: ' + fontSmall + '; color: #333399; text-decoration: none}');
}
document.writeln('\/\/-->');
document.writeln('<\/style>');
}
}
else {
document.writeln('<style type="text\/css">');
document.writeln('<!--');
document.writeln('div {font-family: ' + fontFamily + '; font-size: ' + fontSize + '; color: #000000}');
document.writeln('.heada {font-family: ' + fontFamily + '; font-size: ' + fontSize + '; color: #000000}');
document.writeln('.headaCnt {font-family: ' + fontFamily + '; font-size: ' + fontSmall + '; color: #000000}');
document.writeln('.parent {font-family: ' + fontFamily + '; color: #000000; text-decoration: none}');
document.writeln('.child {font-family: ' + fontFamily + '; font-size: ' + fontSmall + '; color: #333399; text-decoration: none}');
document.writeln('.item, .item:active, .item:hover, .tblItem, .tblItem:active {font-size: ' + fontSmall + '; color: #333399; text-decoration: none}');
document.writeln('.tblItem:hover {color: #FF0000; text-decoration: underline}');
document.writeln('\/\/-->');
document.writeln('<\/style>');
} // end of adding styles
window.onload = initIt; window.onload = initIt;

View File

@@ -34,7 +34,15 @@
if (!defined('PMA_SQP_LIB_INCLUDED')) { if (!defined('PMA_SQP_LIB_INCLUDED')) {
define('PMA_SQP_LIB_INCLUDED', 1); define('PMA_SQP_LIB_INCLUDED', 1);
/**
* Minimum inclusion? (i.e. for the stylesheet builder)
*/
if (!isset($is_minimum_common)) {
$is_minimum_common = FALSE;
}
if ($is_minimum_common == FALSE) {
/** /**
* Include the string library as we use it heavily * Include the string library as we use it heavily
*/ */
@@ -1657,7 +1665,7 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
return $str; return $str;
} // end of the "PMA_SQP_formatHtml()" function } // end of the "PMA_SQP_formatHtml()" function
}
/** /**
* Builds a CSS rule used for html formatted SQL queries * Builds a CSS rule used for html formatted SQL queries
@@ -1710,7 +1718,7 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
return $css_string; return $css_string;
} // end of the "PMA_SQP_buildCssData()" function } // end of the "PMA_SQP_buildCssData()" function
if ($is_minimum_common == FALSE) {
/** /**
* Gets SQL queries with no format * Gets SQL queries with no format
* *
@@ -1745,6 +1753,6 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
*/ */
return PMA_SQP_formatNone($arr); return PMA_SQP_formatNone($arr);
} // end of the "PMA_SQP_formatText()" function } // end of the "PMA_SQP_formatText()" function
} // end if: minimal common.lib needed?
} // $__PMA_SQP_LIB__ } // $__PMA_SQP_LIB__
?> ?>

View File

@@ -25,18 +25,11 @@ if ($cfg['OBGzip']) {
} }
} }
/** // garvin: For re-usability, moved http-headers
* Send http headers // to a seperate file. It can now be included by header.inc.php3,
*/ // queryframe.php3, querywindow.php3.
// Don't use cache (required for Opera)
$now = gmdate('D, d M Y H:i:s') . ' GMT';
header('Expires: ' . $now);
header('Last-Modified: ' . $now);
header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
header('Pragma: no-cache'); // HTTP/1.0
// Define the charset to be used
header('Content-Type: text/html; charset=' . $charset);
include('./libraries/header_http.inc.php3');
/** /**
* Displays the frame * Displays the frame
@@ -52,18 +45,7 @@ PMA_setFontSizes();
<title>phpMyAdmin</title> <title>phpMyAdmin</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" /> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" />
<base<?php if (!empty($cfg['PmaAbsoluteUri'])) echo ' href="' . $cfg['PmaAbsoluteUri'] . '"'; ?> /> <base<?php if (!empty($cfg['PmaAbsoluteUri'])) echo ' href="' . $cfg['PmaAbsoluteUri'] . '"'; ?> />
<style type="text/css"> <link rel="stylesheet" type="text/css" href="./css/phpmyadmin.css.php3?js_frame=left&num_dbs=0" />
<!--
body {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>}
div {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000}
.heada {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000}
.headaCnt {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_smaller; ?>; color: #000000}
.parent {font-family: <?php echo $left_font_family; ?>; color: #000000; text-decoration: none}
.child {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_smaller; ?>; color: #333399; text-decoration: none}
.item, .item:active, .item:hover, .tblItem, .tblItem:active {font-size: <?php echo $font_smaller; ?>; color: #333399; text-decoration: none}
.tblItem:hover {color: #FF0000; text-decoration: underline}
//-->
</style>
<?php <?php
if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) { if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
?> ?>

View File

@@ -39,60 +39,13 @@ if ($server > 0) {
$num_dbs = 0; $num_dbs = 0;
} }
// garvin: For re-usability, moved http-headers and stylesheets
// to a seperate file. It can now be included by header.inc.php3,
// queryframe.php3, querywindow.php3.
/** include('./libraries/header_http.inc.php3');
* Send http headers include('./libraries/header_meta_style.inc.php3');
*/
// Don't use cache (required for Opera)
$now = gmdate('D, d M Y H:i:s') . ' GMT';
header('Expires: ' . $now);
header('Last-Modified: ' . $now);
header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
header('Pragma: no-cache'); // HTTP/1.0
// Define the charset to be used
header('Content-Type: text/html; charset=' . $charset);
/**
* Displays the frame
*/
// Gets the font sizes to use
PMA_setFontSizes();
?> ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $available_languages[$lang][2]; ?>" lang="<?php echo $available_languages[$lang][2]; ?>" dir="<?php echo $text_dir; ?>">
<head>
<title>phpMyAdmin</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" />
<base<?php if (!empty($cfg['PmaAbsoluteUri'])) echo ' href="' . $cfg['PmaAbsoluteUri'] . '"'; ?> />
<style type="text/css">
<!--
body {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>}
div {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000}
.heada {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000}
.headaCnt {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_smaller; ?>; color: #000000}
.parent {font-family: <?php echo $left_font_family; ?>; color: #000000; text-decoration: none}
.child {font-family: <?php echo $left_font_family; ?>; font-size: <?php echo $font_smaller; ?>; color: #333399; text-decoration: none}
.item, .item:active, .item:hover, .tblItem, .tblItem:active {font-size: <?php echo $font_smaller; ?>; color: #333399; text-decoration: none}
.tblItem:hover {color: #FF0000; text-decoration: underline}
td.tab {
border-top: 1px solid #999;
border-right: 1px solid #666;
border-left: 1px solid #999;
border-bottom: none;
border-radius: 2px;
-moz-border-radius: 2px;
}
table.tabs {
border-top: none;
border-right: none;
border-left: none;
border-bottom: 1px solid #666;
}
//-->
</style>
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
<?php <?php

View File

@@ -2,6 +2,8 @@
/* $Id$ */ /* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4: // vim: expandtab sw=4 ts=4 sts=4:
$is_transformation_wrapper = true;
/** /**
* Get the variables sent or posted to this script and displays the header * Get the variables sent or posted to this script and displays the header
*/ */
@@ -13,73 +15,17 @@ require('./libraries/grab_globals.lib.php3');
if (!defined('PMA_COMMON_LIB_INCLUDED')) { if (!defined('PMA_COMMON_LIB_INCLUDED')) {
include('./libraries/common.lib.php3'); include('./libraries/common.lib.php3');
} }
if (!defined('PMA_OB_LIB_INCLUDED')) {
include('./libraries/ob.lib.php3');
}
require('./libraries/relation.lib.php3'); // foreign keys require('./libraries/relation.lib.php3'); // foreign keys
require('./libraries/transformations.lib.php3'); // Transformations require('./libraries/transformations.lib.php3'); // Transformations
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
/**
* Displays the query submitted and its result
*/
if (!empty($message)) {
if (isset($goto)) {
$goto_cpy = $goto;
$goto = 'tbl_properties.php3?'
. PMA_generate_common_url($db, $table)
. '&amp;$show_query=1'
. '&amp;sql_query=' . urlencode($disp_query);
} else {
$show_query = '1';
}
if (isset($sql_query)) {
$sql_query_cpy = $sql_query;
unset($sql_query);
}
if (isset($disp_query)) {
$sql_query = $disp_query;
}
PMA_showMessage($message);
if (isset($goto_cpy)) {
$goto = $goto_cpy;
unset($goto_cpy);
}
if (isset($sql_query_cpy)) {
$sql_query = $sql_query_cpy;
unset($sql_query_cpy);
}
}
/**
* Defines the url to return to in case of error in a sql statement
*/
if (!isset($goto)) {
$goto = 'db_details.php3';
}
if (!ereg('^(db_details|tbl_properties|tbl_select)', $goto)) {
$err_url = $goto . "?" . PMA_generate_common_url($db) . "&amp;sql_query=" . urlencode($sql_query);
} else {
$err_url = $goto . '?'
. PMA_generate_common_url($db)
. ((ereg('^(tbl_properties|tbl_select)', $goto)) ? '&amp;table=' . urlencode($table) : '');
}
/** /**
* Ensures db and table are valid, else moves to the "parent" script * Ensures db and table are valid, else moves to the "parent" script
*/ */
require('./libraries/db_table_exists.lib.php3'); require('./libraries/db_table_exists.lib.php3');
/**
* Sets parameters for links and displays top menu
*/
$url_query = PMA_generate_common_url($db, $table)
. '&amp;goto=tbl_properties.php3';
/** /**
* Get the list of the fields of the current table * Get the list of the fields of the current table
*/ */
@@ -89,36 +35,17 @@ if (isset($primary_key)) {
$local_query = 'SELECT * FROM ' . PMA_backquote($table) . ' WHERE ' . $primary_key; $local_query = 'SELECT * FROM ' . PMA_backquote($table) . ' WHERE ' . $primary_key;
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url); $result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
$row = PMA_mysql_fetch_array($result); $row = PMA_mysql_fetch_array($result);
// No row returned } else {
if (!$row) {
unset($row);
unset($primary_key);
$goto_cpy = $goto;
$goto = 'tbl_properties.php3?'
. PMA_generate_common_url($db, $table)
. '&amp;$show_query=1'
. '&amp;sql_query=' . urlencode($local_query);
if (isset($sql_query)) {
$sql_query_cpy = $sql_query;
unset($sql_query);
}
$sql_query = $local_query;
PMA_showMessage($strEmptyResultSet);
$goto = $goto_cpy;
unset($goto_cpy);
if (isset($sql_query_cpy)) {
$sql_query = $sql_query_cpy;
unset($sql_query_cpy);
}
} // end if (no record returned)
}
else
{
$local_query = 'SELECT * FROM ' . PMA_backquote($table) . ' LIMIT 1'; $local_query = 'SELECT * FROM ' . PMA_backquote($table) . ' LIMIT 1';
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url); $result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
unset($row); $row = PMA_mysql_fetch_array($result);
} }
// No row returned
if (!$row) {
exit;
} // end if (no record returned)
$default_ct = 'application/octet-stream'; $default_ct = 'application/octet-stream';
if ($cfgRelation['commwork'] && $cfgRelation['mimework']) { if ($cfgRelation['commwork'] && $cfgRelation['mimework']) {
@@ -133,27 +60,21 @@ if ($cfgRelation['commwork'] && $cfgRelation['mimework']) {
} }
} }
/** // garvin: For re-usability, moved http-headers and stylesheets
* Sends http headers // to a seperate file. It can now be included by header.inc.php3,
*/ // queryframe.php3, querywindow.php3.
// Don't use cache (required for Opera)
if (!isset($noheader)) { include('./libraries/header_http.inc.php3');
$GLOBALS['now'] = gmdate('D, d M Y H:i:s') . ' GMT';
header('Expires: ' . $GLOBALS['now']); // rfc2616 - Section 14.21
header('Last-Modified: ' . $GLOBALS['now']);
header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
header('Pragma: no-cache'); // HTTP/1.0
// [MIME] // [MIME]
$content_type = 'Content-Type: ' . (isset($mime_map[urldecode($transform_key)]['mimetype']) ? str_replace("_", "/", $mime_map[urldecode($transform_key)]['mimetype']) : $default_ct) . (isset($mime_options['charset']) ? $mime_options['charset'] : ''); $content_type = 'Content-Type: ' . (isset($mime_map[urldecode($transform_key)]['mimetype']) ? str_replace("_", "/", $mime_map[urldecode($transform_key)]['mimetype']) : $default_ct) . (isset($mime_options['charset']) ? $mime_options['charset'] : '');
header($content_type); header($content_type);
}
if (!isset($resize)) { if (!isset($resize)) {
echo $row[urldecode($transform_key)]; echo $row[urldecode($transform_key)];
} else { } else {
// if image_*__inline.inc.php3 finds that we can resize, // if image_*__inline.inc.php3 finds that we can resize,
// it sets $resize to jpeg or png // it sets $resize to jpeg or png
$srcImage = imagecreatefromstring($row[urldecode($transform_key)]); $srcImage = imagecreatefromstring($row[urldecode($transform_key)]);
$srcWidth = ImageSX( $srcImage ); $srcWidth = ImageSX( $srcImage );
$srcHeight = ImageSY( $srcImage ); $srcHeight = ImageSY( $srcImage );
@@ -189,7 +110,6 @@ if (!isset($resize)) {
} }
ImageDestroy( $srcImage ); ImageDestroy( $srcImage );
ImageDestroy( $destImage ); ImageDestroy( $destImage );
} }
/** /**