coding standards

This commit is contained in:
Loïc Chapeaux
2002-10-04 08:30:07 +00:00
parent 5dbcad6527
commit abc5c3aa3a
5 changed files with 27 additions and 14 deletions

View File

@@ -8,7 +8,7 @@
if (!defined('PMA_BOOKMARK_LIB_INCLUDED')){ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')) {
define('PMA_BOOKMARK_LIB_INCLUDED', 1); define('PMA_BOOKMARK_LIB_INCLUDED', 1);
/** /**
@@ -110,7 +110,7 @@ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')){
* @param array the properties of the bookmark to add * @param array the properties of the bookmark to add
* @param array the bookmark parameters for the current user * @param array the bookmark parameters for the current user
* *
* @return boolean if the INSERT succeeds * @return boolean whether the INSERT succeeds or not
* *
* @access public * @access public
*/ */
@@ -119,20 +119,22 @@ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')){
$query = 'INSERT INTO ' . PMA_backquote($cfgBookmark['db']) . '.' . PMA_backquote($cfgBookmark['table']) $query = 'INSERT INTO ' . PMA_backquote($cfgBookmark['db']) . '.' . PMA_backquote($cfgBookmark['table'])
. ' (id, dbase, user, query, label) VALUES (\'\', \'' . PMA_sqlAddslashes($fields['dbase']) . '\', \'' . PMA_sqlAddslashes($fields['user']) . '\', \'' . PMA_sqlAddslashes(urldecode($fields['query'])) . '\', \'' . PMA_sqlAddslashes($fields['label']) . '\')'; . ' (id, dbase, user, query, label) VALUES (\'\', \'' . PMA_sqlAddslashes($fields['dbase']) . '\', \'' . PMA_sqlAddslashes($fields['user']) . '\', \'' . PMA_sqlAddslashes(urldecode($fields['query'])) . '\', \'' . PMA_sqlAddslashes($fields['label']) . '\')';
if (isset($GLOBALS['dbh'])) { if (isset($GLOBALS['dbh'])) {
$result = PMA_mysql_query($query, $GLOBALS['dbh']); $result = PMA_mysql_query($query, $GLOBALS['dbh']);
if (PMA_mysql_error($GLOBALS['dbh'])) { if (PMA_mysql_error($GLOBALS['dbh'])) {
$error = PMA_mysql_error($GLOBALS['dbh']); $error = PMA_mysql_error($GLOBALS['dbh']);
include('./header.inc.php3'); include('./header.inc.php3');
PMA_mysqlDie($error); PMA_mysqlDie($error);
} }
} else { } else {
$result = PMA_mysql_query($query); $result = PMA_mysql_query($query);
if (PMA_mysql_error()) { if (PMA_mysql_error()) {
$error = PMA_mysql_error(); $error = PMA_mysql_error();
include('./header.inc.php3'); include('./header.inc.php3');
PMA_mysqlDie($error); PMA_mysqlDie($error);
} }
} }
return TRUE;
} // end of the 'PMA_addBookmarks()' function } // end of the 'PMA_addBookmarks()' function

View File

