diff --git a/ChangeLog b/ChangeLog index b95e263cd..aca26e896 100755 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,23 @@ $Id$ $Source$ 2003-03-10 Garvin Hicking + * 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 - + 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 fieldnames to be mapped to false keys for display. diff --git a/css/phpmyadmin.css.php3 b/css/phpmyadmin.css.php3 new file mode 100644 index 000000000..61a354d23 --- /dev/null +++ b/css/phpmyadmin.css.php3 @@ -0,0 +1,206 @@ + +/* No layer effects neccessary */ +div {font-family: ; font-size: ; color: #000000} +input {font-family: ; font-size: } +select {font-family: ; font-size: ; background-color: #ffffff; color: #000000} +.heada {font-family: ; font-size: ; color: #000000} +.parent {font-family: ; color: #000000; text-decoration: none} +.item, .item:active, .item:hover, .tblItem, .tblItem:active {font-family: ; font-size: ; color: #333399; text-decoration: none} +.tblItem:hover {color: #FF0000; text-decoration: underline} + 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: ; font-size: ; color: #000000} +.heada {font-family: ; font-size: ; color: #000000} +.headaCnt {font-family: ; font-size: ; color: #000000} +.parent {font-family: ; color: #000000; text-decoration: none; display: block} +.child {font-family: ; font-size: ; color: #333399; text-decoration: none; display: none} +.item, .item:active, .item:hover, .tblItem, .tblItem:active {font-size: ; color: #333399; text-decoration: none} +.tblItem:hover {color: #FF0000; text-decoration: underline}' + +/* Layer effeccts neccessary: capable, but no is_DOM. We found an older CSS-Browser */ +div {font-family: ; font-size: ; color: #000000} +.heada {font-family: ; font-size: ; color: #000000} +.headaCnt {font-family: ; font-size: ; color: #000000} + +/* Additional effects for IE4 */ +.parent {font-family: ; color: #000000; text-decoration: none; display: block} +.child {font-family: ; font-size: ; color: #333399; text-decoration: none; display: none} +.item, .item:active, .item:hover, .tblItem, .tblItem:active {font-size: ; color: #333399; text-decoration: none} +.tblItem:hover {color: #FF0000; text-decoration: underline} + +/* Additional effects for NON-IE4 */ +.parent {font-family: ; color: #000000; text-decoration: none; position: absolute; visibility: hidden} +.child {font-family: ; font-size: ; color: #333399; position: absolute; visibility: hidden} +.item, .tblItem {font-family: ; font-size: ; color: #333399; text-decoration: none} + +/* Additional effects for left frame not required or not possible because of lacking CSS-capability. */ +div {font-family: ; font-size: ; color: #000000} +.heada {font-family: ; font-size: ; color: #000000} +.headaCnt {font-family: ; font-size: ; color: #000000} +.parent {font-family: ; color: #000000; text-decoration: none} +.child {font-family: ; font-size: ; color: #333399; text-decoration: none} +.item, .item:active, .item:hover, .tblItem, .tblItem:active {font-size: ; color: #333399; text-decoration: none} +.tblItem:hover {color: #FF0000; text-decoration: underline} + +/* Always enabled stylesheets (left frame) */ +body {font-family: ; font-size: } + +/* For printview */ +body {font-family: ; font-size: ; color: #000000; background-color: #ffffff} +h1 {font-family: ; font-size: ; font-weight: bold} +table {border-width:1px; border-color:#000000; border-style:solid; border-collapse:collapse; border-spacing:0} +th {font-family: ; font-size: ; font-weight: bold; color: #000000; background-color: #ffffff; border-width:1px; border-color:#000000; border-style:solid; padding:2px} +td {font-family: ; font-size: ; color: #000000; background-color: #ffffff; border-width:1px; border-color:#000000; border-style:solid; padding:2px} + +/* Always enabled stylesheets (right frame) */ +body { + font-family: ; + font-size: ; + color: #000000; + + background-color: +} + +pre, tt {font-size: } +th {font-family: ; font-size: ; font-weight: bold; color: #000000; background-color: } +td {font-family: ; font-size: } +form {font-family: ; font-size: } +input {font-family: ; font-size: } +input.textfield {font-family: ; font-size: ; color: #000000; background-color: #FFFFFF} +select {font-family: ; font-size: ; color: #000000; background-color: #FFFFFF} +textarea {font-family: ; font-size: ; color: #000000; background-color: #FFFFFF} +h1 {font-family: ; font-size: ; font-weight: bold} +h2 {font-family: ; font-size: ; font-weight: bold} +h3 {font-family: ; font-size: ; font-weight: bold} +a:link {font-family: ; font-size: ; text-decoration: none; color: #0000FF} +a:visited {font-family: ; font-size: ; text-decoration: none; color: #0000FF} +a:hover {font-family: ; font-size: ; text-decoration: underline; color: #FF0000} +a.nav:link {font-family: ; color: #000000} +a.nav:visited {font-family: ; color: #000000} +a.nav:hover {font-family: ; color: #FF0000} +a.h1:link {font-family: ; font-size: ; font-weight: bold; color: #000000} +a.h1:active {font-family: ; font-size: ; font-weight: bold; color: #000000} +a.h1:visited {font-family: ; font-size: ; font-weight: bold; color: #000000} +a.h1:hover {font-family: ; font-size: ; font-weight: bold; color: #FF0000} +a.h2:link {font-family: ; font-size: ; font-weight: bold; color: #000000} +a.h2:active {font-family: ; font-size: ; font-weight: bold; color: #000000} +a.h2:visited {font-family: ; font-size: ; font-weight: bold; color: #000000} +a.h2:hover {font-family: ; font-size: ; font-weight: bold; color: #FF0000} +a.drop:link {font-family: ; color: #ff0000} +a.drop:visited {font-family: ; color: #ff0000} +a.drop:hover {font-family: ; color: #ffffff; background-color:#ff0000; text-decoration: none} +dfn {font-style: normal} +dfn:hover {font-style: normal; cursor: help} +.nav {font-family: ; color: #000000} +.warning {font-family: ; 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: ;} +.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 {} + + diff --git a/header.inc.php3 b/header.inc.php3 index 597fbf2cc..6c93df05f 100755 --- a/header.inc.php3 +++ b/header.inc.php3 @@ -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. -/** - * Sends http headers - */ -// 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']); +include('./libraries/header_http.inc.php3'); +include('./libraries/header_meta_style.inc.php3'); - -/** - * 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'; -} -?> - - - - -phpMyAdmin - -' . "\n"; -} -?> - - - - if (top.frames.queryframe) { + if (top.frames.queryframe && top.frames.queryframe.document && top.frames.queryframe.document.queryframeform) { top.frames.queryframe.document.queryframeform.db.value = ""; top.frames.queryframe.document.queryframeform.table.value = ""; } diff --git a/header_printview.inc.php3 b/header_printview.inc.php3 index f269165a8..f80d17866 100644 --- a/header_printview.inc.php3 +++ b/header_printview.inc.php3 @@ -15,18 +15,11 @@ if ($cfg['OBGzip']) { } -/** - * Sends http headers - */ -// 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); +// garvin: For re-usability, moved http-headers +// to a seperate file. It can now be included by header.inc.php3, +// queryframe.php3, querywindow.php3. +include('./libraries/header_http.inc.php3'); /** * Sends the beginning of the html page then returns to the calling script @@ -49,14 +42,7 @@ if ($text_dir == 'ltr') { <?php echo $strSQLResult; ?> - phpMyAdmin <?php echo PMA_VERSION ?> - diff --git a/index.php3 b/index.php3 index 3b4877b7a..676f79c9c 100755 --- a/index.php3 +++ b/index.php3 @@ -55,11 +55,7 @@ if ($cfg['QueryHistoryDB'] && $cfgRelation['historywork']) { phpMyAdmin <?php echo PMA_VERSION; ?> - <?php echo $HTTP_HOST; ?> - + diff --git a/left.php3 b/left.php3 index 6186c6eff..c3e423556 100755 --- a/left.php3 +++ b/left.php3 @@ -40,18 +40,11 @@ if ($server > 0) { } -/** - * Send http headers - */ -// 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); +// garvin: For re-usability, moved http-headers +// to a seperate file. It can now be included by header.inc.php3, +// queryframe.php3, querywindow.php3. +include('./libraries/header_http.inc.php3'); /** * Displays the frame @@ -98,69 +91,31 @@ if ($num_dbs > 1 && !$cfg['LeftFrameLight']) { } } // end if... else if... } // end if - var fontFamily = ''; - var fontSize = ''; - var fontBig = ''; - var fontSmall = ''; + var isServer = 0) ? 'true' : 'false'; ?>; + + document.writeln(''); //--> - - + 1) else if ($num_dbs == 1) { echo "\n"; ?> - + - + 'en-iso-8859-1', - 'AllowAnywhereRecoding' => FALSE); + 'AllowAnywhereRecoding' => FALSE); // Loads the language file include('./libraries/select_lang.lib.php3'); // Sends the Content-Type header @@ -101,6 +108,7 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')) { phpMyAdmin + + @@ -82,7 +64,7 @@ function open_querywindow(url) { querywindow.opener = self; } - if (window.focus) { + if (window.focus) { querywindow.focus(); } diff --git a/querywindow.php3 b/querywindow.php3 index 79774a807..dc9caf9bd 100644 --- a/querywindow.php3 +++ b/querywindow.php3 @@ -39,60 +39,13 @@ if ($server > 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. -/** - * Send http headers - */ -// 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(); +include('./libraries/header_http.inc.php3'); +include('./libraries/header_meta_style.inc.php3'); ?> - - - - - phpMyAdmin - - /> -