Little code reorganistaion (RFE #957308), removed some remaining php3 compatibility code in SQL parser.

This commit is contained in:
Michal Čihař
2004-05-20 16:14:13 +00:00
parent f5371237aa
commit 1aaa89fa54
58 changed files with 256 additions and 254 deletions

View File

@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2004-05-20 Michal Čihař <michal@cihar.com>
* many files: Little code reorganistaion (RFE #957308), removed some
remaining php3 compatibility code in SQL parser.
2004-05-20 Marc Delisle <lem9@users.sourceforge.net> 2004-05-20 Marc Delisle <lem9@users.sourceforge.net>
* pdf_schema.php: set contents page (first page)'s orientation * pdf_schema.php: set contents page (first page)'s orientation
to the same asked for the data dictionary to the same asked for the data dictionary

View File

@@ -153,7 +153,7 @@ if (isset($disp_row) && is_array($disp_row)) {
$mysql_key_relrow = array(); $mysql_key_relrow = array();
$mysql_val_relrow = array(); $mysql_val_relrow = array();
$count = 0; $count = 0;
foreach($disp_row AS $disp_row_key => $relrow) { foreach ($disp_row AS $disp_row_key => $relrow) {
if ($foreign_display != FALSE) { if ($foreign_display != FALSE) {
$val = $relrow[$foreign_display]; $val = $relrow[$foreign_display];
} else { } else {

View File

@@ -224,7 +224,7 @@ button.mult_submit {
div.warning { div.warning {
border: 1px solid red; border: 1px solid red;
<?php if($cfg['ErrorIconic']) { ?> <?php if ($cfg['ErrorIconic']) { ?>
background-image: url(../images/s_warn.png); background-image: url(../images/s_warn.png);
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: 10px 50%; background-position: 10px 50%;

View File

@@ -183,7 +183,7 @@ if (!empty($cfg['UploadDir'])) {
// showing UploadDir Error at the end of all option for SQL-Queries // showing UploadDir Error at the end of all option for SQL-Queries
$strErrorUploadDir = ' <tr><td colspan="2"><img src="images/spacer.png" width="1" height="1" border="0" alt="" /></td></tr>' . "\n"; $strErrorUploadDir = ' <tr><td colspan="2"><img src="images/spacer.png" width="1" height="1" border="0" alt="" /></td></tr>' . "\n";
$strErrorUploadDir.= ' <tr><td colspan="2" class="tblHeadError">'; $strErrorUploadDir.= ' <tr><td colspan="2" class="tblHeadError">';
if($cfg['PropertiesIconic']){ if ($cfg['PropertiesIconic']){
$strErrorUploadDir.= '<img src="./images/s_error.png" border="0" width="16" height="16" hspace="2" align="absmiddle" />'; $strErrorUploadDir.= '<img src="./images/s_error.png" border="0" width="16" height="16" hspace="2" align="absmiddle" />';
} }
$strErrorUploadDir.= ' ' . $strError . '' . "\n"; $strErrorUploadDir.= ' ' . $strError . '' . "\n";
@@ -229,13 +229,13 @@ if ($cfg['Bookmark']['db'] && $cfg['Bookmark']['table']) {
echo ' <b>' . $strBookmarkQuery . ':</b>&nbsp;' . "\n"; echo ' <b>' . $strBookmarkQuery . ':</b>&nbsp;' . "\n";
echo ' <select name="id_bookmark">' . "\n"; echo ' <select name="id_bookmark">' . "\n";
echo ' <option value=""></option>' . "\n"; echo ' <option value=""></option>' . "\n";
foreach($bookmark_list AS $key => $value) { foreach ($bookmark_list AS $key => $value) {
echo ' <option value="' . htmlspecialchars($value) . '">' . htmlspecialchars($key) . '</option>' . "\n"; echo ' <option value="' . htmlspecialchars($value) . '">' . htmlspecialchars($key) . '</option>' . "\n";
} }
echo ' </select>' . "\n"; echo ' </select>' . "\n";
echo ' </td></tr><tr bgcolor="' . $cfg['BgcolorOne'] . '"><td colspan="2">'; echo ' </td></tr><tr bgcolor="' . $cfg['BgcolorOne'] . '"><td colspan="2">';
echo ' ' . $strVar . ' '; echo ' ' . $strVar . ' ';
if($cfg['ReplaceHelpImg']){ if ($cfg['ReplaceHelpImg']){
echo '<a href="./Documentation.html#faqbookmark" target="documentation">' echo '<a href="./Documentation.html#faqbookmark" target="documentation">'
. '<img src="./images/b_help.png" border="0" width="11" height="11" align="absmiddle" alt="' . $strDocu . '" /></a>'; . '<img src="./images/b_help.png" border="0" width="11" height="11" align="absmiddle" alt="' . $strDocu . '" /></a>';
}else{ }else{

View File

@@ -64,7 +64,7 @@ if (isset($cfg['docSQLDir']) && !empty($cfg['docSQLDir'])) {
} }
if (isset($lines) && is_array($lines) && count($lines) > 0) { if (isset($lines) && is_array($lines) && count($lines) > 0) {
foreach($lines AS $lkey => $line) { foreach ($lines AS $lkey => $line) {
//echo '<p>' . $line . '</p>'; //echo '<p>' . $line . '</p>';
$inf = explode('|',$line); $inf = explode('|',$line);
if (!empty($inf[1]) && strlen(trim($inf[1])) > 0) { if (!empty($inf[1]) && strlen(trim($inf[1])) > 0) {

View File

@@ -628,7 +628,7 @@ for ($x = 0; $x < $col; $x++) {
<br /> <br />
<select name="TableList[]" size="7" multiple="multiple"> <select name="TableList[]" size="7" multiple="multiple">
<?php <?php
foreach($tbl_names AS $key => $val) { foreach ($tbl_names AS $key => $val) {
echo ' '; echo ' ';
echo '<option value="' . htmlspecialchars($key) . '"' . $val . '>' . htmlspecialchars($key) . '</option>' . "\n"; echo '<option value="' . htmlspecialchars($key) . '"' . $val . '>' . htmlspecialchars($key) . '</option>' . "\n";
} }
@@ -729,7 +729,7 @@ if (isset($Field) && count($Field) > 0) {
$fromclause = ''; $fromclause = '';
// We only start this if we have fields, otherwise it would be dumb // We only start this if we have fields, otherwise it would be dumb
foreach($Field AS $value) { foreach ($Field AS $value) {
$parts = explode('.', $value); $parts = explode('.', $value);
if (!empty($parts[0]) && !empty($parts[1])) { if (!empty($parts[0]) && !empty($parts[1])) {
$tab_raw = urldecode($parts[0]); $tab_raw = urldecode($parts[0]);
@@ -781,7 +781,7 @@ if (isset($Field) && count($Field) > 0) {
// the last db selected is not always the one where we need to work) // the last db selected is not always the one where we need to work)
PMA_DBI_select_db($db); PMA_DBI_select_db($db);
foreach($tab_all AS $tab) { foreach ($tab_all AS $tab) {
$ind_rs = PMA_DBI_query('SHOW INDEX FROM ' . PMA_backquote($tab) . ';'); $ind_rs = PMA_DBI_query('SHOW INDEX FROM ' . PMA_backquote($tab) . ';');
while ($ind = PMA_DBI_fetch_assoc($ind_rs)) { while ($ind = PMA_DBI_fetch_assoc($ind_rs)) {
$col1 = $tab . '.' . $ind['Column_name']; $col1 = $tab . '.' . $ind['Column_name'];
@@ -822,7 +822,7 @@ if (isset($Field) && count($Field) > 0) {
// (that would mean that they were also found in the whereclauses // (that would mean that they were also found in the whereclauses
// which would be great). if yes, we take only those // which would be great). if yes, we take only those
if ($needsort == 1) { if ($needsort == 1) {
foreach($col_cand AS $col => $is_where) { foreach ($col_cand AS $col => $is_where) {
$tab = explode('.', $col); $tab = explode('.', $col);
$tab = $tab[0]; $tab = $tab[0];
if ($is_where == 'Y') { if ($is_where == 'Y') {
@@ -848,7 +848,7 @@ if (isset($Field) && count($Field) > 0) {
if (count($col_cand) > 1) { if (count($col_cand) > 1) {
// Of course we only want to check each table once // Of course we only want to check each table once
$checked_tables = $col_cand; $checked_tables = $col_cand;
foreach($col_cand AS $tab) { foreach ($col_cand AS $tab) {
if ($checked_tables[$tab] != 1 ) { if ($checked_tables[$tab] != 1 ) {
$rows_qry = 'SELECT COUNT(1) AS anz ' $rows_qry = 'SELECT COUNT(1) AS anz '
. 'FROM ' . PMA_backquote($tab); . 'FROM ' . PMA_backquote($tab);
@@ -883,7 +883,7 @@ if (isset($Field) && count($Field) > 0) {
*/ */
function PMA_arrayShort($array, $key) function PMA_arrayShort($array, $key)
{ {
foreach($array AS $k => $v) { foreach ($array AS $k => $v) {
if ($k != $key) { if ($k != $key) {
$reta[$k] = $v; $reta[$k] = $v;
} }
@@ -964,7 +964,7 @@ if (isset($Field) && count($Field) > 0) {
$run++; $run++;
if ($run > 5) { if ($run > 5) {
foreach($tab_left AS $tab) { foreach ($tab_left AS $tab) {
$emerg .= ', ' . $tab; $emerg .= ', ' . $tab;
$tab_left = PMA_arrayShort($tab_left, $tab); $tab_left = PMA_arrayShort($tab_left, $tab);
} }

View File

@@ -272,7 +272,7 @@ else {
$tables = $tables_temp; $tables = $tables_temp;
} }
foreach($tables AS $keyname => $sts_data) { foreach ($tables AS $keyname => $sts_data) {
$table = $sts_data['Name']; $table = $sts_data['Name'];
$table_encoded = urlencode($table); $table_encoded = urlencode($table);
$table_name = htmlspecialchars($table); $table_name = htmlspecialchars($table);
@@ -300,7 +300,7 @@ else {
$click_mouse = ' onmousedown="document.getElementById(\'checkbox_tbl_' . $i . '\').checked = (document.getElementById(\'checkbox_tbl_' . $i . '\').checked ? false : true);" '; $click_mouse = ' onmousedown="document.getElementById(\'checkbox_tbl_' . $i . '\').checked = (document.getElementById(\'checkbox_tbl_' . $i . '\').checked ? false : true);" ';
$row_count++; $row_count++;
if($num_columns > 0 && $num_tables > $num_columns && (($row_count % ($num_columns)) == 0)) { if ($num_columns > 0 && $num_tables > $num_columns && (($row_count % ($num_columns)) == 0)) {
$bgcolor = $cfg['BgcolorTwo']; $bgcolor = $cfg['BgcolorTwo'];
$row_count = 1; $row_count = 1;
?> ?>
@@ -640,14 +640,14 @@ if ($num_tables > 0) {
<table border="0" cellpadding="2" cellspacing="0"> <table border="0" cellpadding="2" cellspacing="0">
<tr><td nowrap="nowrap" colspan="3"><?php <tr><td nowrap="nowrap" colspan="3"><?php
echo '<a href="db_printview.php?' . $url_query . '">'; echo '<a href="db_printview.php?' . $url_query . '">';
if($cfg['PropertiesIconic']){ if ($cfg['PropertiesIconic']){
echo '<img src="./images/b_print.png" border="0" width="16" height="16" hspace="2" align="absmiddle" />'; echo '<img src="./images/b_print.png" border="0" width="16" height="16" hspace="2" align="absmiddle" />';
} }
echo $strPrintView . '</a>'; echo $strPrintView . '</a>';
?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<?php <?php
echo '<a href="./db_datadict.php?' . $url_query . '">'; echo '<a href="./db_datadict.php?' . $url_query . '">';
if($cfg['PropertiesIconic']){ if ($cfg['PropertiesIconic']){
echo '<img src="./images/b_tblanalyse.png" border="0" width="16" height="16" hspace="2" align="absmiddle" />'; echo '<img src="./images/b_tblanalyse.png" border="0" width="16" height="16" hspace="2" align="absmiddle" />';
} }
echo $strDataDict . '</a>'; echo $strDataDict . '</a>';
@@ -662,7 +662,7 @@ if ($num_tables > 0) {
<tr> <tr>
<td class="tblHeaders" colspan="3" nowrap="nowrap"><?php <td class="tblHeaders" colspan="3" nowrap="nowrap"><?php
echo PMA_generate_common_hidden_inputs($db); echo PMA_generate_common_hidden_inputs($db);
if($cfg['PropertiesIconic']){ echo '<img src="images/b_newtbl.png" border="0" width="16" height="16" hspace="2" align="absmiddle" />'; } if ($cfg['PropertiesIconic']){ echo '<img src="images/b_newtbl.png" border="0" width="16" height="16" hspace="2" align="absmiddle" />'; }
// if you want navigation: // if you want navigation:
$strDBLink = '<a href="' . $GLOBALS['cfg']['DefaultTabDatabase'] . '?' . PMA_generate_common_url() . '&amp;db=' . urlencode($GLOBALS['db']) . '">' $strDBLink = '<a href="' . $GLOBALS['cfg']['DefaultTabDatabase'] . '?' . PMA_generate_common_url() . '&amp;db=' . urlencode($GLOBALS['db']) . '">'
. htmlspecialchars($GLOBALS['db']) . '</a>'; . htmlspecialchars($GLOBALS['db']) . '</a>';
@@ -698,7 +698,7 @@ if ($cfgRelation['commwork']) {
<tr> <tr>
<td colspan="3" class="tblHeaders"><?php <td colspan="3" class="tblHeaders"><?php
if($cfg['PropertiesIconic']){ if ($cfg['PropertiesIconic']){
echo '<img src="images/b_comment.png" border="0" width="16" height="16" hspace="2" align="absmiddle" />'; echo '<img src="images/b_comment.png" border="0" width="16" height="16" hspace="2" align="absmiddle" />';
} }
echo $strDBComment; echo $strDBComment;
@@ -718,7 +718,7 @@ if ($cfgRelation['commwork']) {
<!-- Rename database --> <!-- Rename database -->
<tr><td colspan="3"><img src="images/spacer.png" width="1" height="1" border="0" alt="" /></td></tr> <tr><td colspan="3"><img src="images/spacer.png" width="1" height="1" border="0" alt="" /></td></tr>
<tr><td colspan="3" class="tblHeaders"><?php <tr><td colspan="3" class="tblHeaders"><?php
if($cfg['PropertiesIconic']){ if ($cfg['PropertiesIconic']){
echo '<img src="images/b_edit.png" border="0" width="16" height="16" hspace="2" align="absmiddle" />'; echo '<img src="images/b_edit.png" border="0" width="16" height="16" hspace="2" align="absmiddle" />';
} }
echo $strDBRename.':&nbsp;'; echo $strDBRename.':&nbsp;';
@@ -740,7 +740,7 @@ if (PMA_MYSQL_INT_VERSION >= 40101) {
echo ' <!-- Change database charset -->' . "\n" echo ' <!-- Change database charset -->' . "\n"
. ' <tr><td colspan="3"><img src="images/spacer.png" width="1" height="1" border="0" alt="" /></td></tr>' . "\n" . ' <tr><td colspan="3"><img src="images/spacer.png" width="1" height="1" border="0" alt="" /></td></tr>' . "\n"
. ' <tr><td colspan="3" class="tblHeaders">'; . ' <tr><td colspan="3" class="tblHeaders">';
if($cfg['PropertiesIconic']){ if ($cfg['PropertiesIconic']){
echo '<img src="./images/s_asci.png" border="0" width="16" height="16" hspace="2" align="absmiddle" />'; echo '<img src="./images/s_asci.png" border="0" width="16" height="16" hspace="2" align="absmiddle" />';
} }
echo ' <label for="select_db_collation">' . $strCollation . '</label>:&nbsp;' . "\n" echo ' <label for="select_db_collation">' . $strCollation . '</label>:&nbsp;' . "\n"
@@ -760,7 +760,7 @@ if ($num_tables > 0
&& !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == FALSE) { && !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == FALSE) {
echo ' <tr><td colspan="3"><img src="images/spacer.png" width="1" height="1" border="0" alt="" /></td></tr>' . "\n" echo ' <tr><td colspan="3"><img src="images/spacer.png" width="1" height="1" border="0" alt="" /></td></tr>' . "\n"
. ' <tr><td colspan="3" class="tblHeadError">'; . ' <tr><td colspan="3" class="tblHeadError">';
if($cfg['PropertiesIconic']){ if ($cfg['PropertiesIconic']){
echo '<img src="./images/s_error.png" border="0" width="16" height="16" hspace="2" align="absmiddle" />'; echo '<img src="./images/s_error.png" border="0" width="16" height="16" hspace="2" align="absmiddle" />';
} }
echo ' ' . $strError . '' . "\n"; echo ' ' . $strError . '' . "\n";
@@ -789,13 +789,13 @@ if ($cfgRelation['pdfwork'] && $num_tables > 0) {
<!-- Work on PDF Pages --> <!-- Work on PDF Pages -->
<tr><td colspan="3" class="tblHeaders"> <tr><td colspan="3" class="tblHeaders">
<?php <?php
if($cfg['PropertiesIconic']){ if ($cfg['PropertiesIconic']){
echo '<img src="./images/b_pdfdoc.png" border="0" width="16" height="16" hspace="2" align="absmiddle" />'; echo '<img src="./images/b_pdfdoc.png" border="0" width="16" height="16" hspace="2" align="absmiddle" />';
} }
?>PDF</td></tr><tr bgcolor="<?php echo $cfg['BgcolorOne']; ?>"> ?>PDF</td></tr><tr bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
<td colspan="3"><?php <td colspan="3"><?php
echo '<a href="pdf_pages.php?' . $takeaway . '">'; echo '<a href="pdf_pages.php?' . $takeaway . '">';
if($cfg['PropertiesIconic']){ if ($cfg['PropertiesIconic']){
echo '<img src="./images/b_edit.png" border="0" width="16" height="16" hspace="2" align="absmiddle" />'; echo '<img src="./images/b_edit.png" border="0" width="16" height="16" hspace="2" align="absmiddle" />';
} }
echo ''. $strEditPDFPages . '</a>'; echo ''. $strEditPDFPages . '</a>';
@@ -815,7 +815,7 @@ if ($cfgRelation['pdfwork'] && $num_tables > 0) {
<tr bgcolor="<?php echo $cfg['BgcolorTwo']; ?>"><td colspan="3"> <tr bgcolor="<?php echo $cfg['BgcolorTwo']; ?>"><td colspan="3">
<?php <?php
echo PMA_generate_common_hidden_inputs($db); echo PMA_generate_common_hidden_inputs($db);
if($cfg['PropertiesIconic']){ if ($cfg['PropertiesIconic']){
echo '<img src="./images/b_view.png" border="0" width="16" height="16" hspace="2" align="absmiddle" />'; echo '<img src="./images/b_view.png" border="0" width="16" height="16" hspace="2" align="absmiddle" />';
} }
?> ?>
@@ -865,7 +865,7 @@ if ($cfgRelation['pdfwork'] && $num_tables > 0) {
<?php echo $strPaperSize; ?> <?php echo $strPaperSize; ?>
<select name="paper"> <select name="paper">
<?php <?php
foreach($cfg['PDFPageSizes'] AS $key => $val) { foreach ($cfg['PDFPageSizes'] AS $key => $val) {
echo '<option value="' . $val . '"'; echo '<option value="' . $val . '"';
if ($val == $cfg['PDFDefaultPageSize']) { if ($val == $cfg['PDFDefaultPageSize']) {
echo ' selected="selected"'; echo ' selected="selected"';
@@ -894,7 +894,7 @@ if ($num_tables > 0
<!-- import docSQL files --> <!-- import docSQL files -->
<tr bgcolor="<?php echo $cfg['BgcolorOne']; ?>"><td colspan="3"><?php <tr bgcolor="<?php echo $cfg['BgcolorOne']; ?>"><td colspan="3"><?php
echo '<a href="db_details_importdocsql.php?' . $takeaway . '">'; echo '<a href="db_details_importdocsql.php?' . $takeaway . '">';
if($cfg['PropertiesIconic']){ if ($cfg['PropertiesIconic']){
echo '<img src="./images/b_docsql.png" border="0" width="16" height="16" hspace="2" align="absmiddle" />'; echo '<img src="./images/b_docsql.png" border="0" width="16" height="16" hspace="2" align="absmiddle" />';
} }
echo $strImportDocSQL . '</a>'; echo $strImportDocSQL . '</a>';

View File

@@ -119,7 +119,7 @@ else {
</tr> </tr>
<?php <?php
$i = $sum_entries = $sum_size = 0; $i = $sum_entries = $sum_size = 0;
foreach($tables AS $keyname => $sts_data) { foreach ($tables AS $keyname => $sts_data) {
$table = $sts_data['Name']; $table = $sts_data['Name'];
$bgcolor = ($i++ % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; $bgcolor = ($i++ % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
echo "\n"; echo "\n";

View File

@@ -366,7 +366,7 @@ if ($export_type == 'server') {
$tmp_select = '|' . $tmp_select . '|'; $tmp_select = '|' . $tmp_select . '|';
} }
// Walk over databases // Walk over databases
foreach($dblist AS $current_db) { foreach ($dblist AS $current_db) {
if ((isset($tmp_select) && strpos(' ' . $tmp_select, '|' . $current_db . '|')) if ((isset($tmp_select) && strpos(' ' . $tmp_select, '|' . $current_db . '|'))
|| !isset($tmp_select)) { || !isset($tmp_select)) {
if (!PMA_exportDBHeader($current_db)) if (!PMA_exportDBHeader($current_db))

View File

@@ -184,14 +184,14 @@ if (empty($GLOBALS['is_header_sent'])) {
) )
); );
if (isset($GLOBALS['db'])) { if (isset($GLOBALS['db'])) {
if($cfg['PropertiesIconic']){ if ($cfg['PropertiesIconic']){
$host_icon_img='<img src="./images/s_host.png" width="16" height="16" border="0" hspace="2" align="absmiddle" />'; $host_icon_img='<img src="./images/s_host.png" width="16" height="16" border="0" hspace="2" align="absmiddle" />';
} }
echo '<td nowrap="nowrap">Server:&nbsp;</td>' echo '<td nowrap="nowrap">Server:&nbsp;</td>'
. '<td nowrap="nowrap"><b>' . '<td nowrap="nowrap"><b>'
. '<a href="' . $GLOBALS['cfg']['DefaultTabServer'] . $header_url_qry . '">' . $host_icon_img . htmlspecialchars($server_info) . '</a>' . '<a href="' . $GLOBALS['cfg']['DefaultTabServer'] . $header_url_qry . '">' . $host_icon_img . htmlspecialchars($server_info) . '</a>'
. '</b></td>'; . '</b></td>';
if($cfg['PropertiesIconic']){ if ($cfg['PropertiesIconic']){
$db_icon_img='<img src="./images/s_db.png" width="16" height="16" border="0" hspace="2" align="absmiddle" />'; $db_icon_img='<img src="./images/s_db.png" width="16" height="16" border="0" hspace="2" align="absmiddle" />';
} }
echo '<td nowrap="nowrap">&nbsp;&nbsp;&gt;&nbsp;&nbsp;</td>'; echo '<td nowrap="nowrap">&nbsp;&nbsp;&gt;&nbsp;&nbsp;</td>';
@@ -201,7 +201,7 @@ if (empty($GLOBALS['is_header_sent'])) {
. $db_icon_img . htmlspecialchars($GLOBALS['db']) . '</a>' . $db_icon_img . htmlspecialchars($GLOBALS['db']) . '</a>'
. '</b></td>'; . '</b></td>';
if (!empty($GLOBALS['table'])) { if (!empty($GLOBALS['table'])) {
if($cfg['PropertiesIconic']){ if ($cfg['PropertiesIconic']){
$tbl_icon_img='<img src="./images/s_tbl.png" width="16" height="16" border="0" hspace="2" align="absmiddle" />'; $tbl_icon_img='<img src="./images/s_tbl.png" width="16" height="16" border="0" hspace="2" align="absmiddle" />';
} }
echo '<td nowrap="nowrap">&nbsp;&nbsp;&gt;&nbsp;&nbsp;</td>'; echo '<td nowrap="nowrap">&nbsp;&nbsp;&gt;&nbsp;&nbsp;</td>';
@@ -213,7 +213,7 @@ if (empty($GLOBALS['is_header_sent'])) {
} }
} else { } else {
if($cfg['PropertiesIconic']){ if ($cfg['PropertiesIconic']){
$host_icon_img='<img src="./images/s_host.png" width="16" height="16" border="0" hspace="2" align="absmiddle" />'; $host_icon_img='<img src="./images/s_host.png" width="16" height="16" border="0" hspace="2" align="absmiddle" />';
} }
echo '<tr><td nowrap="nowrap">Server:&nbsp;</td>' echo '<tr><td nowrap="nowrap">Server:&nbsp;</td>'

View File

@@ -114,7 +114,7 @@ function PMA_nestedSetHeader($baseid, $tablestack, $keyhistory, $indent, $indent
$indent++; $indent++;
} }
foreach($tablestack AS $key => $val) { foreach ($tablestack AS $key => $val) {
if ($key != 'pma_name' && $key != 'pma_list_item') { if ($key != 'pma_name' && $key != 'pma_list_item') {
if ($headerOut) { if ($headerOut) {
PMA_nestedSetHeaderParent($baseid, $key, $keyhistory, $indent, $indent_level, $val); PMA_nestedSetHeaderParent($baseid, $key, $keyhistory, $indent, $indent_level, $val);
@@ -164,11 +164,11 @@ function PMA_nestedSet($baseid, $tablestack, $key = '__protected__', $keyhistory
$on_mouse = (($GLOBALS['cfg']['LeftPointerColor'] == '') ? '' : ' onmouseover="if (isDOM || isIE4) {hilightBase(\'el' . $keyhistory . $key . '\', \'' . $GLOBALS['cfg']['LeftPointerColor'] . '\')}" onmouseout="if (isDOM || isIE4) {hilightBase(\'el' . $keyhistory . $key . '\', \'' . $GLOBALS['cfg']['LeftBgColor'] . '\')}"'); $on_mouse = (($GLOBALS['cfg']['LeftPointerColor'] == '') ? '' : ' onmouseover="if (isDOM || isIE4) {hilightBase(\'el' . $keyhistory . $key . '\', \'' . $GLOBALS['cfg']['LeftPointerColor'] . '\')}" onmouseout="if (isDOM || isIE4) {hilightBase(\'el' . $keyhistory . $key . '\', \'' . $GLOBALS['cfg']['LeftBgColor'] . '\')}"');
$loops = 0; $loops = 0;
foreach($tablestack['pma_name'] AS $tkey => $tval) { foreach ($tablestack['pma_name'] AS $tkey => $tval) {
echo PMA_indent($indent * 5) . '<img src="images/spacer.gif" border="0" width="' . (($indent+$extra_indent) * $indent_level) . '" height="9" alt="" />'; echo PMA_indent($indent * 5) . '<img src="images/spacer.gif" border="0" width="' . (($indent+$extra_indent) * $indent_level) . '" height="9" alt="" />';
$items = explode("\n", $tablestack['pma_list_item'][$tkey]); $items = explode("\n", $tablestack['pma_list_item'][$tkey]);
foreach($items AS $ikey => $ival) { foreach ($items AS $ikey => $ival) {
echo "\n"; echo "\n";
echo PMA_indent(($indent * 5)) . $ival; echo PMA_indent(($indent * 5)) . $ival;
} }
@@ -345,7 +345,7 @@ if ($cfg['LeftDisplayServers']) {
<?php <?php
} }
foreach($cfg['Servers'] AS $key => $val) { foreach ($cfg['Servers'] AS $key => $val) {
if (!empty($val['host'])) { if (!empty($val['host'])) {
$selected = 0; $selected = 0;
@@ -548,7 +548,7 @@ if ($num_dbs > 1) {
natcasesort($table_array); natcasesort($table_array);
} }
foreach($table_array as $table => $table_sortkey) { foreach ($table_array as $table => $table_sortkey) {
$alias = (!empty($tooltip_name) && isset($tooltip_name[$table])) $alias = (!empty($tooltip_name) && isset($tooltip_name[$table]))
? htmlspecialchars($tooltip_name[$table]) ? htmlspecialchars($tooltip_name[$table])
: ''; : '';
@@ -574,7 +574,7 @@ if ($num_dbs > 1) {
if (!empty($cfg['LeftFrameTableSeparator'])) { if (!empty($cfg['LeftFrameTableSeparator'])) {
$_table = explode($cfg['LeftFrameTableSeparator'], str_replace('\'', '\\\'', $tablename)); $_table = explode($cfg['LeftFrameTableSeparator'], str_replace('\'', '\\\'', $tablename));
if (is_array($_table)) { if (is_array($_table)) {
foreach($_table AS $key => $val) { foreach ($_table AS $key => $val) {
if ($val == '') { if ($val == '') {
$_table[$key] = '__protected__'; $_table[$key] = '__protected__';
} }
@@ -644,7 +644,7 @@ if ($num_dbs > 1) {
natsort($table_title); natsort($table_title);
} }
foreach($table_title as $each_key => $each_val) { foreach ($table_title as $each_key => $each_val) {
$table_list .= ' ' . $table_array[$each_key]; $table_list .= ' ' . $table_array[$each_key];
} }
} else { } else {
@@ -801,7 +801,7 @@ else if ($num_dbs == 1) {
natcasesort($table_array); natcasesort($table_array);
} }
foreach($table_array as $table => $table_sortkey) { foreach ($table_array as $table => $table_sortkey) {
$alias = (!empty($tooltip_name) && isset($tooltip_name[$table])) $alias = (!empty($tooltip_name) && isset($tooltip_name[$table]))
? htmlspecialchars($tooltip_name[$table]) ? htmlspecialchars($tooltip_name[$table])
: ''; : '';
@@ -836,7 +836,7 @@ else if ($num_dbs == 1) {
if (!empty($cfg['LeftFrameTableSeparator'])) { if (!empty($cfg['LeftFrameTableSeparator'])) {
$_table = explode($cfg['LeftFrameTableSeparator'], str_replace('\'', '\\\'', $tablename)); $_table = explode($cfg['LeftFrameTableSeparator'], str_replace('\'', '\\\'', $tablename));
if (is_array($_table)) { if (is_array($_table)) {
foreach($_table AS $key => $val) { foreach ($_table AS $key => $val) {
if ($val == '') { if ($val == '') {
$_table[$key] = '__protected__'; $_table[$key] = '__protected__';
} }

View File

@@ -234,7 +234,7 @@ if (top != self) {
echo "\n"; echo "\n";
uasort($available_languages, 'PMA_cookie_cmp'); uasort($available_languages, 'PMA_cookie_cmp');
foreach($available_languages AS $id => $tmplang) { foreach ($available_languages AS $id => $tmplang) {
$lang_name = ucfirst(substr(strstr($tmplang[0], '|'), 1)); $lang_name = ucfirst(substr(strstr($tmplang[0], '|'), 1));
if ($lang == $id) { if ($lang == $id) {
$selected = ' selected="selected"'; $selected = ' selected="selected"';
@@ -311,7 +311,7 @@ if (top != self) {
<?php <?php
echo "\n"; echo "\n";
// Displays the MySQL servers choice // Displays the MySQL servers choice
foreach($cfg['Servers'] AS $key => $val) { foreach ($cfg['Servers'] AS $key => $val) {
if (!empty($val['host']) || $val['auth_type'] == 'arbitrary') { if (!empty($val['host']) || $val['auth_type'] == 'arbitrary') {
echo ' <option value="' . $key . '"'; echo ' <option value="' . $key . '"';
if (!empty($server) && ($server == $key)) { if (!empty($server) && ($server == $key)) {

View File

@@ -144,7 +144,7 @@ function PMA_convert_display_charset($what) {
} }
else if (is_array($what)) { else if (is_array($what)) {
$result = array(); $result = array();
foreach($what AS $key => $val) { foreach ($what AS $key => $val) {
if (is_string($val) || is_array($val)) { if (is_string($val) || is_array($val)) {
if (is_string($key)) { if (is_string($key)) {
$result[PMA_convert_display_charset($key)] = PMA_convert_display_charset($val); $result[PMA_convert_display_charset($key)] = PMA_convert_display_charset($val);

View File

@@ -436,28 +436,28 @@ if ($is_minimum_common == FALSE) {
if (!empty($GLOBALS['cfg']['MySQLManualType'])) { if (!empty($GLOBALS['cfg']['MySQLManualType'])) {
switch ($GLOBALS['cfg']['MySQLManualType']) { switch ($GLOBALS['cfg']['MySQLManualType']) {
case 'old': case 'old':
if($GLOBALS['cfg']['ReplaceHelpImg']){ if ($GLOBALS['cfg']['ReplaceHelpImg']){
return '<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '/' . $link[0] . '/' . $link[1] . '/' . $link . '.html" target="mysql_doc"><img src="images/b_help.png" width="11" height="11" border="0" alt="' . $GLOBALS['strDocu'] . '" hspace="2" align="absmiddle"></a>'; }else{ return '<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '/' . $link[0] . '/' . $link[1] . '/' . $link . '.html" target="mysql_doc"><img src="images/b_help.png" width="11" height="11" border="0" alt="' . $GLOBALS['strDocu'] . '" hspace="2" align="absmiddle"></a>'; }else{
return '[<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '/' . $link[0] . '/' . $link[1] . '/' . $link . '.html" target="mysql_doc">' . $GLOBALS['strDocu'] . '</a>]'; } return '[<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '/' . $link[0] . '/' . $link[1] . '/' . $link . '.html" target="mysql_doc">' . $GLOBALS['strDocu'] . '</a>]'; }
case 'chapters': case 'chapters':
if($GLOBALS['cfg']['ReplaceHelpImg']){ if ($GLOBALS['cfg']['ReplaceHelpImg']){
return '<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '/manual_' . $chapter . '.html#' . $link . '" target="mysql_doc"><img src="images/b_help.png" width="11" height="11" border="0" alt="' . $GLOBALS['strDocu'] . '" hspace="2" align="absmiddle"></a>'; }else{ return '<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '/manual_' . $chapter . '.html#' . $link . '" target="mysql_doc"><img src="images/b_help.png" width="11" height="11" border="0" alt="' . $GLOBALS['strDocu'] . '" hspace="2" align="absmiddle"></a>'; }else{
return '[<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '/manual_' . $chapter . '.html#' . $link . '" target="mysql_doc">' . $GLOBALS['strDocu'] . '</a>]'; } return '[<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '/manual_' . $chapter . '.html#' . $link . '" target="mysql_doc">' . $GLOBALS['strDocu'] . '</a>]'; }
case 'big': case 'big':
if($GLOBALS['cfg']['ReplaceHelpImg']){ if ($GLOBALS['cfg']['ReplaceHelpImg']){
return '<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '#' . $link . '" target="mysql_doc"><img src="images/b_help.png" width="11" height="11" border="0" alt="' . $GLOBALS['strDocu'] . '" hspace="2" align="absmiddle"></a>'; }else{ return '<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '#' . $link . '" target="mysql_doc"><img src="images/b_help.png" width="11" height="11" border="0" alt="' . $GLOBALS['strDocu'] . '" hspace="2" align="absmiddle"></a>'; }else{
return '[<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '#' . $link . '" target="mysql_doc">' . $GLOBALS['strDocu'] . '</a>]'; } return '[<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '#' . $link . '" target="mysql_doc">' . $GLOBALS['strDocu'] . '</a>]'; }
case 'none': case 'none':
return ''; return '';
case 'searchable': case 'searchable':
default: default:
if($GLOBALS['cfg']['ReplaceHelpImg']){ if ($GLOBALS['cfg']['ReplaceHelpImg']){
return '<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '/' . $link . '.html" target="mysql_doc"><img src="images/b_help.png" width="11" height="11" border="0" alt="' . $GLOBALS['strDocu'] . '" hspace="2" align="absmiddle"></a>'; }else{ return '<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '/' . $link . '.html" target="mysql_doc"><img src="images/b_help.png" width="11" height="11" border="0" alt="' . $GLOBALS['strDocu'] . '" hspace="2" align="absmiddle"></a>'; }else{
return '[<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '/' . $link . '.html" target="mysql_doc">' . $GLOBALS['strDocu'] . '</a>]'; } return '[<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '/' . $link . '.html" target="mysql_doc">' . $GLOBALS['strDocu'] . '</a>]'; }
} }
} else { } else {
// no Type defined, show the old one // no Type defined, show the old one
if($GLOBALS['cfg']['ReplaceHelpImg']){ if ($GLOBALS['cfg']['ReplaceHelpImg']){
return '<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '/' . $link[0] . '/' . $link[1] . '/' . $link . '.html" target="mysql_doc"><img src="images/b_help.png" width="11" height="11" border="0" alt="' . $GLOBALS['strDocu'] . '" hspace="2" align="absmiddle"></a>'; }else{ return '<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '/' . $link[0] . '/' . $link[1] . '/' . $link . '.html" target="mysql_doc"><img src="images/b_help.png" width="11" height="11" border="0" alt="' . $GLOBALS['strDocu'] . '" hspace="2" align="absmiddle"></a>'; }else{
return '[<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '/' . $link[0] . '/' . $link[1] . '/' . $link . '.html" target="mysql_doc">' . $GLOBALS['strDocu'] . '</a>]'; } return '[<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '/' . $link[0] . '/' . $link[1] . '/' . $link . '.html" target="mysql_doc">' . $GLOBALS['strDocu'] . '</a>]'; }
} }
@@ -465,7 +465,7 @@ if ($is_minimum_common == FALSE) {
// no URL defined // no URL defined
if (!empty($GLOBALS['cfg']['ManualBaseShort'])) { if (!empty($GLOBALS['cfg']['ManualBaseShort'])) {
// the old configuration // the old configuration
if($GLOBALS['cfg']['ReplaceHelpImg']){ if ($GLOBALS['cfg']['ReplaceHelpImg']){
return '<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '/' . $link[0] . '/' . $link[1] . '/' . $link . '.html" target="mysql_doc"><img src="images/b_help.png" width="11" height="11" border="0" alt="' . $GLOBALS['strDocu'] . '" hspace="2" align="absmiddle"></a>'; }else{ return '<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '/' . $link[0] . '/' . $link[1] . '/' . $link . '.html" target="mysql_doc"><img src="images/b_help.png" width="11" height="11" border="0" alt="' . $GLOBALS['strDocu'] . '" hspace="2" align="absmiddle"></a>'; }else{
return '[<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '/' . $link[0] . '/' . $link[1] . '/' . $link . '.html" target="mysql_doc">' . $GLOBALS['strDocu'] . '</a>]'; } return '[<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '/' . $link[0] . '/' . $link[1] . '/' . $link . '.html" target="mysql_doc">' . $GLOBALS['strDocu'] . '</a>]'; }
} else { } else {
@@ -685,7 +685,7 @@ function PMA_safe_db_list($only_db_check, $dbh, $dblist_cnt, $rs, $userlink, $cf
$dblist[] = $uva_db; $dblist[] = $uva_db;
$uva_mydbs[$uva_db] = 0; $uva_mydbs[$uva_db] = 0;
} else if (!isset($dblist[$uva_db])) { } else if (!isset($dblist[$uva_db])) {
foreach($uva_mydbs AS $uva_matchpattern => $uva_value) { foreach ($uva_mydbs AS $uva_matchpattern => $uva_value) {
// loic1: fixed bad regexp // loic1: fixed bad regexp
// TODO: db names may contain characters // TODO: db names may contain characters
// that are regexp instructions // that are regexp instructions
@@ -912,7 +912,7 @@ if ($is_minimum_common == FALSE) {
/** /**
* Gets the valid servers list and parameters * Gets the valid servers list and parameters
*/ */
foreach($cfg['Servers'] AS $key => $val) { foreach ($cfg['Servers'] AS $key => $val) {
// Don't use servers with no hostname // Don't use servers with no hostname
if ( ($val['connect_type'] == 'tcp') && empty($val['host'])) { if ( ($val['connect_type'] == 'tcp') && empty($val['host'])) {
unset($cfg['Servers'][$key]); unset($cfg['Servers'][$key]);
@@ -1070,7 +1070,7 @@ if ($is_minimum_common == FALSE) {
if ($dblist[$i] == '*' && $dblist_asterisk_bool == FALSE) { if ($dblist[$i] == '*' && $dblist_asterisk_bool == FALSE) {
$dblist_asterisk_bool = TRUE; $dblist_asterisk_bool = TRUE;
$dblist_full = PMA_safe_db_list(FALSE, $dbh, FALSE, $rs, $userlink, $cfg, $dblist); $dblist_full = PMA_safe_db_list(FALSE, $dbh, FALSE, $rs, $userlink, $cfg, $dblist);
foreach($dblist_full AS $dbl_key => $dbl_val) { foreach ($dblist_full AS $dbl_key => $dbl_val) {
if (!in_array($dbl_val, $dblist)) { if (!in_array($dbl_val, $dblist)) {
$true_dblist[] = $dbl_val; $true_dblist[] = $dbl_val;
} }
@@ -1228,7 +1228,7 @@ if ($is_minimum_common == FALSE) {
if (is_array($a_name)) { if (is_array($a_name)) {
$result = array(); $result = array();
foreach($a_name AS $key => $val) { foreach ($a_name AS $key => $val) {
$result[$key] = '`' . $val . '`'; $result[$key] = '`' . $val . '`';
} }
return $result; return $result;
@@ -1516,7 +1516,7 @@ if (typeof(document.getElementById) != 'undefined'
} else { } else {
$explain_link = ''; $explain_link = '';
} }
if(!empty($explain_link)) { if (!empty($explain_link)) {
$explain_link .= '</a>]'; $explain_link .= '</a>]';
} }
} else { } else {
@@ -1800,7 +1800,7 @@ if (typeof(document.getElementById) != 'undefined'
$link_or_button = ' <form action="' $link_or_button = ' <form action="'
. $edit_url_parts['path'] . $edit_url_parts['path']
. '" method="post">' . "\n"; . '" method="post">' . "\n";
foreach($query_parts AS $query_pair) { foreach ($query_parts AS $query_pair) {
list($eachvar, $eachval) = explode('=', $query_pair); list($eachvar, $eachval) = explode('=', $query_pair);
$link_or_button .= ' <input type="hidden" name="' . str_replace('amp;', '', $eachvar) . '" value="' . htmlspecialchars(urldecode($eachval)) . '" />' . "\n"; $link_or_button .= ' <input type="hidden" name="' . str_replace('amp;', '', $eachvar) . '" value="' . htmlspecialchars(urldecode($eachval)) . '" />' . "\n";
} // end while } // end while
@@ -1910,7 +1910,7 @@ if (typeof(document.getElementById) != 'undefined'
$found_error = FALSE; $found_error = FALSE;
$error_message = ''; $error_message = '';
foreach($params AS $param) { foreach ($params AS $param) {
if (!isset($GLOBALS[$param])) { if (!isset($GLOBALS[$param])) {
$error_message .= $reported_script_name . ': Missing ' . $param . '<br />'; $error_message .= $reported_script_name . ': Missing ' . $param . '<br />';
$found_error = TRUE; $found_error = TRUE;
@@ -1986,7 +1986,7 @@ if (typeof(document.getElementById) != 'undefined'
// do not use an alias in a condition // do not use an alias in a condition
$column_for_condition = $meta->name; $column_for_condition = $meta->name;
if (isset($analyzed_sql[0]['select_expr']) && is_array($analyzed_sql[0]['select_expr'])) { if (isset($analyzed_sql[0]['select_expr']) && is_array($analyzed_sql[0]['select_expr'])) {
foreach($analyzed_sql[0]['select_expr'] AS $select_expr_position => $select_expr) { foreach ($analyzed_sql[0]['select_expr'] AS $select_expr_position => $select_expr) {
$alias = $analyzed_sql[0]['select_expr'][$select_expr_position]['alias']; $alias = $analyzed_sql[0]['select_expr'][$select_expr_position]['alias'];
if (!empty($alias)) { if (!empty($alias)) {
$true_column = $analyzed_sql[0]['select_expr'][$select_expr_position]['column']; $true_column = $analyzed_sql[0]['select_expr'][$select_expr_position]['column'];

View File

@@ -22,14 +22,14 @@
*/ */
function obj2xml($v, $indent = '') { function obj2xml($v, $indent = '') {
$attr = ''; $attr = '';
foreach($v AS $key => $val) { foreach ($v AS $key => $val) {
if (is_string($key) && ($key == '__attr')) { if (is_string($key) && ($key == '__attr')) {
continue; continue;
} }
// Check for __attr // Check for __attr
if (is_object($val->__attr)) { if (is_object($val->__attr)) {
foreach($val->__attr AS $key2 => $val2) { foreach ($val->__attr AS $key2 => $val2) {
$attr .= " $key2=\"$val2\""; $attr .= " $key2=\"$val2\"";
} }
} else { } else {

View File

@@ -34,7 +34,7 @@ if (isset($GLOBALS['DBG']) && $GLOBALS['DBG']
'<td>' . $GLOBALS['strDBGContext'] . '</td>' . "\n" . '<td>' . $GLOBALS['strDBGContext'] . '</td>' . "\n" .
'</tr></thead>' . "\n" . '</tr></thead>' . "\n" .
'<tbody style="vertical-align: top">' . "\n"; '<tbody style="vertical-align: top">' . "\n";
foreach($dbg_prof_results['line_no'] AS $idx => $line_no) { foreach ($dbg_prof_results['line_no'] AS $idx => $line_no) {
$mod_no = $dbg_prof_results['mod_no'][$idx]; $mod_no = $dbg_prof_results['mod_no'][$idx];
dbg_get_module_name($mod_no, &$mod_name); dbg_get_module_name($mod_no, &$mod_name);
@@ -64,7 +64,7 @@ if (isset($GLOBALS['DBG']) && $GLOBALS['DBG']
if (($idx & 1) == 0) if (($idx & 1) == 0)
$bk = "#e0e0e0"; $bk = "#e0e0e0";
if($time_avg_hit > $GLOBALS['cfg']['DBG']['profile']['threshold'] ) { if ($time_avg_hit > $GLOBALS['cfg']['DBG']['profile']['threshold'] ) {
echo '<tr style="background:' . $bk . '">' . echo '<tr style="background:' . $bk . '">' .
'<td>' . $mod_name . '</td>' . '<td>' . $mod_name . '</td>' .
'<td>' . $line_no . '</td>' . '<td>' . $line_no . '</td>' .

View File

@@ -149,7 +149,7 @@ function PMA_mysql_fetch_array($result, $type = FALSE) {
$ret = array(); $ret = array();
$num = mysql_num_fields($result); $num = mysql_num_fields($result);
$i = 0; $i = 0;
for($i = 0; $i < $num; $i++) { for ($i = 0; $i < $num; $i++) {
$name = mysql_field_name($result, $i); $name = mysql_field_name($result, $i);
$flags = mysql_field_flags($result, $i); $flags = mysql_field_flags($result, $i);
/* Field is BINARY (either marked manually, or it is BLOB) => do not convert it */ /* Field is BINARY (either marked manually, or it is BLOB) => do not convert it */

View File

@@ -135,7 +135,7 @@ function PMA_mysqli_fetch_array($result, $type = FALSE) {
$num = mysqli_num_fields($result); $num = mysqli_num_fields($result);
$fields = mysqli_fetch_fields($result); $fields = mysqli_fetch_fields($result);
$i = 0; $i = 0;
for($i = 0; $i < $num; $i++) { for ($i = 0; $i < $num; $i++) {
if (!$meta) { if (!$meta) {
/* No meta information available -> we guess that it should be converted */ /* No meta information available -> we guess that it should be converted */
if (isset($data[$i])) $ret[$i] = PMA_convert_display_charset($data[$i]); if (isset($data[$i])) $ret[$i] = PMA_convert_display_charset($data[$i]);
@@ -255,7 +255,7 @@ function PMA_DBI_get_fields_meta($result) {
$typeAr[MYSQLI_TYPE_GEOMETRY] = 'unknown'; $typeAr[MYSQLI_TYPE_GEOMETRY] = 'unknown';
$fields = mysqli_fetch_fields($result); $fields = mysqli_fetch_fields($result);
foreach($fields as $k => $field) { foreach ($fields as $k => $field) {
$fields[$k]->type = $typeAr[$fields[$k]->type]; $fields[$k]->type = $typeAr[$fields[$k]->type];
$fields[$k]->flags = PMA_DBI_field_flags($result, $k); $fields[$k]->flags = PMA_DBI_field_flags($result, $k);

View File

@@ -101,22 +101,22 @@ if (isset($sql_query)) {
<?php if (!$hide_sql) { ?> <?php if (!$hide_sql) { ?>
<!-- SQL --> <!-- SQL -->
<input type="radio" name="what" value="sql" id="radio_dump_sql" onclick="if(this.checked) { hide_them_all(); getElement('sql_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'sql'); ?> /> <input type="radio" name="what" value="sql" id="radio_dump_sql" onclick="if (this.checked) { hide_them_all(); getElement('sql_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'sql'); ?> />
<label for="radio_dump_sql"><?php echo $strSQL; ?></label> <label for="radio_dump_sql"><?php echo $strSQL; ?></label>
<br /><br /> <br /><br />
<?php } ?> <?php } ?>
<!-- LaTeX table --> <!-- LaTeX table -->
<input type="radio" name="what" value="latex" id="radio_dump_latex" onclick="if(this.checked) { hide_them_all(); getElement('latex_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'latex'); ?> /> <input type="radio" name="what" value="latex" id="radio_dump_latex" onclick="if (this.checked) { hide_them_all(); getElement('latex_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'latex'); ?> />
<label for="radio_dump_latex"><?php echo $strLaTeX; ?></label> <label for="radio_dump_latex"><?php echo $strLaTeX; ?></label>
<br /><br /> <br /><br />
<!-- Excel CSV --> <!-- Excel CSV -->
<input type="radio" name="what" value="excel" id="radio_dump_excel" onclick="if(this.checked) { hide_them_all(); getElement('excel_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'excel'); ?> /> <input type="radio" name="what" value="excel" id="radio_dump_excel" onclick="if (this.checked) { hide_them_all(); getElement('excel_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'excel'); ?> />
<label for="radio_dump_excel"><?php echo $strStrucExcelCSV; ?></label> <label for="radio_dump_excel"><?php echo $strStrucExcelCSV; ?></label>
<br /><br /> <br /><br />
<!-- General CSV --> <!-- General CSV -->
<input type="radio" name="what" value="csv" id="radio_dump_csv" onclick="if(this.checked) { hide_them_all(); getElement('csv_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'csv'); ?> /> <input type="radio" name="what" value="csv" id="radio_dump_csv" onclick="if (this.checked) { hide_them_all(); getElement('csv_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'csv'); ?> />
<label for="radio_dump_csv"><?php echo $strStrucCSV;?></label> <label for="radio_dump_csv"><?php echo $strStrucCSV;?></label>
@@ -124,7 +124,7 @@ if (isset($sql_query)) {
<br /><br /> <br /><br />
<!-- XML --> <!-- XML -->
<input type="radio" name="what" value="xml" id="radio_dump_xml" onclick="if(this.checked) { hide_them_all(); getElement('none_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'xml'); ?> /> <input type="radio" name="what" value="xml" id="radio_dump_xml" onclick="if (this.checked) { hide_them_all(); getElement('none_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'xml'); ?> />
<label for="radio_dump_xml"><?php echo $strXML; ?></label>&nbsp;&nbsp; <label for="radio_dump_xml"><?php echo $strXML; ?></label>&nbsp;&nbsp;
<?php } ?> <?php } ?>
</fieldset> </fieldset>
@@ -159,7 +159,7 @@ if ($export_type == 'server') {
<!-- For structure --> <!-- For structure -->
<fieldset> <fieldset>
<legend> <legend>
<input type="checkbox" name="sql_structure" value="structure" id="checkbox_sql_structure" <?php PMA_exportCheckboxCheck('sql_structure'); ?> onclick="if(!this.checked &amp;&amp; !getElement('checkbox_sql_data').checked) return false; else return true;" /> <input type="checkbox" name="sql_structure" value="structure" id="checkbox_sql_structure" <?php PMA_exportCheckboxCheck('sql_structure'); ?> onclick="if (!this.checked &amp;&amp; !getElement('checkbox_sql_data').checked) return false; else return true;" />
<label for="checkbox_sql_structure"><?php echo $strStructure; ?></label><br /> <label for="checkbox_sql_structure"><?php echo $strStructure; ?></label><br />
</legend> </legend>
@@ -207,7 +207,7 @@ if ($cfgRelation['mimework']) {
<!-- For data --> <!-- For data -->
<fieldset> <fieldset>
<legend> <legend>
<input type="checkbox" name="sql_data" value="data" id="checkbox_sql_data" <?php PMA_exportCheckboxCheck('sql_data'); ?> onclick="if(!this.checked &amp;&amp; (!getElement('checkbox_sql_structure') || !getElement('checkbox_sql_structure').checked)) return false; else return true;" /> <input type="checkbox" name="sql_data" value="data" id="checkbox_sql_data" <?php PMA_exportCheckboxCheck('sql_data'); ?> onclick="if (!this.checked &amp;&amp; (!getElement('checkbox_sql_structure') || !getElement('checkbox_sql_structure').checked)) return false; else return true;" />
<label for="checkbox_sql_data"><?php echo $strData; ?></label><br /> <label for="checkbox_sql_data"><?php echo $strData; ?></label><br />
</legend> </legend>
<input type="checkbox" name="showcolumns" value="yes" id="checkbox_dump_showcolumns" <?php PMA_exportCheckboxCheck('sql_columns'); ?> /> <input type="checkbox" name="showcolumns" value="yes" id="checkbox_dump_showcolumns" <?php PMA_exportCheckboxCheck('sql_columns'); ?> />
@@ -245,7 +245,7 @@ if ($cfgRelation['mimework']) {
<!-- For structure --> <!-- For structure -->
<fieldset> <fieldset>
<legend> <legend>
<input type="checkbox" name="latex_structure" value="structure" id="checkbox_latex_structure" <?php PMA_exportCheckboxCheck('latex_structure'); ?> onclick="if(!this.checked &amp;&amp; !getElement('checkbox_latex_data').checked) return false; else return true;" /> <input type="checkbox" name="latex_structure" value="structure" id="checkbox_latex_structure" <?php PMA_exportCheckboxCheck('latex_structure'); ?> onclick="if (!this.checked &amp;&amp; !getElement('checkbox_latex_data').checked) return false; else return true;" />
<label for="checkbox_latex_structure"><?php echo $strStructure; ?></label><br /> <label for="checkbox_latex_structure"><?php echo $strStructure; ?></label><br />
</legend> </legend>
<table border="0" cellspacing="1" cellpadding="0"> <table border="0" cellspacing="1" cellpadding="0">
@@ -302,7 +302,7 @@ if ($cfgRelation['mimework']) {
<!-- For data --> <!-- For data -->
<fieldset> <fieldset>
<legend> <legend>
<input type="checkbox" name="latex_data" value="data" id="checkbox_latex_data" <?php PMA_exportCheckboxCheck('latex_data'); ?> onclick="if(!this.checked &amp;&amp; (!getElement('checkbox_latex_structure') || !getElement('checkbox_latex_structure').checked)) return false; else return true;" /> <input type="checkbox" name="latex_data" value="data" id="checkbox_latex_data" <?php PMA_exportCheckboxCheck('latex_data'); ?> onclick="if (!this.checked &amp;&amp; (!getElement('checkbox_latex_structure') || !getElement('checkbox_latex_structure').checked)) return false; else return true;" />
<label for="checkbox_latex_data"><?php echo $strData; ?></label><br /> <label for="checkbox_latex_data"><?php echo $strData; ?></label><br />
</legend> </legend>
<input type="checkbox" name="latex_showcolumns" value="yes" id="ch_latex_showcolumns" <?php PMA_exportCheckboxCheck('latex_columns'); ?> /> <input type="checkbox" name="latex_showcolumns" value="yes" id="ch_latex_showcolumns" <?php PMA_exportCheckboxCheck('latex_columns'); ?> />

View File

@@ -548,10 +548,10 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
echo $GLOBALS['strSortByKey'] . ': <select name="sql_query">' . "\n"; echo $GLOBALS['strSortByKey'] . ': <select name="sql_query">' . "\n";
$used_index = false; $used_index = false;
$local_order = (isset($sort_expression) ? $sort_expression : ''); $local_order = (isset($sort_expression) ? $sort_expression : '');
foreach($indexes_data AS $key => $val) { foreach ($indexes_data AS $key => $val) {
$asc_sort = ''; $asc_sort = '';
$desc_sort = ''; $desc_sort = '';
foreach($val AS $key2 => $val2) { foreach ($val AS $key2 => $val2) {
$asc_sort .= PMA_backquote($val2['Column_name']) . ' ASC , '; $asc_sort .= PMA_backquote($val2['Column_name']) . ' ASC , ';
$desc_sort .= PMA_backquote($val2['Column_name']) . ' DESC , '; $desc_sort .= PMA_backquote($val2['Column_name']) . ' DESC , ';
} }
@@ -725,7 +725,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
$wi = 0; $wi = 0;
if (isset($analyzed_sql[0]['where_clause_identifiers']) && is_array($analyzed_sql[0]['where_clause_identifiers'])) { if (isset($analyzed_sql[0]['where_clause_identifiers']) && is_array($analyzed_sql[0]['where_clause_identifiers'])) {
foreach($analyzed_sql[0]['where_clause_identifiers'] AS $wci_nr => $wci) { foreach ($analyzed_sql[0]['where_clause_identifiers'] AS $wci_nr => $wci) {
$highlight_columns[$wci] = 'true'; $highlight_columns[$wci] = 'true';
} }
} }
@@ -1029,7 +1029,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
echo ' <td>&nbsp;</td>' . "\n"; echo ' <td>&nbsp;</td>' . "\n";
} }
foreach($vertical_display['desc'] AS $key => $val) { foreach ($vertical_display['desc'] AS $key => $val) {
echo $val; echo $val;
} }
@@ -1261,7 +1261,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
$vertical_display['data'][$row_no][$i] = ' <td align="right" valign="top" ' . $column_style . ' bgcolor="' . $bgcolor . '" class="nowrap">'; $vertical_display['data'][$row_no][$i] = ' <td align="right" valign="top" ' . $column_style . ' bgcolor="' . $bgcolor . '" class="nowrap">';
if (isset($analyzed_sql[0]['select_expr']) && is_array($analyzed_sql[0]['select_expr'])) { if (isset($analyzed_sql[0]['select_expr']) && is_array($analyzed_sql[0]['select_expr'])) {
foreach($analyzed_sql[0]['select_expr'] AS $select_expr_position => $select_expr) { foreach ($analyzed_sql[0]['select_expr'] AS $select_expr_position => $select_expr) {
$alias = $analyzed_sql[0]['select_expr'][$select_expr_position]['alias']; $alias = $analyzed_sql[0]['select_expr'][$select_expr_position]['alias'];
if (!empty($alias)) { if (!empty($alias)) {
$true_column = $analyzed_sql[0]['select_expr'][$select_expr_position]['column']; $true_column = $analyzed_sql[0]['select_expr'][$select_expr_position]['column'];
@@ -1387,7 +1387,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
$vertical_display['data'][$row_no][$i] = ' <td valign="top" ' . $column_style . ' bgcolor="' . $bgcolor . '"' . $nowrap . '>'; $vertical_display['data'][$row_no][$i] = ' <td valign="top" ' . $column_style . ' bgcolor="' . $bgcolor . '"' . $nowrap . '>';
if (isset($analyzed_sql[0]['select_expr']) && is_array($analyzed_sql[0]['select_expr'])) { if (isset($analyzed_sql[0]['select_expr']) && is_array($analyzed_sql[0]['select_expr'])) {
foreach($analyzed_sql[0]['select_expr'] AS $select_expr_position => $select_expr) { foreach ($analyzed_sql[0]['select_expr'] AS $select_expr_position => $select_expr) {
$alias = $analyzed_sql[0]['select_expr'][$select_expr_position]['alias']; $alias = $analyzed_sql[0]['select_expr'][$select_expr_position]['alias'];
if (!empty($alias)) { if (!empty($alias)) {
$true_column = $analyzed_sql[0]['select_expr'][$select_expr_position]['column']; $true_column = $analyzed_sql[0]['select_expr'][$select_expr_position]['column'];
@@ -1531,7 +1531,7 @@ function PMA_displayVerticalTable()
echo '<tr>' . "\n"; echo '<tr>' . "\n";
echo $vertical_display['textbtn']; echo $vertical_display['textbtn'];
$foo_counter = 0; $foo_counter = 0;
foreach($vertical_display['row_delete'] AS $key => $val) { foreach ($vertical_display['row_delete'] AS $key => $val) {
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) { if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
echo '<td>&nbsp;</td>' . "\n"; echo '<td>&nbsp;</td>' . "\n";
} }
@@ -1550,7 +1550,7 @@ function PMA_displayVerticalTable()
echo $vertical_display['textbtn']; echo $vertical_display['textbtn'];
} }
$foo_counter = 0; $foo_counter = 0;
foreach($vertical_display['edit'] AS $key => $val) { foreach ($vertical_display['edit'] AS $key => $val) {
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) { if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
echo ' <td>&nbsp;</td>' . "\n"; echo ' <td>&nbsp;</td>' . "\n";
} }
@@ -1568,7 +1568,7 @@ function PMA_displayVerticalTable()
echo $vertical_display['textbtn']; echo $vertical_display['textbtn'];
} }
$foo_counter = 0; $foo_counter = 0;
foreach($vertical_display['delete'] AS $key => $val) { foreach ($vertical_display['delete'] AS $key => $val) {
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) { if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
echo '<td>&nbsp;</td>' . "\n"; echo '<td>&nbsp;</td>' . "\n";
} }
@@ -1581,7 +1581,7 @@ function PMA_displayVerticalTable()
// Displays data // Displays data
$row_no = 0; $row_no = 0;
foreach($vertical_display['desc'] AS $key => $val) { foreach ($vertical_display['desc'] AS $key => $val) {
$row_no++; $row_no++;
if (isset($GLOBALS['printview']) && ($GLOBALS['printview'] == '1')) { if (isset($GLOBALS['printview']) && ($GLOBALS['printview'] == '1')) {
@@ -1605,7 +1605,7 @@ function PMA_displayVerticalTable()
echo $val; echo $val;
$foo_counter = 0; $foo_counter = 0;
foreach($vertical_display['rowdata'][$key] AS $subkey => $subval) { foreach ($vertical_display['rowdata'][$key] AS $subkey => $subval) {
if (($foo_counter != 0) && ($repeat_cells != 0) and !($foo_counter % $repeat_cells)) { if (($foo_counter != 0) && ($repeat_cells != 0) and !($foo_counter % $repeat_cells)) {
echo $val; echo $val;
} }
@@ -1622,7 +1622,7 @@ function PMA_displayVerticalTable()
echo '<tr>' . "\n"; echo '<tr>' . "\n";
echo $vertical_display['textbtn']; echo $vertical_display['textbtn'];
$foo_counter = 0; $foo_counter = 0;
foreach($vertical_display['row_delete'] AS $key => $val) { foreach ($vertical_display['row_delete'] AS $key => $val) {
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) { if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
echo '<td>&nbsp;</td>' . "\n"; echo '<td>&nbsp;</td>' . "\n";
} }
@@ -1641,7 +1641,7 @@ function PMA_displayVerticalTable()
echo $vertical_display['textbtn']; echo $vertical_display['textbtn'];
} }
$foo_counter = 0; $foo_counter = 0;
foreach($vertical_display['edit'] AS $key => $val) { foreach ($vertical_display['edit'] AS $key => $val) {
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) { if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
echo '<td>&nbsp;</td>' . "\n"; echo '<td>&nbsp;</td>' . "\n";
} }
@@ -1659,7 +1659,7 @@ function PMA_displayVerticalTable()
echo $vertical_display['textbtn']; echo $vertical_display['textbtn'];
} }
$foo_counter = 0; $foo_counter = 0;
foreach($vertical_display['delete'] AS $key => $val) { foreach ($vertical_display['delete'] AS $key => $val) {
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) { if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
echo '<td>&nbsp;</td>' . "\n"; echo '<td>&nbsp;</td>' . "\n";
} }
@@ -1789,7 +1789,7 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
$target=array(); $target=array();
if (isset($analyzed_sql[0]['table_ref']) && is_array($analyzed_sql[0]['table_ref'])) { if (isset($analyzed_sql[0]['table_ref']) && is_array($analyzed_sql[0]['table_ref'])) {
foreach($analyzed_sql[0]['table_ref'] AS $table_ref_position => $table_ref) { foreach ($analyzed_sql[0]['table_ref'] AS $table_ref_position => $table_ref) {
$target[] = $analyzed_sql[0]['table_ref'][$table_ref_position]['table_true_name']; $target[] = $analyzed_sql[0]['table_ref'][$table_ref_position]['table_true_name'];
} }
} }
@@ -1801,7 +1801,7 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
} else { } else {
$exist_rel = PMA_getForeigners($db, $table, '', 'both'); $exist_rel = PMA_getForeigners($db, $table, '', 'both');
if ($exist_rel) { if ($exist_rel) {
foreach($exist_rel AS $master_field => $rel) { foreach ($exist_rel AS $master_field => $rel) {
$display_field = PMA_getDisplayField($rel['foreign_db'],$rel['foreign_table']); $display_field = PMA_getDisplayField($rel['foreign_db'],$rel['foreign_table']);
$map[$master_field] = array($rel['foreign_table'], $map[$master_field] = array($rel['foreign_table'],
$rel['foreign_field'], $rel['foreign_field'],

View File

@@ -18,7 +18,7 @@
function PMA_texEscape($string) { function PMA_texEscape($string) {
$escape = array('$', '%', '{', '}', '&', '#', '_', '^'); $escape = array('$', '%', '{', '}', '&', '#', '_', '^');
$cnt_escape = count($escape); $cnt_escape = count($escape);
for($k=0; $k < $cnt_escape; $k++) { for ($k=0; $k < $cnt_escape; $k++) {
$string = str_replace($escape[$k], '\\' . $escape[$k], $string); $string = str_replace($escape[$k], '\\' . $escape[$k], $string);
} }
return $string; return $string;
@@ -140,7 +140,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
$buffer = $crlf . '%' . $crlf . '% ' . $GLOBALS['strData'] . ': ' . $table . $crlf . '%' . $crlf $buffer = $crlf . '%' . $crlf . '% ' . $GLOBALS['strData'] . ': ' . $table . $crlf . '%' . $crlf
. ' \\begin{longtable}{|'; . ' \\begin{longtable}{|';
for($index=0;$index<$columns_cnt;$index++) { for ($index=0;$index<$columns_cnt;$index++) {
$buffer .= 'l|'; $buffer .= 'l|';
} }
$buffer .= '} ' . $crlf ; $buffer .= '} ' . $crlf ;
@@ -174,7 +174,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
$buffer = ''; $buffer = '';
// print each row // print each row
for($i = 0; $i < $columns_cnt; $i++) { for ($i = 0; $i < $columns_cnt; $i++) {
if ( isset($record[$columns[$i]]) && (!function_exists('is_null') || !is_null($record[$columns[$i]]))) { if ( isset($record[$columns[$i]]) && (!function_exists('is_null') || !is_null($record[$columns[$i]]))) {
$column_value = PMA_texEscape(stripslashes($record[$columns[$i]])); $column_value = PMA_texEscape(stripslashes($record[$columns[$i]]));
} else { } else {
@@ -182,7 +182,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
} }
// last column ... no need for & character // last column ... no need for & character
if($i == ($columns_cnt - 1)) { if ($i == ($columns_cnt - 1)) {
$buffer .= $column_value; $buffer .= $column_value;
} else { } else {
$buffer .= $column_value . " & "; $buffer .= $column_value . " & ";
@@ -226,7 +226,7 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
$keys_query = 'SHOW KEYS FROM ' . PMA_backquote($table) . ' FROM '. PMA_backquote($db); $keys_query = 'SHOW KEYS FROM ' . PMA_backquote($table) . ' FROM '. PMA_backquote($db);
$keys_result = PMA_DBI_query($keys_query); $keys_result = PMA_DBI_query($keys_query);
$unique_keys = array(); $unique_keys = array();
while($key = PMA_DBI_fetch_assoc($keys_result)) { while ($key = PMA_DBI_fetch_assoc($keys_result)) {
if ($key['Non_unique'] == 0) $unique_keys[] = $key['Column_name']; if ($key['Non_unique'] == 0) $unique_keys[] = $key['Column_name'];
} }
PMA_DBI_free_result($keys_result); PMA_DBI_free_result($keys_result);

View File

@@ -28,7 +28,7 @@ $comment_marker = '-- ';
function PMA_fieldTypes($db, $table,$use_backquotes) { function PMA_fieldTypes($db, $table,$use_backquotes) {
PMA_DBI_select_db($db); PMA_DBI_select_db($db);
$table_def = PMA_DBI_query('SHOW FIELDS FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table)); $table_def = PMA_DBI_query('SHOW FIELDS FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table));
while($row = PMA_DBI_fetch_assoc($table_def)) { while ($row = PMA_DBI_fetch_assoc($table_def)) {
$types[PMA_backquote($row['Field'],$use_backquotes)] = ereg_replace('\\(.*', '', $row['Type']); $types[PMA_backquote($row['Field'],$use_backquotes)] = ereg_replace('\\(.*', '', $row['Type']);
} }
return $types; return $types;
@@ -340,7 +340,7 @@ function PMA_getTableComments($db, $table, $crlf, $do_relation = false, $do_comm
if (isset($comments_map) && count($comments_map) > 0) { if (isset($comments_map) && count($comments_map) > 0) {
$schema_create .= $crlf . $GLOBALS['comment_marker'] . $crlf $schema_create .= $crlf . $GLOBALS['comment_marker'] . $crlf
. $GLOBALS['comment_marker'] . $GLOBALS['strCommentsForTable']. ' ' . PMA_backquote($table, $use_backquotes) . ':' . $crlf; . $GLOBALS['comment_marker'] . $GLOBALS['strCommentsForTable']. ' ' . PMA_backquote($table, $use_backquotes) . ':' . $crlf;
foreach($comments_map AS $comment_field => $comment) { foreach ($comments_map AS $comment_field => $comment) {
$schema_create .= $GLOBALS['comment_marker'] . ' ' . PMA_backquote($comment_field, $use_backquotes) . $crlf $schema_create .= $GLOBALS['comment_marker'] . ' ' . PMA_backquote($comment_field, $use_backquotes) . $crlf
. $GLOBALS['comment_marker'] . ' ' . PMA_backquote($comment, $use_backquotes) . $crlf; . $GLOBALS['comment_marker'] . ' ' . PMA_backquote($comment, $use_backquotes) . $crlf;
} }
@@ -351,7 +351,7 @@ function PMA_getTableComments($db, $table, $crlf, $do_relation = false, $do_comm
$schema_create .= $crlf . $GLOBALS['comment_marker'] . $crlf $schema_create .= $crlf . $GLOBALS['comment_marker'] . $crlf
. $GLOBALS['comment_marker'] . $GLOBALS['strMIMETypesForTable']. ' ' . PMA_backquote($table, $use_backquotes) . ':' . $crlf; . $GLOBALS['comment_marker'] . $GLOBALS['strMIMETypesForTable']. ' ' . PMA_backquote($table, $use_backquotes) . ':' . $crlf;
@reset($mime_map); @reset($mime_map);
foreach($mime_map AS $mime_field => $mime) { foreach ($mime_map AS $mime_field => $mime) {
$schema_create .= $GLOBALS['comment_marker'] . ' ' . PMA_backquote($mime_field, $use_backquotes) . $crlf $schema_create .= $GLOBALS['comment_marker'] . ' ' . PMA_backquote($mime_field, $use_backquotes) . $crlf
. $GLOBALS['comment_marker'] . ' ' . PMA_backquote($mime['mimetype'], $use_backquotes) . $crlf; . $GLOBALS['comment_marker'] . ' ' . PMA_backquote($mime['mimetype'], $use_backquotes) . $crlf;
} }
@@ -361,7 +361,7 @@ function PMA_getTableComments($db, $table, $crlf, $do_relation = false, $do_comm
if ($have_rel) { if ($have_rel) {
$schema_create .= $crlf . $GLOBALS['comment_marker'] . $crlf $schema_create .= $crlf . $GLOBALS['comment_marker'] . $crlf
. $GLOBALS['comment_marker'] . $GLOBALS['strRelationsForTable']. ' ' . PMA_backquote($table, $use_backquotes) . ':' . $crlf; . $GLOBALS['comment_marker'] . $GLOBALS['strRelationsForTable']. ' ' . PMA_backquote($table, $use_backquotes) . ':' . $crlf;
foreach($res_rel AS $rel_field => $rel) { foreach ($res_rel AS $rel_field => $rel) {
$schema_create .= $GLOBALS['comment_marker'] . ' ' . PMA_backquote($rel_field, $use_backquotes) . $crlf $schema_create .= $GLOBALS['comment_marker'] . ' ' . PMA_backquote($rel_field, $use_backquotes) . $crlf
. $GLOBALS['comment_marker'] . ' ' . PMA_backquote($rel['foreign_table'], $use_backquotes) . $GLOBALS['comment_marker'] . ' ' . PMA_backquote($rel['foreign_table'], $use_backquotes)
. ' -> ' . PMA_backquote($rel['foreign_field'], $use_backquotes) . $crlf; . ' -> ' . PMA_backquote($rel['foreign_field'], $use_backquotes) . $crlf;

View File

@@ -1,6 +1,6 @@
<?php <?php
// vim: expandtab sw=4 ts=4 sts=4: // vim: expandtab sw=4 ts=4 sts=4:
for($i=0;$i<=255;$i++) for ($i=0;$i<=255;$i++)
$fpdf_charwidths['courier'][chr($i)]=600; $fpdf_charwidths['courier'][chr($i)]=600;
$fpdf_charwidths['courierB']=$fpdf_charwidths['courier']; $fpdf_charwidths['courierB']=$fpdf_charwidths['courier'];
$fpdf_charwidths['courierI']=$fpdf_charwidths['courier']; $fpdf_charwidths['courierI']=$fpdf_charwidths['courier'];

View File

@@ -310,7 +310,7 @@ class FPDF
{ {
$nf = $this->n; $nf = $this->n;
foreach($this->diffs AS $diff) { foreach ($this->diffs AS $diff) {
// Encodings // Encodings
$this->_newobj(); $this->_newobj();
$this->_out('<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences [' . $diff . ']>>'); $this->_out('<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences [' . $diff . ']>>');
@@ -320,7 +320,7 @@ class FPDF
$mqr = get_magic_quotes_runtime(); $mqr = get_magic_quotes_runtime();
set_magic_quotes_runtime(0); set_magic_quotes_runtime(0);
foreach($this->FontFiles AS $file => $info) { foreach ($this->FontFiles AS $file => $info) {
// Font file embedding // Font file embedding
$this->_newobj(); $this->_newobj();
$this->FontFiles[$file]['n'] = $this->n; $this->FontFiles[$file]['n'] = $this->n;
@@ -347,7 +347,7 @@ class FPDF
} // end while } // end while
set_magic_quotes_runtime($mqr); set_magic_quotes_runtime($mqr);
foreach($this->fonts AS $k => $font) { foreach ($this->fonts AS $k => $font) {
// Font objects // Font objects
$this->_newobj(); $this->_newobj();
$this->fonts[$k]['n'] = $this->n; $this->fonts[$k]['n'] = $this->n;
@@ -390,7 +390,7 @@ class FPDF
// Descriptor // Descriptor
$this->_newobj(); $this->_newobj();
$s = '<</Type /FontDescriptor /FontName /' . $name; $s = '<</Type /FontDescriptor /FontName /' . $name;
foreach($font['desc'] AS $k => $v) { foreach ($font['desc'] AS $k => $v) {
$s .= ' /' . $k . ' ' . $v; $s .= ' /' . $k . ' ' . $v;
} }
$file = $font['file']; $file = $font['file'];
@@ -413,7 +413,7 @@ class FPDF
{ {
$filter = ($this->compress) ? '/Filter /FlateDecode ' : ''; $filter = ($this->compress) ? '/Filter /FlateDecode ' : '';
foreach($this->images AS $file => $info) { foreach ($this->images AS $file => $info) {
$this->_newobj(); $this->_newobj();
$this->images[$file]['n'] = $this->n; $this->images[$file]['n'] = $this->n;
$this->_out('<</Type /XObject'); $this->_out('<</Type /XObject');
@@ -472,13 +472,13 @@ class FPDF
$this->_out('2 0 obj'); $this->_out('2 0 obj');
$this->_out('<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]'); $this->_out('<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');
$this->_out('/Font <<'); $this->_out('/Font <<');
foreach($this->fonts AS $font) { foreach ($this->fonts AS $font) {
$this->_out('/F' . $font['i'] . ' ' . $font['n'] . ' 0 R'); $this->_out('/F' . $font['i'] . ' ' . $font['n'] . ' 0 R');
} }
$this->_out('>>'); $this->_out('>>');
if (count($this->images)) { if (count($this->images)) {
$this->_out('/XObject <<'); $this->_out('/XObject <<');
foreach($this->images AS $image) { foreach ($this->images AS $image) {
$this->_out('/I' . $image['i'] . ' ' . $image['n'] . ' 0 R'); $this->_out('/I' . $image['i'] . ' ' . $image['n'] . ' 0 R');
} }
$this->_out('>>'); $this->_out('>>');
@@ -702,7 +702,7 @@ class FPDF
if (!isset($a['channels']) || $a['channels'] == 3) { if (!isset($a['channels']) || $a['channels'] == 3) {
$colspace = 'DeviceRGB'; $colspace = 'DeviceRGB';
} }
else if($a['channels'] == 4) { else if ($a['channels'] == 4) {
$colspace = 'DeviceCMYK'; $colspace = 'DeviceCMYK';
} }
else { else {
@@ -847,7 +847,7 @@ class FPDF
else { else {
fread($f, $n + 4); fread($f, $n + 4);
} // end if... else if... else } // end if... else if... else
} while($n); // end do } while ($n); // end do
if ($colspace == 'Indexed' && empty($pal)) { if ($colspace == 'Indexed' && empty($pal)) {
$this->Error('Missing palette in ' . $file); $this->Error('Missing palette in ' . $file);
@@ -2206,7 +2206,7 @@ class FPDF
if ($l > $wmax) { if ($l > $wmax) {
// Automatic line break // Automatic line break
if ($sep == -1) { if ($sep == -1) {
if($this->x > $this->lMargin) { if ($this->x > $this->lMargin) {
// Move to next line // Move to next line
$this->x =$this->lMargin; $this->x =$this->lMargin;
$this->y +=$h; $this->y +=$h;

View File

@@ -17,7 +17,7 @@ function PMA_gpc_extract($array, &$target) {
return FALSE; return FALSE;
} }
$is_magic_quotes = get_magic_quotes_gpc(); $is_magic_quotes = get_magic_quotes_gpc();
foreach($array AS $key => $value) { foreach ($array AS $key => $value) {
if (is_array($value)) { if (is_array($value)) {
// there could be a variable coming from a cookie of // there could be a variable coming from a cookie of
// another application, with the same name as this array // another application, with the same name as this array
@@ -42,7 +42,7 @@ if (!empty($_POST)) {
} // end if } // end if
if (!empty($_FILES)) { if (!empty($_FILES)) {
foreach($_FILES AS $name => $value) { foreach ($_FILES AS $name => $value) {
$$name = $value['tmp_name']; $$name = $value['tmp_name'];
${$name . '_name'} = $value['name']; ${$name . '_name'} = $value['name'];
} }

View File

@@ -252,7 +252,7 @@ function PMA_allowDeny($type)
'localhost' => '127.0.0.1/8' 'localhost' => '127.0.0.1/8'
); );
foreach($rules AS $rule) { foreach ($rules AS $rule) {
// extract rule data // extract rule data
$rule_data = explode(' ', $rule); $rule_data = explode(' ', $rule);

View File

@@ -36,7 +36,7 @@ if (PMA_MYSQL_INT_VERSION >= 40100){
$mysql_collations_count = count($mysql_collations_flat); $mysql_collations_count = count($mysql_collations_flat);
sort($mysql_collations_flat, SORT_STRING); sort($mysql_collations_flat, SORT_STRING);
foreach($mysql_collations AS $key => $value) { foreach ($mysql_collations AS $key => $value) {
sort($mysql_collations[$key], SORT_STRING); sort($mysql_collations[$key], SORT_STRING);
reset($mysql_collations[$key]); reset($mysql_collations[$key]);
} }

View File

@@ -300,11 +300,11 @@ function PMA_getForeigners($db, $table, $column = '', $source = 'both') {
$analyzed_sql = PMA_SQP_analyze(PMA_SQP_parse($show_create_table)); $analyzed_sql = PMA_SQP_analyze(PMA_SQP_parse($show_create_table));
foreach($analyzed_sql[0]['foreign_keys'] AS $one_key) { foreach ($analyzed_sql[0]['foreign_keys'] AS $one_key) {
// the analyzer may return more than one column name in the // the analyzer may return more than one column name in the
// index list or the ref_index_list // index list or the ref_index_list
foreach($one_key['index_list'] AS $i => $field) { foreach ($one_key['index_list'] AS $i => $field) {
// If a foreign key is defined in the 'internal' source (pmadb) // If a foreign key is defined in the 'internal' source (pmadb)
// and in 'innodb', we won't get it twice if $source='both' // and in 'innodb', we won't get it twice if $source='both'
@@ -614,7 +614,7 @@ function PMA_foreignDropdown($disp, $foreign_field, $foreign_display, $data, $ma
$reloptions = array('content-id' => array(), 'id-content' => array()); $reloptions = array('content-id' => array(), 'id-content' => array());
foreach($disp AS $disp_key => $relrow) { foreach ($disp AS $disp_key => $relrow) {
$key = $relrow[$foreign_field]; $key = $relrow[$foreign_field];
if (PMA_strlen($relrow[$foreign_display]) <= $cfg['LimitChars']) { if (PMA_strlen($relrow[$foreign_display]) <= $cfg['LimitChars']) {
$value = (($foreign_display != FALSE) ? htmlspecialchars($relrow[$foreign_display]) : ''); $value = (($foreign_display != FALSE) ? htmlspecialchars($relrow[$foreign_display]) : '');

View File

@@ -173,7 +173,7 @@ function PMA_langDetect($str = '', $envType = '')
global $available_languages; global $available_languages;
global $lang; global $lang;
foreach($available_languages AS $key => $value) { foreach ($available_languages AS $key => $value) {
// $envType = 1 for the 'HTTP_ACCEPT_LANGUAGE' environment variable, // $envType = 1 for the 'HTTP_ACCEPT_LANGUAGE' environment variable,
// 2 for the 'HTTP_USER_AGENT' one // 2 for the 'HTTP_USER_AGENT' one
if (($envType == 1 && eregi('^(' . $value[0] . ')(;q=[0-9]\\.[0-9])?$', $str)) if (($envType == 1 && eregi('^(' . $value[0] . ')(;q=[0-9]\\.[0-9])?$', $str))
@@ -221,7 +221,7 @@ if (!isset($cfg['DefaultLang']) && isset($cfgDefaultLang)) {
if (!isset($cfg['AllowAnywhereRecoding']) || !$cfg['AllowAnywhereRecoding']) { if (!isset($cfg['AllowAnywhereRecoding']) || !$cfg['AllowAnywhereRecoding']) {
$available_language_files = $available_languages; $available_language_files = $available_languages;
$available_languages = array(); $available_languages = array();
foreach($available_language_files AS $tmp_lang => $tmp_lang_data) { foreach ($available_language_files AS $tmp_lang => $tmp_lang_data) {
if (substr($tmp_lang, -5) != 'utf-8') { if (substr($tmp_lang, -5) != 'utf-8') {
$available_languages[$tmp_lang] = $tmp_lang_data; $available_languages[$tmp_lang] = $tmp_lang_data;
} }

View File

@@ -669,12 +669,10 @@ if ($is_minimum_common == FALSE) {
function PMA_SQP_typeCheck($toCheck, $whatWeWant) function PMA_SQP_typeCheck($toCheck, $whatWeWant)
{ {
$typeSeperator = '_'; $typeSeperator = '_';
if(strcmp($whatWeWant, $toCheck) == 0) { if (strcmp($whatWeWant, $toCheck) == 0) {
return TRUE; return TRUE;
} else { } else {
//if(strpos($whatWeWant, $typeSeperator) === FALSE) { if (strpos($whatWeWant, $typeSeperator) === FALSE) {
// PHP3 compatible (works unless there is a real ff character)
if(!strpos("\xff" . $whatWeWant, $typeSeperator)) {
return strncmp($whatWeWant, $toCheck , strpos($toCheck, $typeSeperator)) == 0; return strncmp($whatWeWant, $toCheck , strpos($toCheck, $typeSeperator)) == 0;
} else { } else {
return FALSE; return FALSE;
@@ -2015,7 +2013,7 @@ function PMA_SQP_buildCssData()
global $cfg; global $cfg;
$css_string = ''; $css_string = '';
foreach($cfg['SQP']['fmtColor'] AS $key => $col) { foreach ($cfg['SQP']['fmtColor'] AS $key => $col) {
$css_string .= PMA_SQP_buildCssRule('syntax_' . $key, 'color', $col); $css_string .= PMA_SQP_buildCssRule('syntax_' . $key, 'color', $col);
} }

View File

@@ -43,7 +43,7 @@ function PMA_getAvailableMIMEtypes() {
if (is_array($filestack)) { if (is_array($filestack)) {
@ksort($filestack); @ksort($filestack);
foreach($filestack AS $key => $file) { foreach ($filestack AS $key => $file) {
if (preg_match('|^.*__.*\.inc\.php(3?)$|', trim($file), $match)) { if (preg_match('|^.*__.*\.inc\.php(3?)$|', trim($file), $match)) {
// File contains transformation functions. // File contains transformation functions.

View File

@@ -28,7 +28,7 @@ $types = PMA_getAvailableMIMEtypes();
<h2><?php echo $strMIME_available_mime; ?></h2> <h2><?php echo $strMIME_available_mime; ?></h2>
<?php <?php
foreach($types['mimetype'] AS $key => $mimetype) { foreach ($types['mimetype'] AS $key => $mimetype) {
if (isset($types['empty_mimetype'][$mimetype])) { if (isset($types['empty_mimetype'][$mimetype])) {
echo '<i>' . $mimetype . '</i><br />'; echo '<i>' . $mimetype . '</i><br />';
@@ -54,7 +54,7 @@ foreach($types['mimetype'] AS $key => $mimetype) {
<?php <?php
@reset($types); @reset($types);
$i = 0; $i = 0;
foreach($types['transformation'] AS $key => $transform) { foreach ($types['transformation'] AS $key => $transform) {
$i++; $i++;
$func = strtolower(preg_replace('@(\.inc\.php3?)$@i', '', $types['transformation_file'][$key])); $func = strtolower(preg_replace('@(\.inc\.php3?)$@i', '', $types['transformation_file'][$key]));
$desc = 'strTransformation_' . $func; $desc = 'strTransformation_' . $func;

View File

@@ -60,7 +60,7 @@ echo "\n";
if ($server > 0) { if ($server > 0) {
// robbat2: Use the verbose name of the server instead of the hostname // robbat2: Use the verbose name of the server instead of the hostname
// if a value is set // if a value is set
if(!empty($cfg['Server']['verbose'])) { if (!empty($cfg['Server']['verbose'])) {
$server_info = $cfg['Server']['verbose']; $server_info = $cfg['Server']['verbose'];
} else { } else {
$server_info = $cfg['Server']['host']; $server_info = $cfg['Server']['host'];
@@ -118,7 +118,7 @@ if ($server == 0 || count($cfg['Servers']) > 1) {
<select name="server"> <select name="server">
<?php <?php
echo "\n"; echo "\n";
foreach($cfg['Servers'] AS $key => $val) { foreach ($cfg['Servers'] AS $key => $val) {
if (!empty($val['host'])) { if (!empty($val['host'])) {
echo ' <option value="' . $key . '"'; echo ' <option value="' . $key . '"';
if (!empty($server) && ($server == $key)) { if (!empty($server) && ($server == $key)) {
@@ -452,7 +452,7 @@ if (empty($cfg['Lang'])) {
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" /> <input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<input type="hidden" name="server" value="<?php echo $server; ?>" /> <input type="hidden" name="server" value="<?php echo $server; ?>" />
Language <a href="./translators.html" target="documentation"><?php Language <a href="./translators.html" target="documentation"><?php
if($cfg['ReplaceHelpImg']){ if ($cfg['ReplaceHelpImg']){
echo '<img src="./images/b_info.png" border="0" width="11" height="11" alt="Info" hspace="1" vspace="1" />'; echo '<img src="./images/b_info.png" border="0" width="11" height="11" alt="Info" hspace="1" vspace="1" />';
}else{ echo '(*)'; } }else{ echo '(*)'; }
?></a>: ?></a>:
@@ -476,7 +476,7 @@ if (empty($cfg['Lang'])) {
} // end of the 'PMA_cmp()' function } // end of the 'PMA_cmp()' function
uasort($available_languages, 'PMA_cmp'); uasort($available_languages, 'PMA_cmp');
foreach($available_languages AS $id => $tmplang) { foreach ($available_languages AS $id => $tmplang) {
$lang_name = ucfirst(substr(strstr($tmplang[0], '|'), 1)); $lang_name = ucfirst(substr(strstr($tmplang[0], '|'), 1));
if ($lang == $id) { if ($lang == $id) {
$selected = ' selected="selected"'; $selected = ' selected="selected"';
@@ -507,7 +507,7 @@ if (isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding']
<select name="convcharset" dir="ltr" onchange="this.form.submit();"> <select name="convcharset" dir="ltr" onchange="this.form.submit();">
<?php <?php
echo "\n"; echo "\n";
foreach($cfg['AvailableCharsets'] AS $id => $tmpcharset) { foreach ($cfg['AvailableCharsets'] AS $id => $tmpcharset) {
if ($convcharset == $tmpcharset) { if ($convcharset == $tmpcharset) {
$selected = ' selected="selected"'; $selected = ' selected="selected"';
} else { } else {

View File

@@ -87,7 +87,7 @@ if (!empty($submit_mult) && !empty($what)) {
$full_query = ''; $full_query = '';
$selected_cnt = count($selected); $selected_cnt = count($selected);
$i = 0; $i = 0;
foreach($selected AS $idx => $sval) { foreach ($selected AS $idx => $sval) {
switch ($what) { switch ($what) {
case 'row_delete': case 'row_delete':
$full_query .= htmlspecialchars(urldecode($sval)) $full_query .= htmlspecialchars(urldecode($sval))
@@ -150,7 +150,7 @@ if (!empty($submit_mult) && !empty($what)) {
} else { } else {
echo PMA_generate_common_hidden_inputs(); echo PMA_generate_common_hidden_inputs();
} }
foreach($selected AS $idx => $sval) { foreach ($selected AS $idx => $sval) {
echo ' <input type="hidden" name="selected[]" value="' . htmlspecialchars($sval) . '" />' . "\n"; echo ' <input type="hidden" name="selected[]" value="' . htmlspecialchars($sval) . '" />' . "\n";
} }
?> ?>

View File

@@ -105,9 +105,9 @@ if ($cfgRelation['pdfwork']) {
// one table, and might be a master itself) // one table, and might be a master itself)
$foreign_tables = array(); $foreign_tables = array();
foreach($all_tables AS $master_table) { foreach ($all_tables AS $master_table) {
$foreigners = PMA_getForeigners($db, $master_table); $foreigners = PMA_getForeigners($db, $master_table);
foreach($foreigners AS $foreigner) { foreach ($foreigners AS $foreigner) {
if (!in_array($foreigner['foreign_table'], $foreign_tables)) { if (!in_array($foreigner['foreign_table'], $foreign_tables)) {
$foreign_tables[] = $foreigner['foreign_table']; $foreign_tables[] = $foreigner['foreign_table'];
} }
@@ -115,7 +115,7 @@ if ($cfgRelation['pdfwork']) {
} }
// then merge the arrays // then merge the arrays
foreach($foreign_tables AS $foreign_table) { foreach ($foreign_tables AS $foreign_table) {
if (!in_array($foreign_table, $all_tables)) { if (!in_array($foreign_table, $all_tables)) {
$all_tables[] = $foreign_table; $all_tables[] = $foreign_table;
} }
@@ -129,7 +129,7 @@ if ($cfgRelation['pdfwork']) {
$delta = 50; $delta = 50;
$delta_mult = 1.34; $delta_mult = 1.34;
$direction = "right"; $direction = "right";
foreach($all_tables AS $current_table) { foreach ($all_tables AS $current_table) {
// save current table's coordinates // save current table's coordinates
$insert_query = 'INSERT INTO ' . PMA_backquote($cfgRelation['table_coords']) . ' ' $insert_query = 'INSERT INTO ' . PMA_backquote($cfgRelation['table_coords']) . ' '
@@ -208,7 +208,7 @@ if ($cfgRelation['pdfwork']) {
} // end for } // end for
break; break;
case 'deleteCrap': case 'deleteCrap':
foreach($delrow AS $current_row) { foreach ($delrow AS $current_row) {
$d_query = 'DELETE FROM ' . PMA_backquote($cfgRelation['table_coords']) . ' ' . "\n" $d_query = 'DELETE FROM ' . PMA_backquote($cfgRelation['table_coords']) . ' ' . "\n"
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'' . "\n" . ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'' . "\n"
. ' AND table_name = \'' . PMA_sqlAddslashes($current_row) . '\'' . "\n" . ' AND table_name = \'' . PMA_sqlAddslashes($current_row) . '\'' . "\n"
@@ -305,7 +305,7 @@ if ($cfg['WYSIWYG-PDF']) {
</form> </form>
<div id="pdflayout" class="pdflayout" style="visibility: hidden;"> <div id="pdflayout" class="pdflayout" style="visibility: hidden;">
<?php <?php
foreach($array_sh_page AS $key => $temp_sh_page) { foreach ($array_sh_page AS $key => $temp_sh_page) {
$drag_x = $temp_sh_page['x']; $drag_x = $temp_sh_page['x'];
$drag_y = $temp_sh_page['y']; $drag_y = $temp_sh_page['y'];
@@ -372,7 +372,7 @@ function resetDrag() {
$i = 0; $i = 0;
foreach($array_sh_page AS $dummy_sh_page => $sh_page) { foreach ($array_sh_page AS $dummy_sh_page => $sh_page) {
$_mtab = $sh_page['table_name']; $_mtab = $sh_page['table_name'];
$tabExist[$_mtab] = FALSE; $tabExist[$_mtab] = FALSE;
echo "\n" . ' <tr '; echo "\n" . ' <tr ';
@@ -384,7 +384,7 @@ function resetDrag() {
echo '>'; echo '>';
echo "\n" . ' <td>' echo "\n" . ' <td>'
. "\n" . ' <select name="c_table_' . $i . '[name]">'; . "\n" . ' <select name="c_table_' . $i . '[name]">';
foreach($selectboxall AS $key => $value) { foreach ($selectboxall AS $key => $value) {
echo "\n" . ' <option value="' . $value . '"'; echo "\n" . ' <option value="' . $value . '"';
if ($value == $sh_page['table_name']) { if ($value == $sh_page['table_name']) {
echo ' selected="selected"'; echo ' selected="selected"';
@@ -416,7 +416,7 @@ function resetDrag() {
echo '>'; echo '>';
echo "\n" . ' <td>' echo "\n" . ' <td>'
. "\n" . ' <select name="c_table_' . $i . '[name]">'; . "\n" . ' <select name="c_table_' . $i . '[name]">';
foreach($selectboxall AS $key => $value) { foreach ($selectboxall AS $key => $value) {
echo "\n" . ' <option value="' . $value . '">' . $value . '</option>'; echo "\n" . ' <option value="' . $value . '">' . $value . '</option>';
} }
echo "\n" . ' </select>' echo "\n" . ' </select>'
@@ -445,7 +445,7 @@ function resetDrag() {
$_strname = ''; $_strname = '';
$shoot = FALSE; $shoot = FALSE;
if (!empty($tabExist) && is_array($tabExist)) { if (!empty($tabExist) && is_array($tabExist)) {
foreach($tabExist AS $key => $value) { foreach ($tabExist AS $key => $value) {
if (!$value) { if (!$value) {
$_strtrans .= '<input type="hidden" name="delrow[]" value="' . $key . '">' . "\n"; $_strtrans .= '<input type="hidden" name="delrow[]" value="' . $key . '">' . "\n";
$_strname .= '<li>' . $key . '</li>' . "\n"; $_strname .= '<li>' . $key . '</li>' . "\n";
@@ -497,7 +497,7 @@ function resetDrag() {
<?php echo $strPaperSize; ?> <?php echo $strPaperSize; ?>
<select name="paper" <?php echo ($cfg['WYSIWYG-PDF'] ? 'onchange="refreshDragOption(\'pdflayout\');"' : ''); ?>> <select name="paper" <?php echo ($cfg['WYSIWYG-PDF'] ? 'onchange="refreshDragOption(\'pdflayout\');"' : ''); ?>>
<?php <?php
foreach($cfg['PDFPageSizes'] AS $key => $val) { foreach ($cfg['PDFPageSizes'] AS $key => $val) {
echo '<option value="' . $val . '"'; echo '<option value="' . $val . '"';
if ($val == $cfg['PDFDefaultPageSize']) { if ($val == $cfg['PDFDefaultPageSize']) {
echo ' selected="selected"'; echo ' selected="selected"';

View File

@@ -96,11 +96,11 @@ class PMA_PDF extends FPDF
} }
function _putpages() function _putpages()
{ {
if(count($this->Alias) > 0) if (count($this->Alias) > 0)
{ {
$nb=$this->page; $nb=$this->page;
foreach($this->Alias AS $alias => $value) { foreach ($this->Alias AS $alias => $value) {
for($n=1;$n<=$nb;$n++) for ($n=1;$n<=$nb;$n++)
$this->pages[$n]=str_replace($alias,$value,$this->pages[$n]); $this->pages[$n]=str_replace($alias,$value,$this->pages[$n]);
} }
} }
@@ -336,14 +336,14 @@ class PMA_PDF extends FPDF
$this->Outlines[0][]=$level; $this->Outlines[0][]=$level;
$this->Outlines[1][]=$txt; $this->Outlines[1][]=$txt;
$this->Outlines[2][]=$this->page; $this->Outlines[2][]=$this->page;
if($y==-1) if ($y==-1)
$y=$this->GetY(); $y=$this->GetY();
$this->Outlines[3][]=round($this->hPt-$y*$this->k,2); $this->Outlines[3][]=round($this->hPt-$y*$this->k,2);
} }
function _putbookmarks() function _putbookmarks()
{ {
if(count($this->Outlines)>0) if (count($this->Outlines)>0)
{ {
//Save object number //Save object number
$memo_n = $this->n; $memo_n = $this->n;
@@ -352,29 +352,29 @@ function _putbookmarks()
$first_level=array(); $first_level=array();
$parent=array(); $parent=array();
$parent[0]=1; $parent[0]=1;
for( $i=0; $i<$nb_outlines; $i++) for ($i=0; $i<$nb_outlines; $i++)
{ {
$level=$this->Outlines[0][$i]; $level=$this->Outlines[0][$i];
$kids=0; $kids=0;
$last=-1; $last=-1;
$prev=-1; $prev=-1;
$next=-1; $next=-1;
if( $i>0 ) if ($i>0 )
{ {
$cursor=$i-1; $cursor=$i-1;
//Take the previous outline in the same level //Take the previous outline in the same level
while( $this->Outlines[0][$cursor] > $level && $cursor > 0) while ($this->Outlines[0][$cursor] > $level && $cursor > 0)
$cursor--; $cursor--;
if( $this->Outlines[0][$cursor] == $level) if ($this->Outlines[0][$cursor] == $level)
$prev=$cursor; $prev=$cursor;
} }
if( $i<$nb_outlines-1) if ($i<$nb_outlines-1)
{ {
$cursor=$i+1; $cursor=$i+1;
while( isset($this->Outlines[0][$cursor]) && $this->Outlines[0][$cursor] > $level) while (isset($this->Outlines[0][$cursor]) && $this->Outlines[0][$cursor] > $level)
{ {
//Take the immediate kid in level + 1 //Take the immediate kid in level + 1
if( $this->Outlines[0][$cursor] == $level+1) if ($this->Outlines[0][$cursor] == $level+1)
{ {
$kids++; $kids++;
$last=$cursor; $last=$cursor;
@@ -383,24 +383,24 @@ function _putbookmarks()
} }
$cursor=$i+1; $cursor=$i+1;
//Take the next outline in the same level //Take the next outline in the same level
while( $this->Outlines[0][$cursor] > $level && ($cursor+1 < sizeof($this->Outlines[0]))) while ($this->Outlines[0][$cursor] > $level && ($cursor+1 < sizeof($this->Outlines[0])))
$cursor++; $cursor++;
if( $this->Outlines[0][$cursor] == $level) if ($this->Outlines[0][$cursor] == $level)
$next=$cursor; $next=$cursor;
} }
$this->_newobj(); $this->_newobj();
$parent[$level+1]=$this->n; $parent[$level+1]=$this->n;
if( $level == 0) if ($level == 0)
$first_level[]=$this->n; $first_level[]=$this->n;
$this->_out('<<'); $this->_out('<<');
$this->_out('/Title ('.$this->Outlines[1][$i].')'); $this->_out('/Title ('.$this->Outlines[1][$i].')');
$this->_out('/Parent '.$parent[$level].' 0 R'); $this->_out('/Parent '.$parent[$level].' 0 R');
if( $prev != -1) if ($prev != -1)
$this->_out('/Prev '.($memo_n+$prev+1).' 0 R'); $this->_out('/Prev '.($memo_n+$prev+1).' 0 R');
if( $next != -1) if ($next != -1)
$this->_out('/Next '.($this->n+$next-$i).' 0 R'); $this->_out('/Next '.($this->n+$next-$i).' 0 R');
$this->_out('/Dest ['.(1+(2*$this->Outlines[2][$i])).' 0 R /XYZ null '.$this->Outlines[3][$i].' null]'); $this->_out('/Dest ['.(1+(2*$this->Outlines[2][$i])).' 0 R /XYZ null '.$this->Outlines[3][$i].' null]');
if( $kids > 0) if ($kids > 0)
{ {
$this->_out('/First '.($this->n+1).' 0 R'); $this->_out('/First '.($this->n+1).' 0 R');
$this->_out('/Last '.($this->n+$last-$i).' 0 R'); $this->_out('/Last '.($this->n+$last-$i).' 0 R');
@@ -432,7 +432,7 @@ function _putresources()
function _putcatalog() function _putcatalog()
{ {
parent::_putcatalog(); parent::_putcatalog();
if(count($this->Outlines)>0) if (count($this->Outlines)>0)
{ {
$this->_out('/Outlines '.$this->def_outlines.' 0 R'); $this->_out('/Outlines '.$this->def_outlines.' 0 R');
$this->_out('/PageMode /UseOutlines'); $this->_out('/PageMode /UseOutlines');
@@ -449,7 +449,7 @@ function Row($data,$links)
// line height // line height
$nb=0; $nb=0;
$data_cnt = count($data); $data_cnt = count($data);
for($i=0;$i<$data_cnt;$i++) for ($i=0;$i<$data_cnt;$i++)
$nb=max($nb,$this->NbLines($this->widths[$i],$data[$i])); $nb=max($nb,$this->NbLines($this->widths[$i],$data[$i]));
$il = $this->FontSize; $il = $this->FontSize;
$h=($il+1)*$nb; $h=($il+1)*$nb;
@@ -457,7 +457,7 @@ function Row($data,$links)
$this->CheckPageBreak($h); $this->CheckPageBreak($h);
// draw the cells // draw the cells
$data_cnt = count($data); $data_cnt = count($data);
for($i=0;$i<$data_cnt;$i++) for ($i=0;$i<$data_cnt;$i++)
{ {
$w=$this->widths[$i]; $w=$this->widths[$i];
// save current position // save current position
@@ -479,7 +479,7 @@ function Row($data,$links)
function CheckPageBreak($h) function CheckPageBreak($h)
{ {
// if height h overflows, manual page break // if height h overflows, manual page break
if($this->GetY()+$h>$this->PageBreakTrigger) if ($this->GetY()+$h>$this->PageBreakTrigger)
$this->AddPage($this->CurOrientation); $this->AddPage($this->CurOrientation);
} }
@@ -487,22 +487,22 @@ function NbLines($w,$txt)
{ {
// compute number of lines used by a multicell of width w // compute number of lines used by a multicell of width w
$cw=&$this->CurrentFont['cw']; $cw=&$this->CurrentFont['cw'];
if($w==0) if ($w==0)
$w=$this->w-$this->rMargin-$this->x; $w=$this->w-$this->rMargin-$this->x;
$wmax=($w-2*$this->cMargin)*1000/$this->FontSize; $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
$s=str_replace("\r",'',$txt); $s=str_replace("\r",'',$txt);
$nb=strlen($s); $nb=strlen($s);
if($nb>0 and $s[$nb-1]=="\n") if ($nb>0 and $s[$nb-1]=="\n")
$nb--; $nb--;
$sep=-1; $sep=-1;
$i=0; $i=0;
$j=0; $j=0;
$l=0; $l=0;
$nl=1; $nl=1;
while($i<$nb) while ($i<$nb)
{ {
$c=$s[$i]; $c=$s[$i];
if($c=="\n") if ($c=="\n")
{ {
$i++; $i++;
$sep=-1; $sep=-1;
@@ -511,14 +511,14 @@ function NbLines($w,$txt)
$nl++; $nl++;
continue; continue;
} }
if($c==' ') if ($c==' ')
$sep=$i; $sep=$i;
$l+=$cw[$c]; $l+=$cw[$c];
if($l>$wmax) if ($l>$wmax)
{ {
if($sep==-1) if ($sep==-1)
{ {
if($i==$j) if ($i==$j)
$i++; $i++;
} }
else else
@@ -576,7 +576,7 @@ class PMA_RT_Table
// there are fields that require wider cells than the name of the table? // there are fields that require wider cells than the name of the table?
global $pdf; global $pdf;
foreach($this->fields AS $field) { foreach ($this->fields AS $field) {
$this->width = max($this->width, $pdf->GetStringWidth($field)); $this->width = max($this->width, $pdf->GetStringWidth($field));
} }
$this->width += $pdf->GetStringWidth(' '); $this->width += $pdf->GetStringWidth(' ');
@@ -633,7 +633,7 @@ class PMA_RT_Table
$pdf->SetTextColor(0); $pdf->SetTextColor(0);
$pdf->SetFillColor(255); $pdf->SetFillColor(255);
foreach($this->fields AS $field) { foreach ($this->fields AS $field) {
// loic1 : PHP3 fix // loic1 : PHP3 fix
// if (in_array($field, $this->primary)) { // if (in_array($field, $this->primary)) {
if ($setcolor) { if ($setcolor) {
@@ -994,7 +994,7 @@ class PMA_RT
function PMA_RT_drawRelations($change_color) function PMA_RT_drawRelations($change_color)
{ {
$i = 0; $i = 0;
foreach($this->relations AS $relation) { foreach ($this->relations AS $relation) {
$relation->PMA_RT_Relation_draw($change_color, $i); $relation->PMA_RT_Relation_draw($change_color, $i);
$i++; $i++;
} // end while } // end while
@@ -1012,7 +1012,7 @@ class PMA_RT
*/ */
function PMA_RT_drawTables($show_info,$draw_color=0) function PMA_RT_drawTables($show_info,$draw_color=0)
{ {
foreach($this->tables AS $table) { foreach ($this->tables AS $table) {
$table->PMA_RT_Table_draw($show_info, $this->ff,$draw_color); $table->PMA_RT_Table_draw($show_info, $this->ff,$draw_color);
} }
} // end of the "PMA_RT_drawTables()" method } // end of the "PMA_RT_drawTables()" method
@@ -1138,12 +1138,12 @@ class PMA_RT
/* snip */ /* snip */
foreach($alltables AS $table) { foreach ($alltables AS $table) {
if (!isset($this->tables[$table])) { if (!isset($this->tables[$table])) {
$this->tables[$table] = new PMA_RT_Table($table, $this->ff, $this->tablewidth); $this->tables[$table] = new PMA_RT_Table($table, $this->ff, $this->tablewidth);
} }
if($this->same_wide){ if ($this->same_wide){
$this->tables[$table]->width = $this->tablewidth; $this->tables[$table]->width = $this->tablewidth;
} }
$this->PMA_RT_setMinMax($this->tables[$table]); $this->PMA_RT_setMinMax($this->tables[$table]);
@@ -1176,12 +1176,12 @@ class PMA_RT
// and finding its foreigns is OK (then we can support innodb) // and finding its foreigns is OK (then we can support innodb)
$seen_a_relation = FALSE; $seen_a_relation = FALSE;
foreach($alltables AS $one_table) { foreach ($alltables AS $one_table) {
$exist_rel = PMA_getForeigners($db, $one_table, '', 'both'); $exist_rel = PMA_getForeigners($db, $one_table, '', 'both');
if ($exist_rel) { if ($exist_rel) {
$seen_a_relation = TRUE; $seen_a_relation = TRUE;
foreach($exist_rel AS $master_field => $rel) { foreach ($exist_rel AS $master_field => $rel) {
// put the foreign table on the schema only if selected // put the foreign table on the schema only if selected
// by the user // by the user
// (do not use array_search() because we would have to // (do not use array_search() because we would have to
@@ -1223,7 +1223,7 @@ function PMA_RT_DOC($alltables ){
$pdf->Cell(0,9, $GLOBALS['strTableOfContents'],1,0,'C'); $pdf->Cell(0,9, $GLOBALS['strTableOfContents'],1,0,'C');
$pdf->Ln(15); $pdf->Ln(15);
$i = 1; $i = 1;
foreach($alltables AS $table) { foreach ($alltables AS $table) {
$pdf->PMA_links['doc'][$table]['-'] = $pdf->AddLink(); $pdf->PMA_links['doc'][$table]['-'] = $pdf->AddLink();
$pdf->SetX(10); $pdf->SetX(10);
//$pdf->Ln(1); //$pdf->Ln(1);
@@ -1248,7 +1248,7 @@ function PMA_RT_DOC($alltables ){
$pdf->SetX(10); $pdf->SetX(10);
$pdf->Cell(0,6,$i.' '. $GLOBALS['strRelationalSchema'],0,1,'L',0,$pdf->PMA_links['RT']['-']); $pdf->Cell(0,6,$i.' '. $GLOBALS['strRelationalSchema'],0,1,'L',0,$pdf->PMA_links['RT']['-']);
$z = 0; $z = 0;
foreach($alltables AS $table) { foreach ($alltables AS $table) {
$z++; $z++;
$pdf->addpage($GLOBALS['orientation']); $pdf->addpage($GLOBALS['orientation']);
$pdf->Bookmark($table); $pdf->Bookmark($table);

View File

@@ -161,7 +161,7 @@ if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
$temp_history = PMA_getHistory($cfg['Server']['user']); $temp_history = PMA_getHistory($cfg['Server']['user']);
if (is_array($temp_history) && count($temp_history) > 0) { if (is_array($temp_history) && count($temp_history) > 0) {
foreach($temp_history AS $history_nr => $history_array) { foreach ($temp_history AS $history_nr => $history_array) {
if (!isset($dup_sql[$history_array['sqlquery']])) { if (!isset($dup_sql[$history_array['sqlquery']])) {
$sql_history[] = '<li>' $sql_history[] = '<li>'
. '<a href="#" onclick="document.querywindow.querydisplay_tab.value = \'' . (isset($querydisplay_tab) && $querydisplay_tab != 'full' ? 'sql' : 'full') . '\'; document.querywindow.query_history_latest.value = \'' . preg_replace('/(\n)/i', ' ', addslashes(htmlspecialchars($history_array['sqlquery']))) . '\'; document.querywindow.auto_commit.value = \'false\'; document.querywindow.db.value = \'' . htmlspecialchars($history_array['db']) . '\'; document.querywindow.query_history_latest_db.value = \'' . htmlspecialchars($history_array['db']) . '\'; document.querywindow.table.value = \'' . (isset($history_array['table']) ? htmlspecialchars($history_array['table']) : '') . '\'; document.querywindow.query_history_latest_table.value = \'' . (isset($history_array['table']) ? htmlspecialchars($history_array['table']) : '') . '\'; document.querywindow.submit(); return false;">' . $titles['Change'] . '</a>' . '<a href="#" onclick="document.querywindow.querydisplay_tab.value = \'' . (isset($querydisplay_tab) && $querydisplay_tab != 'full' ? 'sql' : 'full') . '\'; document.querywindow.query_history_latest.value = \'' . preg_replace('/(\n)/i', ' ', addslashes(htmlspecialchars($history_array['sqlquery']))) . '\'; document.querywindow.auto_commit.value = \'false\'; document.querywindow.db.value = \'' . htmlspecialchars($history_array['db']) . '\'; document.querywindow.query_history_latest_db.value = \'' . htmlspecialchars($history_array['db']) . '\'; document.querywindow.table.value = \'' . (isset($history_array['table']) ? htmlspecialchars($history_array['table']) : '') . '\'; document.querywindow.query_history_latest_table.value = \'' . (isset($history_array['table']) ? htmlspecialchars($history_array['table']) : '') . '\'; document.querywindow.submit(); return false;">' . $titles['Change'] . '</a>'
@@ -176,7 +176,7 @@ if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
if (isset($query_history) && is_array($query_history)) { if (isset($query_history) && is_array($query_history)) {
$current_index = count($query_history); $current_index = count($query_history);
foreach($query_history AS $query_no => $query_sql) { foreach ($query_history AS $query_no => $query_sql) {
if (!isset($dup_sql[$query_sql])) { if (!isset($dup_sql[$query_sql])) {
$input_query_history[] = '<input type="hidden" name="query_history[]" value="' . $query_sql . '" />'; $input_query_history[] = '<input type="hidden" name="query_history[]" value="' . $query_sql . '" />';

View File

@@ -329,7 +329,7 @@ if (isset($my_die)) {
$js_to_run = 'functions.js'; $js_to_run = 'functions.js';
require_once('./header.inc.php'); require_once('./header.inc.php');
if (is_array($my_die)) { if (is_array($my_die)) {
foreach($my_die AS $key => $die_string) { foreach ($my_die AS $key => $die_string) {
PMA_mysqlDie('', $die_string, '', $err_url, FALSE); PMA_mysqlDie('', $die_string, '', $err_url, FALSE);
echo '<hr />'; echo '<hr />';
} }

View File

@@ -110,7 +110,7 @@ if (!empty($dbstats) && !$is_superuser) {
* Prepares the statistics * Prepares the statistics
*/ */
$statistics = array(); $statistics = array();
foreach($dblist AS $current_db) { foreach ($dblist AS $current_db) {
$tmp_array = array( $tmp_array = array(
'db_name' => $current_db, 'db_name' => $current_db,
'tbl_cnt' => 0, 'tbl_cnt' => 0,

View File

@@ -39,7 +39,7 @@ if ($server > 0 && empty($dblist)) {
$multi_values = '<div align="center"><select name="db_select[]" size="6" multiple="multiple">'; $multi_values = '<div align="center"><select name="db_select[]" size="6" multiple="multiple">';
$multi_values .= "\n"; $multi_values .= "\n";
foreach($dblist AS $current_db) { foreach ($dblist AS $current_db) {
if (!empty($selectall) || (isset($tmp_select) && strpos(' ' . $tmp_select, '|' . $current_db . '|'))) { if (!empty($selectall) || (isset($tmp_select) && strpos(' ' . $tmp_select, '|' . $current_db . '|'))) {
$is_selected = ' selected="selected"'; $is_selected = ' selected="selected"';
} else { } else {

View File

@@ -66,7 +66,7 @@ unset($row);
</tr> </tr>
<?php <?php
$useBgcolorOne = TRUE; $useBgcolorOne = TRUE;
foreach($serverProcesses AS $name => $value) { foreach ($serverProcesses AS $name => $value) {
?> ?>
<tr> <tr>
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">&nbsp;<a href="./server_processlist.php?<?php echo $url_query . '&amp;kill=' . $value['Id']; ?>"><?php echo $strKill; ?></a>&nbsp;</td> <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">&nbsp;<a href="./server_processlist.php?<?php echo $url_query . '&amp;kill=' . $value['Id']; ?>"><?php echo $strKill; ?></a>&nbsp;</td>

View File

@@ -71,7 +71,7 @@ unset($res, $row);
//Get query statistics //Get query statistics
$queryStats = array(); $queryStats = array();
$tmp_array = $serverStatus; $tmp_array = $serverStatus;
foreach($tmp_array AS $name => $value) { foreach ($tmp_array AS $name => $value) {
if (substr($name, 0, 4) == 'Com_') { if (substr($name, 0, 4) == 'Com_') {
$queryStats[str_replace('_', ' ', substr($name, 4))] = $value; $queryStats[str_replace('_', ' ', substr($name, 4))] = $value;
unset($serverStatus[$name]); unset($serverStatus[$name]);
@@ -236,7 +236,7 @@ if (!empty($serverStatus)) {
<?php <?php
$useBgcolorOne = TRUE; $useBgcolorOne = TRUE;
$countRows = 0; $countRows = 0;
foreach($serverStatus AS $name => $value) { foreach ($serverStatus AS $name => $value) {
?> ?>
<tr> <tr>
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">&nbsp;<?php echo htmlspecialchars(str_replace('_', ' ', $name)); ?>&nbsp;</td> <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">&nbsp;<?php echo htmlspecialchars(str_replace('_', ' ', $name)); ?>&nbsp;</td>

View File

@@ -194,14 +194,14 @@ if (isset($submit_num_fields)) {
// garvin: Update comment table, if a comment was set. // garvin: Update comment table, if a comment was set.
if (isset($field_comments) && is_array($field_comments) && $cfgRelation['commwork']) { if (isset($field_comments) && is_array($field_comments) && $cfgRelation['commwork']) {
foreach($field_comments AS $fieldindex => $fieldcomment) { foreach ($field_comments AS $fieldindex => $fieldcomment) {
PMA_setComment($db, $table, $field_name[$fieldindex], $fieldcomment); PMA_setComment($db, $table, $field_name[$fieldindex], $fieldcomment);
} }
} }
// garvin: Update comment table for mime types [MIME] // garvin: Update comment table for mime types [MIME]
if (isset($field_mimetype) && is_array($field_mimetype) && $cfgRelation['commwork'] && $cfgRelation['mimework'] && $cfg['BrowseMIME']) { if (isset($field_mimetype) && is_array($field_mimetype) && $cfgRelation['commwork'] && $cfgRelation['mimework'] && $cfg['BrowseMIME']) {
foreach($field_mimetype AS $fieldindex => $mimetype) { foreach ($field_mimetype AS $fieldindex => $mimetype) {
PMA_setMIME($db, $table, $field_name[$fieldindex], $mimetype, $field_transformation[$fieldindex], $field_transformation_options[$fieldindex]); PMA_setMIME($db, $table, $field_name[$fieldindex], $mimetype, $field_transformation[$fieldindex], $field_transformation_options[$fieldindex]);
} }
} }

View File

@@ -90,14 +90,14 @@ if (isset($submit)) {
// garvin: Update comment table, if a comment was set. // garvin: Update comment table, if a comment was set.
if (isset($field_comments) && is_array($field_comments) && $cfgRelation['commwork']) { if (isset($field_comments) && is_array($field_comments) && $cfgRelation['commwork']) {
foreach($field_comments AS $fieldindex => $fieldcomment) { foreach ($field_comments AS $fieldindex => $fieldcomment) {
PMA_setComment($db, $table, $field_name[$fieldindex], $fieldcomment, $field_orig[$fieldindex]); PMA_setComment($db, $table, $field_name[$fieldindex], $fieldcomment, $field_orig[$fieldindex]);
} }
} }
// garvin: Rename relations&display fields, if altered. // garvin: Rename relations&display fields, if altered.
if (($cfgRelation['displaywork'] || $cfgRelation['relwork']) && isset($field_orig) && is_array($field_orig)) { if (($cfgRelation['displaywork'] || $cfgRelation['relwork']) && isset($field_orig) && is_array($field_orig)) {
foreach($field_orig AS $fieldindex => $fieldcontent) { foreach ($field_orig AS $fieldindex => $fieldcontent) {
if ($field_name[$fieldindex] != $fieldcontent) { if ($field_name[$fieldindex] != $fieldcontent) {
if ($cfgRelation['displaywork']) { if ($cfgRelation['displaywork']) {
$table_query = 'UPDATE ' . PMA_backquote($cfgRelation['table_info']) $table_query = 'UPDATE ' . PMA_backquote($cfgRelation['table_info'])
@@ -135,7 +135,7 @@ if (isset($submit)) {
// garvin: Update comment table for mime types [MIME] // garvin: Update comment table for mime types [MIME]
if (isset($field_mimetype) && is_array($field_mimetype) && $cfgRelation['commwork'] && $cfgRelation['mimework'] && $cfg['BrowseMIME']) { if (isset($field_mimetype) && is_array($field_mimetype) && $cfgRelation['commwork'] && $cfgRelation['mimework'] && $cfg['BrowseMIME']) {
foreach($field_mimetype AS $fieldindex => $mimetype) { foreach ($field_mimetype AS $fieldindex => $mimetype) {
PMA_setMIME($db, $table, $field_name[$fieldindex], $mimetype, $field_transformation[$fieldindex], $field_transformation_options[$fieldindex]); PMA_setMIME($db, $table, $field_name[$fieldindex], $mimetype, $field_transformation[$fieldindex], $field_transformation_options[$fieldindex]);
} }
} }

View File

@@ -88,7 +88,7 @@ if (isset($primary_key)) {
$row = array(); $row = array();
$result = array(); $result = array();
foreach($primary_key_array AS $rowcount => $primary_key) { foreach ($primary_key_array AS $rowcount => $primary_key) {
$local_query = 'SELECT * FROM ' . PMA_backquote($table) . ' WHERE ' . $primary_key . ';'; $local_query = 'SELECT * FROM ' . PMA_backquote($table) . ' WHERE ' . $primary_key . ';';
$result[$rowcount] = PMA_DBI_query($local_query, NULL, PMA_DBI_QUERY_STORE); $result[$rowcount] = PMA_DBI_query($local_query, NULL, PMA_DBI_QUERY_STORE);
$row[$rowcount] = PMA_DBI_fetch_assoc($result[$rowcount]); $row[$rowcount] = PMA_DBI_fetch_assoc($result[$rowcount]);
@@ -165,7 +165,7 @@ document.onkeydown = onKeyDownArrowsHandler;
<input type="hidden" name="sql_query" value="<?php echo isset($sql_query) ? urlencode($sql_query) : ''; ?>" /> <input type="hidden" name="sql_query" value="<?php echo isset($sql_query) ? urlencode($sql_query) : ''; ?>" />
<?php <?php
if (isset($primary_key_array)) { if (isset($primary_key_array)) {
foreach($primary_key_array AS $primary_key) { foreach ($primary_key_array AS $primary_key) {
?> ?>
<input type="hidden" name="primary_key[]" value="<?php echo urlencode($primary_key); ?>" /> <input type="hidden" name="primary_key[]" value="<?php echo urlencode($primary_key); ?>" />
<?php <?php
@@ -215,7 +215,7 @@ $tab1 = +2;
$tab2 = +1; $tab2 = +1;
$tab3 = 0; $tab3 = 0;
$o_rows = 0; $o_rows = 0;
foreach($loop_array AS $vrowcount => $vrow) { foreach ($loop_array AS $vrowcount => $vrow) {
if ($vrow === FALSE) { if ($vrow === FALSE) {
unset($vrow); unset($vrow);
} }

View File

@@ -192,14 +192,14 @@ if (isset($submit_num_fields)) {
// garvin: Update comment table, if a comment was set. // garvin: Update comment table, if a comment was set.
if (isset($field_comments) && is_array($field_comments) && $cfgRelation['commwork']) { if (isset($field_comments) && is_array($field_comments) && $cfgRelation['commwork']) {
foreach($field_comments AS $fieldindex => $fieldcomment) { foreach ($field_comments AS $fieldindex => $fieldcomment) {
PMA_setComment($db, $table, $field_name[$fieldindex], $fieldcomment); PMA_setComment($db, $table, $field_name[$fieldindex], $fieldcomment);
} }
} }
// garvin: Update comment table for mime types [MIME] // garvin: Update comment table for mime types [MIME]
if (isset($field_mimetype) && is_array($field_mimetype) && $cfgRelation['commwork'] && $cfgRelation['mimework'] && $cfg['BrowseMIME']) { if (isset($field_mimetype) && is_array($field_mimetype) && $cfgRelation['commwork'] && $cfgRelation['mimework'] && $cfg['BrowseMIME']) {
foreach($field_mimetype AS $fieldindex => $mimetype) { foreach ($field_mimetype AS $fieldindex => $mimetype) {
PMA_setMIME($db, $table, $field_name[$fieldindex], $mimetype, $field_transformation[$fieldindex], $field_transformation_options[$fieldindex]); PMA_setMIME($db, $table, $field_name[$fieldindex], $mimetype, $field_transformation[$fieldindex], $field_transformation_options[$fieldindex]);
} }
} }

View File

@@ -120,7 +120,7 @@ if (!defined('PMA_IDX_INCLUDED')) {
$fields_names = array(); $fields_names = array();
$fields_types = array(); $fields_types = array();
foreach($save_row AS $saved_row_key => $row) { foreach ($save_row AS $saved_row_key => $row) {
$fields_names[] = $row['Field']; $fields_names[] = $row['Field'];
// loic1: set or enum types: slashes single quotes inside options // loic1: set or enum types: slashes single quotes inside options
if (preg_match('@^(set|enum)\((.+)\)$@i', $row['Type'], $tmp)) { if (preg_match('@^(set|enum)\((.+)\)$@i', $row['Type'], $tmp)) {
@@ -189,7 +189,7 @@ if (!defined('PMA_IDX_INCLUDED')
break; break;
} // end switch } // end switch
$index_fields = ''; $index_fields = '';
foreach($column AS $i => $name) { foreach ($column AS $i => $name) {
if ($name != '--ignore--') { if ($name != '--ignore--') {
$index_fields .= (empty($index_fields) ? '' : ',') $index_fields .= (empty($index_fields) ? '' : ',')
. PMA_backquote($name) . PMA_backquote($name)
@@ -266,7 +266,7 @@ else if (!defined('PMA_IDX_INCLUDED')
} // end for } // end for
// Restore entered values // Restore entered values
foreach($column AS $i => $name) { foreach ($column AS $i => $name) {
if ($name != '--ignore--'){ if ($name != '--ignore--'){
$edited_index_data[$i+1]['Column_name'] = $name; $edited_index_data[$i+1]['Column_name'] = $name;
$edited_index_data[$i+1]['Sub_part'] = $sub_part[$i]; $edited_index_data[$i+1]['Sub_part'] = $sub_part[$i];
@@ -300,7 +300,7 @@ else if (!defined('PMA_IDX_INCLUDED')
</td> </td>
</tr> </tr>
<tr><td align="right"><?php <tr><td align="right"><?php
if($cfg['ErrorIconic']){ if ($cfg['ErrorIconic']){
echo '<img src="./images/s_warn.png" width="16" height="16" border="0" alt="Attention" />'; echo '<img src="./images/s_warn.png" width="16" height="16" border="0" alt="Attention" />';
} }
?></td><td><?php echo $strPrimaryKeyWarning . "\n"; ?></td></tr> ?></td><td><?php echo $strPrimaryKeyWarning . "\n"; ?></td></tr>
@@ -336,7 +336,7 @@ else if (!defined('PMA_IDX_INCLUDED')
<th><?php echo $strSize; ?></th> <th><?php echo $strSize; ?></th>
</tr> </tr>
<?php <?php
foreach($edited_index_info['Sequences'] AS $row_no => $seq_index) { foreach ($edited_index_info['Sequences'] AS $row_no => $seq_index) {
$add_type = (is_array($fields_types) && count($fields_types) == count($fields_names)); $add_type = (is_array($fields_types) && count($fields_types) == count($fields_names));
$selected = $edited_index_data[$seq_index]['Column_name']; $selected = $edited_index_data[$seq_index]['Column_name'];
if (!empty($edited_index_data[$seq_index]['Sub_part'])) { if (!empty($edited_index_data[$seq_index]['Sub_part'])) {
@@ -353,7 +353,7 @@ else if (!defined('PMA_IDX_INCLUDED')
<option value="--ignore--"<?php if ('--ignore--' == $selected) echo ' selected="selected"'; ?>> <option value="--ignore--"<?php if ('--ignore--' == $selected) echo ' selected="selected"'; ?>>
-- <?php echo $strIgnore; ?> --</option> -- <?php echo $strIgnore; ?> --</option>
<?php <?php
foreach($fields_names AS $key => $val) { foreach ($fields_names AS $key => $val) {
if ($index_type != 'FULLTEXT' if ($index_type != 'FULLTEXT'
|| preg_match('@^(varchar|text|tinytext|mediumtext|longtext)@i', $fields_types[$key])) { || preg_match('@^(varchar|text|tinytext|mediumtext|longtext)@i', $fields_types[$key])) {
echo "\n" . ' ' echo "\n" . ' '
@@ -439,7 +439,7 @@ else if (!defined('PMA_IDX_INCLUDED')
</tr> </tr>
<?php <?php
echo "\n"; echo "\n";
foreach($indexes AS $index_no => $index_name) { foreach ($indexes AS $index_no => $index_name) {
$cell_bgd = (($index_no % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']); $cell_bgd = (($index_no % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']);
$index_td = ' <td bgcolor="' . $cell_bgd . '" rowspan="' . count($indexes_info[$index_name]['Sequences']) . '">' . "\n"; $index_td = ' <td bgcolor="' . $cell_bgd . '" rowspan="' . count($indexes_info[$index_name]['Sequences']) . '">' . "\n";
echo ' <tr>' . "\n"; echo ' <tr>' . "\n";
@@ -482,7 +482,7 @@ else if (!defined('PMA_IDX_INCLUDED')
. ' <a href="sql.php?' . $url_query . '&amp;sql_query=' . $local_query . '&amp;zero_rows=' . $zero_rows . '" onclick="return confirmLink(this, \'' . $js_msg . '\')">' . $drop_link_text . '</a>' . "\n" . ' <a href="sql.php?' . $url_query . '&amp;sql_query=' . $local_query . '&amp;zero_rows=' . $zero_rows . '" onclick="return confirmLink(this, \'' . $js_msg . '\')">' . $drop_link_text . '</a>' . "\n"
. ' </td>' . "\n"; . ' </td>' . "\n";
foreach($indexes_info[$index_name]['Sequences'] AS $row_no => $seq_index) { foreach ($indexes_info[$index_name]['Sequences'] AS $row_no => $seq_index) {
if ($row_no > 0) { if ($row_no > 0) {
echo ' <tr>' . "\n"; echo ' <tr>' . "\n";
} }
@@ -510,7 +510,7 @@ else if (!defined('PMA_IDX_INCLUDED')
else { else {
// none indexes // none indexes
echo "\n" . ' <tr><td colspan=7" align="center">' . "\n"; echo "\n" . ' <tr><td colspan=7" align="center">' . "\n";
if($cfg['ErrorIconic']){ if ($cfg['ErrorIconic']){
echo '<img src="./images/s_warn.png" width="16" height="16" border="0" alt="Warning" hspace="2" align="absmiddle" />'; echo '<img src="./images/s_warn.png" width="16" height="16" border="0" alt="Warning" hspace="2" align="absmiddle" />';
} }
echo ' <b>' . $strNoIndex . '</b></td></tr>' . "\n\n"; echo ' <b>' . $strNoIndex . '</b></td></tr>' . "\n\n";

View File

@@ -56,19 +56,19 @@ global $cfgRelation;
if ($cfgRelation[$work]) { if ($cfgRelation[$work]) {
$select_parts = array(); $select_parts = array();
$row_fields = array(); $row_fields = array();
foreach($get_fields AS $nr => $get_field) { foreach ($get_fields AS $nr => $get_field) {
$select_parts[] = PMA_backquote($get_field); $select_parts[] = PMA_backquote($get_field);
$row_fields[$get_field] = 'cc'; $row_fields[$get_field] = 'cc';
} }
$where_parts = array(); $where_parts = array();
foreach($where_fields AS $_where => $_value) { foreach ($where_fields AS $_where => $_value) {
$where_parts[] = PMA_backquote($_where) . ' = \'' . PMA_sqlAddslashes($_value) . '\''; $where_parts[] = PMA_backquote($_where) . ' = \'' . PMA_sqlAddslashes($_value) . '\'';
} }
$new_parts = array(); $new_parts = array();
$new_value_parts = array(); $new_value_parts = array();
foreach($new_fields AS $_where => $_value) { foreach ($new_fields AS $_where => $_value) {
$new_parts[] = PMA_backquote($_where); $new_parts[] = PMA_backquote($_where);
$new_value_parts[] = PMA_sqlAddslashes($_value); $new_value_parts[] = PMA_sqlAddslashes($_value);
} }
@@ -80,7 +80,7 @@ global $cfgRelation;
while ($table_copy_row = @PMA_DBI_fetch_assoc($table_copy_rs)) { while ($table_copy_row = @PMA_DBI_fetch_assoc($table_copy_rs)) {
$value_parts = array(); $value_parts = array();
foreach($table_copy_row AS $_key => $_val) { foreach ($table_copy_row AS $_key => $_val) {
if (isset($row_fields[$_key]) && $row_fields[$_key] == 'cc') { if (isset($row_fields[$_key]) && $row_fields[$_key] == 'cc') {
$value_parts[] = PMA_sqlAddslashes($_val); $value_parts[] = PMA_sqlAddslashes($_val);
} }

View File

@@ -54,7 +54,7 @@ $multi_tables = (count($the_tables) > 1);
if ($multi_tables) { if ($multi_tables) {
$tbl_list = ''; $tbl_list = '';
foreach($the_tables AS $key => $table) { foreach ($the_tables AS $key => $table) {
$tbl_list .= (empty($tbl_list) ? '' : ', ') $tbl_list .= (empty($tbl_list) ? '' : ', ')
. PMA_backquote(urldecode($table)); . PMA_backquote(urldecode($table));
} }
@@ -65,7 +65,7 @@ if ($multi_tables) {
$tables_cnt = count($the_tables); $tables_cnt = count($the_tables);
$counter = 0; $counter = 0;
foreach($the_tables AS $key => $table) { foreach ($the_tables AS $key => $table) {
$table = urldecode($table); $table = urldecode($table);
if ($counter + 1 >= $tables_cnt) { if ($counter + 1 >= $tables_cnt) {
$breakstyle = ''; $breakstyle = '';
@@ -311,7 +311,7 @@ foreach($the_tables AS $key => $table) {
</tr> </tr>
<?php <?php
echo "\n"; echo "\n";
foreach($indexes AS $index_no => $index_name) { foreach ($indexes AS $index_no => $index_name) {
$cell_bgd = (($index_no % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']); $cell_bgd = (($index_no % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']);
$index_td = ' <td class="print" rowspan="' . count($indexes_info[$index_name]['Sequences']) . '">' . "\n"; $index_td = ' <td class="print" rowspan="' . count($indexes_info[$index_name]['Sequences']) . '">' . "\n";
echo ' <tr>' . "\n"; echo ' <tr>' . "\n";
@@ -336,7 +336,7 @@ foreach($the_tables AS $key => $table) {
. ' ' . (isset($indexes_info[$index_name]['Cardinality']) ? $indexes_info[$index_name]['Cardinality'] : $strNone) . "\n" . ' ' . (isset($indexes_info[$index_name]['Cardinality']) ? $indexes_info[$index_name]['Cardinality'] : $strNone) . "\n"
. ' </td>' . "\n"; . ' </td>' . "\n";
foreach($indexes_info[$index_name]['Sequences'] AS $row_no => $seq_index) { foreach ($indexes_info[$index_name]['Sequences'] AS $row_no => $seq_index) {
if ($row_no > 0) { if ($row_no > 0) {
echo ' <tr>' . "\n"; echo ' <tr>' . "\n";
} }

View File

@@ -49,7 +49,7 @@ if (isset($after_field)) {
} }
if (isset($selected) && is_array($selected)) { if (isset($selected) && is_array($selected)) {
foreach($selected AS $o_fld_nr => $o_fld_val) { foreach ($selected AS $o_fld_nr => $o_fld_val) {
?> ?>
<input type="hidden" name="selected[<?php echo $o_fld_nr; ?>]" value="<?php echo urlencode($o_fld_val); ?>" /> <input type="hidden" name="selected[<?php echo $o_fld_nr; ?>]" value="<?php echo urlencode($o_fld_val); ?>" />
<?php <?php
@@ -62,7 +62,7 @@ if (isset($selected) && is_array($selected)) {
} }
if (isset($true_selected) && is_array($true_selected)) { if (isset($true_selected) && is_array($true_selected)) {
foreach($true_selected AS $o_fld_nr => $o_fld_val) { foreach ($true_selected AS $o_fld_nr => $o_fld_val) {
?> ?>
<input type="hidden" name="true_selected[<?php echo $o_fld_nr; ?>]" value="<?php echo urlencode($o_fld_val); ?>" /> <input type="hidden" name="true_selected[<?php echo $o_fld_nr; ?>]" value="<?php echo urlencode($o_fld_val); ?>" />
<?php <?php
@@ -131,7 +131,7 @@ if (!$is_backup) {
// the index as a value, not a key. Inserted here for easier maintaineance // the index as a value, not a key. Inserted here for easier maintaineance
// and less code to change in existing files. // and less code to change in existing files.
if (isset($field_fulltext) && is_array($field_fulltext)) { if (isset($field_fulltext) && is_array($field_fulltext)) {
foreach($field_fulltext AS $fulltext_nr => $fulltext_indexkey) { foreach ($field_fulltext AS $fulltext_nr => $fulltext_indexkey) {
$submit_fulltext[$fulltext_indexkey] = $fulltext_indexkey; $submit_fulltext[$fulltext_indexkey] = $fulltext_indexkey;
} }
} }
@@ -341,7 +341,7 @@ for ($i = 0 ; $i < $num_fields; $i++) {
$content_cells[$i][$ci] = '<select name="field_extra[]" id="field_' . $i . '_' . ($ci - $ci_offset) . '">'; $content_cells[$i][$ci] = '<select name="field_extra[]" id="field_' . $i . '_' . ($ci - $ci_offset) . '">';
if(!isset($row) || empty($row['Extra'])) { if (!isset($row) || empty($row['Extra'])) {
$content_cells[$i][$ci] .= "\n"; $content_cells[$i][$ci] .= "\n";
$content_cells[$i][$ci] .= '<option value=""></option>' . "\n"; $content_cells[$i][$ci] .= '<option value=""></option>' . "\n";
$content_cells[$i][$ci] .= '<option value="AUTO_INCREMENT">auto_increment</option>' . "\n"; $content_cells[$i][$ci] .= '<option value="AUTO_INCREMENT">auto_increment</option>' . "\n";
@@ -367,7 +367,7 @@ for ($i = 0 ; $i < $num_fields; $i++) {
$content_cells[$i][$ci] .= ' <option value="auto">auto-detect</option>' . "\n"; $content_cells[$i][$ci] .= ' <option value="auto">auto-detect</option>' . "\n";
if (is_array($available_mime['mimetype'])) { if (is_array($available_mime['mimetype'])) {
foreach($available_mime['mimetype'] AS $mimekey => $mimetype) { foreach ($available_mime['mimetype'] AS $mimekey => $mimetype) {
$checked = (isset($row) && isset($row['Field']) && isset($mime_map[$row['Field']]['mimetype']) && ($mime_map[$row['Field']]['mimetype'] == str_replace('/', '_', $mimetype)) ? 'selected ' : ''); $checked = (isset($row) && isset($row['Field']) && isset($mime_map[$row['Field']]['mimetype']) && ($mime_map[$row['Field']]['mimetype'] == str_replace('/', '_', $mimetype)) ? 'selected ' : '');
$content_cells[$i][$ci] .= ' <option value="' . str_replace('/', '_', $mimetype) . '" ' . $checked . '>' . htmlspecialchars($mimetype) . '</option>'; $content_cells[$i][$ci] .= ' <option value="' . str_replace('/', '_', $mimetype) . '" ' . $checked . '>' . htmlspecialchars($mimetype) . '</option>';
} }
@@ -379,7 +379,7 @@ for ($i = 0 ; $i < $num_fields; $i++) {
$content_cells[$i][$ci] = '<select id="field_' . $i . '_' . ($ci - $ci_offset) . '" size="1" name="field_transformation[]">' . "\n"; $content_cells[$i][$ci] = '<select id="field_' . $i . '_' . ($ci - $ci_offset) . '" size="1" name="field_transformation[]">' . "\n";
$content_cells[$i][$ci] .= ' <option value="" title="' . $strNone . '"></option>' . "\n"; $content_cells[$i][$ci] .= ' <option value="" title="' . $strNone . '"></option>' . "\n";
if (is_array($available_mime['transformation'])) { if (is_array($available_mime['transformation'])) {
foreach($available_mime['transformation'] AS $mimekey => $transform) { foreach ($available_mime['transformation'] AS $mimekey => $transform) {
$checked = (isset($row) && isset($row['Field']) && isset($mime_map[$row['Field']]['transformation']) && (preg_match('@' . preg_quote($available_mime['transformation_file'][$mimekey]) . '3?@i', $mime_map[$row['Field']]['transformation'])) ? 'selected ' : ''); $checked = (isset($row) && isset($row['Field']) && isset($mime_map[$row['Field']]['transformation']) && (preg_match('@' . preg_quote($available_mime['transformation_file'][$mimekey]) . '3?@i', $mime_map[$row['Field']]['transformation'])) ? 'selected ' : '');
$tooltip = 'strTransformation_' . strtolower(preg_replace('@(\.inc\.php3?)$@', '', $available_mime['transformation_file'][$mimekey])); $tooltip = 'strTransformation_' . strtolower(preg_replace('@(\.inc\.php3?)$@', '', $available_mime['transformation_file'][$mimekey]));
$tooltip = isset($$tooltip) ? $$tooltip : sprintf(str_replace('<br />', ' ', $strMIME_nodescription), 'PMA_transformation_' . $tooltip . '()'); $tooltip = isset($$tooltip) ? $$tooltip : sprintf(str_replace('<br />', ' ', $strMIME_nodescription), 'PMA_transformation_' . $tooltip . '()');
@@ -447,7 +447,7 @@ if ($cfg['DefaultPropDisplay'] == 'horizontal') {
<tr> <tr>
<?php <?php
if (is_array($header_cells)) { if (is_array($header_cells)) {
foreach($header_cells AS $header_nr => $header_val) { foreach ($header_cells AS $header_nr => $header_val) {
?> ?>
<th><?php echo $header_val; ?></th> <th><?php echo $header_val; ?></th>
<?php <?php
@@ -458,14 +458,14 @@ if ($cfg['DefaultPropDisplay'] == 'horizontal') {
<?php <?php
if (is_array($content_cells)) { if (is_array($content_cells)) {
$i = 0; $i = 0;
foreach($content_cells AS $content_nr => $content_row) { foreach ($content_cells AS $content_nr => $content_row) {
$i++; $i++;
echo "\n" . '<tr>' . "\n"; echo "\n" . '<tr>' . "\n";
$bgcolor = ($i % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; $bgcolor = ($i % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
if (is_array($content_row)) { if (is_array($content_row)) {
foreach($content_row AS $content_row_nr => $content_row_val) { foreach ($content_row AS $content_row_nr => $content_row_val) {
?> ?>
<td bgcolor="<?php echo $bgcolor; ?>"><?php echo $content_row_val; ?></td> <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $content_row_val; ?></td>
<?php <?php
@@ -485,7 +485,7 @@ if ($cfg['DefaultPropDisplay'] == 'horizontal') {
<?php <?php
if (is_array($header_cells)) { if (is_array($header_cells)) {
$i = 0; $i = 0;
foreach($header_cells AS $header_nr => $header_val) { foreach ($header_cells AS $header_nr => $header_val) {
echo "\n" . '<tr>' . "\n"; echo "\n" . '<tr>' . "\n";
?> ?>
<th align="right"><?php echo $header_val; ?></th> <th align="right"><?php echo $header_val; ?></th>

View File

@@ -41,7 +41,7 @@ if (isset($sql_query)) {
if (isset($primary_key)) { if (isset($primary_key)) {
$sql_query .= ' WHERE '; $sql_query .= ' WHERE ';
$conj = ''; $conj = '';
foreach($primary_key AS $i => $key) { foreach ($primary_key AS $i => $key) {
$sql_query .= $conj . '( ' . $key . ' ) '; $sql_query .= $conj . '( ' . $key . ' ) ';
$conj = 'OR '; $conj = 'OR ';
} }

View File

@@ -106,7 +106,7 @@ if (PMA_MYSQL_INT_VERSION >= 32334) {
<select name="order_field" style="vertical-align: middle"> <select name="order_field" style="vertical-align: middle">
<?php <?php
echo "\n"; echo "\n";
foreach($columns AS $junk => $fieldname) { foreach ($columns AS $junk => $fieldname) {
echo ' <option value="' . htmlspecialchars($fieldname) . '">' . htmlspecialchars($fieldname) . '</option>' . "\n"; echo ' <option value="' . htmlspecialchars($fieldname) . '">' . htmlspecialchars($fieldname) . '</option>' . "\n";
} }
unset($columns); unset($columns);
@@ -323,7 +323,7 @@ if ($cfgRelation['relwork'] && $tbl_type != "INNODB") {
<?php echo $strReferentialIntegrity; ?><br /> <?php echo $strReferentialIntegrity; ?><br />
<?php <?php
echo "\n"; echo "\n";
foreach($foreign AS $master => $arr) { foreach ($foreign AS $master => $arr) {
$join_query = 'SELECT ' . PMA_backquote($table) . '.* FROM ' $join_query = 'SELECT ' . PMA_backquote($table) . '.* FROM '
. PMA_backquote($table) . ' LEFT JOIN ' . PMA_backquote($table) . ' LEFT JOIN '
. PMA_backquote($arr['foreign_table']); . PMA_backquote($arr['foreign_table']);

View File

@@ -444,7 +444,7 @@ if ($cfg['PropertiesIconic']) {
<tr><td> <tr><td>
<!-- Printable view of the table --> <!-- Printable view of the table -->
<a href="tbl_printview.php?<?php echo $url_query; ?>"><?php <a href="tbl_printview.php?<?php echo $url_query; ?>"><?php
if($cfg['PropertiesIconic']){ if ($cfg['PropertiesIconic']){
echo '<img src="./images/b_print.png" border="0" hspace="2" align="absmiddle" width="16" height="16" />'; echo '<img src="./images/b_print.png" border="0" hspace="2" align="absmiddle" width="16" height="16" />';
} }
echo $strPrintView; echo $strPrintView;
@@ -455,7 +455,7 @@ if ($cfg['Server']['relation']) {
?> ?>
<!-- Work on Relations --> <!-- Work on Relations -->
<a href="tbl_relation.php?<?php echo $url_query; ?>"><?php <a href="tbl_relation.php?<?php echo $url_query; ?>"><?php
if($cfg['PropertiesIconic']){ if ($cfg['PropertiesIconic']){
echo '<img src="./images/b_relations.png" border="0" hspace="2" align="absmiddle" width="16" height="16" />'; echo '<img src="./images/b_relations.png" border="0" hspace="2" align="absmiddle" width="16" height="16" />';
} }
echo $strRelationView; echo $strRelationView;
@@ -465,7 +465,7 @@ if ($cfg['Server']['relation']) {
?> ?>
<!-- Let MySQL propose the optimal structure --> <!-- Let MySQL propose the optimal structure -->
<a href="sql.php?<?php echo $url_query; ?>&amp;session_max_rows=all&amp;sql_query=<?php echo urlencode('SELECT * FROM ' . PMA_backquote($table) . ' PROCEDURE ANALYSE()'); ?>"><?php <a href="sql.php?<?php echo $url_query; ?>&amp;session_max_rows=all&amp;sql_query=<?php echo urlencode('SELECT * FROM ' . PMA_backquote($table) . ' PROCEDURE ANALYSE()'); ?>"><?php
if($cfg['PropertiesIconic']){ if ($cfg['PropertiesIconic']){
echo '<img src="./images/b_tblanalyse.png" border="0" hspace="2" align="absmiddle" width="16" height="16" />'; echo '<img src="./images/b_tblanalyse.png" border="0" hspace="2" align="absmiddle" width="16" height="16" />';
} }
echo $strStructPropose; echo $strStructPropose;
@@ -490,7 +490,7 @@ if ($cfg['Server']['relation']) {
<option value="--first--"><?php echo $strAtBeginningOfTable; ?></option> <option value="--first--"><?php echo $strAtBeginningOfTable; ?></option>
<optgroup label="<?php printf($strAfter, ''); ?>" title="<?php printf($strAfter, ''); ?>"> <optgroup label="<?php printf($strAfter, ''); ?>" title="<?php printf($strAfter, ''); ?>">
<?php <?php
foreach($aryFields AS $junk => $fieldname) { foreach ($aryFields AS $junk => $fieldname) {
echo ' <option value="' . htmlspecialchars($fieldname) . '">' . htmlspecialchars($fieldname) . '</option>' . "\n"; echo ' <option value="' . htmlspecialchars($fieldname) . '">' . htmlspecialchars($fieldname) . '</option>' . "\n";
} }
unset($aryFields); unset($aryFields);

View File

@@ -336,7 +336,7 @@ if (!isset($is_inside_querywindow) ||
echo ' <div style="margin-bottom: 5px">' . "\n"; echo ' <div style="margin-bottom: 5px">' . "\n";
echo ' <select name="id_bookmark" style="vertical-align: middle">' . "\n"; echo ' <select name="id_bookmark" style="vertical-align: middle">' . "\n";
echo ' <option value=""></option>' . "\n"; echo ' <option value=""></option>' . "\n";
foreach($bookmark_list AS $key => $value) { foreach ($bookmark_list AS $key => $value) {
echo ' <option value="' . $value . '">' . htmlspecialchars($key) . '</option>' . "\n"; echo ' <option value="' . $value . '">' . htmlspecialchars($key) . '</option>' . "\n";
} }
echo ' </select>' . "<br />\n"; echo ' </select>' . "<br />\n";

View File

@@ -37,7 +37,7 @@ function PMA_generate_dropdown($dropdown_question,$radio_name,$choices,$selected
echo '<select name="' . $radio_name . '" style="font-size: ' . $font_smallest . '">' . "\n"; echo '<select name="' . $radio_name . '" style="font-size: ' . $font_smallest . '">' . "\n";
echo '<option value="nix" style="font-size: ' . $font_smallest . '" >--</option>' . "\n"; echo '<option value="nix" style="font-size: ' . $font_smallest . '" >--</option>' . "\n";
foreach($choices AS $one_value => $one_label) { foreach ($choices AS $one_value => $one_label) {
echo '<option value="' . $one_value . '"'; echo '<option value="' . $one_value . '"';
if ($selected_value == $one_value) { if ($selected_value == $one_value) {
echo ' selected="selected" '; echo ' selected="selected" ';
@@ -73,7 +73,7 @@ if ($cfgRelation['relwork']
// u p d a t e s f o r I n t e r n a l r e l a t i o n s // u p d a t e s f o r I n t e r n a l r e l a t i o n s
foreach($destination AS $master_field => $foreign_string) { foreach ($destination AS $master_field => $foreign_string) {
if ($foreign_string != 'nix') { if ($foreign_string != 'nix') {
list($foreign_db, $foreign_table, $foreign_field) = explode('.', $foreign_string); list($foreign_db, $foreign_table, $foreign_field) = explode('.', $foreign_string);
if (!isset($existrel[$master_field])) { if (!isset($existrel[$master_field])) {
@@ -112,7 +112,7 @@ if ($cfgRelation['relwork']
// ( for now, one index name; we keep the definitions if the // ( for now, one index name; we keep the definitions if the
// foreign db is not the same) // foreign db is not the same)
if (isset($destination_innodb)) { if (isset($destination_innodb)) {
foreach($destination_innodb AS $master_field => $foreign_string) { foreach ($destination_innodb AS $master_field => $foreign_string) {
if ($foreign_string != 'nix') { if ($foreign_string != 'nix') {
list($foreign_db, $foreign_table, $foreign_field) = explode('.', $foreign_string); list($foreign_db, $foreign_table, $foreign_field) = explode('.', $foreign_string);
if (!isset($existrel_innodb[$master_field])) { if (!isset($existrel_innodb[$master_field])) {
@@ -229,7 +229,7 @@ if ($cfgRelation['displaywork']
if ($cfgRelation['commwork'] if ($cfgRelation['commwork']
&& isset($submit_comm) && $submit_comm == 'true') { && isset($submit_comm) && $submit_comm == 'true') {
foreach($comment AS $key => $value) { foreach ($comment AS $key => $value) {
// garvin: I exported the snippet here to a function (relation.lib.php) , so it can be used multiple times throughout other pages where you can set comments. // garvin: I exported the snippet here to a function (relation.lib.php) , so it can be used multiple times throughout other pages where you can set comments.
PMA_setComment($db, $table, $key, $value); PMA_setComment($db, $table, $key, $value);
} // end while (transferred data) } // end while (transferred data)
@@ -391,7 +391,7 @@ if ($col_rs && PMA_DBI_num_rows($col_rs) > 0) {
$foreign_field = FALSE; $foreign_field = FALSE;
} }
$seen_key = FALSE; $seen_key = FALSE;
foreach($selectboxall AS $key => $value) { foreach ($selectboxall AS $key => $value) {
echo ' ' echo ' '
. '<option value="' . htmlspecialchars($key) . '"'; . '<option value="' . htmlspecialchars($key) . '"';
if ($foreign_field && $key == $foreign_field) { if ($foreign_field && $key == $foreign_field) {
@@ -428,7 +428,7 @@ if ($col_rs && PMA_DBI_num_rows($col_rs) > 0) {
} }
$found_foreign_field = FALSE; $found_foreign_field = FALSE;
foreach($selectboxall_innodb AS $key => $value) { foreach ($selectboxall_innodb AS $key => $value) {
echo ' ' echo ' '
. '<option value="' . htmlspecialchars($key) . '"'; . '<option value="' . htmlspecialchars($key) . '"';
if ($foreign_field && $key == $foreign_field) { if ($foreign_field && $key == $foreign_field) {
@@ -505,7 +505,7 @@ if ($col_rs && PMA_DBI_num_rows($col_rs) > 0) {
<option value="">---</option> <option value="">---</option>
<?php <?php
echo "\n"; echo "\n";
foreach($save_row AS $row) { foreach ($save_row AS $row) {
echo ' <option value="' . htmlspecialchars($row['Field']) . '"'; echo ' <option value="' . htmlspecialchars($row['Field']) . '"';
if (isset($disp) && $row['Field'] == $disp) { if (isset($disp) && $row['Field'] == $disp) {
echo ' selected="selected"'; echo ' selected="selected"';

View File

@@ -44,7 +44,7 @@ if (isset($after_insert) && $after_insert == 'new_insert') {
. '&dontlimitchars=' . $dontlimitchars . '&dontlimitchars=' . $dontlimitchars
. (empty($sql_query) ? '' : '&sql_query=' . urlencode($sql_query)); . (empty($sql_query) ? '' : '&sql_query=' . urlencode($sql_query));
if (isset($primary_key)) { if (isset($primary_key)) {
foreach($primary_key AS $pk) { foreach ($primary_key AS $pk) {
$goto .= '&primary_key[]=' . $pk; $goto .= '&primary_key[]=' . $pk;
} }
} }
@@ -104,7 +104,7 @@ PMA_DBI_select_db($db);
$query = array(); $query = array();
$message = ''; $message = '';
foreach($loop_array AS $primary_key_index => $enc_primary_key) { foreach ($loop_array AS $primary_key_index => $enc_primary_key) {
// skip fields to be ignored // skip fields to be ignored
if (!$using_key && isset($GLOBALS['insert_ignore_' . $enc_primary_key])) continue; if (!$using_key && isset($GLOBALS['insert_ignore_' . $enc_primary_key])) continue;
@@ -122,7 +122,7 @@ foreach($loop_array AS $primary_key_index => $enc_primary_key) {
$me_fields_type = isset($fields_type['multi_edit']) && isset($fields_type['multi_edit'][$enc_primary_key]) ? $fields_type['multi_edit'][$enc_primary_key] : null; $me_fields_type = isset($fields_type['multi_edit']) && isset($fields_type['multi_edit'][$enc_primary_key]) ? $fields_type['multi_edit'][$enc_primary_key] : null;
$me_fields_null = isset($fields_null['multi_edit']) && isset($fields_null['multi_edit'][$enc_primary_key]) ? $fields_null['multi_edit'][$enc_primary_key] : null; $me_fields_null = isset($fields_null['multi_edit']) && isset($fields_null['multi_edit'][$enc_primary_key]) ? $fields_null['multi_edit'][$enc_primary_key] : null;
foreach($me_fields AS $encoded_key => $val) { foreach ($me_fields AS $encoded_key => $val) {
$key = urldecode($encoded_key); $key = urldecode($encoded_key);
$fieldlist .= PMA_backquote($key) . ', '; $fieldlist .= PMA_backquote($key) . ', ';
@@ -199,7 +199,7 @@ $sql_query = implode(';', $query) . ';';
$total_affected_rows = 0; $total_affected_rows = 0;
$last_message = ''; $last_message = '';
foreach($query AS $query_index => $single_query) { foreach ($query AS $query_index => $single_query) {
if ($cfg['IgnoreMultiSubmitErrors']) { if ($cfg['IgnoreMultiSubmitErrors']) {
$result = PMA_DBI_try_query($single_query); $result = PMA_DBI_try_query($single_query);
} else { } else {

View File

@@ -72,7 +72,7 @@ if (!empty($submit_mult)) {
$primary_key = array(); $primary_key = array();
// garvin: As we got the fields to be edited from the 'rows_to_delete' checkbox, we use the index of it as the // garvin: As we got the fields to be edited from the 'rows_to_delete' checkbox, we use the index of it as the
// indicating primary key. Then we built the array which is used for the tbl_change.php script. // indicating primary key. Then we built the array which is used for the tbl_change.php script.
foreach($rows_to_delete AS $i_primary_key => $del_query) { foreach ($rows_to_delete AS $i_primary_key => $del_query) {
$primary_key[] = urldecode($i_primary_key); $primary_key[] = urldecode($i_primary_key);
} }
@@ -88,7 +88,7 @@ if (!empty($submit_mult)) {
$sql_query = urldecode($sql_query); $sql_query = urldecode($sql_query);
// garvin: As we got the fields to be edited from the 'rows_to_delete' checkbox, we use the index of it as the // garvin: As we got the fields to be edited from the 'rows_to_delete' checkbox, we use the index of it as the
// indicating primary key. Then we built the array which is used for the tbl_change.php script. // indicating primary key. Then we built the array which is used for the tbl_change.php script.
foreach($rows_to_delete AS $i_primary_key => $del_query) { foreach ($rows_to_delete AS $i_primary_key => $del_query) {
$primary_key[] = urldecode($i_primary_key); $primary_key[] = urldecode($i_primary_key);
} }

View File

@@ -47,7 +47,7 @@ if ($cfgRelation['commwork'] && $cfgRelation['mimework']) {
$mime_map = PMA_getMime($db, $table); $mime_map = PMA_getMime($db, $table);
$mime_options = PMA_transformation_getOptions((isset($mime_map[urldecode($transform_key)]['transformation_options']) ? $mime_map[urldecode($transform_key)]['transformation_options'] : '')); $mime_options = PMA_transformation_getOptions((isset($mime_map[urldecode($transform_key)]['transformation_options']) ? $mime_map[urldecode($transform_key)]['transformation_options'] : ''));
foreach($mime_options AS $key => $option) { foreach ($mime_options AS $key => $option) {
if (substr($option, 0, 10) == '; charset=') { if (substr($option, 0, 10) == '; charset=') {
$mime_options['charset'] = $option; $mime_options['charset'] = $option;
} }
@@ -89,7 +89,7 @@ if (!isset($resize)) {
$ratioWidth = $srcWidth/$newWidth; $ratioWidth = $srcWidth/$newWidth;
$ratioHeight = $srcHeight/$newHeight; $ratioHeight = $srcHeight/$newHeight;
if( $ratioWidth < $ratioHeight){ if ($ratioWidth < $ratioHeight){
$destWidth = $srcWidth/$ratioHeight; $destWidth = $srcWidth/$ratioHeight;
$destHeight = $newHeight; $destHeight = $newHeight;
}else{ }else{