From 7a19861b4b4b8e3c3cc22e769c8107b3c699e101 Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Tue, 25 Apr 2006 15:21:33 +0000 Subject: [PATCH] style upgrade --- ChangeLog | 4 +- pdf_schema.php | 4 -- server_binlog.php | 70 +++++++++++------------ server_variables.php | 17 +++--- tbl_change.php | 107 +++++++++++++++++------------------- transformation_overview.php | 43 ++++++++------- 6 files changed, 115 insertions(+), 130 deletions(-) diff --git a/ChangeLog b/ChangeLog index f51286379f..b56cc35b93 100755 --- a/ChangeLog +++ b/ChangeLog @@ -13,7 +13,9 @@ $Source$ 2006-04-25 Sebastian Mendel * db_details_qbe.php, db_printview.php, libraries/display_tbl.lib.php, - css/phpmyadmin.css.php, js/functions.js, pdf_pages.php: + css/phpmyadmin.css.php, js/functions.js, pdf_pages.php, pdf_schema.php, + server_binlog.php, server_variables.php, tbl_change.php, + transformation_overview.php: style upgrade 2006-04-24 Michal Čihař diff --git a/pdf_schema.php b/pdf_schema.php index 2db981a8f4..047d47d8a9 100644 --- a/pdf_schema.php +++ b/pdf_schema.php @@ -1251,7 +1251,6 @@ function PMA_RT_DOC($alltables) $pdf->Ln(); } - $i = 0; $pdf->SetFont('', 'B'); if (isset($orientation) && $orientation == 'L') { $pdf->Cell(25, 8, ucfirst($GLOBALS['strField']), 1, 0, 'C'); @@ -1287,9 +1286,6 @@ function PMA_RT_DOC($alltables) $pdf->SetFont('', ''); while ($row = PMA_DBI_fetch_assoc($result)) { - $bgcolor = ($i % 2) ?$GLOBALS['cfg']['BgcolorOne'] : $GLOBALS['cfg']['BgcolorTwo']; - $i++; - $type = $row['Type']; // reformat mysql query output - staybyte - 9. June 2001 // loic1: set or enum types: slashes single quotes inside options diff --git a/server_binlog.php b/server_binlog.php index 43f26280a7..c51bdc1a89 100644 --- a/server_binlog.php +++ b/server_binlog.php @@ -2,18 +2,18 @@ /* $Id$ */ // vim: expandtab sw=4 ts=4 sts=4: -require_once('./libraries/common.lib.php'); +require_once './libraries/common.lib.php'; /** * Does the common work */ -require_once('./libraries/server_common.inc.php'); +require_once './libraries/server_common.inc.php'; /** * Displays the links */ -require('./libraries/server_links.inc.php'); +require './libraries/server_links.inc.php'; /** @@ -57,14 +57,7 @@ if (!empty($log)) { /** * Sends the query and buffers the result */ -$serverProcesses = array(); -$res = PMA_DBI_query($sql_query); -while ($row = PMA_DBI_fetch_assoc($res)) { - $serverProcesses[] = $row; -} -@PMA_DBI_free_result($res); -unset($res); -unset($row); +$serverProcesses = PMA_DBI_fetch_result($sql_query); PMA_showMessage($GLOBALS['strSuccess']); @@ -74,38 +67,41 @@ PMA_showMessage($GLOBALS['strSuccess']); */ ?> - - - - - - - - - - - + + + + + + + + + + + $GLOBALS['cfg']['LimitChars']) { $value['Info'] = PMA_substr($value['Info'], 0, $GLOBALS['cfg']['LimitChars']) . '...'; } -?> - - - - - - - - - + + + + + + + + + -
<?php echo empty($full) ? $strShowFullQueries : $strTruncateQueries; ?>
            
+ + <?php echo empty($full) ? $strShowFullQueries : $strTruncateQueries; ?>
            
            
diff --git a/server_variables.php b/server_variables.php index ad24ec786d..f3482d587b 100644 --- a/server_variables.php +++ b/server_variables.php @@ -5,18 +5,18 @@ if ( ! defined( 'PMA_NO_VARIABLES_IMPORT' ) ) { define( 'PMA_NO_VARIABLES_IMPORT', true ); } -require_once('./libraries/common.lib.php'); +require_once './libraries/common.lib.php'; /** * Does the common work */ -require('./libraries/server_common.inc.php'); +require './libraries/server_common.inc.php'; /** * Displays the links */ -require('./libraries/server_links.inc.php'); +require './libraries/server_links.inc.php'; /** @@ -60,20 +60,19 @@ if (PMA_MYSQL_INT_VERSION >= 40003) { $value) { ?> $value) { ?> = 40003 - && $serverVarsGlobal[$name] !== $value ) { + && $serverVarsGlobal[$name] !== $value) { ?> () $value) { /** * Sends the footer */ -require_once('./libraries/footer.inc.php'); +require_once './libraries/footer.inc.php'; ?> diff --git a/tbl_change.php b/tbl_change.php index c3c95b597e..70b9c68409 100644 --- a/tbl_change.php +++ b/tbl_change.php @@ -5,10 +5,10 @@ /** * Gets the variables sent or posted to this script and displays the header */ -require_once('./libraries/common.lib.php'); +require_once './libraries/common.lib.php'; /** - * Sets global variables. + * Sets global variables. * Here it's better to use a if, instead of the '?' operator * to avoid setting a variable to '' when it's not present in $_REQUEST */ @@ -36,9 +36,9 @@ if (isset($_REQUEST['sql_query'])) { $js_to_run = 'tbl_change.js'; -require_once('./libraries/header.inc.php'); -require_once('./libraries/relation.lib.php'); // foreign keys -require_once('./libraries/file_listing.php'); // file listing +require_once './libraries/header.inc.php'; +require_once './libraries/relation.lib.php'; // foreign keys +require_once './libraries/file_listing.php'; // file listing /** @@ -93,7 +93,7 @@ if (!preg_match('@^(db_details|tbl_properties|tbl_select|tbl_import)@', $goto)) /** * Ensures db and table are valid, else moves to the "parent" script */ -require_once('./libraries/db_table_exists.lib.php'); +require_once './libraries/db_table_exists.lib.php'; /** @@ -102,15 +102,15 @@ require_once('./libraries/db_table_exists.lib.php'); $url_query = PMA_generate_common_url($db, $table) . '&goto=tbl_properties.php'; -require_once('./libraries/tbl_properties_table_info.inc.php'); +require_once './libraries/tbl_properties_table_info.inc.php'; /* Get comments */ $comments_map = array(); if ($GLOBALS['cfg']['ShowPropertyComments']) { - require_once('./libraries/relation.lib.php'); - require_once('./libraries/transformations.lib.php'); + require_once './libraries/relation.lib.php'; + require_once './libraries/transformations.lib.php'; $cfgRelation = PMA_getRelationsParam(); @@ -122,11 +122,11 @@ if ($GLOBALS['cfg']['ShowPropertyComments']) { /** * Displays top menu links */ -require_once('./libraries/tbl_properties_links.inc.php'); +require_once './libraries/tbl_properties_links.inc.php'; /** - * Get the analysis of SHOW CREATE TABLE for this table + * Get the analysis of SHOW CREATE TABLE for this table */ $show_create_table = PMA_DBI_fetch_value( 'SHOW CREATE TABLE ' . PMA_backquote($db) . '.' . PMA_backquote($table), @@ -176,7 +176,7 @@ if (isset($primary_key)) { unset($sql_query_cpy); } echo "\n"; - require_once('./libraries/footer.inc.php'); + require_once './libraries/footer.inc.php'; } // end if (no record returned) } } else { @@ -318,6 +318,7 @@ foreach ($loop_array AS $vrowcount => $vrow) { // Sets a multiplier used for input-field counts (as zero cannot be used, advance the counter plus one) $m_rows = $o_rows + 1; + $odd_row = true; for ($i = 0; $i < $fields_cnt; $i++) { // Display the submit button after every 15 lines --swix // (wanted to use an and instead, @@ -392,13 +393,11 @@ foreach ($loop_array AS $vrowcount => $vrow) { $field_name = '' . $field_name . ''; } - $bgcolor = ($i % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?> - - align="center" bgcolor=""> - "> + align="center"> + $vrow) { break; } ?> - > + > + $vrow) { if ($cfg['ShowFunctionFields']) { if (($cfg['ProtectBinary'] && $is_blob && !$is_upload) || ($cfg['ProtectBinary'] == 'all' && $is_binary)) { - echo ' ' . $strBinary . '' . "\n"; + echo ' ' . $strBinary . '' . "\n"; } elseif (strstr($row_table_def['True_Type'], 'enum') || strstr($row_table_def['True_Type'], 'set')) { - echo ' --' . "\n"; + echo ' --' . "\n"; } else { ?> - + @@ -628,7 +625,7 @@ foreach ($loop_array AS $vrowcount => $vrow) { - + @@ -640,10 +637,10 @@ foreach ($loop_array AS $vrowcount => $vrow) { unset($disp_row); } elseif ($cfg['LongtextDoubleTextarea'] && strstr($type, 'longtext')) { ?> -   +   - - + + @@ -651,7 +648,7 @@ foreach ($loop_array AS $vrowcount => $vrow) { - + @@ -659,13 +656,13 @@ foreach ($loop_array AS $vrowcount => $vrow) { 32000) { - echo ' ' . $strTextAreaLength . '' . "\n"; + echo ' ' . $strTextAreaLength . '' . "\n"; } } elseif ($type == 'enum') { $enum = PMA_getEnumSetOptions($row_table_def['Type']); $enum_cnt = count($enum); ?> - + $vrow) { $countset = count($set); $size = min(4, $countset); ?> - + @@ -759,7 +756,7 @@ foreach ($loop_array AS $vrowcount => $vrow) { || ($cfg['ProtectBinary'] == 'all' && $is_binary)) { echo "\n"; ?> - + $vrow) { } elseif ($is_blob) { echo "\n"; ?> - + @@ -790,7 +787,7 @@ foreach ($loop_array AS $vrowcount => $vrow) { } echo "\n"; ?> - + ="return unNullify('', '')" tabindex="" id="field__3" /> $vrow) { $fieldsize = 20; $maxlength = 99; } // end if... else... - echo "\n"; ?> - + $vrow) { ="return unNullify('', '')" tabindex="" > ="return unNullify('', '')" tabindex="" id="field__3" /> - - + + - - + + @@ -892,16 +887,14 @@ foreach ($loop_array AS $vrowcount => $vrow) {
'; @@ -970,11 +963,9 @@ if (isset($primary_key)) { - diff --git a/transformation_overview.php b/transformation_overview.php index 18095142a1..6012cab17c 100644 --- a/transformation_overview.php +++ b/transformation_overview.php @@ -10,10 +10,10 @@ define('PMA_DISPLAY_HEADING', 0); /** * Gets some core libraries and displays a top message if required */ -require_once('./libraries/common.lib.php'); -require_once('./libraries/header.inc.php'); -require_once('./libraries/relation.lib.php'); -require_once('./libraries/transformations.lib.php'); +require_once './libraries/common.lib.php'; +require_once './libraries/header.inc.php'; +require_once './libraries/relation.lib.php'; +require_once './libraries/transformations.lib.php'; $cfgRelation = PMA_getRelationsParam(); $types = PMA_getAvailableMIMEtypes(); @@ -21,7 +21,7 @@ $types = PMA_getAvailableMIMEtypes();

$mimetype) { +foreach ($types['mimetype'] as $key => $mimetype) { if (isset($types['empty_mimetype'][$mimetype])) { echo '' . $mimetype . '
'; @@ -39,32 +39,33 @@ foreach ($types['mimetype'] AS $key => $mimetype) {

- - - - - + + + + + + + $transform) { - $i++; +$odd_row = true; +foreach ($types['transformation'] as $key => $transform) { $func = strtolower(preg_replace('@(\.inc\.php3?)$@i', '', $types['transformation_file'][$key])); $desc = 'strTransformation_' . $func; -?> - + ?> + - + - + +
' . sprintf($strMIME_nodescription, 'PMA_transformation_' . $func . '()') . ''); ?>' . sprintf($strMIME_nodescription, 'PMA_transformation_' . $func . '()') . ''); ?>