* coding standards\n* xhtml fixe

This commit is contained in:
Loïc Chapeaux
2002-01-25 10:51:07 +00:00
parent 3f988273b6
commit 6686f83bd7
2 changed files with 42 additions and 36 deletions

View File

@@ -10,8 +10,9 @@ $Source$
Georgi Georgiev <chutz at chubaka.homeip.net>. Georgi Georgiev <chutz at chubaka.homeip.net>.
* lang/danish.inc.php3: updated thanks to * lang/danish.inc.php3: updated thanks to
Niels Oesten <niels at oesten.dk>. Niels Oesten <niels at oesten.dk>.
* sql.php3: codding standards (tabs). * Documentation.html; sql.php3; libraries/display_tbl.lib.php3:
* Documentation.html: fixed xhtml1.0 errors. - coding standards (tabs);
- fixed xhtml1.0 errors.
* config.inc.php3, lines 55-56: lowered the line size to avoid automatic * config.inc.php3, lines 55-56: lowered the line size to avoid automatic
add of <cr><lf> while ediding this file. add of <cr><lf> while ediding this file.

View File

@@ -637,8 +637,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
* @param integer the link id associated to the query which results have * @param integer the link id associated to the query which results have
* to be displayed * to be displayed
* @param array which elements to display * @param array which elements to display
* @param array the list of fields properties * @param array the list of relations
* @param integer the total number of fields returned by the sql query
* *
* @return boolean always true * @return boolean always true
* *
@@ -862,15 +861,18 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
|| (function_exists('is_null') && is_null($row[$primary->name]))) { || (function_exists('is_null') && is_null($row[$primary->name]))) {
$vertical_display['data'][$foo][$i] = ' <td align="right" valign="top" bgcolor="' . $bgcolor . '"><i>NULL</i></td>' . "\n"; $vertical_display['data'][$foo][$i] = ' <td align="right" valign="top" bgcolor="' . $bgcolor . '"><i>NULL</i></td>' . "\n";
} else if ($row[$i] != '') { } else if ($row[$i] != '') {
$vertical_display['data'][$foo][$i] = ' <td align="right" valign="top" bgcolor="' . $bgcolor . '">' . $vertical_display['data'][$foo][$i] = ' <td align="right" valign="top" bgcolor="' . $bgcolor . '">';
( isset($map[$primary->name]) ? '<a href="sql.php3?'. if (isset($map[$primary->name])) {
'lang=' . $lang. '&server=' . $server. '&db='. urlencode($db). $vertical_display['data'][$foo][$i] .= '<a href="sql.php3?'
'&table=' . urlencode($map[$primary->name][0]). '&pos=0&sessionMaxRow='. $sessionMaxRow. . 'lang=' . $lang . '&amp;server=' . $server
'&dontlimitchars=' . $dontlimitchars. '&sql_query='. urlencode('SELECT * FROM ' . '&amp;db=' . urlencode($db) . '&amp;table=' . urlencode($map[$primary->name][0])
. PMA_backquote($map[$primary->name][0]) . ' WHERE ' . '&amp;pos=0&amp;sessionMaxRow=' . $sessionMaxRow . '&amp;dontlimitchars=' . $dontlimitchars
. $map[$primary->name][1] . '= ' . $row[$i]). '">' . $row[$primary->name] . '</a>' . '&amp;sql_query=' . urlencode('SELECT * FROM ' . PMA_backquote($map[$primary->name][0]) . ' WHERE ' . $map[$primary->name][1] . ' = ' . $row[$i]) . '">'
: $row[$primary->name] . $row[$primary->name] . '</a>';
) . '</td>' . "\n"; } else {
$vertical_display['data'][$foo][$i] .= $row[$primary->name];
}
$vertical_display['data'][$foo][$i] .= '</td>' . "\n";
} else { } else {
$vertical_display['data'][$foo][$i] = ' <td align="right" valign="top" bgcolor="' . $bgcolor . '">&nbsp;</td>' . "\n"; $vertical_display['data'][$foo][$i] = ' <td align="right" valign="top" bgcolor="' . $bgcolor . '">&nbsp;</td>' . "\n";
} }
@@ -985,7 +987,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
$vertical_display['edit'][$foo] .= ' <td bgcolor="' . $bgcolor . '">' . "\n" $vertical_display['edit'][$foo] .= ' <td bgcolor="' . $bgcolor . '">' . "\n"
. ' <a href="' . $edit_url . '">' . "\n" . ' <a href="' . $edit_url . '">' . "\n"
. ' ' . $edit_str . '</a>' . "\n" . ' ' . $edit_str . '</a>' . "\n"
. ' </td>' . "\n"; } . ' </td>' . "\n";
}
if (isset($del_url)) { if (isset($del_url)) {
$vertical_display['delete'][$foo] .= ' <td bgcolor="' . $bgcolor . '">' . "\n" $vertical_display['delete'][$foo] .= ' <td bgcolor="' . $bgcolor . '">' . "\n"
@@ -995,9 +998,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
$vertical_display['delete'][$foo] .= 'onclick="return confirmLink(this, \'' . $js_conf . '\')"'; $vertical_display['delete'][$foo] .= 'onclick="return confirmLink(this, \'' . $js_conf . '\')"';
} }
if (isset($del_str)) { if (isset($del_str)) {
$vertical_display['delete'][$foo] .= '>' . "\n" $vertical_display['delete'][$foo] .= '>' . "\n"
. ' ' . $del_str . '</a>' . "\n" . ' ' . $del_str . '</a>' . "\n"
. ' </td>' . "\n"; } . ' </td>' . "\n";
}
echo (($disp_direction == 'horizontal') ? "\n" : ''); echo (($disp_direction == 'horizontal') ? "\n" : '');
$foo++; $foo++;
@@ -1128,6 +1132,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
* @global string the current language * @global string the current language
* @global integer the server to use (refers to the number in the * @global integer the server to use (refers to the number in the
* configuration file) * configuration file)
* @global array the current server config
* @global string the database name * @global string the database name
* @global string the table name * @global string the table name
* @global string the url to go back in case of errors * @global string the url to go back in case of errors
@@ -1144,7 +1149,6 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
* @global integer the number of row to display between two table headers * @global integer the number of row to display between two table headers
* @global boolean whether to limit the number of displayed characters of * @global boolean whether to limit the number of displayed characters of
* text type fields or not * text type fields or not
* @global array current server config
* *
* @access private * @access private
* *
@@ -1154,11 +1158,11 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
*/ */
function PMA_displayTable(&$dt_result, &$the_disp_mode) function PMA_displayTable(&$dt_result, &$the_disp_mode)
{ {
global $lang, $server, $db, $table; global $lang, $server, $cfgServer, $db, $table;
global $goto; global $goto;
global $sql_query, $num_rows, $unlim_num_rows, $pos, $fields_meta, $fields_cnt; global $sql_query, $num_rows, $unlim_num_rows, $pos, $fields_meta, $fields_cnt;
global $vertical_display, $disp_direction, $repeat_cells; global $vertical_display, $disp_direction, $repeat_cells;
global $dontlimitchars, $cfgServer; global $dontlimitchars;
// 1. ----- Prepares the work ----- // 1. ----- Prepares the work -----
@@ -1224,30 +1228,31 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
echo "\n" . '<br /><br />' . "\n"; echo "\n" . '<br /><br />' . "\n";
} }
// 2b ----- Get field references from Database ----- // 2b ----- Get field references from Database -----
// (see the 'relation' config variable) // (see the 'relation' config variable)
// (currently not available for PHP3 due to spliti() ) // (currently not available for PHP3 due to spliti() )
if (PMA_PHP_INT_VERSION >= 40000 if (PMA_PHP_INT_VERSION >= 40000
&& isset($cfgServer['relation']) && isset($cfgServer['relation'])
&& !empty($cfgServer['relation'])) { && !empty($cfgServer['relation'])) {
// init map
$map = array();
// find tables
$tabs = '(\'' . join('\',\'', spliti('`? *((on [^,]+)?,|(NATURAL )?(inner|left|right)( outer)? join) *`?',
eregi_replace('^.*FROM +`?|`? *(on [^,]+)?(WHERE.*)?$', '', $sql_query))) . '\')';
$local_query = 'SELECT src_column, dest_table, dest_column' // init map
. ' FROM ' . $cfgServer['relation'] $map = array();
. ' WHERE src_table IN ' . $tabs; // find tables
$result = @mysql_query($local_query); $tabs = '(\'' . join('\',\'', spliti('`? *((on [^,]+)?,|(NATURAL )?(inner|left|right)( outer)? join) *`?',
eregi_replace('^.*FROM +`?|`? *(on [^,]+)?(WHERE.*)?$', '', $sql_query))) . '\')';
$local_query = 'SELECT src_column, dest_table, dest_column'
. ' FROM ' . $cfgServer['relation']
. ' WHERE src_table IN ' . $tabs;
$result = @mysql_query($local_query);
if ($result) { if ($result) {
while ( $rel = mysql_fetch_row($result) ) { while ($rel = mysql_fetch_row($result)) {
$map[$rel[0]] = array($rel[1], $rel[2]); $map[$rel[0]] = array($rel[1], $rel[2]);
} }
} }
} } // end 2b
// 3. ----- Displays the results table ----- // 3. ----- Displays the results table -----
?> ?>
<!-- Results table --> <!-- Results table -->