summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/common.inc15
-rw-r--r--includes/database.mysql.inc12
-rw-r--r--includes/database.pear.inc2
3 files changed, 17 insertions, 12 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 99b4c36bc..881cb06cd 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -117,7 +117,8 @@ function t($string, $args = 0) {
global $languages;
if (!$args) {
return $string;
- } else {
+ }
+ else {
return strtr($string, $args);
}
}
@@ -582,7 +583,7 @@ function form_select($title, $name, $value, $options, $description = 0, $extra =
foreach ($options as $key=>$choice) {
$select .= "<option value=\"$key\"". (is_array($value) ? (in_array($key, $value) ? " selected=\"selected\"" : "") : ($key == $value ? " selected=\"selected\"" : "")) .">". check_form($choice) ."</option>";
}
- return form_item($title, "<select name=\"edit[$name]".($multiple ? "[]" : "")."\"" .($multiple ? " multiple " : "").($extra ? " $extra" : "") .">$select</select>", $description);
+ return form_item($title, "<select name=\"edit[$name]". ($multiple ? "[]" : "") ."\"". ($multiple ? " multiple " : "") . ($extra ? " $extra" : "") .">$select</select>", $description);
}
}
@@ -607,10 +608,10 @@ function form_submit($value) {
*/
function drupal_url($args = array(), $script = "node") {
$t = array();
- foreach($args as $k => $v) {
+ foreach ($args as $k => $v) {
$t[] = "$k=$v";
}
- return "$script.php?".implode("&amp;", $t);
+ return "$script.php?". implode("&amp;", $t);
}
/**
@@ -623,17 +624,17 @@ function drupal_url($args = array(), $script = "node") {
* @param $script script to be invoked; optional, defaults to node
*/
function l($linktext, $args = array(), $title = "", $script = "node") {
- return "<a href=\"".drupal_url($args, $script)."\" title=\"$title\">$linktext</a>";
+ return "<a href=\"". drupal_url($args, $script) ."\" title=\"$title\">$linktext</a>";
}
function la($linktext, $args = array(), $title = "") {
// we don't call l() to avoid another duplication of the array
- return "<a href=\"".drupal_url($args, "admin")."\" title=\"$title\">$linktext</a>";
+ return "<a href=\"". drupal_url($args, "admin") ."\" title=\"$title\">$linktext</a>";
}
function lm($linktext, $args = array(), $title = "") {
// we don't call l() to avoid another duplication of the array
- return "<a href=\"".drupal_url($args, "module")."\" title=\"$title\">$linktext</a>";
+ return "<a href=\"". drupal_url($args, "module") ."\" title=\"$title\">$linktext</a>";
}
function field_get($string, $name) {
diff --git a/includes/database.mysql.inc b/includes/database.mysql.inc
index 42df3fe6b..5417eb305 100644
--- a/includes/database.mysql.inc
+++ b/includes/database.mysql.inc
@@ -1,10 +1,11 @@
<?php
+// $Id$
function db_connect($url) {
$url = parse_url($url);
mysql_pconnect($url["host"], $url["user"], $url["pass"]) or die(mysql_error());
- mysql_select_db(substr($url["path"], 1)) or die ("unable to select database");
+ mysql_select_db(substr($url["path"], 1)) or die("unable to select database");
// NOTE: we are using a persistent connection!
}
@@ -15,7 +16,8 @@ function db_query($query) {
$args = array_map("check_query", $args);
$args[0] = $query;
return _db_query(call_user_func_array("sprintf", $args));
- } else {
+ }
+ else {
return _db_query($query);
}
}
@@ -27,7 +29,8 @@ function db_queryd($query) {
$args = array_map("check_query", $args);
$args[0] = $query;
return _db_query(call_user_func_array("sprintf", $args), 1);
- } else {
+ }
+ else {
return _db_query($query, 1);
}
}
@@ -48,7 +51,8 @@ function _db_query($query, $debug = 0) {
if (!mysql_errno()) {
return $result;
- } else {
+ }
+ else {
trigger_error(mysql_error() ."\nquery: ". htmlspecialchars($query), E_USER_ERROR);
}
}
diff --git a/includes/database.pear.inc b/includes/database.pear.inc
index c48ffbb35..2c27d5bb3 100644
--- a/includes/database.pear.inc
+++ b/includes/database.pear.inc
@@ -9,7 +9,7 @@ function db_connect($url) {
$db_handle = DB::connect($url);
if (DB::isError($db_handle)) {
- die ("Database problem: ". $db_handle->getMessage());
+ die("Database problem: ". $db_handle->getMessage());
}
$db_handle->setFetchMode(DB_FETCHMODE_ASSOC);