@@ -9,7 +9,7 @@
if (!defined('PMA_COMMON_LIB_INCLUDED')){ if (!defined('PMA_COMMON_LIB_INCLUDED')) {
define('PMA_COMMON_LIB_INCLUDED', 1); define('PMA_COMMON_LIB_INCLUDED', 1);
/** /**
@@ -85,8 +85,8 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
// Include failed // Include failed
if (!isset($cfgServers) && !isset($cfg['Servers'])) { if (!isset($cfgServers) && !isset($cfg['Servers'])) {
// Creates fake settings // Creates fake settings
$cfg = array('DefaultLang' => 'en-iso-8859-1', $cfg = array('DefaultLang' => 'en-iso-8859-1',
'AllowAnywhereRecoding' => FALSE); 'AllowAnywhereRecoding' => FALSE);
// Loads the language file // Loads the language file
include('./libraries/select_lang.lib.php3'); include('./libraries/select_lang.lib.php3');
// Sends the Content-Type header // Sends the Content-Type header
@@ -136,7 +136,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
/** /**
* Includes the language file if it hasn't been included yet * Includes the language file if it hasn't been included yet
*/ */
if (!defined('PMA_SELECT_LANG_LIB_INCLUDED')){ if (!defined('PMA_SELECT_LANG_LIB_INCLUDED')) {
include('./libraries/select_lang.lib.php3'); include('./libraries/select_lang.lib.php3');
} }
@@ -1207,7 +1207,7 @@ if (typeof(document.getElementById) != 'undefined'
if (eregi('^SELECT[[:space:]]+', $GLOBALS['sql_query'])) { if (eregi('^SELECT[[:space:]]+', $GLOBALS['sql_query'])) {
$explain_link .= urlencode('EXPLAIN ' . $GLOBALS['sql_query']) . '">' . $GLOBALS['strExplain']; $explain_link .= urlencode('EXPLAIN ' . $GLOBALS['sql_query']) . '">' . $GLOBALS['strExplain'];
} else if (eregi('^EXPLAIN[[:space:]]+SELECT[[:space:]]+', $GLOBALS['sql_query'])) { } else if (eregi('^EXPLAIN[[:space:]]+SELECT[[:space:]]+', $GLOBALS['sql_query'])) {
$explain_link .= substr($GLOBALS['sql_query'],8) . '">' . $GLOBALS['strNoExplain']; $explain_link .= substr($GLOBALS['sql_query'], 8) . '">' . $GLOBALS['strNoExplain'];
} else { } else {
$explain_link = ''; $explain_link = '';
} }

View File

@@ -7,7 +7,7 @@
*/ */
if (!defined('PMA_CONFIG_IMPORT_LIB_INCLUDED')){ if (!defined('PMA_CONFIG_IMPORT_LIB_INCLUDED')) {
define('PMA_CONFIG_IMPORT_LIB_INCLUDED', 1); define('PMA_CONFIG_IMPORT_LIB_INCLUDED', 1);
if (!isset($cfg['PmaAbsoluteUri'])) { if (!isset($cfg['PmaAbsoluteUri'])) {

View File

@@ -1,6 +1,15 @@
<?php <?php
// <markus@noga.de> /* $Id$ */
// get foreign keys in preparation for a drop-down selector
/**
* Gets foreign keys in preparation for a drop-down selector
* Thanks to <markus@noga.de>
*/
if (!defined('PMA_GET_FOREIGN_LIB_INCLUDED')) {
define('PMA_GET_FOREIGN_LIB_INCLUDED', 1);
// lem9: we always show the foreign field in the drop-down; if a display // lem9: we always show the foreign field in the drop-down; if a display
// field is defined, we show it besides the foreign field // field is defined, we show it besides the foreign field
@@ -32,4 +41,6 @@
$disp = PMA_mysql_query($dispsql); $disp = PMA_mysql_query($dispsql);
} }
} // end if $foreigners } // end if $foreigners
} // $__PMA_GET_FOREIGN_LIB_INCLUDED__
?> ?>

View File

@@ -48,11 +48,11 @@ if (isset($submit)) {
$field_name[$i] = $field_orig[$i]; $field_name[$i] = $field_orig[$i];
} }
$field_default_orig[$i] = urldecode($field_default_orig[$i]); $field_default_orig[$i] = urldecode($field_default_orig[$i]);
if (strcmp(str_replace('"', '&quot;', $field_default_orig[$i]), $field_default[$i]) == 0) { if (strcmp(str_replace('"', '&quot;', $field_default_orig[$i]), $field_default[$i]) == 0) {
$field_default[$i] = $field_default_orig[$i]; $field_default[$i] = $field_default_orig[$i];
} }
$field_length_orig[$i] = urldecode($field_length_orig[$i]); $field_length_orig[$i] = urldecode($field_length_orig[$i]);
if (strcmp(str_replace('"', '&quot;', $field_length_orig[$i]), $field_length[$i]) ==0) { if (strcmp(str_replace('"', '&quot;', $field_length_orig[$i]), $field_length[$i]) == 0) {
$field_length[$i] = $field_length_orig[$i]; $field_length[$i] = $field_length_orig[$i];
} }
if (!isset($query)) { if (!isset($query)) {