From 56d2664a904119f73e7df4fb355e4c525e040b70 Mon Sep 17 00:00:00 2001
From: Dries Buytaert
Date: Mon, 14 Apr 2008 17:48:46 +0000
Subject: - Patch #245115 by kkaefer, John Morahan, JohnAlbin et al: after a
long discussion we've decided to make the concatenation operator consistent
with the other operators.
---
includes/actions.inc | 4 +-
includes/batch.inc | 8 +-
includes/bootstrap.inc | 24 ++--
includes/cache.inc | 18 +--
includes/common.inc | 158 ++++++++++++-------------
includes/database.inc | 20 ++--
includes/database.mysql-common.inc | 66 +++++------
includes/database.mysql.inc | 26 ++--
includes/database.mysqli.inc | 24 ++--
includes/database.pgsql.inc | 104 ++++++++--------
includes/file.inc | 40 +++----
includes/form.inc | 154 ++++++++++++------------
includes/image.gd.inc | 4 +-
includes/image.inc | 6 +-
includes/install.inc | 44 +++----
includes/install.mysql.inc | 2 +-
includes/install.pgsql.inc | 10 +-
includes/language.inc | 2 +-
includes/locale.inc | 84 ++++++-------
includes/mail.inc | 26 ++--
includes/menu.inc | 90 +++++++-------
includes/module.inc | 10 +-
includes/path.inc | 2 +-
includes/session.inc | 2 +-
includes/tablesort.inc | 4 +-
includes/theme.inc | 154 ++++++++++++------------
includes/theme.maintenance.inc | 24 ++--
includes/unicode.inc | 4 +-
includes/xmlrpc.inc | 24 ++--
includes/xmlrpcs.inc | 10 +-
install.php | 76 ++++++------
modules/aggregator/aggregator.admin.inc | 8 +-
modules/aggregator/aggregator.module | 42 +++----
modules/aggregator/aggregator.pages.inc | 26 ++--
modules/block/block-admin-display-form.tpl.php | 8 +-
modules/block/block.admin.inc | 20 ++--
modules/block/block.module | 40 +++----
modules/blog/blog.module | 16 +--
modules/blog/blog.pages.inc | 8 +-
modules/blogapi/blogapi.install | 2 +-
modules/blogapi/blogapi.module | 30 ++---
modules/book/book.admin.inc | 10 +-
modules/book/book.install | 4 +-
modules/book/book.module | 60 +++++-----
modules/book/book.pages.inc | 14 +--
modules/color/color.module | 72 +++++------
modules/comment/comment-folded.tpl.php | 2 +-
modules/comment/comment.admin.inc | 14 +--
modules/comment/comment.install | 2 +-
modules/comment/comment.module | 132 ++++++++++-----------
modules/comment/comment.pages.inc | 2 +-
modules/comment/comment.tpl.php | 2 +-
modules/contact/contact.admin.inc | 4 +-
modules/contact/contact.module | 18 +--
modules/contact/contact.pages.inc | 4 +-
modules/dblog/dblog.admin.inc | 10 +-
modules/dblog/dblog.module | 12 +-
modules/filter/filter.admin.inc | 26 ++--
modules/filter/filter.install | 6 +-
modules/filter/filter.module | 134 ++++++++++-----------
modules/filter/filter.pages.inc | 6 +-
modules/forum/forum.admin.inc | 10 +-
modules/forum/forum.module | 52 ++++----
modules/help/help.admin.inc | 10 +-
modules/help/help.module | 8 +-
modules/locale/locale.install | 10 +-
modules/locale/locale.module | 66 +++++------
modules/menu/menu.admin.inc | 48 ++++----
modules/menu/menu.module | 32 ++---
modules/node/content_types.inc | 18 +--
modules/node/node.admin.inc | 30 ++---
modules/node/node.module | 112 +++++++++---------
modules/node/node.pages.inc | 36 +++---
modules/openid/openid.inc | 28 ++---
modules/openid/openid.module | 24 ++--
modules/openid/openid.pages.inc | 8 +-
modules/openid/xrds.inc | 4 +-
modules/path/path.admin.inc | 2 +-
modules/path/path.module | 32 ++---
modules/php/php.install | 2 +-
modules/php/php.module | 44 +++----
modules/poll/poll.module | 18 +--
modules/poll/poll.pages.inc | 4 +-
modules/profile/profile.admin.inc | 30 ++---
modules/profile/profile.module | 42 +++----
modules/search/search.admin.inc | 4 +-
modules/search/search.module | 116 +++++++++---------
modules/search/search.pages.inc | 8 +-
modules/statistics/statistics.admin.inc | 4 +-
modules/statistics/statistics.module | 36 +++---
modules/statistics/statistics.pages.inc | 4 +-
modules/syslog/syslog.module | 22 ++--
modules/system/block.tpl.php | 2 +-
modules/system/system.admin.inc | 94 +++++++--------
modules/system/system.install | 80 ++++++-------
modules/system/system.module | 102 ++++++++--------
modules/taxonomy/taxonomy.admin.inc | 30 ++---
modules/taxonomy/taxonomy.module | 60 +++++-----
modules/taxonomy/taxonomy.pages.inc | 16 +--
modules/throttle/throttle.module | 10 +-
modules/tracker/tracker.module | 6 +-
modules/tracker/tracker.pages.inc | 4 +-
modules/translation/translation.module | 30 ++---
modules/translation/translation.pages.inc | 8 +-
modules/trigger/trigger.admin.inc | 8 +-
modules/trigger/trigger.module | 20 ++--
modules/update/update.compare.inc | 2 +-
modules/update/update.fetch.inc | 4 +-
modules/update/update.module | 24 ++--
modules/update/update.report.inc | 40 +++----
modules/upload/upload.admin.inc | 32 ++---
modules/upload/upload.module | 26 ++--
modules/user/user.admin.inc | 46 +++----
modules/user/user.install | 4 +-
modules/user/user.module | 90 +++++++-------
modules/user/user.pages.inc | 10 +-
themes/bluemarine/comment.tpl.php | 2 +-
themes/chameleon/chameleon.theme | 28 ++---
themes/engines/phptemplate/phptemplate.engine | 2 +-
themes/garland/block.tpl.php | 2 +-
themes/garland/comment.tpl.php | 2 +-
themes/garland/maintenance-page.tpl.php | 10 +-
themes/garland/page.tpl.php | 16 +--
themes/garland/template.php | 12 +-
themes/pushbutton/comment.tpl.php | 2 +-
update.php | 54 ++++-----
126 files changed, 1850 insertions(+), 1850 deletions(-)
diff --git a/includes/actions.inc b/includes/actions.inc
index 8eeca815d..8811383a0 100644
--- a/includes/actions.inc
+++ b/includes/actions.inc
@@ -65,8 +65,8 @@ function actions_do($action_ids, $object = NULL, $context = NULL, $a1 = NULL, $a
if ($where) {
$where_clause = implode(' ', $where);
// Strip off leading 'OR '.
- $where_clause = '('. strstr($where_clause, " ") .')';
- $result_db = db_query('SELECT * FROM {actions} WHERE '. $where_clause, $where_values);
+ $where_clause = '(' . strstr($where_clause, " ") . ')';
+ $result_db = db_query('SELECT * FROM {actions} WHERE ' . $where_clause, $where_values);
while ($action = db_fetch_object($result_db)) {
$actions[$action->aid] = $action->parameters ? unserialize($action->parameters) : array();
$actions[$action->aid]['callback'] = $action->callback;
diff --git a/includes/batch.inc b/includes/batch.inc
index cd2127f0b..798d2b3eb 100644
--- a/includes/batch.inc
+++ b/includes/batch.inc
@@ -78,7 +78,7 @@ function _batch_progress_page_js() {
$url = url($batch['url'], array('query' => array('id' => $batch['id'])));
$js_setting = array(
'batch' => array(
- 'errorMessage' => $current_set['error_message'] .' '. $batch['error_message'],
+ 'errorMessage' => $current_set['error_message'] . ' ' . $batch['error_message'],
'initMessage' => $current_set['init_message'],
'uri' => $url,
),
@@ -132,7 +132,7 @@ function _batch_progress_page_nojs() {
// function), it will output whatever is in the output buffer,
// followed by the error message.
ob_start();
- $fallback = $current_set['error_message'] .' '. $batch['error_message'];
+ $fallback = $current_set['error_message'] . ' ' . $batch['error_message'];
$fallback = theme('maintenance_page', $fallback, FALSE, FALSE);
// We strip the end of the page using a marker in the template, so any
@@ -153,7 +153,7 @@ function _batch_progress_page_nojs() {
}
$url = url($batch['url'], array('query' => array('id' => $batch['id'], 'op' => $new_op)));
- drupal_set_html_head(' ');
+ drupal_set_html_head(' ');
$output = theme('progress_bar', $percentage, $message);
return $output;
}
@@ -243,7 +243,7 @@ function _batch_process() {
'@current' => floor($current),
'@percentage' => $percentage,
);
- $message = strtr($progress_message, $values) .' ';
+ $message = strtr($progress_message, $values) . ' ';
$message .= $task_message ? $task_message : ' ';
return array($percentage, $message);
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 106320c25..49659f8ca 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -277,8 +277,8 @@ function conf_init() {
global $db_url, $db_prefix, $cookie_domain, $conf, $installed_profile, $update_free_access;
$conf = array();
- if (file_exists('./'. conf_path() .'/settings.php')) {
- include_once './'. conf_path() .'/settings.php';
+ if (file_exists('./' . conf_path() . '/settings.php')) {
+ include_once './' . conf_path() . '/settings.php';
}
if (isset($base_url)) {
@@ -287,7 +287,7 @@ function conf_init() {
if (!isset($parts['path'])) {
$parts['path'] = '';
}
- $base_path = $parts['path'] .'/';
+ $base_path = $parts['path'] . '/';
// Build $base_root (everything until first slash after "scheme://").
$base_root = substr($base_url, 0, strlen($base_url) - strlen($parts['path']));
}
@@ -297,7 +297,7 @@ function conf_init() {
// As $_SERVER['HTTP_HOST'] is user input, ensure it only contains
// characters allowed in hostnames.
- $base_url = $base_root .= '://'. preg_replace('/[^a-z0-9-:._]/i', '', $_SERVER['HTTP_HOST']);
+ $base_url = $base_root .= '://' . preg_replace('/[^a-z0-9-:._]/i', '', $_SERVER['HTTP_HOST']);
// $_SERVER['SCRIPT_NAME'] can, in contrast to $_SERVER['PHP_SELF'], not
// be modified by a visitor.
@@ -330,13 +330,13 @@ function conf_init() {
$cookie_domain = substr($cookie_domain, 4);
}
$cookie_domain = explode(':', $cookie_domain);
- $cookie_domain = '.'. $cookie_domain[0];
+ $cookie_domain = '.' . $cookie_domain[0];
// Per RFC 2109, cookie domains must contain at least one dot other than the
// first. For hosts such as 'localhost' or IP Addresses we don't set a cookie domain.
if (count(explode('.', $cookie_domain)) > 2 && !is_numeric(str_replace('.', '', $cookie_domain))) {
ini_set('session.cookie_domain', $cookie_domain);
}
- session_name('SESS'. md5($session_name));
+ session_name('SESS' . md5($session_name));
}
/**
@@ -566,7 +566,7 @@ function drupal_load($type, $name) {
*/
function drupal_page_header() {
header("Expires: Sun, 19 Nov 1978 05:00:00 GMT");
- header("Last-Modified: ". gmdate("D, d M Y H:i:s") ." GMT");
+ header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", FALSE);
}
@@ -582,8 +582,8 @@ function drupal_page_header() {
*/
function drupal_page_cache_header($cache) {
// Set default values:
- $last_modified = gmdate('D, d M Y H:i:s', $cache->created) .' GMT';
- $etag = '"'. md5($last_modified) .'"';
+ $last_modified = gmdate('D, d M Y H:i:s', $cache->created) . ' GMT';
+ $etag = '"' . md5($last_modified) . '"';
// See if the client has provided the required HTTP headers:
$if_modified_since = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? stripslashes($_SERVER['HTTP_IF_MODIFIED_SINCE']) : FALSE;
@@ -720,10 +720,10 @@ function request_uri() {
}
else {
if (isset($_SERVER['argv'])) {
- $uri = $_SERVER['SCRIPT_NAME'] .'?'. $_SERVER['argv'][0];
+ $uri = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['argv'][0];
}
elseif (isset($_SERVER['QUERY_STRING'])) {
- $uri = $_SERVER['SCRIPT_NAME'] .'?'. $_SERVER['QUERY_STRING'];
+ $uri = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING'];
}
else {
$uri = $_SERVER['SCRIPT_NAME'];
@@ -955,7 +955,7 @@ function _drupal_bootstrap($phase) {
// Deny access to blocked IP addresses - t() is not yet available.
if (drupal_is_denied(ip_address())) {
header('HTTP/1.1 403 Forbidden');
- print 'Sorry, '. check_plain(ip_address()) .' has been banned.';
+ print 'Sorry, ' . check_plain(ip_address()) . ' has been banned.';
exit();
}
break;
diff --git a/includes/cache.inc b/includes/cache.inc
index 9fe7602c0..06b03fe2c 100644
--- a/includes/cache.inc
+++ b/includes/cache.inc
@@ -20,10 +20,10 @@ function cache_get($cid, $table = 'cache') {
// Reset the variable immediately to prevent a meltdown in heavy load situations.
variable_set('cache_flush', 0);
// Time to flush old cache data
- db_query("DELETE FROM {". $table ."} WHERE expire != %d AND expire <= %d", CACHE_PERMANENT, $cache_flush);
+ db_query("DELETE FROM {" . $table . "} WHERE expire != %d AND expire <= %d", CACHE_PERMANENT, $cache_flush);
}
- $cache = db_fetch_object(db_query("SELECT data, created, headers, expire, serialized FROM {". $table ."} WHERE cid = '%s'", $cid));
+ $cache = db_fetch_object(db_query("SELECT data, created, headers, expire, serialized FROM {" . $table . "} WHERE cid = '%s'", $cid));
if (isset($cache->data)) {
// If the data is permanent or we're not enforcing a minimum cache lifetime
// always return the cached data.
@@ -106,9 +106,9 @@ function cache_set($cid, $data, $table = 'cache', $expire = CACHE_PERMANENT, $he
$serialized = 1;
}
$created = time();
- db_query("UPDATE {". $table ."} SET data = %b, created = %d, expire = %d, headers = '%s', serialized = %d WHERE cid = '%s'", $data, $created, $expire, $headers, $serialized, $cid);
+ db_query("UPDATE {" . $table . "} SET data = %b, created = %d, expire = %d, headers = '%s', serialized = %d WHERE cid = '%s'", $data, $created, $expire, $headers, $serialized, $cid);
if (!db_affected_rows()) {
- @db_query("INSERT INTO {". $table ."} (cid, data, created, expire, headers, serialized) VALUES ('%s', %b, %d, %d, '%s', %d)", $cid, $data, $created, $expire, $headers, $serialized);
+ @db_query("INSERT INTO {" . $table . "} (cid, data, created, expire, headers, serialized) VALUES ('%s', %b, %d, %d, '%s', %d)", $cid, $data, $created, $expire, $headers, $serialized);
}
}
@@ -157,26 +157,26 @@ function cache_clear_all($cid = NULL, $table = NULL, $wildcard = FALSE) {
else if (time() > ($cache_flush + variable_get('cache_lifetime', 0))) {
// Clear the cache for everyone, cache_flush_delay seconds have
// passed since the first request to clear the cache.
- db_query("DELETE FROM {". $table ."} WHERE expire != %d AND expire < %d", CACHE_PERMANENT, time());
+ db_query("DELETE FROM {" . $table . "} WHERE expire != %d AND expire < %d", CACHE_PERMANENT, time());
variable_set('cache_flush', 0);
}
}
else {
// No minimum cache lifetime, flush all temporary cache entries now.
- db_query("DELETE FROM {". $table ."} WHERE expire != %d AND expire < %d", CACHE_PERMANENT, time());
+ db_query("DELETE FROM {" . $table . "} WHERE expire != %d AND expire < %d", CACHE_PERMANENT, time());
}
}
else {
if ($wildcard) {
if ($cid == '*') {
- db_query("DELETE FROM {". $table ."}");
+ db_query("DELETE FROM {" . $table . "}");
}
else {
- db_query("DELETE FROM {". $table ."} WHERE cid LIKE '%s%%'", $cid);
+ db_query("DELETE FROM {" . $table . "} WHERE cid LIKE '%s%%'", $cid);
}
}
else {
- db_query("DELETE FROM {". $table ."} WHERE cid = '%s'", $cid);
+ db_query("DELETE FROM {" . $table . "} WHERE cid = '%s'", $cid);
}
}
}
diff --git a/includes/common.inc b/includes/common.inc
index 721091bad..371f3443f 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -105,7 +105,7 @@ function drupal_set_html_head($data = NULL) {
static $stored_head = '';
if (!is_null($data)) {
- $stored_head .= $data ."\n";
+ $stored_head .= $data . "\n";
}
return $stored_head;
}
@@ -209,7 +209,7 @@ function drupal_query_string_encode($query, $exclude = array(), $parent = '') {
foreach ($query as $key => $value) {
$key = drupal_urlencode($key);
if ($parent) {
- $key = $parent .'['. $key .']';
+ $key = $parent . '[' . $key . ']';
}
if (in_array($key, $exclude)) {
@@ -220,7 +220,7 @@ function drupal_query_string_encode($query, $exclude = array(), $parent = '') {
$params[] = drupal_query_string_encode($value, $exclude, $key);
}
else {
- $params[] = $key .'='. drupal_urlencode($value);
+ $params[] = $key . '=' . drupal_urlencode($value);
}
}
@@ -239,16 +239,16 @@ function drupal_query_string_encode($query, $exclude = array(), $parent = '') {
*/
function drupal_get_destination() {
if (isset($_REQUEST['destination'])) {
- return 'destination='. urlencode($_REQUEST['destination']);
+ return 'destination=' . urlencode($_REQUEST['destination']);
}
else {
// Use $_GET here to retrieve the original path in source form.
$path = isset($_GET['q']) ? $_GET['q'] : '';
$query = drupal_query_string_encode($_GET, array('q'));
if ($query != '') {
- $path .= '?'. $query;
+ $path .= '?' . $query;
}
- return 'destination='. urlencode($path);
+ return 'destination=' . urlencode($path);
}
}
@@ -316,7 +316,7 @@ function drupal_goto($path = '', $query = NULL, $fragment = NULL, $http_response
// need all session data written to the database before redirecting.
session_write_close();
- header('Location: '. $url, TRUE, $http_response_code);
+ header('Location: ' . $url, TRUE, $http_response_code);
// The "Location" header sends a redirect status code to the HTTP daemon. In
// some cases this can be wrong, so we make sure none of the code below the
@@ -438,17 +438,17 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data =
switch ($uri['scheme']) {
case 'http':
$port = isset($uri['port']) ? $uri['port'] : 80;
- $host = $uri['host'] . ($port != 80 ? ':'. $port : '');
+ $host = $uri['host'] . ($port != 80 ? ':' . $port : '');
$fp = @fsockopen($uri['host'], $port, $errno, $errstr, 15);
break;
case 'https':
// Note: Only works for PHP 4.3 compiled with OpenSSL.
$port = isset($uri['port']) ? $uri['port'] : 443;
- $host = $uri['host'] . ($port != 443 ? ':'. $port : '');
- $fp = @fsockopen('ssl://'. $uri['host'], $port, $errno, $errstr, 20);
+ $host = $uri['host'] . ($port != 443 ? ':' . $port : '');
+ $fp = @fsockopen('ssl://' . $uri['host'], $port, $errno, $errstr, 20);
break;
default:
- $result->error = 'invalid schema '. $uri['scheme'];
+ $result->error = 'invalid schema ' . $uri['scheme'];
return $result;
}
@@ -464,7 +464,7 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data =
// Construct the path to act on.
$path = isset($uri['path']) ? $uri['path'] : '/';
if (isset($uri['query'])) {
- $path .= '?'. $uri['query'];
+ $path .= '?' . $uri['query'];
}
// Create HTTP request.
@@ -474,23 +474,23 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data =
// host that do not take into account the port number.
'Host' => "Host: $host",
'User-Agent' => 'User-Agent: Drupal (+http://drupal.org/)',
- 'Content-Length' => 'Content-Length: '. strlen($data)
+ 'Content-Length' => 'Content-Length: ' . strlen($data)
);
// If the server url has a user then attempt to use basic authentication
if (isset($uri['user'])) {
- $defaults['Authorization'] = 'Authorization: Basic '. base64_encode($uri['user'] . (!empty($uri['pass']) ? ":". $uri['pass'] : ''));
+ $defaults['Authorization'] = 'Authorization: Basic ' . base64_encode($uri['user'] . (!empty($uri['pass']) ? ":" . $uri['pass'] : ''));
}
foreach ($headers as $header => $value) {
- $defaults[$header] = $header .': '. $value;
+ $defaults[$header] = $header . ': ' . $value;
}
- $request = $method .' '. $path ." HTTP/1.0\r\n";
+ $request = $method . ' ' . $path . " HTTP/1.0\r\n";
$request .= implode("\r\n", $defaults);
$request .= "\r\n\r\n";
if ($data) {
- $request .= $data ."\r\n";
+ $request .= $data . "\r\n";
}
$result->request = $request;
@@ -516,7 +516,7 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data =
if (isset($result->headers[$header]) && $header == 'Set-Cookie') {
// RFC 2109: the Set-Cookie response header comprises the token Set-
// Cookie:, followed by a comma-separated list of one or more cookies.
- $result->headers[$header] .= ','. trim($value);
+ $result->headers[$header] .= ',' . trim($value);
}
else {
$result->headers[$header] = trim($value);
@@ -599,7 +599,7 @@ function drupal_error_handler($errno, $message, $filename, $line, $context) {
}
}
- $entry = $types[$errno] .': '. $message .' in '. $filename .' on line '. $line .'.';
+ $entry = $types[$errno] . ': ' . $message . ' in ' . $filename . ' on line ' . $line . '.';
// Force display of error messages in update.php.
if (variable_get('error_level', 1) == 1 || strstr($_SERVER['SCRIPT_NAME'], 'update.php')) {
@@ -719,7 +719,7 @@ function fix_gpc_magic() {
*
* Here is an example of t() used correctly:
* @code
- * $output .= ''. t('Go to the contact page .', array('@contact-page' => url('contact'))) .'
';
+ * $output .= '' . t('Go to the contact page .', array('@contact-page' => url('contact'))) . '
';
* @endcode
*
* Also avoid escaping quotation marks wherever possible.
@@ -761,7 +761,7 @@ function t($string, $args = array(), $langcode = NULL) {
// handful of string replacements. See settings.php for examples.
// Cache the $custom_strings variable to improve performance.
if (!isset($custom_strings[$langcode])) {
- $custom_strings[$langcode] = variable_get('locale_custom_strings_'. $langcode, array());
+ $custom_strings[$langcode] = variable_get('locale_custom_strings_' . $langcode, array());
}
// Custom strings work for English too, even if locale module is disabled.
if (isset($custom_strings[$langcode][$string])) {
@@ -838,10 +838,10 @@ function valid_email_address($mail) {
function valid_url($url, $absolute = FALSE) {
$allowed_characters = '[a-z0-9\/:_\-_\.\?\$,;~=#&%\+]';
if ($absolute) {
- return preg_match("/^(http|https|ftp):\/\/". $allowed_characters ."+$/i", $url);
+ return preg_match("/^(http|https|ftp):\/\/" . $allowed_characters . "+$/i", $url);
}
else {
- return preg_match("/^". $allowed_characters ."+$/i", $url);
+ return preg_match("/^" . $allowed_characters . "+$/i", $url);
}
}
@@ -904,14 +904,14 @@ function format_rss_channel($title, $link, $description, $items, $langcode = NUL
$langcode = $langcode ? $langcode : $language->language;
$output = "\n";
- $output .= ' '. check_plain($title) ." \n";
- $output .= ' '. check_url($link) ."\n";
+ $output .= ' ' . check_plain($title) . " \n";
+ $output .= ' ' . check_url($link) . "\n";
// The RSS 2.0 "spec" doesn't indicate HTML can be used in the description.
// We strip all HTML tags, but need to prevent double encoding from properly
// escaped source data (such as & becoming &).
- $output .= ' '. check_plain(decode_entities(strip_tags($description))) ." \n";
- $output .= ' '. check_plain($langcode) ." \n";
+ $output .= ' ' . check_plain(decode_entities(strip_tags($description))) . " \n";
+ $output .= ' ' . check_plain($langcode) . " \n";
$output .= format_xml_elements($args);
$output .= $items;
$output .= " \n";
@@ -926,9 +926,9 @@ function format_rss_channel($title, $link, $description, $items, $langcode = NUL
*/
function format_rss_item($title, $link, $description, $args = array()) {
$output = "- \n";
- $output .= '
'. check_plain($title) ." \n";
- $output .= ' '. check_url($link) ."\n";
- $output .= ' '. check_plain($description) ." \n";
+ $output .= ' ' . check_plain($title) . " \n";
+ $output .= ' ' . check_url($link) . "\n";
+ $output .= ' ' . check_plain($description) . " \n";
$output .= format_xml_elements($args);
$output .= " \n";
@@ -954,13 +954,13 @@ function format_xml_elements($array) {
foreach ($array as $key => $value) {
if (is_numeric($key)) {
if ($value['key']) {
- $output .= ' <'. $value['key'];
+ $output .= ' <' . $value['key'];
if (isset($value['attributes']) && is_array($value['attributes'])) {
$output .= drupal_attributes($value['attributes']);
}
if ($value['value'] != '') {
- $output .= '>'. (is_array($value['value']) ? format_xml_elements($value['value']) : check_plain($value['value'])) .''. $value['key'] .">\n";
+ $output .= '>' . (is_array($value['value']) ? format_xml_elements($value['value']) : check_plain($value['value'])) . '' . $value['key'] . ">\n";
}
else {
$output .= " />\n";
@@ -968,7 +968,7 @@ function format_xml_elements($array) {
}
}
else {
- $output .= ' <'. $key .'>'. (is_array($value) ? format_xml_elements($value) : check_plain($value)) ."$key>\n";
+ $output .= ' <' . $key . '>' . (is_array($value) ? format_xml_elements($value) : check_plain($value)) . "$key>\n";
}
}
return $output;
@@ -1040,8 +1040,8 @@ function format_plural($count, $singular, $plural, $args = array(), $langcode =
return t($plural, $args, $langcode);
default:
unset($args['@count']);
- $args['@count['. $index .']'] = $count;
- return t(strtr($plural, array('@count' => '@count['. $index .']')), $args, $langcode);
+ $args['@count[' . $index . ']'] = $count;
+ return t(strtr($plural, array('@count' => '@count[' . $index . ']')), $args, $langcode);
}
}
}
@@ -1187,7 +1187,7 @@ function format_date($timestamp, $type = 'medium', $format = '', $timezone = NUL
// Special treatment for long month names: May is both an abbreviation
// and a full month name in English, but other languages have
// different abbreviations.
- $date .= trim(t('!long-month-name '. gmdate($c, $timestamp), array('!long-month-name' => ''), $langcode));
+ $date .= trim(t('!long-month-name ' . gmdate($c, $timestamp), array('!long-month-name' => ''), $langcode));
}
else if (strpos('BdgGhHiIjLmnsStTUwWYyz', $c) !== FALSE) {
$date .= gmdate($c, $timestamp);
@@ -1276,7 +1276,7 @@ function url($path = NULL, $options = array()) {
language_url_rewrite($path, $options);
}
if ($options['fragment']) {
- $options['fragment'] = '#'. $options['fragment'];
+ $options['fragment'] = '#' . $options['fragment'];
}
if (is_array($options['query'])) {
$options['query'] = drupal_query_string_encode($options['query']);
@@ -1287,7 +1287,7 @@ function url($path = NULL, $options = array()) {
if (strpos($path, '#') !== FALSE) {
list($path, $old_fragment) = explode('#', $path, 2);
if (isset($old_fragment) && !$options['fragment']) {
- $options['fragment'] = '#'. $old_fragment;
+ $options['fragment'] = '#' . $old_fragment;
}
}
// Append the query.
@@ -1335,14 +1335,14 @@ function url($path = NULL, $options = array()) {
custom_url_rewrite_outbound($path, $options, $original_path);
}
- $base = $options['absolute'] ? $options['base_url'] .'/' : base_path();
+ $base = $options['absolute'] ? $options['base_url'] . '/' : base_path();
$prefix = empty($path) ? rtrim($options['prefix'], '/') : $options['prefix'];
$path = drupal_urlencode($prefix . $path);
if ($clean_url) {
// With Clean URLs.
if ($options['query']) {
- return $base . $path .'?'. $options['query'] . $options['fragment'];
+ return $base . $path . '?' . $options['query'] . $options['fragment'];
}
else {
return $base . $path . $options['fragment'];
@@ -1352,13 +1352,13 @@ function url($path = NULL, $options = array()) {
// Without Clean URLs.
$variables = array();
if (!empty($path)) {
- $variables[] = 'q='. $path;
+ $variables[] = 'q=' . $path;
}
if (!empty($options['query'])) {
$variables[] = $options['query'];
}
if ($query = join('&', $variables)) {
- return $base . $script .'?'. $query . $options['fragment'];
+ return $base . $script . '?' . $query . $options['fragment'];
}
else {
return $base . $options['fragment'];
@@ -1378,7 +1378,7 @@ function drupal_attributes($attributes = array()) {
if (is_array($attributes)) {
$t = '';
foreach ($attributes as $key => $value) {
- $t .= " $key=".'"'. check_plain($value) .'"';
+ $t .= " $key=" . '"' . check_plain($value) . '"';
}
return $t;
}
@@ -1450,7 +1450,7 @@ function l($text, $path, $options = array()) {
$options['attributes']['title'] = strip_tags($options['attributes']['title']);
}
- return ''. ($options['html'] ? $text : check_plain($text)) .' ';
+ return '' . ($options['html'] ? $text : check_plain($text)) . ' ';
}
/**
@@ -1534,7 +1534,7 @@ function drupal_eval($code) {
}
ob_start();
- print eval('?>'. $code);
+ print eval('?>' . $code);
$output = ob_get_contents();
ob_end_clean();
@@ -1571,7 +1571,7 @@ function base_path() {
* Add a tag to the page's HEAD.
*/
function drupal_add_link($attributes) {
- drupal_set_html_head(' \n");
+ drupal_set_html_head(' \n");
}
/**
@@ -1688,7 +1688,7 @@ function drupal_get_css($css = NULL) {
// browser-caching. The string changes on every update or full cache
// flush, forcing browsers to load a new copy of the files, as the
// URL changed.
- $query_string = '?'. substr(variable_get('css_js_query_string', '0'), 0, 1);
+ $query_string = '?' . substr(variable_get('css_js_query_string', '0'), 0, 1);
foreach ($css as $media => $types) {
// If CSS preprocessing is off, we still need to output the styles.
@@ -1713,24 +1713,24 @@ function drupal_get_css($css = NULL) {
// If a CSS file is not to be preprocessed and it's a module CSS file, it needs to *always* appear at the *top*,
// regardless of whether preprocessing is on or off.
if (!$preprocess && $type == 'module') {
- $no_module_preprocess .= ' '."\n";
+ $no_module_preprocess .= ' ' . "\n";
}
// If a CSS file is not to be preprocessed and it's a theme CSS file, it needs to *always* appear at the *bottom*,
// regardless of whether preprocessing is on or off.
else if (!$preprocess && $type == 'theme') {
- $no_theme_preprocess .= ' '."\n";
+ $no_theme_preprocess .= ' ' . "\n";
}
else {
- $output .= ' '."\n";
+ $output .= ' ' . "\n";
}
}
}
}
if ($is_writable && $preprocess_css) {
- $filename = md5(serialize($types) . $query_string) .'.css';
+ $filename = md5(serialize($types) . $query_string) . '.css';
$preprocess_file = drupal_build_css_cache($types, $filename);
- $output .= ' '."\n";
+ $output .= ' ' . "\n";
}
}
@@ -1755,14 +1755,14 @@ function drupal_build_css_cache($types, $filename) {
$csspath = file_create_path('css');
file_check_directory($csspath, FILE_CREATE_DIRECTORY);
- if (!file_exists($csspath .'/'. $filename)) {
+ if (!file_exists($csspath . '/' . $filename)) {
// Build aggregate CSS file.
foreach ($types as $type) {
foreach ($type as $file => $cache) {
if ($cache) {
$contents = drupal_load_stylesheet($file, TRUE);
// Return the path to where this CSS file originated from.
- $base = base_path() . dirname($file) .'/';
+ $base = base_path() . dirname($file) . '/';
_drupal_build_css_path(NULL, $base);
// Prefix all paths within this CSS file, ignoring external and absolute paths.
$data .= preg_replace_callback('/url\([\'"]?(?![a-z]+:|\/+)([^\'")]+)[\'"]?\)/i', '_drupal_build_css_path', $contents);
@@ -1778,9 +1778,9 @@ function drupal_build_css_cache($types, $filename) {
$data = implode('', $matches[0]) . $data;
// Create the CSS file.
- file_save_data($data, $csspath .'/'. $filename, FILE_EXISTS_REPLACE);
+ file_save_data($data, $csspath . '/' . $filename, FILE_EXISTS_REPLACE);
}
- return $csspath .'/'. $filename;
+ return $csspath . '/' . $filename;
}
/**
@@ -1802,7 +1802,7 @@ function _drupal_build_css_path($matches, $base = NULL) {
$last = $path;
$path = preg_replace('`(^|/)(?!../)([^/]+)/../`', '$1', $path);
}
- return 'url('. $path .')';
+ return 'url(' . $path . ')';
}
/**
@@ -1872,7 +1872,7 @@ function _drupal_load_stylesheet($matches) {
// Load the imported stylesheet and replace @import commands in there as well.
$file = drupal_load_stylesheet($filename);
// Alter all url() paths, but not external.
- return preg_replace('/url\(([\'"]?)(?![a-z]+:)([^\'")]+)[\'"]?\)?;/i', 'url(\1'. dirname($filename) .'/', $file);
+ return preg_replace('/url\(([\'"]?)(?![a-z]+:)([^\'")]+)[\'"]?\)?;/i', 'url(\1' . dirname($filename) . '/', $file);
}
/**
@@ -2039,7 +2039,7 @@ function drupal_get_js($scope = 'header', $javascript = NULL) {
// URL changed. Files that should not be cached (see drupal_add_js())
// get time() as query-string instead, to enforce reload on every
// page request.
- $query_string = '?'. substr(variable_get('css_js_query_string', '0'), 0, 1);
+ $query_string = '?' . substr(variable_get('css_js_query_string', '0'), 0, 1);
foreach ($javascript as $type => $data) {
@@ -2047,11 +2047,11 @@ function drupal_get_js($scope = 'header', $javascript = NULL) {
switch ($type) {
case 'setting':
- $output .= '\n";
+ $output .= '\n";
break;
case 'inline':
foreach ($data as $info) {
- $output .= '\n";
+ $output .= '\n";
}
break;
default:
@@ -2059,7 +2059,7 @@ function drupal_get_js($scope = 'header', $javascript = NULL) {
// Additionally, go through any remaining scripts if JS preprocessing is on and output the non-cached ones.
foreach ($data as $path => $info) {
if (!$info['preprocess'] || !$is_writable || !$preprocess_js) {
- $no_preprocess[$type] .= '\n";
+ $no_preprocess[$type] .= '\n";
}
else {
$files[$path] = $info;
@@ -2070,9 +2070,9 @@ function drupal_get_js($scope = 'header', $javascript = NULL) {
// Aggregate any remaining JS files that haven't already been output.
if ($is_writable && $preprocess_js && count($files) > 0) {
- $filename = md5(serialize($files) . $query_string) .'.js';
+ $filename = md5(serialize($files) . $query_string) . '.js';
$preprocess_file = drupal_build_js_cache($files, $filename);
- $preprocessed .= ''."\n";
+ $preprocessed .= '' . "\n";
}
// Keep the order of JS files consistent as some are preprocessed and others are not.
@@ -2131,16 +2131,16 @@ function drupal_get_js($scope = 'header', $javascript = NULL) {
* the block regions on the admin/build/block page), a separate subgroup class
* must also be added to differentiate the groups.
* @code
- * $form['my_elements'][$region][$delta]['weight']['#attributes']['class'] = "my-elements-weight my-elements-weight-". $region;
+ * $form['my_elements'][$region][$delta]['weight']['#attributes']['class'] = "my-elements-weight my-elements-weight-" . $region;
* @endcode
*
* $group is still 'my-element-weight', and the additional $subgroup variable
- * will be passed in as 'my-elements-weight-'. $region. This also means that
+ * will be passed in as 'my-elements-weight-' . $region. This also means that
* you'll need to call drupal_add_tabledrag() once for every region added.
*
* @code
* foreach ($regions as $region) {
- * drupal_add_tabledrag('my-module-table', 'order', 'sibling', 'my-elements-weight', 'my-elements-weight-'. $region);
+ * drupal_add_tabledrag('my-module-table', 'order', 'sibling', 'my-elements-weight', 'my-elements-weight-' . $region);
* }
* @endcode
*
@@ -2227,20 +2227,20 @@ function drupal_build_js_cache($files, $filename) {
$jspath = file_create_path('js');
file_check_directory($jspath, FILE_CREATE_DIRECTORY);
- if (!file_exists($jspath .'/'. $filename)) {
+ if (!file_exists($jspath . '/' . $filename)) {
// Build aggregate JS file.
foreach ($files as $path => $info) {
if ($info['preprocess']) {
// Append a ';' after each JS file to prevent them from running together.
- $contents .= file_get_contents($path) .';';
+ $contents .= file_get_contents($path) . ';';
}
}
// Create the JS file.
- file_save_data($contents, $jspath .'/'. $filename, FILE_EXISTS_REPLACE);
+ file_save_data($contents, $jspath . '/' . $filename, FILE_EXISTS_REPLACE);
}
- return $jspath .'/'. $filename;
+ return $jspath . '/' . $filename;
}
/**
@@ -2598,7 +2598,7 @@ function drupal_system_listing($mask, $directory, $key = 'name', $min_depth = 1)
$files = array();
// Always search sites/all/* as well as the global directories
- $searchdir[] = 'sites/all/'. $directory;
+ $searchdir[] = 'sites/all/' . $directory;
// The 'profiles' directory contains pristine collections of modules and
// themes as organized by a distribution. It is pristine in the same way
@@ -2663,8 +2663,8 @@ function drupal_alter($type, &$data) {
array_shift($additional_args);
$args = array_merge($args, $additional_args);
- foreach (module_implements($type .'_alter') as $module) {
- $function = $module .'_'. $type .'_alter';
+ foreach (module_implements($type . '_alter') as $module) {
+ $function = $module . '_' . $type . '_alter';
call_user_func_array($function, $args);
}
}
@@ -3293,7 +3293,7 @@ function drupal_write_record($table, &$object, $update = array()) {
// Build the SQL.
$query = '';
if (!count($update)) {
- $query = "INSERT INTO {". $table ."} (". implode(', ', $fields) .') VALUES ('. implode(', ', $placeholders) .')';
+ $query = "INSERT INTO {" . $table . "} (" . implode(', ', $fields) . ') VALUES (' . implode(', ', $placeholders) . ')';
$return = SAVED_NEW;
}
else {
@@ -3302,15 +3302,15 @@ function drupal_write_record($table, &$object, $update = array()) {
if ($query) {
$query .= ', ';
}
- $query .= $field .' = '. $placeholders[$id];
+ $query .= $field . ' = ' . $placeholders[$id];
}
foreach ($update as $key){
- $conditions[] = "$key = ". db_type_placeholder($schema['fields'][$key]['type']);
+ $conditions[] = "$key = " . db_type_placeholder($schema['fields'][$key]['type']);
$values[] = $object->$key;
}
- $query = "UPDATE {". $table ."} SET $query WHERE ". implode(' AND ', $conditions);
+ $query = "UPDATE {" . $table . "} SET $query WHERE " . implode(' AND ', $conditions);
$return = SAVED_UPDATED;
}
@@ -3510,7 +3510,7 @@ function drupal_implode_tags($tags) {
foreach ($tags as $tag) {
// Commas and quotes in tag names are special cases, so encode them.
if (strpos($tag, ',') !== FALSE || strpos($tag, '"') !== FALSE) {
- $tag = '"'. str_replace('"', '""', $tag) .'"';
+ $tag = '"' . str_replace('"', '""', $tag) . '"';
}
$encoded_tags[] = $tag;
diff --git a/includes/database.inc b/includes/database.inc
index d3de06cd8..145290ab0 100644
--- a/includes/database.inc
+++ b/includes/database.inc
@@ -87,13 +87,13 @@ function db_prefix_tables($sql) {
$tmp = $db_prefix;
unset($tmp['default']);
foreach ($tmp as $key => $val) {
- $sql = strtr($sql, array('{'. $key .'}' => $val . $key));
+ $sql = strtr($sql, array('{' . $key . '}' => $val . $key));
}
return strtr($sql, array('{' => $db_prefix['default'], '}' => ''));
}
else {
foreach ($db_prefix as $key => $val) {
- $sql = strtr($sql, array('{'. $key .'}' => $val . $key));
+ $sql = strtr($sql, array('{' . $key . '}' => $val . $key));
}
return strtr($sql, array('{' => '', '}' => ''));
}
@@ -146,7 +146,7 @@ function db_set_active($name = 'default') {
include_once $handler;
}
else {
- _db_error_page("The database type '". $db_type ."' is unsupported. Please use either 'mysql' or 'mysqli' for MySQL, or 'pgsql' for PostgreSQL databases.");
+ _db_error_page("The database type '" . $db_type . "' is unsupported. Please use either 'mysql' or 'mysqli' for MySQL, or 'pgsql' for PostgreSQL databases.");
}
$db_conns[$name] = db_connect($connect_url);
@@ -180,7 +180,7 @@ function _db_error_page($error = '') {
$message .= 'If you are the maintainer of this site, please check your database settings in the settings.php
file and ensure that your hosting provider\'s database server is running. For more help, see the handbook , or contact your hosting provider.
';
if ($error && ini_get('display_errors')) {
- $message .= 'The '. theme('placeholder', $db_type) .' error was: '. theme('placeholder', $error) .'.
';
+ $message .= 'The ' . theme('placeholder', $db_type) . ' error was: ' . theme('placeholder', $error) . '.
';
}
print theme('maintenance_page', $message);
@@ -282,7 +282,7 @@ function _db_rewrite_sql($query = '', $primary_table = 'n', $primary_field = 'ni
}
}
- $where = empty($where) ? '' : '('. implode(') AND (', $where) .')';
+ $where = empty($where) ? '' : '(' . implode(') AND (', $where) . ')';
$join = empty($join) ? '' : implode(' ', $join);
return array($join, $where, $distinct);
@@ -331,7 +331,7 @@ function db_rewrite_sql($query, $primary_table = 'n', $primary_field = 'nid', $
if ($where) {
$n = strlen($matches[1]);
$second_part = substr($query, $n);
- $first_part = substr($matches[1], 0, $n - 5) ." $join WHERE $where AND ( ";
+ $first_part = substr($matches[1], 0, $n - 5) . " $join WHERE $where AND ( ";
// PHP 4 does not support strrpos for strings. We emulate it.
$haystack_reverse = strrev($second_part);
// No need to use strrev on the needle, we supply GROUP, ORDER, LIMIT
@@ -345,14 +345,14 @@ function db_rewrite_sql($query, $primary_table = 'n', $primary_field = 'nid', $
}
}
if ($pos === FALSE) {
- $query = $first_part . $second_part .')';
+ $query = $first_part . $second_part . ')';
}
else {
- $query = $first_part . substr($second_part, 0, -$pos) .')'. substr($second_part, -$pos);
+ $query = $first_part . substr($second_part, 0, -$pos) . ')' . substr($second_part, -$pos);
}
}
else {
- $query = $matches[1] ." $join ". substr($query, strlen($matches[1]));
+ $query = $matches[1] . " $join " . substr($query, strlen($matches[1]));
}
}
@@ -564,7 +564,7 @@ function db_type_placeholder($type) {
// There is no safe value to return here, so return something that
// will cause the query to fail.
- return 'unsupported type '. $type .'for db_type_placeholder';
+ return 'unsupported type ' . $type . 'for db_type_placeholder';
}
/**
diff --git a/includes/database.mysql-common.inc b/includes/database.mysql-common.inc
index 73ae6395e..dc834349a 100644
--- a/includes/database.mysql-common.inc
+++ b/includes/database.mysql-common.inc
@@ -63,21 +63,21 @@ function db_create_table_sql($name, $table) {
$table['mysql_suffix'] = "/*!40100 DEFAULT CHARACTER SET UTF8 */";
}
- $sql = "CREATE TABLE {". $name ."} (\n";
+ $sql = "CREATE TABLE {" . $name . "} (\n";
// Add the SQL statement for each field.
foreach ($table['fields'] as $field_name => $field) {
- $sql .= _db_create_field_sql($field_name, _db_process_field($field)) .", \n";
+ $sql .= _db_create_field_sql($field_name, _db_process_field($field)) . ", \n";
}
// Process keys & indexes.
$keys = _db_create_keys_sql($table);
if (count($keys)) {
- $sql .= implode(", \n", $keys) .", \n";
+ $sql .= implode(", \n", $keys) . ", \n";
}
// Remove the last comma and space.
- $sql = substr($sql, 0, -3) ."\n) ";
+ $sql = substr($sql, 0, -3) . "\n) ";
$sql .= $table['mysql_suffix'];
@@ -88,16 +88,16 @@ function _db_create_keys_sql($spec) {
$keys = array();
if (!empty($spec['primary key'])) {
- $keys[] = 'PRIMARY KEY ('. _db_create_key_sql($spec['primary key']) .')';
+ $keys[] = 'PRIMARY KEY (' . _db_create_key_sql($spec['primary key']) . ')';
}
if (!empty($spec['unique keys'])) {
foreach ($spec['unique keys'] as $key => $fields) {
- $keys[] = 'UNIQUE KEY '. $key .' ('. _db_create_key_sql($fields) .')';
+ $keys[] = 'UNIQUE KEY ' . $key . ' (' . _db_create_key_sql($fields) . ')';
}
}
if (!empty($spec['indexes'])) {
foreach ($spec['indexes'] as $index => $fields) {
- $keys[] = 'INDEX '. $index .' ('. _db_create_key_sql($fields) .')';
+ $keys[] = 'INDEX ' . $index . ' (' . _db_create_key_sql($fields) . ')';
}
}
@@ -108,7 +108,7 @@ function _db_create_key_sql($fields) {
$ret = array();
foreach ($fields as $field) {
if (is_array($field)) {
- $ret[] = $field[0] .'('. $field[1] .')';
+ $ret[] = $field[0] . '(' . $field[1] . ')';
}
else {
$ret[] = $field;
@@ -132,7 +132,7 @@ function _db_process_field($field) {
// Set the correct database-engine specific datatype.
if (!isset($field['mysql_type'])) {
$map = db_type_map();
- $field['mysql_type'] = $map[$field['type'] .':'. $field['size']];
+ $field['mysql_type'] = $map[$field['type'] . ':' . $field['size']];
}
if ($field['type'] == 'serial') {
@@ -154,13 +154,13 @@ function _db_process_field($field) {
* The field specification, as per the schema data structure format.
*/
function _db_create_field_sql($name, $spec) {
- $sql = "`". $name ."` ". $spec['mysql_type'];
+ $sql = "`" . $name . "` " . $spec['mysql_type'];
if (isset($spec['length'])) {
- $sql .= '('. $spec['length'] .')';
+ $sql .= '(' . $spec['length'] . ')';
}
elseif (isset($spec['precision']) && isset($spec['scale'])) {
- $sql .= '('. $spec['precision'] .', '. $spec['scale'] .')';
+ $sql .= '(' . $spec['precision'] . ', ' . $spec['scale'] . ')';
}
if (!empty($spec['unsigned'])) {
@@ -177,9 +177,9 @@ function _db_create_field_sql($name, $spec) {
if (isset($spec['default'])) {
if (is_string($spec['default'])) {
- $spec['default'] = "'". $spec['default'] ."'";
+ $spec['default'] = "'" . $spec['default'] . "'";
}
- $sql .= ' DEFAULT '. $spec['default'];
+ $sql .= ' DEFAULT ' . $spec['default'];
}
if (empty($spec['not null']) && !isset($spec['default'])) {
@@ -246,7 +246,7 @@ function db_type_map() {
* The new name for the table.
*/
function db_rename_table(&$ret, $table, $new_name) {
- $ret[] = update_sql('ALTER TABLE {'. $table .'} RENAME TO {'. $new_name .'}');
+ $ret[] = update_sql('ALTER TABLE {' . $table . '} RENAME TO {' . $new_name . '}');
}
/**
@@ -258,7 +258,7 @@ function db_rename_table(&$ret, $table, $new_name) {
* The table to be dropped.
*/
function db_drop_table(&$ret, $table) {
- $ret[] = update_sql('DROP TABLE {'. $table .'}');
+ $ret[] = update_sql('DROP TABLE {' . $table . '}');
}
/**
@@ -290,17 +290,17 @@ function db_add_field(&$ret, $table, $field, $spec, $keys_new = array()) {
$fixnull = TRUE;
$spec['not null'] = FALSE;
}
- $query = 'ALTER TABLE {'. $table .'} ADD ';
+ $query = 'ALTER TABLE {' . $table . '} ADD ';
$query .= _db_create_field_sql($field, _db_process_field($spec));
if (count($keys_new)) {
- $query .= ', ADD '. implode(', ADD ', _db_create_keys_sql($keys_new));
+ $query .= ', ADD ' . implode(', ADD ', _db_create_keys_sql($keys_new));
}
$ret[] = update_sql($query);
if (isset($spec['initial'])) {
// All this because update_sql does not support %-placeholders.
- $sql = 'UPDATE {'. $table .'} SET '. $field .' = '. db_type_placeholder($spec['type']);
+ $sql = 'UPDATE {' . $table . '} SET ' . $field . ' = ' . db_type_placeholder($spec['type']);
$result = db_query($sql, $spec['initial']);
- $ret[] = array('success' => $result !== FALSE, 'query' => check_plain($sql .' ('. $spec['initial'] .')'));
+ $ret[] = array('success' => $result !== FALSE, 'query' => check_plain($sql . ' (' . $spec['initial'] . ')'));
}
if ($fixnull) {
$spec['not null'] = TRUE;
@@ -319,7 +319,7 @@ function db_add_field(&$ret, $table, $field, $spec, $keys_new = array()) {
* The field to be dropped.
*/
function db_drop_field(&$ret, $table, $field) {
- $ret[] = update_sql('ALTER TABLE {'. $table .'} DROP '. $field);
+ $ret[] = update_sql('ALTER TABLE {' . $table . '} DROP ' . $field);
}
/**
@@ -342,7 +342,7 @@ function db_field_set_default(&$ret, $table, $field, $default) {
$default = is_string($default) ? "'$default'" : $default;
}
- $ret[] = update_sql('ALTER TABLE {'. $table .'} ALTER COLUMN '. $field .' SET DEFAULT '. $default);
+ $ret[] = update_sql('ALTER TABLE {' . $table . '} ALTER COLUMN ' . $field . ' SET DEFAULT ' . $default);
}
/**
@@ -356,7 +356,7 @@ function db_field_set_default(&$ret, $table, $field, $default) {
* The field to be altered.
*/
function db_field_set_no_default(&$ret, $table, $field) {
- $ret[] = update_sql('ALTER TABLE {'. $table .'} ALTER COLUMN '. $field .' DROP DEFAULT');
+ $ret[] = update_sql('ALTER TABLE {' . $table . '} ALTER COLUMN ' . $field . ' DROP DEFAULT');
}
/**
@@ -370,8 +370,8 @@ function db_field_set_no_default(&$ret, $table, $field) {
* Fields for the primary key.
*/
function db_add_primary_key(&$ret, $table, $fields) {
- $ret[] = update_sql('ALTER TABLE {'. $table .'} ADD PRIMARY KEY ('.
- _db_create_key_sql($fields) .')');
+ $ret[] = update_sql('ALTER TABLE {' . $table . '} ADD PRIMARY KEY (' .
+ _db_create_key_sql($fields) . ')');
}
/**
@@ -383,7 +383,7 @@ function db_add_primary_key(&$ret, $table, $fields) {
* The table to be altered.
*/
function db_drop_primary_key(&$ret, $table) {
- $ret[] = update_sql('ALTER TABLE {'. $table .'} DROP PRIMARY KEY');
+ $ret[] = update_sql('ALTER TABLE {' . $table . '} DROP PRIMARY KEY');
}
/**
@@ -399,8 +399,8 @@ function db_drop_primary_key(&$ret, $table) {
* An array of field names.
*/
function db_add_unique_key(&$ret, $table, $name, $fields) {
- $ret[] = update_sql('ALTER TABLE {'. $table .'} ADD UNIQUE KEY '.
- $name .' ('. _db_create_key_sql($fields) .')');
+ $ret[] = update_sql('ALTER TABLE {' . $table . '} ADD UNIQUE KEY ' .
+ $name . ' (' . _db_create_key_sql($fields) . ')');
}
/**
@@ -414,7 +414,7 @@ function db_add_unique_key(&$ret, $table, $name, $fields) {
* The name of the key.
*/
function db_drop_unique_key(&$ret, $table, $name) {
- $ret[] = update_sql('ALTER TABLE {'. $table .'} DROP KEY '. $name);
+ $ret[] = update_sql('ALTER TABLE {' . $table . '} DROP KEY ' . $name);
}
/**
@@ -430,7 +430,7 @@ function db_drop_unique_key(&$ret, $table, $name) {
* An array of field names.
*/
function db_add_index(&$ret, $table, $name, $fields) {
- $query = 'ALTER TABLE {'. $table .'} ADD INDEX '. $name .' ('. _db_create_key_sql($fields) .')';
+ $query = 'ALTER TABLE {' . $table . '} ADD INDEX ' . $name . ' (' . _db_create_key_sql($fields) . ')';
$ret[] = update_sql($query);
}
@@ -445,7 +445,7 @@ function db_add_index(&$ret, $table, $name, $fields) {
* The name of the index.
*/
function db_drop_index(&$ret, $table, $name) {
- $ret[] = update_sql('ALTER TABLE {'. $table .'} DROP INDEX '. $name);
+ $ret[] = update_sql('ALTER TABLE {' . $table . '} DROP INDEX ' . $name);
}
/**
@@ -512,10 +512,10 @@ function db_drop_index(&$ret, $table, $name) {
*/
function db_change_field(&$ret, $table, $field, $field_new, $spec, $keys_new = array()) {
- $sql = 'ALTER TABLE {'. $table .'} CHANGE '. $field .' '.
+ $sql = 'ALTER TABLE {' . $table . '} CHANGE ' . $field . ' ' .
_db_create_field_sql($field_new, _db_process_field($spec));
if (count($keys_new)) {
- $sql .= ', ADD '. implode(', ADD ', _db_create_keys_sql($keys_new));
+ $sql .= ', ADD ' . implode(', ADD ', _db_create_keys_sql($keys_new));
}
$ret[] = update_sql($sql);
}
diff --git a/includes/database.mysql.inc b/includes/database.mysql.inc
index e8f831d71..81b1308cb 100644
--- a/includes/database.mysql.inc
+++ b/includes/database.mysql.inc
@@ -65,7 +65,7 @@ function db_connect($url) {
// Allow for non-standard MySQL port.
if (isset($url['port'])) {
- $url['host'] = $url['host'] .':'. $url['port'];
+ $url['host'] = $url['host'] . ':' . $url['port'];
}
// - TRUE makes mysql_connect() always open a new link, even if
@@ -103,13 +103,13 @@ function _db_query($query, $debug = 0) {
$name = $user->uid ? $user->name : variable_get('anonymous', 'Anonymous');
// str_replace() to prevent SQL injection via username or anonymous name.
$name = str_replace(array('*', '/'), '', $name);
- $query = '/* '. $name .' : '. $bt[2]['function'] .' */ '. $query;
+ $query = '/* ' . $name . ' : ' . $bt[2]['function'] . ' */ ' . $query;
}
$result = mysql_query($query, $active_db);
if (variable_get('dev_query', 0)) {
- $query = $bt[2]['function'] ."\n". $query;
+ $query = $bt[2]['function'] . "\n" . $query;
list($usec, $sec) = explode(' ', microtime());
$stop = (float)$usec + (float)$sec;
$diff = $stop - $timer;
@@ -117,7 +117,7 @@ function _db_query($query, $debug = 0) {
}
if ($debug) {
- print 'query: '. $query .' error:'. mysql_error($active_db) .'
';
+ print 'query: ' . $query . ' error:' . mysql_error($active_db) . '
';
}
if (!mysql_errno($active_db)) {
@@ -126,7 +126,7 @@ function _db_query($query, $debug = 0) {
else {
// Indicate to drupal_error_handler that this is a database error.
${DB_ERROR} = TRUE;
- trigger_error(check_plain(mysql_error($active_db) ."\nquery: ". $query), E_USER_WARNING);
+ trigger_error(check_plain(mysql_error($active_db) . "\nquery: " . $query), E_USER_WARNING);
return FALSE;
}
}
@@ -239,7 +239,7 @@ function db_query_range($query) {
}
_db_query_callback($args, TRUE);
$query = preg_replace_callback(DB_QUERY_REGEXP, '_db_query_callback', $query);
- $query .= ' LIMIT '. (int)$from .', '. (int)$count;
+ $query .= ' LIMIT ' . (int)$from . ', ' . (int)$count;
return _db_query($query);
}
@@ -280,7 +280,7 @@ function db_query_temporary($query) {
$tablename = array_pop($args);
array_shift($args);
- $query = preg_replace('/^SELECT/i', 'CREATE TEMPORARY TABLE '. $tablename .' Engine=HEAP SELECT', db_prefix_tables($query));
+ $query = preg_replace('/^SELECT/i', 'CREATE TEMPORARY TABLE ' . $tablename . ' Engine=HEAP SELECT', db_prefix_tables($query));
if (isset($args[0]) and is_array($args[0])) { // 'All arguments in one array' syntax
$args = $args[0];
}
@@ -299,7 +299,7 @@ function db_query_temporary($query) {
*/
function db_encode_blob($data) {
global $active_db;
- return "'". mysql_real_escape_string($data, $active_db) ."'";
+ return "'" . mysql_real_escape_string($data, $active_db) . "'";
}
/**
@@ -326,7 +326,7 @@ function db_escape_string($text) {
* Lock a table.
*/
function db_lock_table($table) {
- db_query('LOCK TABLES {'. db_escape_table($table) .'} WRITE');
+ db_query('LOCK TABLES {' . db_escape_table($table) . '} WRITE');
}
/**
@@ -340,14 +340,14 @@ function db_unlock_tables() {
* Check if a table exists.
*/
function db_table_exists($table) {
- return (bool) db_fetch_object(db_query("SHOW TABLES LIKE '{". db_escape_table($table) ."}'"));
+ return (bool) db_fetch_object(db_query("SHOW TABLES LIKE '{" . db_escape_table($table) . "}'"));
}
/**
* Check if a column exists in the given table.
*/
function db_column_exists($table, $column) {
- return (bool) db_fetch_object(db_query("SHOW COLUMNS FROM {". db_escape_table($table) ."} LIKE '". db_escape_table($column) ."'"));
+ return (bool) db_fetch_object(db_query("SHOW COLUMNS FROM {" . db_escape_table($table) . "} LIKE '" . db_escape_table($column) . "'"));
}
/**
@@ -362,9 +362,9 @@ function db_column_exists($table, $column) {
* @return SQL query with the DISTINCT wrapper surrounding the given table.field.
*/
function db_distinct_field($table, $field, $query) {
- $field_to_select = 'DISTINCT('. $table .'.'. $field .')';
+ $field_to_select = 'DISTINCT(' . $table . '.' . $field . ')';
// (?uid ? $user->name : variable_get('anonymous', 'Anonymous');
// str_replace() to prevent SQL injection via username or anonymous name.
$name = str_replace(array('*', '/'), '', $name);
- $query = '/* '. $name .' : '. $bt[2]['function'] .' */ '. $query;
+ $query = '/* ' . $name . ' : ' . $bt[2]['function'] . ' */ ' . $query;
}
$result = mysqli_query($active_db, $query);
if (variable_get('dev_query', 0)) {
- $query = $bt[2]['function'] ."\n". $query;
+ $query = $bt[2]['function'] . "\n" . $query;
list($usec, $sec) = explode(' ', microtime());
$stop = (float)$usec + (float)$sec;
$diff = $stop - $timer;
@@ -118,7 +118,7 @@ function _db_query($query, $debug = 0) {
}
if ($debug) {
- print 'query: '. $query .' error:'. mysqli_error($active_db) .'
';
+ print 'query: ' . $query . ' error:' . mysqli_error($active_db) . '
';
}
if (!mysqli_errno($active_db)) {
@@ -127,7 +127,7 @@ function _db_query($query, $debug = 0) {
else {
// Indicate to drupal_error_handler that this is a database error.
${DB_ERROR} = TRUE;
- trigger_error(check_plain(mysqli_error($active_db) ."\nquery: ". $query), E_USER_WARNING);
+ trigger_error(check_plain(mysqli_error($active_db) . "\nquery: " . $query), E_USER_WARNING);
return FALSE;
}
}
@@ -242,7 +242,7 @@ function db_query_range($query) {
}
_db_query_callback($args, TRUE);
$query = preg_replace_callback(DB_QUERY_REGEXP, '_db_query_callback', $query);
- $query .= ' LIMIT '. (int)$from .', '. (int)$count;
+ $query .= ' LIMIT ' . (int)$from . ', ' . (int)$count;
return _db_query($query);
}
@@ -283,7 +283,7 @@ function db_query_temporary($query) {
$tablename = array_pop($args);
array_shift($args);
- $query = preg_replace('/^SELECT/i', 'CREATE TEMPORARY TABLE '. $tablename .' Engine=HEAP SELECT', db_prefix_tables($query));
+ $query = preg_replace('/^SELECT/i', 'CREATE TEMPORARY TABLE ' . $tablename . ' Engine=HEAP SELECT', db_prefix_tables($query));
if (isset($args[0]) and is_array($args[0])) { // 'All arguments in one array' syntax
$args = $args[0];
}
@@ -302,7 +302,7 @@ function db_query_temporary($query) {
*/
function db_encode_blob($data) {
global $active_db;
- return "'". mysqli_real_escape_string($active_db, $data) ."'";
+ return "'" . mysqli_real_escape_string($active_db, $data) . "'";
}
/**
@@ -329,7 +329,7 @@ function db_escape_string($text) {
* Lock a table.
*/
function db_lock_table($table) {
- db_query('LOCK TABLES {'. db_escape_table($table) .'} WRITE');
+ db_query('LOCK TABLES {' . db_escape_table($table) . '} WRITE');
}
/**
@@ -343,14 +343,14 @@ function db_unlock_tables() {
* Check if a table exists.
*/
function db_table_exists($table) {
- return (bool) db_fetch_object(db_query("SHOW TABLES LIKE '{". db_escape_table($table) ."}'"));
+ return (bool) db_fetch_object(db_query("SHOW TABLES LIKE '{" . db_escape_table($table) . "}'"));
}
/**
* Check if a column exists in the given table.
*/
function db_column_exists($table, $column) {
- return (bool) db_fetch_object(db_query("SHOW COLUMNS FROM {". db_escape_table($table) ."} LIKE '". db_escape_table($column) ."'"));
+ return (bool) db_fetch_object(db_query("SHOW COLUMNS FROM {" . db_escape_table($table) . "} LIKE '" . db_escape_table($column) . "'"));
}
/**
@@ -365,9 +365,9 @@ function db_column_exists($table, $column) {
* @return SQL query with the DISTINCT wrapper surrounding the given table.field.
*/
function db_distinct_field($table, $field, $query) {
- $field_to_select = 'DISTINCT('. $table .'.'. $field .')';
+ $field_to_select = 'DISTINCT(' . $table . '.' . $field . ')';
// (?query: '. $query .' error:'. pg_last_error($active_db) .'
';
+ print 'query: ' . $query . ' error:' . pg_last_error($active_db) . '
';
}
if ($last_result !== FALSE) {
@@ -156,7 +156,7 @@ function _db_query($query, $debug = 0) {
else {
// Indicate to drupal_error_handler that this is a database error.
${DB_ERROR} = TRUE;
- trigger_error(check_plain(pg_last_error($active_db) ."\nquery: ". $query), E_USER_WARNING);
+ trigger_error(check_plain(pg_last_error($active_db) . "\nquery: " . $query), E_USER_WARNING);
return FALSE;
}
}
@@ -228,7 +228,7 @@ function db_error() {
* The name of the autoincrement field.
*/
function db_last_insert_id($table, $field) {
- return db_result(db_query("SELECT CURRVAL('{". db_escape_table($table) ."}_". db_escape_table($field) ."_seq')"));
+ return db_result(db_query("SELECT CURRVAL('{" . db_escape_table($table) . "}_" . db_escape_table($field) . "_seq')"));
}
/**
@@ -280,7 +280,7 @@ function db_query_range($query) {
}
_db_query_callback($args, TRUE);
$query = preg_replace_callback(DB_QUERY_REGEXP, '_db_query_callback', $query);
- $query .= ' LIMIT '. (int)$count .' OFFSET '. (int)$from;
+ $query .= ' LIMIT ' . (int)$count . ' OFFSET ' . (int)$from;
return _db_query($query);
}
@@ -321,7 +321,7 @@ function db_query_temporary($query) {
$tablename = array_pop($args);
array_shift($args);
- $query = preg_replace('/^SELECT/i', 'CREATE TEMPORARY TABLE '. $tablename .' AS SELECT', db_prefix_tables($query));
+ $query = preg_replace('/^SELECT/i', 'CREATE TEMPORARY TABLE ' . $tablename . ' AS SELECT', db_prefix_tables($query));
if (isset($args[0]) and is_array($args[0])) { // 'All arguments in one array' syntax
$args = $args[0];
}
@@ -340,7 +340,7 @@ function db_query_temporary($query) {
* Encoded data.
*/
function db_encode_blob($data) {
- return "'". pg_escape_bytea($data) ."'";
+ return "'" . pg_escape_bytea($data) . "'";
}
/**
@@ -369,7 +369,7 @@ function db_escape_string($text) {
* This function automatically starts a transaction.
*/
function db_lock_table($table) {
- db_query('BEGIN; LOCK TABLE {'. db_escape_table($table) .'} IN EXCLUSIVE MODE');
+ db_query('BEGIN; LOCK TABLE {' . db_escape_table($table) . '} IN EXCLUSIVE MODE');
}
/**
@@ -384,14 +384,14 @@ function db_unlock_tables() {
* Check if a table exists.
*/
function db_table_exists($table) {
- return (bool) db_result(db_query("SELECT COUNT(*) FROM pg_class WHERE relname = '{". db_escape_table($table) ."}'"));
+ return (bool) db_result(db_query("SELECT COUNT(*) FROM pg_class WHERE relname = '{" . db_escape_table($table) . "}'"));
}
/**
* Check if a column exists in the given table.
*/
function db_column_exists($table, $column) {
- return (bool) db_result(db_query("SELECT COUNT(pg_attribute.attname) FROM pg_class, pg_attribute WHERE pg_attribute.attrelid = pg_class.oid AND pg_class.relname = '{". db_escape_table($table) ."}' AND attname = '". db_escape_table($column) ."'"));
+ return (bool) db_result(db_query("SELECT COUNT(pg_attribute.attname) FROM pg_class, pg_attribute WHERE pg_attribute.attrelid = pg_class.oid AND pg_class.relname = '{" . db_escape_table($table) . "}' AND attname = '" . db_escape_table($column) . "'"));
}
/**
@@ -418,10 +418,10 @@ function db_check_setup() {
* @return SQL query with the DISTINCT wrapper surrounding the given table.field.
*/
function db_distinct_field($table, $field, $query) {
- $field_to_select = 'DISTINCT ON ('. $table .'.'. $field .") $table.$field";
+ $field_to_select = 'DISTINCT ON (' . $table . '.' . $field . ") $table.$field";
// (? $key) {
- $sql_keys[] = 'CONSTRAINT {'. $name .'}_'. $key_name .'_key UNIQUE ('. implode(', ', $key) .')';
+ $sql_keys[] = 'CONSTRAINT {' . $name . '}_' . $key_name . '_key UNIQUE (' . implode(', ', $key) . ')';
}
}
- $sql = "CREATE TABLE {". $name ."} (\n\t";
+ $sql = "CREATE TABLE {" . $name . "} (\n\t";
$sql .= implode(",\n\t", $sql_fields);
if (count($sql_keys) > 0) {
$sql .= ",\n\t";
@@ -525,8 +525,8 @@ function db_create_table_sql($name, $table) {
}
function _db_create_index_sql($table, $name, $fields) {
- $query = 'CREATE INDEX {'. $table .'}_'. $name .'_idx ON {'. $table .'} (';
- $query .= _db_create_key_sql($fields) .')';
+ $query = 'CREATE INDEX {' . $table . '}_' . $name . '_idx ON {' . $table . '} (';
+ $query .= _db_create_key_sql($fields) . ')';
return $query;
}
@@ -534,7 +534,7 @@ function _db_create_key_sql($fields) {
$ret = array();
foreach ($fields as $field) {
if (is_array($field)) {
- $ret[] = 'substr('. $field[0] .', 1, '. $field[1] .')';
+ $ret[] = 'substr(' . $field[0] . ', 1, ' . $field[1] . ')';
}
else {
$ret[] = $field;
@@ -572,7 +572,7 @@ function _db_process_field($field) {
// Set the correct database-engine specific datatype.
if (!isset($field['pgsql_type'])) {
$map = db_type_map();
- $field['pgsql_type'] = $map[$field['type'] .':'. $field['size']];
+ $field['pgsql_type'] = $map[$field['type'] . ':' . $field['size']];
}
if ($field['type'] == 'serial') {
unset($field['not null']);
@@ -592,7 +592,7 @@ function _db_process_field($field) {
* The field specification, as per the schema data structure format.
*/
function _db_create_field_sql($name, $spec) {
- $sql = $name .' '. $spec['pgsql_type'];
+ $sql = $name . ' ' . $spec['pgsql_type'];
if ($spec['type'] == 'serial') {
unset($spec['not null']);
@@ -607,17 +607,17 @@ function _db_create_field_sql($name, $spec) {
}
if (!empty($spec['length'])) {
- $sql .= '('. $spec['length'] .')';
+ $sql .= '(' . $spec['length'] . ')';
}
elseif (isset($spec['precision']) && isset($spec['scale'])) {
- $sql .= '('. $spec['precision'] .', '. $spec['scale'] .')';
+ $sql .= '(' . $spec['precision'] . ', ' . $spec['scale'] . ')';
}
if (isset($spec['not null']) && $spec['not null']) {
$sql .= ' NOT NULL';
}
if (isset($spec['default'])) {
- $default = is_string($spec['default']) ? "'". $spec['default'] ."'" : $spec['default'];
+ $default = is_string($spec['default']) ? "'" . $spec['default'] . "'" : $spec['default'];
$sql .= " default $default";
}
@@ -635,7 +635,7 @@ function _db_create_field_sql($name, $spec) {
* The new name for the table.
*/
function db_rename_table(&$ret, $table, $new_name) {
- $ret[] = update_sql('ALTER TABLE {'. $table .'} RENAME TO {'. $new_name .'}');
+ $ret[] = update_sql('ALTER TABLE {' . $table . '} RENAME TO {' . $new_name . '}');
}
/**
@@ -647,7 +647,7 @@ function db_rename_table(&$ret, $table, $new_name) {
* The table to be dropped.
*/
function db_drop_table(&$ret, $table) {
- $ret[] = update_sql('DROP TABLE {'. $table .'}');
+ $ret[] = update_sql('DROP TABLE {' . $table . '}');
}
/**
@@ -679,17 +679,17 @@ function db_add_field(&$ret, $table, $field, $spec, $new_keys = array()) {
$fixnull = TRUE;
$spec['not null'] = FALSE;
}
- $query = 'ALTER TABLE {'. $table .'} ADD COLUMN ';
+ $query = 'ALTER TABLE {' . $table . '} ADD COLUMN ';
$query .= _db_create_field_sql($field, _db_process_field($spec));
$ret[] = update_sql($query);
if (isset($spec['initial'])) {
// All this because update_sql does not support %-placeholders.
- $sql = 'UPDATE {'. $table .'} SET '. $field .' = '. db_type_placeholder($spec['type']);
+ $sql = 'UPDATE {' . $table . '} SET ' . $field . ' = ' . db_type_placeholder($spec['type']);
$result = db_query($sql, $spec['initial']);
- $ret[] = array('success' => $result !== FALSE, 'query' => check_plain($sql .' ('. $spec['initial'] .')'));
+ $ret[] = array('success' => $result !== FALSE, 'query' => check_plain($sql . ' (' . $spec['initial'] . ')'));
}
if ($fixnull) {
- $ret[] = update_sql("ALTER TABLE {". $table ."} ALTER $field SET NOT NULL");
+ $ret[] = update_sql("ALTER TABLE {" . $table . "} ALTER $field SET NOT NULL");
}
if (isset($new_keys)) {
_db_create_keys($ret, $table, $new_keys);
@@ -707,7 +707,7 @@ function db_add_field(&$ret, $table, $field, $spec, $new_keys = array()) {
* The field to be dropped.
*/
function db_drop_field(&$ret, $table, $field) {
- $ret[] = update_sql('ALTER TABLE {'. $table .'} DROP COLUMN '. $field);
+ $ret[] = update_sql('ALTER TABLE {' . $table . '} DROP COLUMN ' . $field);
}
/**
@@ -730,7 +730,7 @@ function db_field_set_default(&$ret, $table, $field, $default) {
$default = is_string($default) ? "'$default'" : $default;
}
- $ret[] = update_sql('ALTER TABLE {'. $table .'} ALTER COLUMN '. $field .' SET DEFAULT '. $default);
+ $ret[] = update_sql('ALTER TABLE {' . $table . '} ALTER COLUMN ' . $field . ' SET DEFAULT ' . $default);
}
/**
@@ -744,7 +744,7 @@ function db_field_set_default(&$ret, $table, $field, $default) {
* The field to be altered.
*/
function db_field_set_no_default(&$ret, $table, $field) {
- $ret[] = update_sql('ALTER TABLE {'. $table .'} ALTER COLUMN '. $field .' DROP DEFAULT');
+ $ret[] = update_sql('ALTER TABLE {' . $table . '} ALTER COLUMN ' . $field . ' DROP DEFAULT');
}
/**
@@ -758,8 +758,8 @@ function db_field_set_no_default(&$ret, $table, $field) {
* Fields for the primary key.
*/
function db_add_primary_key(&$ret, $table, $fields) {
- $ret[] = update_sql('ALTER TABLE {'. $table .'} ADD PRIMARY KEY ('.
- implode(',', $fields) .')');
+ $ret[] = update_sql('ALTER TABLE {' . $table . '} ADD PRIMARY KEY (' .
+ implode(',', $fields) . ')');
}
/**
@@ -771,7 +771,7 @@ function db_add_primary_key(&$ret, $table, $fields) {
* The table to be altered.
*/
function db_drop_primary_key(&$ret, $table) {
- $ret[] = update_sql('ALTER TABLE {'. $table .'} DROP CONSTRAINT {'. $table .'}_pkey');
+ $ret[] = update_sql('ALTER TABLE {' . $table . '} DROP CONSTRAINT {' . $table . '}_pkey');
}
/**
@@ -787,9 +787,9 @@ function db_drop_primary_key(&$ret, $table) {
* An array of field names.
*/
function db_add_unique_key(&$ret, $table, $name, $fields) {
- $name = '{'. $table .'}_'. $name .'_key';
- $ret[] = update_sql('ALTER TABLE {'. $table .'} ADD CONSTRAINT '.
- $name .' UNIQUE ('. implode(',', $fields) .')');
+ $name = '{' . $table . '}_' . $name . '_key';
+ $ret[] = update_sql('ALTER TABLE {' . $table . '} ADD CONSTRAINT ' .
+ $name . ' UNIQUE (' . implode(',', $fields) . ')');
}
/**
@@ -803,8 +803,8 @@ function db_add_unique_key(&$ret, $table, $name, $fields) {
* The name of the key.
*/
function db_drop_unique_key(&$ret, $table, $name) {
- $name = '{'. $table .'}_'. $name .'_key';
- $ret[] = update_sql('ALTER TABLE {'. $table .'} DROP CONSTRAINT '. $name);
+ $name = '{' . $table . '}_' . $name . '_key';
+ $ret[] = update_sql('ALTER TABLE {' . $table . '} DROP CONSTRAINT ' . $name);
}
/**
@@ -834,8 +834,8 @@ function db_add_index(&$ret, $table, $name, $fields) {
* The name of the index.
*/
function db_drop_index(&$ret, $table, $name) {
- $name = '{'. $table .'}_'. $name .'_idx';
- $ret[] = update_sql('DROP INDEX '. $name);
+ $name = '{' . $table . '}_' . $name . '_idx';
+ $ret[] = update_sql('DROP INDEX ' . $name);
}
/**
@@ -901,19 +901,19 @@ function db_drop_index(&$ret, $table, $name) {
* table specification but without the 'fields' element.
*/
function db_change_field(&$ret, $table, $field, $field_new, $spec, $new_keys = array()) {
- $ret[] = update_sql("ALTER TABLE {". $table ."} RENAME $field TO ". $field ."_old");
+ $ret[] = update_sql("ALTER TABLE {" . $table . "} RENAME $field TO " . $field . "_old");
$not_null = isset($spec['not null']) ? $spec['not null'] : FALSE;
unset($spec['not null']);
db_add_field($ret, $table, "$field_new", $spec);
- $ret[] = update_sql("UPDATE {". $table ."} SET $field_new = ". $field ."_old");
+ $ret[] = update_sql("UPDATE {" . $table . "} SET $field_new = " . $field . "_old");
if ($not_null) {
- $ret[] = update_sql("ALTER TABLE {". $table ."} ALTER $field_new SET NOT NULL");
+ $ret[] = update_sql("ALTER TABLE {" . $table . "} ALTER $field_new SET NOT NULL");
}
- db_drop_field($ret, $table, $field .'_old');
+ db_drop_field($ret, $table, $field . '_old');
if (isset($new_keys)) {
_db_create_keys($ret, $table, $new_keys);
diff --git a/includes/file.inc b/includes/file.inc
index 5f1b6ae1a..16f5c5629 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -40,14 +40,14 @@ define('FILE_STATUS_PERMANENT', 1);
*/
function file_create_url($path) {
// Strip file_directory_path from $path. We only include relative paths in urls.
- if (strpos($path, file_directory_path() .'/') === 0) {
+ if (strpos($path, file_directory_path() . '/') === 0) {
$path = trim(substr($path, strlen(file_directory_path())), '\\/');
}
switch (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC)) {
case FILE_DOWNLOADS_PUBLIC:
- return $GLOBALS['base_url'] .'/'. file_directory_path() .'/'. str_replace('\\', '/', $path);
+ return $GLOBALS['base_url'] . '/' . file_directory_path() . '/' . str_replace('\\', '/', $path);
case FILE_DOWNLOADS_PRIVATE:
- return url('system/files/'. $path, array('absolute' => TRUE));
+ return url('system/files/' . $path, array('absolute' => TRUE));
}
}
@@ -75,8 +75,8 @@ function file_create_path($dest = 0) {
return $dest;
}
// Not found, try again with prefixed directory path.
- else if (file_check_location($file_path .'/'. $dest, $file_path)) {
- return $file_path .'/'. $dest;
+ else if (file_check_location($file_path . '/' . $dest, $file_path)) {
+ return $file_path . '/' . $dest;
}
// File not found.
return FALSE;
@@ -128,10 +128,10 @@ function file_check_directory(&$directory, $mode = 0, $form_item = NULL) {
$htaccess_lines = "SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006\nOptions None\nOptions +FollowSymLinks";
if (($fp = fopen("$directory/.htaccess", 'w')) && fputs($fp, $htaccess_lines)) {
fclose($fp);
- chmod($directory .'/.htaccess', 0664);
+ chmod($directory . '/.htaccess', 0664);
}
else {
- $variables = array('%directory' => $directory, '!htaccess' => ' '. nl2br(check_plain($htaccess_lines)));
+ $variables = array('%directory' => $directory, '!htaccess' => ' ' . nl2br(check_plain($htaccess_lines)));
form_set_error($form_item, t("Security warning: Couldn't write .htaccess file. Please create a .htaccess file in your %directory directory which contains the following lines: !htaccess
", $variables));
watchdog('security', "Security warning: Couldn't write .htaccess file. Please create a .htaccess file in your %directory directory which contains the following lines: !htaccess
", $variables, WATCHDOG_ERROR);
}
@@ -185,7 +185,7 @@ function file_check_location($source, $directory = '') {
}
else {
// This file does not yet exist
- $source = realpath(dirname($source)) .'/'. basename($source);
+ $source = realpath(dirname($source)) . '/' . basename($source);
}
$directory = realpath($directory);
if ($directory && strpos($source, $directory) !== 0) {
@@ -244,7 +244,7 @@ function file_copy(&$source, $dest = 0, $replace = FILE_EXISTS_RENAME) {
// If the destination file is not specified then use the filename of the source file.
$basename = $basename ? $basename : basename($source);
- $dest = $directory .'/'. $basename;
+ $dest = $directory . '/' . $basename;
// Make sure source and destination filenames are not the same, makes no sense
// to copy it if they are. In fact copying the file will most likely result in
@@ -369,12 +369,12 @@ function file_munge_filename($filename, $extensions, $alerts = TRUE) {
// end of each section that could be a file extension but isn't in the list
// of allowed extensions.
foreach ($filename_parts as $filename_part) {
- $new_filename .= '.'. $filename_part;
+ $new_filename .= '.' . $filename_part;
if (!in_array($filename_part, $whitelist) && preg_match("/^[a-zA-Z]{2,5}\d?$/", $filename_part)) {
$new_filename .= '_';
}
}
- $filename = $new_filename .'.'. $final_extension;
+ $filename = $new_filename . '.' . $final_extension;
if ($alerts && $original != $filename) {
drupal_set_message(t('For security reasons, your upload has been renamed to %filename.', array('%filename' => $filename)));
@@ -403,7 +403,7 @@ function file_unmunge_filename($filename) {
* @return
*/
function file_create_filename($basename, $directory) {
- $dest = $directory .'/'. $basename;
+ $dest = $directory . '/' . $basename;
if (file_exists($dest)) {
// Destination file already exists, generate an alternative.
@@ -417,7 +417,7 @@ function file_create_filename($basename, $directory) {
$counter = 0;
do {
- $dest = $directory .'/'. $name .'_'. $counter++ . $ext;
+ $dest = $directory . '/' . $name . '_' . $counter++ . $ext;
} while (file_exists($dest));
}
@@ -519,7 +519,7 @@ function file_save_upload($source, $validators = array(), $dest = FALSE, $replac
// @todo: this should not be here. we need to figure out the right place.
$extensions = '';
foreach ($user->roles as $rid => $name) {
- $extensions .= ' '. variable_get("upload_extensions_$rid",
+ $extensions .= ' ' . variable_get("upload_extensions_$rid",
variable_get('upload_extensions_default', 'jpg jpeg gif png txt html doc xls pdf ppt pps odt ods odp'));
}
@@ -543,7 +543,7 @@ function file_save_upload($source, $validators = array(), $dest = FALSE, $replac
}
$file->source = $source;
- $file->destination = file_destination(file_create_path($dest .'/'. $file->filename), $replace);
+ $file->destination = file_destination(file_create_path($dest . '/' . $file->filename), $replace);
$file->filesize = $_FILES['files']['size'][$source];
// Call the validation functions.
@@ -557,10 +557,10 @@ function file_save_upload($source, $validators = array(), $dest = FALSE, $replac
if (!empty($errors)) {
$message = t('The selected file %name could not be uploaded.', array('%name' => $file->filename));
if (count($errors) > 1) {
- $message .= ''. implode(' ', $errors) .' ';
+ $message .= '' . implode(' ', $errors) . ' ';
}
else {
- $message .= ' '. array_pop($errors);
+ $message .= ' ' . array_pop($errors);
}
form_set_error($source, $message);
return 0;
@@ -623,7 +623,7 @@ function file_validate_extensions($file, $extensions) {
// Bypass validation for uid = 1.
if ($user->uid != 1) {
- $regex = '/\.('. ereg_replace(' +', '|', preg_quote($extensions)) .')$/i';
+ $regex = '/\.(' . ereg_replace(' +', '|', preg_quote($extensions)) . ')$/i';
if (!preg_match($regex, $file->filename)) {
$errors[] = t('Only files with the following extensions are allowed: %files-allowed.', array('%files-allowed' => $extensions));
}
@@ -946,7 +946,7 @@ function file_directory_temp() {
}
// if a directory has been found, use it, otherwise default to 'files/tmp' or 'files\\tmp';
- $temporary_directory = $temporary_directory ? $temporary_directory : file_directory_path() . $path_delimiter .'tmp';
+ $temporary_directory = $temporary_directory ? $temporary_directory : file_directory_path() . $path_delimiter . 'tmp';
variable_set('file_directory_temp', $temporary_directory);
}
@@ -959,7 +959,7 @@ function file_directory_temp() {
* @return A string containing the path to Drupal's 'files' directory.
*/
function file_directory_path() {
- return variable_get('file_directory_path', conf_path() .'/files');
+ return variable_get('file_directory_path', conf_path() . '/files');
}
/**
diff --git a/includes/form.inc b/includes/form.inc
index c7738d029..ac9ea2bb9 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -100,7 +100,7 @@ function drupal_get_form($form_id) {
array_unshift($args_temp, $form_id);
$form = call_user_func_array('drupal_retrieve_form', $args_temp);
- $form_build_id = 'form-'. md5(mt_rand());
+ $form_build_id = 'form-' . md5(mt_rand());
$form['#build_id'] = $form_build_id;
drupal_prepare_form($form_id, $form, $form_state);
// Store a copy of the unprocessed form for caching and indicate that it
@@ -196,7 +196,7 @@ function drupal_rebuild_form($form_id, &$form_state, $args, $form_build_id = NUL
if (!isset($form_build_id)) {
// We need a new build_id for the new version of the form.
- $form_build_id = 'form-'. md5(mt_rand());
+ $form_build_id = 'form-' . md5(mt_rand());
}
$form['#build_id'] = $form_build_id;
drupal_prepare_form($form_id, $form, $form_state);
@@ -219,9 +219,9 @@ function drupal_rebuild_form($form_id, &$form_state, $args, $form_build_id = NUL
* Fetch a form from cache.
*/
function form_get_cache($form_build_id, &$form_state) {
- if ($cached = cache_get('form_'. $form_build_id, 'cache_form')) {
+ if ($cached = cache_get('form_' . $form_build_id, 'cache_form')) {
$form = $cached->data;
- if ($cached = cache_get('storage_'. $form_build_id, 'cache_form')) {
+ if ($cached = cache_get('storage_' . $form_build_id, 'cache_form')) {
$form_state['storage'] = $cached->data;
}
return $form;
@@ -234,9 +234,9 @@ function form_get_cache($form_build_id, &$form_state) {
function form_set_cache($form_build_id, $form, $form_state) {
$expire = max(ini_get('session.cookie_lifetime'), 86400);
- cache_set('form_'. $form_build_id, $form, 'cache_form', $expire);
+ cache_set('form_' . $form_build_id, $form, 'cache_form', $expire);
if (!empty($form_state['storage'])) {
- cache_set('storage_'. $form_build_id, $form_state['storage'], 'cache_form', $expire);
+ cache_set('storage_' . $form_build_id, $form_state['storage'], 'cache_form', $expire);
}
}
@@ -404,8 +404,8 @@ function drupal_process_form($form_id, &$form, &$form_state) {
// here, as we've finished with them. The in-memory copies are still
// here, though.
if (variable_get('cache', CACHE_DISABLED) == CACHE_DISABLED && !empty($form_state['values']['form_build_id'])) {
- cache_clear_all('form_'. $form_state['values']['form_build_id'], 'cache_form');
- cache_clear_all('storage_'. $form_state['values']['form_build_id'], 'cache_form');
+ cache_clear_all('form_' . $form_state['values']['form_build_id'], 'cache_form');
+ cache_clear_all('storage_' . $form_state['values']['form_build_id'], 'cache_form');
}
// If batches were set in the submit handlers, we process them now,
@@ -483,7 +483,7 @@ function drupal_prepare_form($form_id, &$form, &$form_state) {
else if (isset($user->uid) && $user->uid && !$form['#programmed']) {
$form['#token'] = $form_id;
$form['form_token'] = array(
- '#id' => form_clean_id('edit-'. $form_id .'-form-token'),
+ '#id' => form_clean_id('edit-' . $form_id . '-form-token'),
'#type' => 'token',
'#default_value' => drupal_get_token($form['#token']),
);
@@ -503,15 +503,15 @@ function drupal_prepare_form($form_id, &$form, &$form_state) {
$form += _element_info('form');
if (!isset($form['#validate'])) {
- if (function_exists($form_id .'_validate')) {
- $form['#validate'] = array($form_id .'_validate');
+ if (function_exists($form_id . '_validate')) {
+ $form['#validate'] = array($form_id . '_validate');
}
}
if (!isset($form['#submit'])) {
- if (function_exists($form_id .'_submit')) {
+ if (function_exists($form_id . '_submit')) {
// We set submit here so that it can be altered.
- $form['#submit'] = array($form_id .'_submit');
+ $form['#submit'] = array($form_id . '_submit');
}
}
@@ -523,7 +523,7 @@ function drupal_prepare_form($form_id, &$form, &$form_state) {
// @todo: Remove this in Drupal 7.
$data = &$form;
$data['__drupal_alter_by_ref'] = array(&$form_state);
- drupal_alter('form_'. $form_id, $data);
+ drupal_alter('form_' . $form_id, $data);
// __drupal_alter_by_ref is unset in the drupal_alter() function, we need
// to repopulate it to ensure both calls get the data.
@@ -737,11 +737,11 @@ function _form_validate($elements, &$form_state, $form_id = NULL) {
*/
function form_execute_handlers($type, &$form, &$form_state) {
$return = FALSE;
- if (isset($form_state[$type .'_handlers'])) {
- $handlers = $form_state[$type .'_handlers'];
+ if (isset($form_state[$type . '_handlers'])) {
+ $handlers = $form_state[$type . '_handlers'];
}
- elseif (isset($form['#'. $type])) {
- $handlers = $form['#'. $type];
+ elseif (isset($form['#' . $type])) {
+ $handlers = $form['#' . $type];
}
else {
$handlers = array();
@@ -948,15 +948,15 @@ function _form_builder_handle_input_element($form_id, &$form, &$form_state, $com
// To make it easier to handle $_FILES in file.inc, we place all
// file fields in the 'files' array. Also, we do not support
// nested file names.
- $form['#name'] = 'files['. $form['#name'] .']';
+ $form['#name'] = 'files[' . $form['#name'] . ']';
}
elseif (count($form['#parents'])) {
- $form['#name'] .= '['. implode('][', $form['#parents']) .']';
+ $form['#name'] .= '[' . implode('][', $form['#parents']) . ']';
}
array_unshift($form['#parents'], $name);
}
if (!isset($form['#id'])) {
- $form['#id'] = form_clean_id('edit-'. implode('-', $form['#parents']));
+ $form['#id'] = form_clean_id('edit-' . implode('-', $form['#parents']));
}
unset($edit);
@@ -965,7 +965,7 @@ function _form_builder_handle_input_element($form_id, &$form, &$form_state, $com
}
if (!isset($form['#value']) && !array_key_exists('#value', $form)) {
- $function = !empty($form['#value_callback']) ? $form['#value_callback'] : 'form_type_'. $form['#type'] .'_value';
+ $function = !empty($form['#value_callback']) ? $form['#value_callback'] : 'form_type_' . $form['#type'] . '_value';
if (($form['#programmed']) || ((!isset($form['#access']) || $form['#access']) && isset($form['#post']) && (isset($form['#post']['form_id']) && $form['#post']['form_id'] == $form_id))) {
$edit = $form['#post'];
foreach ($form['#parents'] as $parent) {
@@ -1131,7 +1131,7 @@ function form_type_image_button_value($form, $edit = FALSE) {
}
if (!isset($post[$element_name])) {
- if (isset($post[$element_name .'_x'])) {
+ if (isset($post[$element_name . '_x'])) {
return $form['#return_value'];
}
return NULL;
@@ -1375,10 +1375,10 @@ function form_options_flatten($array, $reset = TRUE) {
*/
function theme_select($element) {
$select = '';
- $size = $element['#size'] ? ' size="'. $element['#size'] .'"' : '';
+ $size = $element['#size'] ? ' size="' . $element['#size'] . '"' : '';
_form_set_class($element, array('form-select'));
$multiple = $element['#multiple'];
- return theme('form_element', $element, ''. form_select_options($element) .' ');
+ return theme('form_element', $element, '' . form_select_options($element) . ' ');
}
function form_select_options($element, $choices = NULL) {
@@ -1392,7 +1392,7 @@ function form_select_options($element, $choices = NULL) {
$options = '';
foreach ($choices as $key => $choice) {
if (is_array($choice)) {
- $options .= '';
+ $options .= '';
$options .= form_select_options($element, $choice);
$options .= ' ';
}
@@ -1407,7 +1407,7 @@ function form_select_options($element, $choices = NULL) {
else {
$selected = '';
}
- $options .= ''. check_plain($choice) .' ';
+ $options .= '' . check_plain($choice) . ' ';
}
}
return $options;
@@ -1488,7 +1488,7 @@ function theme_fieldset($element) {
}
}
- return ''. ($element['#title'] ? ''. $element['#title'] .' ' : '') . (isset($element['#description']) && $element['#description'] ? ''. $element['#description'] .'
' : '') . (!empty($element['#children']) ? $element['#children'] : '') . $element['#value'] ." \n";
+ return '' . ($element['#title'] ? '' . $element['#title'] . ' ' : '') . (isset($element['#description']) && $element['#description'] ? '' . $element['#description'] . '
' : '') . (!empty($element['#children']) ? $element['#children'] : '') . $element['#value'] . " \n";
}
/**
@@ -1505,12 +1505,12 @@ function theme_fieldset($element) {
function theme_radio($element) {
_form_set_class($element, array('form-radio'));
$output = ' ';
+ $output .= drupal_attributes($element['#attributes']) . ' />';
if (!is_null($element['#title'])) {
- $output = ''. $output .' '. $element['#title'] .' ';
+ $output = '' . $output . ' ' . $element['#title'] . ' ';
}
unset($element['#title']);
@@ -1531,9 +1531,9 @@ function theme_radio($element) {
function theme_radios($element) {
$class = 'form-radios';
if (isset($element['#attributes']['class'])) {
- $class .= ' '. $element['#attributes']['class'];
+ $class .= ' ' . $element['#attributes']['class'];
}
- $element['#children'] = ''. (!empty($element['#children']) ? $element['#children'] : '') .'
';
+ $element['#children'] = '' . (!empty($element['#children']) ? $element['#children'] : '') . '
';
if ($element['#title'] || $element['#description']) {
unset($element['#id']);
return theme('form_element', $element, $element['#children']);
@@ -1623,7 +1623,7 @@ function password_confirm_validate($form, &$form_state) {
* @ingroup themeable
*/
function theme_date($element) {
- return theme('form_element', $element, ''. $element['#children'] .'
');
+ return theme('form_element', $element, '' . $element['#children'] . '
');
}
/**
@@ -1720,7 +1720,7 @@ function expand_radios($element) {
'#default_value' => isset($element['#default_value']) ? $element['#default_value'] : NULL,
'#attributes' => $element['#attributes'],
'#parents' => $element['#parents'],
- '#id' => form_clean_id('edit-'. implode('-', $parents_for_id)),
+ '#id' => form_clean_id('edit-' . implode('-', $parents_for_id)),
);
}
}
@@ -1782,7 +1782,7 @@ function form_expand_ahah($element) {
'event' => $element['#ahah']['event'],
'keypress' => empty($element['#ahah']['keypress']) ? NULL : $element['#ahah']['keypress'],
'wrapper' => empty($element['#ahah']['wrapper']) ? NULL : $element['#ahah']['wrapper'],
- 'selector' => empty($element['#ahah']['selector']) ? '#'. $element['#id'] : $element['#ahah']['selector'],
+ 'selector' => empty($element['#ahah']['selector']) ? '#' . $element['#id'] : $element['#ahah']['selector'],
'effect' => empty($element['#ahah']['effect']) ? 'none' : $element['#ahah']['effect'],
'method' => empty($element['#ahah']['method']) ? 'replace' : $element['#ahah']['method'],
'progress' => empty($element['#ahah']['progress']) ? array('type' => 'throbber') : $element['#ahah']['progress'],
@@ -1841,14 +1841,14 @@ function theme_checkbox($element) {
_form_set_class($element, array('form-checkbox'));
$checkbox = ' ';
+ $checkbox .= drupal_attributes($element['#attributes']) . ' />';
if (!is_null($element['#title'])) {
- $checkbox = ''. $checkbox .' '. $element['#title'] .' ';
+ $checkbox = '' . $checkbox . ' ' . $element['#title'] . ' ';
}
unset($element['#title']);
@@ -1868,9 +1868,9 @@ function theme_checkbox($element) {
function theme_checkboxes($element) {
$class = 'form-checkboxes';
if (isset($element['#attributes']['class'])) {
- $class .= ' '. $element['#attributes']['class'];
+ $class .= ' ' . $element['#attributes']['class'];
}
- $element['#children'] = ''. (!empty($element['#children']) ? $element['#children'] : '') .'
';
+ $element['#children'] = '' . (!empty($element['#children']) ? $element['#children'] : '') . '
';
if ($element['#title'] || $element['#description']) {
unset($element['#id']);
return theme('form_element', $element, $element['#children']);
@@ -1913,13 +1913,13 @@ function theme_submit($element) {
function theme_button($element) {
// Make sure not to overwrite classes.
if (isset($element['#attributes']['class'])) {
- $element['#attributes']['class'] = 'form-'. $element['#button_type'] .' '. $element['#attributes']['class'];
+ $element['#attributes']['class'] = 'form-' . $element['#button_type'] . ' ' . $element['#attributes']['class'];
}
else {
- $element['#attributes']['class'] = 'form-'. $element['#button_type'];
+ $element['#attributes']['class'] = 'form-' . $element['#button_type'];
}
- return ' \n";
+ return ' \n";
}
/**
@@ -1930,18 +1930,18 @@ function theme_button($element) {
function theme_image_button($element) {
// Make sure not to overwrite classes.
if (isset($element['#attributes']['class'])) {
- $element['#attributes']['class'] = 'form-'. $element['#button_type'] .' '. $element['#attributes']['class'];
+ $element['#attributes']['class'] = 'form-' . $element['#button_type'] . ' ' . $element['#attributes']['class'];
}
else {
- $element['#attributes']['class'] = 'form-'. $element['#button_type'];
+ $element['#attributes']['class'] = 'form-' . $element['#button_type'];
}
- return ' \n";
}
@@ -1957,7 +1957,7 @@ function theme_image_button($element) {
* @ingroup themeable
*/
function theme_hidden($element) {
- return ' \n";
+ return ' \n";
}
/**
@@ -1981,8 +1981,8 @@ function theme_token($element) {
* @ingroup themeable
*/
function theme_textfield($element) {
- $size = empty($element['#size']) ? '' : ' size="'. $element['#size'] .'"';
- $maxlength = empty($element['#maxlength']) ? '' : ' maxlength="'. $element['#maxlength'] .'"';
+ $size = empty($element['#size']) ? '' : ' size="' . $element['#size'] . '"';
+ $maxlength = empty($element['#maxlength']) ? '' : ' maxlength="' . $element['#maxlength'] . '"';
$class = array('form-text');
$extra = '';
$output = '';
@@ -1990,18 +1990,18 @@ function theme_textfield($element) {
if ($element['#autocomplete_path']) {
drupal_add_js('misc/autocomplete.js');
$class[] = 'form-autocomplete';
- $extra = ' ';
+ $extra = ' ';
}
_form_set_class($element, $class);
if (isset($element['#field_prefix'])) {
- $output .= ''. $element['#field_prefix'] .' ';
+ $output .= '' . $element['#field_prefix'] . ' ';
}
- $output .= ' ';
+ $output .= ' ';
if (isset($element['#field_suffix'])) {
- $output .= ' '. $element['#field_suffix'] .' ';
+ $output .= ' ' . $element['#field_suffix'] . ' ';
}
return theme('form_element', $element, $output) . $extra;
@@ -2020,8 +2020,8 @@ function theme_textfield($element) {
*/
function theme_form($element) {
// Anonymous div to satisfy XHTML compliance.
- $action = $element['#action'] ? 'action="'. check_url($element['#action']) .'" ' : '';
- return '\n";
+ $action = $element['#action'] ? 'action="' . check_url($element['#action']) . '" ' : '';
+ return '\n";
}
/**
@@ -2054,7 +2054,7 @@ function theme_textarea($element) {
}
_form_set_class($element, $class);
- return theme('form_element', $element, '');
+ return theme('form_element', $element, '');
}
/**
@@ -2087,11 +2087,11 @@ function theme_markup($element) {
* @ingroup themeable
*/
function theme_password($element) {
- $size = $element['#size'] ? ' size="'. $element['#size'] .'" ' : '';
- $maxlength = $element['#maxlength'] ? ' maxlength="'. $element['#maxlength'] .'" ' : '';
+ $size = $element['#size'] ? ' size="' . $element['#size'] . '" ' : '';
+ $maxlength = $element['#maxlength'] ? ' maxlength="' . $element['#maxlength'] . '" ' : '';
_form_set_class($element, array('form-text'));
- $output = ' ';
+ $output = ' ';
return theme('form_element', $element, $output);
}
@@ -2132,7 +2132,7 @@ function process_weight($element) {
*/
function theme_file($element) {
_form_set_class($element, array('form-file'));
- return theme('form_element', $element, ' \n");
+ return theme('form_element', $element, ' \n");
}
/**
@@ -2154,25 +2154,25 @@ function theme_form_element($element, $value) {
$output = '\n";
@@ -2235,7 +2235,7 @@ function form_clean_id($id = NULL, $flush = FALSE) {
// outputting duplicate IDs, which would break JS code and XHTML
// validity anyways. For now, it's an acceptable stopgap solution.
if (isset($seen_ids[$id])) {
- $id = $id .'-'. $seen_ids[$id]++;
+ $id = $id . '-' . $seen_ids[$id]++;
}
else {
$seen_ids[$id] = 1;
@@ -2296,7 +2296,7 @@ function form_clean_id($id = NULL, $flush = FALSE) {
* // and the batch processing can continue to the next operation.
*
* $node = node_load(array('uid' => $uid, 'type' => $type));
- * $context['results'][] = $node->nid .' : '. $node->title;
+ * $context['results'][] = $node->nid . ' : ' . $node->title;
* $context['message'] = $node->title;
* }
*
@@ -2311,7 +2311,7 @@ function form_clean_id($id = NULL, $flush = FALSE) {
* $result = db_query_range("SELECT nid FROM {node} WHERE nid > %d ORDER BY nid ASC", $context['sandbox']['current_node'], 0, $limit);
* while ($row = db_fetch_array($result)) {
* $node = node_load($row['nid'], NULL, TRUE);
- * $context['results'][] = $node->nid .' : '. $node->title;
+ * $context['results'][] = $node->nid . ' : ' . $node->title;
* $context['sandbox']['progress']++;
* $context['sandbox']['current_node'] = $node->nid;
* $context['message'] = $node->title;
@@ -2483,7 +2483,7 @@ function batch_process($redirect = NULL, $url = NULL) {
// Actually store the batch data and the token generated form the batch id.
db_query("UPDATE {batch} SET token = '%s', batch = '%s' WHERE bid = %d", drupal_get_token($batch['id']), serialize($batch), $batch['id']);
- drupal_goto($batch['url'], 'op=start&id='. $batch['id']);
+ drupal_goto($batch['url'], 'op=start&id=' . $batch['id']);
}
else {
// Non-progressive execution: bypass the whole progressbar workflow
diff --git a/includes/image.gd.inc b/includes/image.gd.inc
index c9378ca7f..ab26371f6 100644
--- a/includes/image.gd.inc
+++ b/includes/image.gd.inc
@@ -183,7 +183,7 @@ function image_gd_crop($source, $destination, $x, $y, $width, $height) {
*/
function image_gd_open($file, $extension) {
$extension = str_replace('jpg', 'jpeg', $extension);
- $open_func = 'imageCreateFrom'. $extension;
+ $open_func = 'imageCreateFrom' . $extension;
if (!function_exists($open_func)) {
return FALSE;
}
@@ -204,7 +204,7 @@ function image_gd_open($file, $extension) {
*/
function image_gd_close($res, $destination, $extension) {
$extension = str_replace('jpg', 'jpeg', $extension);
- $close_func = 'image'. $extension;
+ $close_func = 'image' . $extension;
if (!function_exists($close_func)) {
return FALSE;
}
diff --git a/includes/image.inc b/includes/image.inc
index 03f527887..d86b62b01 100644
--- a/includes/image.inc
+++ b/includes/image.inc
@@ -42,7 +42,7 @@ function image_get_available_toolkits() {
$output = array();
foreach ($toolkits as $file => $toolkit) {
include_once "./$file";
- $function = str_replace('.', '_', $toolkit->name) .'_info';
+ $function = str_replace('.', '_', $toolkit->name) . '_info';
if (function_exists($function)) {
$info = $function();
$output[$info['name']] = $info['title'];
@@ -63,7 +63,7 @@ function image_get_toolkit() {
if (!$toolkit) {
$toolkit = variable_get('image_toolkit', 'gd');
- $toolkit_file = './includes/image.'. $toolkit .'.inc';
+ $toolkit_file = './includes/image.' . $toolkit . '.inc';
if (isset($toolkit) && file_exists($toolkit_file)) {
include_once $toolkit_file;
}
@@ -87,7 +87,7 @@ function image_get_toolkit() {
*/
function image_toolkit_invoke($method, $params = array()) {
if ($toolkit = image_get_toolkit()) {
- $function = 'image_'. $toolkit .'_'. $method;
+ $function = 'image_' . $toolkit . '_' . $method;
if (function_exists($function)) {
return call_user_func_array($function, $params);
}
diff --git a/includes/install.inc b/includes/install.inc
index 6d6d4349e..2d74a9230 100644
--- a/includes/install.inc
+++ b/includes/install.inc
@@ -42,8 +42,8 @@ function drupal_get_schema_versions($module) {
$updates = array();
$functions = get_defined_functions();
foreach ($functions['user'] as $function) {
- if (strpos($function, $module .'_update_') === 0) {
- $version = substr($function, strlen($module .'_update_'));
+ if (strpos($function, $module . '_update_') === 0) {
+ $version = substr($function, strlen($module . '_update_'));
if (is_numeric($version)) {
$updates[] = $version;
}
@@ -110,7 +110,7 @@ function drupal_install_profile_name() {
if (!isset($name)) {
// Load profile details.
- $function = $profile .'_profile_details';
+ $function = $profile . '_profile_details';
if (function_exists($function)) {
$details = $function();
}
@@ -134,7 +134,7 @@ function drupal_detect_baseurl($file = 'install.php') {
global $profile;
$proto = $_SERVER['HTTPS'] ? 'https://' : 'http://';
$host = $_SERVER['SERVER_NAME'];
- $port = ($_SERVER['SERVER_PORT'] == 80 ? '' : ':'. $_SERVER['SERVER_PORT']);
+ $port = ($_SERVER['SERVER_PORT'] == 80 ? '' : ':' . $_SERVER['SERVER_PORT']);
$uri = preg_replace("/\?.*/", '', $_SERVER['REQUEST_URI']);
$dir = str_replace("/$file", '', $uri);
@@ -152,9 +152,9 @@ function drupal_detect_database_types() {
$databases = array();
foreach (array('mysql', 'mysqli', 'pgsql') as $type) {
- if (file_exists('./includes/install.'. $type .'.inc')) {
- include_once './includes/install.'. $type .'.inc';
- $function = $type .'_is_available';
+ if (file_exists('./includes/install.' . $type . '.inc')) {
+ include_once './includes/install.' . $type . '.inc';
+ $function = $type . '_is_available';
if ($function()) {
$databases[$type] = $type;
}
@@ -173,7 +173,7 @@ function drupal_detect_database_types() {
*/
function drupal_rewrite_settings($settings = array(), $prefix = '') {
$default_settings = './sites/default/default.settings.php';
- $settings_file = './'. conf_path(FALSE, TRUE) .'/'. $prefix .'settings.php';
+ $settings_file = './' . conf_path(FALSE, TRUE) . '/' . $prefix . 'settings.php';
// Build list of setting names and insert the values into the global namespace.
$keys = array();
@@ -197,7 +197,7 @@ function drupal_rewrite_settings($settings = array(), $prefix = '') {
preg_match('/define\(\s*[\'"]([A-Z_-]+)[\'"]\s*,(.*?)\);/', $line, $variable);
if (in_array($variable[1], $keys)) {
$setting = $settings[$variable[1]];
- $buffer .= str_replace($variable[2], " '". $setting['value'] ."'", $line);
+ $buffer .= str_replace($variable[2], " '" . $setting['value'] . "'", $line);
unset($settings[$variable[1]]);
unset($settings[$variable[2]]);
}
@@ -212,7 +212,7 @@ function drupal_rewrite_settings($settings = array(), $prefix = '') {
// Write new value to settings.php in the following format:
// $'setting' = 'value'; // 'comment'
$setting = $settings[$variable[1]];
- $buffer .= '$'. $variable[1] ." = '". $setting['value'] ."';". (!empty($setting['comment']) ? ' // '. $setting['comment'] ."\n" : "\n");
+ $buffer .= '$' . $variable[1] . " = '" . $setting['value'] . "';" . (!empty($setting['comment']) ? ' // ' . $setting['comment'] . "\n" : "\n");
unset($settings[$variable[1]]);
}
else {
@@ -228,7 +228,7 @@ function drupal_rewrite_settings($settings = array(), $prefix = '') {
// Add required settings that were missing from settings.php.
foreach ($settings as $setting => $data) {
if ($data['required']) {
- $buffer .= "\$$setting = '". $data['value'] ."';\n";
+ $buffer .= "\$$setting = '" . $data['value'] . "';\n";
}
}
@@ -251,7 +251,7 @@ function drupal_rewrite_settings($settings = array(), $prefix = '') {
function drupal_get_install_files($module_list = array()) {
$installs = array();
foreach ($module_list as $module) {
- $installs = array_merge($installs, drupal_system_listing($module .'.install$', 'modules'));
+ $installs = array_merge($installs, drupal_system_listing($module . '.install$', 'modules'));
}
return $installs;
}
@@ -279,7 +279,7 @@ function drupal_verify_profile($profile, $locale) {
require_once($profile_file);
// Get a list of modules required by this profile.
- $function = $profile .'_profile_modules';
+ $function = $profile . '_profile_modules';
$module_list = array_merge(drupal_required_modules(), $function(), ($locale != 'en' ? array('locale') : array()));
// Get a list of modules that exist in Drupal's assorted subdirectories.
@@ -355,11 +355,11 @@ function _drupal_install_module($module) {
*/
function drupal_install_system() {
$system_path = dirname(drupal_get_filename('module', 'system', NULL));
- require_once './'. $system_path .'/system.install';
+ require_once './' . $system_path . '/system.install';
module_invoke('system', 'install');
$system_versions = drupal_get_schema_versions('system');
$system_version = $system_versions ? max($system_versions) : SCHEMA_INSTALLED;
- db_query("INSERT INTO {system} (filename, name, type, owner, status, throttle, bootstrap, schema_version) VALUES('%s', '%s', '%s', '%s', %d, %d, %d, %d)", $system_path .'/system.module', 'system', 'module', '', 1, 0, 0, $system_version);
+ db_query("INSERT INTO {system} (filename, name, type, owner, status, throttle, bootstrap, schema_version) VALUES('%s', '%s', '%s', '%s', %d, %d, %d, %d)", $system_path . '/system.module', 'system', 'module', '', 1, 0, 0, $system_version);
// Now that we've installed things properly, bootstrap the full Drupal environment
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
module_rebuild_cache();
@@ -396,7 +396,7 @@ function drupal_uninstall_module($module) {
}
$placeholders = implode(', ', array_fill(0, count($paths), "'%s'"));
- $result = db_query('SELECT * FROM {menu_links} WHERE router_path IN ('. $placeholders .') AND external = 0 ORDER BY depth DESC', $paths);
+ $result = db_query('SELECT * FROM {menu_links} WHERE router_path IN (' . $placeholders . ') AND external = 0 ORDER BY depth DESC', $paths);
// Remove all such items. Starting from those with the greatest depth will
// minimize the amount of re-parenting done by menu_link_delete().
while ($item = db_fetch_array($result)) {
@@ -427,7 +427,7 @@ function drupal_verify_install_file($file, $mask = NULL, $type = 'file') {
}
// Verify that the file is the type of file it is supposed to be.
if (isset($type) && file_exists($file)) {
- $check = 'is_'. $type;
+ $check = 'is_' . $type;
if (!function_exists($check) || !$check($file)) {
$return = FALSE;
}
@@ -614,7 +614,7 @@ function drupal_install_fix_file($file, $mask, $message = TRUE) {
*/
function install_goto($path) {
global $base_url;
- header('Location: '. $base_url .'/'. $path);
+ header('Location: ' . $base_url . '/' . $path);
header('Cache-Control: no-cache'); // Not a permanent redirect.
exit();
}
@@ -630,7 +630,7 @@ function st($string, $args = array()) {
if (!isset($locale_strings)) {
$locale_strings = array();
- $filename = './profiles/'. $profile .'/translations/'. $install_locale .'.po';
+ $filename = './profiles/' . $profile . '/translations/' . $install_locale . '.po';
if (file_exists($filename)) {
require_once './includes/locale.inc';
$file = (object) array('filepath' => $filename);
@@ -650,7 +650,7 @@ function st($string, $args = array()) {
// Escaped and placeholder
case '%':
default:
- $args[$key] = ''. check_plain($value) .' ';
+ $args[$key] = '' . check_plain($value) . ' ';
break;
// Pass-through
case '!':
@@ -677,7 +677,7 @@ function drupal_check_profile($profile) {
require_once($profile_file);
// Get a list of modules required by this profile.
- $function = $profile .'_profile_modules';
+ $function = $profile . '_profile_modules';
$module_list = array_unique(array_merge(drupal_required_modules(), $function()));
// Get a list of all .install files.
@@ -724,7 +724,7 @@ function drupal_check_module($module) {
if (isset($requirement['severity']) && $requirement['severity'] == REQUIREMENT_ERROR) {
$message = $requirement['description'];
if (isset($requirement['value']) && $requirement['value']) {
- $message .= ' ('. t('Currently using !item !version', array('!item' => $requirement['title'], '!version' => $requirement['value'])) .')';
+ $message .= ' (' . t('Currently using !item !version', array('!item' => $requirement['title'], '!version' => $requirement['value'])) . ')';
}
drupal_set_message($message, 'error');
}
diff --git a/includes/install.mysql.inc b/includes/install.mysql.inc
index dc268525c..2945fab7b 100644
--- a/includes/install.mysql.inc
+++ b/includes/install.mysql.inc
@@ -35,7 +35,7 @@ function drupal_test_mysql($url, &$success) {
// Allow for non-standard MySQL port.
if (isset($url['port'])) {
- $url['host'] = $url['host'] .':'. $url['port'];
+ $url['host'] = $url['host'] . ':' . $url['port'];
}
// Test connecting to the database.
diff --git a/includes/install.pgsql.inc b/includes/install.pgsql.inc
index f03159ebb..c5ad5f2f3 100644
--- a/includes/install.pgsql.inc
+++ b/includes/install.pgsql.inc
@@ -30,19 +30,19 @@ function drupal_test_pgsql($url, &$success) {
// Decode url-encoded information in the db connection string
if (isset($url['user'])) {
- $conn_string .= ' user='. urldecode($url['user']);
+ $conn_string .= ' user=' . urldecode($url['user']);
}
if (isset($url['pass'])) {
- $conn_string .= ' password='. urldecode($url['pass']);
+ $conn_string .= ' password=' . urldecode($url['pass']);
}
if (isset($url['host'])) {
- $conn_string .= ' host='. urldecode($url['host']);
+ $conn_string .= ' host=' . urldecode($url['host']);
}
if (isset($url['path'])) {
- $conn_string .= ' dbname='. substr(urldecode($url['path']), 1);
+ $conn_string .= ' dbname=' . substr(urldecode($url['path']), 1);
}
if (isset($url['port'])) {
- $conn_string .= ' port='. urldecode($url['port']);
+ $conn_string .= ' port=' . urldecode($url['port']);
}
// Test connecting to the database.
diff --git a/includes/language.inc b/includes/language.inc
index e92f36d6d..866947ea3 100644
--- a/includes/language.inc
+++ b/includes/language.inc
@@ -136,7 +136,7 @@ function language_url_rewrite(&$path, &$options) {
case LANGUAGE_NEGOTIATION_PATH:
if (!empty($options['language']->prefix)) {
- $options['prefix'] = $options['language']->prefix .'/';
+ $options['prefix'] = $options['language']->prefix . '/';
}
break;
}
diff --git a/includes/locale.inc b/includes/locale.inc
index 14176bd7d..9f51306f9 100644
--- a/includes/locale.inc
+++ b/includes/locale.inc
@@ -78,12 +78,12 @@ function theme_locale_languages_overview_form($form) {
$rows[] = array(
array('data' => drupal_render($form['enabled'][$key]), 'align' => 'center'),
check_plain($key),
- ''. drupal_render($form['name'][$key]) .' ',
+ '' . drupal_render($form['name'][$key]) . ' ',
drupal_render($form['native'][$key]),
drupal_render($form['direction'][$key]),
drupal_render($form['site_default'][$key]),
drupal_render($form['weight'][$key]),
- l(t('edit'), 'admin/settings/language/edit/'. $key) . (($key != 'en' && $key != $default->language) ? ' '. l(t('delete'), 'admin/settings/language/delete/'. $key) : '')
+ l(t('edit'), 'admin/settings/language/edit/' . $key) . (($key != 'en' && $key != $default->language) ? ' ' . l(t('delete'), 'admin/settings/language/delete/' . $key) : '')
);
}
}
@@ -412,7 +412,7 @@ function locale_languages_delete_form_submit($form, &$form_state) {
if (isset($languages[$form_state['values']['langcode']])) {
// Remove translations first.
db_query("DELETE FROM {locales_target} WHERE language = '%s'", $form_state['values']['langcode']);
- cache_clear_all('locale:'. $form_state['values']['langcode'], 'cache');
+ cache_clear_all('locale:' . $form_state['values']['langcode'], 'cache');
// With no translations, this removes existing JavaScript translations file.
_locale_rebuild_js($form_state['values']['langcode']);
// Remove the language.
@@ -500,7 +500,7 @@ function locale_translate_overview_screen() {
foreach ($languages as $langcode => $language) {
$rows[$langcode] = array('name' => ($langcode == 'en' ? t('English (built-in)') : t($language->name)));
foreach ($groups as $group => $name) {
- $rows[$langcode][$group] = ($langcode == 'en' ? t('n/a') : '0/'. (isset($groupsums[$group]) ? $groupsums[$group] : 0) .' (0%)');
+ $rows[$langcode][$group] = ($langcode == 'en' ? t('n/a') : '0/' . (isset($groupsums[$group]) ? $groupsums[$group] : 0) . ' (0%)');
}
}
@@ -508,7 +508,7 @@ function locale_translate_overview_screen() {
$translations = db_query("SELECT COUNT(*) AS translation, t.language, s.textgroup FROM {locales_source} s INNER JOIN {locales_target} t ON s.lid = t.lid GROUP BY textgroup, language");
while ($data = db_fetch_object($translations)) {
$ratio = (!empty($groupsums[$data->textgroup]) && $data->translation > 0) ? round(($data->translation/$groupsums[$data->textgroup])*100., 2) : 0;
- $rows[$data->language][$data->textgroup] = $data->translation .'/'. $groupsums[$data->textgroup] ." ($ratio%)";
+ $rows[$data->language][$data->textgroup] = $data->translation . '/' . $groupsums[$data->textgroup] . " ($ratio%)";
}
return theme('table', $headers, $rows);
@@ -1062,7 +1062,7 @@ function _locale_import_read_po($op, $file, $mode = NULL, $lang = NULL, $group =
_locale_import_message('The translation file %filename contains a syntax error on line %line.', $file, $lineno);
return FALSE;
}
- $current["msgid"] = $current["msgid"] ."\0". $quoted;
+ $current["msgid"] = $current["msgid"] . "\0" . $quoted;
$context = "MSGID_PLURAL";
}
elseif (!strncmp("msgid", $line, 5)) {
@@ -1453,13 +1453,13 @@ function _locale_import_parse_arithmetic($string) {
if (!empty($prec[$op])) {
$f = "";
if ($op == ":") {
- $f = $elstk[$i - 2] ."):". $elstk[$i - 1] .")";
+ $f = $elstk[$i - 2] . "):" . $elstk[$i - 1] . ")";
}
elseif ($op == "?") {
- $f = "(". $elstk[$i - 2] ."?(". $elstk[$i - 1];
+ $f = "(" . $elstk[$i - 2] . "?(" . $elstk[$i - 1];
}
else {
- $f = "(". $elstk[$i - 2] . $op . $elstk[$i - 1] .")";
+ $f = "(" . $elstk[$i - 2] . $op . $elstk[$i - 1] . ")";
}
array_splice($elstk, $i - 2, 3, $f);
break;
@@ -1506,7 +1506,7 @@ function _locale_import_tokenize_formula($formula) {
case 3:
case 4:
if ($next == '=') {
- $tokens[] = $formula[$i] .'=';
+ $tokens[] = $formula[$i] . '=';
$i++;
}
else {
@@ -1572,7 +1572,7 @@ function _locale_import_append_plural($entry, $key) {
function _locale_import_shorten_comments($comment) {
$comm = '';
while (count($comment)) {
- $test = $comm . substr(array_shift($comment), 1) .', ';
+ $test = $comm . substr(array_shift($comment), 1) . ', ';
if (strlen($comm) < 130) {
$comm = $test;
}
@@ -1623,10 +1623,10 @@ function _locale_parse_js_file($filepath) {
// Match all calls to Drupal.t() in an array.
// Note: \s also matches newlines with the 's' modifier.
- preg_match_all('~[^\w]Drupal\s*\.\s*t\s*\(\s*('. LOCALE_JS_STRING .')\s*[,\)]~s', $file, $t_matches);
+ preg_match_all('~[^\w]Drupal\s*\.\s*t\s*\(\s*(' . LOCALE_JS_STRING . ')\s*[,\)]~s', $file, $t_matches);
// Match all Drupal.formatPlural() calls in another array.
- preg_match_all('~[^\w]Drupal\s*\.\s*formatPlural\s*\(\s*.+?\s*,\s*('. LOCALE_JS_STRING .')\s*,\s*((?:(?:\'(?:\\\\\'|[^\'])*@count(?:\\\\\'|[^\'])*\'|"(?:\\\\"|[^"])*@count(?:\\\\"|[^"])*")(?:\s*\+\s*)?)+)\s*[,\)]~s', $file, $plural_matches);
+ preg_match_all('~[^\w]Drupal\s*\.\s*formatPlural\s*\(\s*.+?\s*,\s*(' . LOCALE_JS_STRING . ')\s*,\s*((?:(?:\'(?:\\\\\'|[^\'])*@count(?:\\\\\'|[^\'])*\'|"(?:\\\\"|[^"])*@count(?:\\\\"|[^"])*")(?:\s*\+\s*)?)+)\s*[,\)]~s', $file, $plural_matches);
// Loop through all matches and process them.
$all_matches = array_merge($plural_matches[1], $t_matches[1]);
@@ -1725,21 +1725,21 @@ function _locale_export_po_generate($language = NULL, $strings = array(), $heade
if (!isset($header)) {
if (isset($language)) {
- $header = '# '. $language->name .' translation of '. variable_get('site_name', 'Drupal') ."\n";
- $header .= '# Generated by '. $user->name .' <'. $user->mail .">\n";
+ $header = '# ' . $language->name . ' translation of ' . variable_get('site_name', 'Drupal') . "\n";
+ $header .= '# Generated by ' . $user->name . ' <' . $user->mail . ">\n";
$header .= "#\n";
$header .= "msgid \"\"\n";
$header .= "msgstr \"\"\n";
$header .= "\"Project-Id-Version: PROJECT VERSION\\n\"\n";
- $header .= "\"POT-Creation-Date: ". date("Y-m-d H:iO") ."\\n\"\n";
- $header .= "\"PO-Revision-Date: ". date("Y-m-d H:iO") ."\\n\"\n";
+ $header .= "\"POT-Creation-Date: " . date("Y-m-d H:iO") . "\\n\"\n";
+ $header .= "\"PO-Revision-Date: " . date("Y-m-d H:iO") . "\\n\"\n";
$header .= "\"Last-Translator: NAME \\n\"\n";
$header .= "\"Language-Team: LANGUAGE \\n\"\n";
$header .= "\"MIME-Version: 1.0\\n\"\n";
$header .= "\"Content-Type: text/plain; charset=utf-8\\n\"\n";
$header .= "\"Content-Transfer-Encoding: 8bit\\n\"\n";
if ($language->formula && $language->plurals) {
- $header .= "\"Plural-Forms: nplurals=". $language->plurals ."; plural=". strtr($language->formula, array('$' => '')) .";\\n\"\n";
+ $header .= "\"Plural-Forms: nplurals=" . $language->plurals . "; plural=" . strtr($language->formula, array('$' => '')) . ";\\n\"\n";
}
}
else {
@@ -1749,7 +1749,7 @@ function _locale_export_po_generate($language = NULL, $strings = array(), $heade
$header .= "msgid \"\"\n";
$header .= "msgstr \"\"\n";
$header .= "\"Project-Id-Version: PROJECT VERSION\\n\"\n";
- $header .= "\"POT-Creation-Date: ". date("Y-m-d H:iO") ."\\n\"\n";
+ $header .= "\"POT-Creation-Date: " . date("Y-m-d H:iO") . "\\n\"\n";
$header .= "\"PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\\n\"\n";
$header .= "\"Last-Translator: NAME \\n\"\n";
$header .= "\"Language-Team: LANGUAGE \\n\"\n";
@@ -1760,22 +1760,22 @@ function _locale_export_po_generate($language = NULL, $strings = array(), $heade
}
}
- $output = $header ."\n";
+ $output = $header . "\n";
foreach ($strings as $lid => $string) {
// Only process non-children, children are output below their parent.
if (!isset($string['child'])) {
if ($string['comment']) {
- $output .= '#: '. $string['comment'] ."\n";
+ $output .= '#: ' . $string['comment'] . "\n";
}
- $output .= 'msgid '. _locale_export_string($string['source']);
+ $output .= 'msgid ' . _locale_export_string($string['source']);
if (!empty($string['plural'])) {
$plural = $string['plural'];
- $output .= 'msgid_plural '. _locale_export_string($strings[$plural]['source']);
+ $output .= 'msgid_plural ' . _locale_export_string($strings[$plural]['source']);
if (isset($language)) {
$translation = $string['translation'];
for ($i = 0; $i < $language->plurals; $i++) {
- $output .= 'msgstr['. $i .'] '. _locale_export_string($translation);
+ $output .= 'msgstr[' . $i . '] ' . _locale_export_string($translation);
if ($plural) {
$translation = _locale_export_remove_plural($strings[$plural]['translation']);
$plural = isset($strings[$plural]['plural']) ? $strings[$plural]['plural'] : 0;
@@ -1786,12 +1786,12 @@ function _locale_export_po_generate($language = NULL, $strings = array(), $heade
}
}
else {
- $output .= 'msgstr[0] ""'."\n";
- $output .= 'msgstr[1] ""'."\n";
+ $output .= 'msgstr[0] ""' . "\n";
+ $output .= 'msgstr[1] ""' . "\n";
}
}
else {
- $output .= 'msgstr '. _locale_export_string($string['translation']);
+ $output .= 'msgstr ' . _locale_export_string($string['translation']);
}
$output .= "\n";
}
@@ -1812,7 +1812,7 @@ function _locale_export_po_generate($language = NULL, $strings = array(), $heade
function _locale_export_po($language = NULL, $output = NULL) {
// Log the export event.
if (isset($language)) {
- $filename = $language->language .'.po';
+ $filename = $language->language . '.po';
watchdog('locale', 'Exported %locale translation file: %filename.', array('%locale' => $language->name, '%filename' => $filename));
}
else {
@@ -1850,7 +1850,7 @@ function _locale_export_string($str) {
// Multiline string
if (count($parts) > 1) {
- return "\"\"\n\"". implode("\"\n\"", $parts) ."\"\n";
+ return "\"\"\n\"" . implode("\"\n\"", $parts) . "\"\n";
}
// Single line string
elseif (count($parts) == 1) {
@@ -1878,7 +1878,7 @@ function _locale_export_wrap($str, $len) {
$nstr = 0;
}
elseif (strlen("$cur $word") > $len) {
- $ret[] = $cur ." ";
+ $ret[] = $cur . " ";
$cur = $word;
}
else {
@@ -1946,7 +1946,7 @@ function _locale_translate_seek() {
switch ($query['language']) {
// Force search in source strings
case "en":
- $sql = $join ." WHERE s.source LIKE '%%%s%%' $grouplimit ORDER BY s.source";
+ $sql = $join . " WHERE s.source LIKE '%%%s%%' $grouplimit ORDER BY s.source";
$arguments = array($query['string']); // $where is not used, discard its arguments
if (!empty($grouplimit)) {
$arguments[] = $query['group'];
@@ -1979,7 +1979,7 @@ function _locale_translate_seek() {
foreach ($arr as $lid => $value) {
$rows[] = array(
$value['group'],
- array('data' => check_plain(truncate_utf8($value['source'], 150, FALSE, TRUE)) .''. $value['location'] .' '),
+ array('data' => check_plain(truncate_utf8($value['source'], 150, FALSE, TRUE)) . '' . $value['location'] . ' '),
array('data' => _locale_translate_language_list($value['languages'], $limit_language), 'align' => 'center'),
array('data' => l(t('edit'), "admin/build/translate/edit/$lid"), 'class' => 'nowrap'),
array('data' => l(t('delete'), "admin/build/translate/delete/$lid"), 'class' => 'nowrap'),
@@ -2038,12 +2038,12 @@ function _locale_invalidate_js($langcode = NULL) {
$languages = language_list();
unset($languages['en']);
foreach ($languages as $lcode => $data) {
- $parsed['refresh:'. $lcode] = 'waiting';
+ $parsed['refresh:' . $lcode] = 'waiting';
}
}
else {
// Invalidate single language.
- $parsed['refresh:'. $langcode] = 'waiting';
+ $parsed['refresh:' . $langcode] = 'waiting';
}
variable_set('javascript_parsed', $parsed);
@@ -2108,7 +2108,7 @@ function _locale_rebuild_js($langcode = NULL) {
$data .= "'pluralFormula': function(\$n) { return Number({$language->formula}); }, ";
}
- $data .= "'strings': ". drupal_to_js($translations) ." };";
+ $data .= "'strings': " . drupal_to_js($translations) . " };";
$data_hash = md5($data);
}
@@ -2118,7 +2118,7 @@ function _locale_rebuild_js($langcode = NULL) {
// Delete old file, if we have no translations anymore, or a different file to be saved.
if (!empty($language->javascript) && (!$data || $language->javascript != $data_hash)) {
- file_delete(file_create_path($dir .'/'. $language->language .'_'. $language->javascript .'.js'));
+ file_delete(file_create_path($dir . '/' . $language->language . '_' . $language->javascript . '.js'));
$language->javascript = '';
$status = 'deleted';
}
@@ -2129,7 +2129,7 @@ function _locale_rebuild_js($langcode = NULL) {
file_check_directory($dir, TRUE);
// Save the file.
- $dest = $dir .'/'. $language->language .'_'. $data_hash .'.js';
+ $dest = $dir . '/' . $language->language . '_' . $data_hash . '.js';
if (file_save_data($data, $dest)) {
$language->javascript = $data_hash;
$status = ($status == 'deleted') ? 'updated' : 'created';
@@ -2180,14 +2180,14 @@ function _locale_rebuild_js($langcode = NULL) {
*/
function _locale_translate_language_list($translation, $limit_language) {
// Add CSS
- drupal_add_css(drupal_get_path('module', 'locale') .'/locale.css', 'module', 'all', FALSE);
+ drupal_add_css(drupal_get_path('module', 'locale') . '/locale.css', 'module', 'all', FALSE);
$languages = language_list();
unset($languages['en']);
$output = '';
foreach ($languages as $langcode => $language) {
if (!$limit_language || $limit_language == $langcode) {
- $output .= (!empty($translation[$langcode])) ? $langcode .' ' : "$langcode ";
+ $output .= (!empty($translation[$langcode])) ? $langcode . ' ' : "$langcode ";
}
}
@@ -2442,7 +2442,7 @@ function locale_batch_by_language($langcode, $finished = NULL, $skip = array())
$components = array();
$query = "SELECT name, filename FROM {system} WHERE status = 1";
if (count($skip)) {
- $query .= " AND name NOT IN (". db_placeholders($skip, 'varchar') .")";
+ $query .= " AND name NOT IN (" . db_placeholders($skip, 'varchar') . ")";
}
$result = db_query($query, $skip);
while ($component = db_fetch_object($result)) {
@@ -2450,7 +2450,7 @@ function locale_batch_by_language($langcode, $finished = NULL, $skip = array())
// with names ending with $langcode.po. This allows for filenames
// like node-module.de.po to let translators use small files and
// be able to import in smaller chunks.
- $files = array_merge($files, file_scan_directory(dirname($component->filename) .'/translations', '(^|\.)'. $langcode .'\.po$', array('.', '..', 'CVS'), 0, FALSE));
+ $files = array_merge($files, file_scan_directory(dirname($component->filename) . '/translations', '(^|\.)' . $langcode . '\.po$', array('.', '..', 'CVS'), 0, FALSE));
$components[] = $component->name;
}
@@ -2482,7 +2482,7 @@ function locale_batch_by_component($components, $finished = '_locale_batch_syste
// as $langcode.po or with names ending with $langcode.po. This allows
// for filenames like node-module.de.po to let translators use small
// files and be able to import in smaller chunks.
- $files = array_merge($files, file_scan_directory(dirname($component->filename) .'/translations', '(^|\.)('. $language_list .')\.po$', array('.', '..', 'CVS'), 0, FALSE));
+ $files = array_merge($files, file_scan_directory(dirname($component->filename) . '/translations', '(^|\.)(' . $language_list . ')\.po$', array('.', '..', 'CVS'), 0, FALSE));
}
}
return _locale_batch_build($files, $finished);
diff --git a/includes/mail.inc b/includes/mail.inc
index 3f943652b..56c765e7c 100644
--- a/includes/mail.inc
+++ b/includes/mail.inc
@@ -85,7 +85,7 @@ function drupal_mail($module, $key, $to, $language, $params = array(), $from = N
// Bundle up the variables into a structured array for altering.
$message = array(
- 'id' => $module .'_'. $key,
+ 'id' => $module . '_' . $key,
'to' => $to,
'from' => isset($from) ? $from : $default_from,
'language' => $language,
@@ -115,7 +115,7 @@ function drupal_mail($module, $key, $to, $language, $params = array(), $from = N
// Build the e-mail (get subject and body, allow additional headers) by
// invoking hook_mail() on this module. We cannot use module_invoke() as
// we need to have $message by reference in hook_mail().
- if (function_exists($function = $module .'_mail')) {
+ if (function_exists($function = $module . '_mail')) {
$function($key, $message, $params);
}
@@ -173,13 +173,13 @@ function drupal_mail($module, $key, $to, $language, $params = array(), $from = N
function drupal_mail_send($message) {
// Allow for a custom mail backend.
if (variable_get('smtp_library', '') && file_exists(variable_get('smtp_library', ''))) {
- include_once './'. variable_get('smtp_library', '');
+ include_once './' . variable_get('smtp_library', '');
return drupal_mail_wrapper($message);
}
else {
$mimeheaders = array();
foreach ($message['headers'] as $name => $value) {
- $mimeheaders[] = $name .': '. mime_header_encode($value);
+ $mimeheaders[] = $name . ': ' . mime_header_encode($value);
}
return mail(
$message['to'],
@@ -286,7 +286,7 @@ function drupal_html_to_text($string, $allowed_tags = NULL) {
if (count($urls)) {
$footnotes .= "\n";
for ($i = 0, $max = count($urls); $i < $max; $i++) {
- $footnotes .= '['. ($i + 1) .'] '. $urls[$i] ."\n";
+ $footnotes .= '[' . ($i + 1) . '] ' . $urls[$i] . "\n";
}
}
@@ -326,7 +326,7 @@ function drupal_html_to_text($string, $allowed_tags = NULL) {
$indent[] = count($lists) ? ' "' : '>';
break;
case 'li':
- $indent[] = is_numeric($lists[0]) ? ' '. $lists[0]++ .') ' : ' * ';
+ $indent[] = is_numeric($lists[0]) ? ' ' . $lists[0]++ . ') ' : ' * ';
break;
case 'dd':
$indent[] = ' ';
@@ -340,7 +340,7 @@ function drupal_html_to_text($string, $allowed_tags = NULL) {
case '/blockquote':
if (count($lists)) {
// Append closing quote for inline quotes (immediately).
- $output = rtrim($output, "> \n") ."\"\n";
+ $output = rtrim($output, "> \n") . "\"\n";
$chunk = ''; // Ensure blank new-line.
}
// Fall-through
@@ -377,7 +377,7 @@ function drupal_html_to_text($string, $allowed_tags = NULL) {
// Horizontal rulers
case 'hr':
// Insert immediately.
- $output .= drupal_wrap_mail('', implode('', $indent)) ."\n";
+ $output .= drupal_wrap_mail('', implode('', $indent)) . "\n";
$output = _drupal_html_to_text_pad($output, '-');
break;
@@ -404,7 +404,7 @@ function drupal_html_to_text($string, $allowed_tags = NULL) {
$chunk = $casing($chunk);
}
// Format it and apply the current indentation.
- $output .= drupal_wrap_mail($chunk, implode('', $indent)) ."\n";
+ $output .= drupal_wrap_mail($chunk, implode('', $indent)) . "\n";
// Remove non-quotation markers from indentation.
$indent = array_map('_drupal_html_to_text_clean', $indent);
}
@@ -442,13 +442,13 @@ function _drupal_html_to_mail_urls($match = NULL, $reset = FALSE) {
}
else {
if (empty($regexp)) {
- $regexp = '@^'. preg_quote($base_path, '@') .'@';
+ $regexp = '@^' . preg_quote($base_path, '@') . '@';
}
if ($match) {
list(, , $url, $label) = $match;
// Ensure all URLs are absolute.
- $urls[] = strpos($url, '://') ? $url : preg_replace($regexp, $base_url .'/', $url);
- return $label .' ['. count($urls) .']';
+ $urls[] = strpos($url, '://') ? $url : preg_replace($regexp, $base_url . '/', $url);
+ return $label . ' [' . count($urls) . ']';
}
}
return $urls;
@@ -477,5 +477,5 @@ function _drupal_html_to_text_pad($text, $pad, $prefix = '') {
}
$n = max(0, 79 - (strlen($text) - $p));
// Add prefix and padding, and restore linebreak.
- return $text . $prefix . str_repeat($pad, $n - strlen($prefix)) ."\n";
+ return $text . $prefix . str_repeat($pad, $n - strlen($prefix)) . "\n";
}
diff --git a/includes/menu.inc b/includes/menu.inc
index 235fd9f8c..914f5c8f1 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -312,7 +312,7 @@ function menu_get_item($path = NULL, $router_item = NULL) {
$parts = array_slice($original_map, 0, MENU_MAX_PARTS);
list($ancestors, $placeholders) = menu_get_ancestors($parts);
- if ($router_item = db_fetch_array(db_query_range('SELECT * FROM {menu_router} WHERE path IN ('. implode (',', $placeholders) .') ORDER BY fit DESC', $ancestors, 0, 1))) {
+ if ($router_item = db_fetch_array(db_query_range('SELECT * FROM {menu_router} WHERE path IN (' . implode (',', $placeholders) . ') ORDER BY fit DESC', $ancestors, 0, 1))) {
$map = _menu_translate($router_item, $original_map);
if ($map === FALSE) {
$router_items[$path] = FALSE;
@@ -685,7 +685,7 @@ function _menu_link_translate(&$item) {
*/
function menu_get_object($type = 'node', $position = 1, $path = NULL) {
$router_item = menu_get_item($path);
- if (isset($router_item['load_functions'][$position]) && !empty($router_item['map'][$position]) && $router_item['load_functions'][$position] == $type .'_load') {
+ if (isset($router_item['load_functions'][$position]) && !empty($router_item['map'][$position]) && $router_item['load_functions'][$position] == $type . '_load') {
return $router_item['map'][$position];
}
}
@@ -773,7 +773,7 @@ function menu_tree_all_data($menu_name = 'navigation', $item = NULL) {
// Use $mlid as a flag for whether the data being loaded is for the whole tree.
$mlid = isset($item['mlid']) ? $item['mlid'] : 0;
// Generate a cache ID (cid) specific for this $menu_name and $item.
- $cid = 'links:'. $menu_name .':all-cid:'. $mlid;
+ $cid = 'links:' . $menu_name . ':all-cid:' . $mlid;
if (!isset($tree[$cid])) {
// If the static variable doesn't have the data, check {cache_menu}.
@@ -798,7 +798,7 @@ function menu_tree_all_data($menu_name = 'navigation', $item = NULL) {
}
$args = array_unique($args);
$placeholders = implode(', ', array_fill(0, count($args), '%d'));
- $where = ' AND ml.plid IN ('. $placeholders .')';
+ $where = ' AND ml.plid IN (' . $placeholders . ')';
$parents = $args;
$parents[] = $item['mlid'];
}
@@ -815,7 +815,7 @@ function menu_tree_all_data($menu_name = 'navigation', $item = NULL) {
$data['tree'] = menu_tree_data(db_query("
SELECT m.load_functions, m.to_arg_functions, m.access_callback, m.access_arguments, m.page_callback, m.page_arguments, m.title, m.title_callback, m.title_arguments, m.type, m.description, ml.*
FROM {menu_links} ml LEFT JOIN {menu_router} m ON m.path = ml.router_path
- WHERE ml.menu_name = '%s'". $where ."
+ WHERE ml.menu_name = '%s'" . $where . "
ORDER BY p1 ASC, p2 ASC, p3 ASC, p4 ASC, p5 ASC, p6 ASC, p7 ASC, p8 ASC, p9 ASC", $args), $parents);
$data['node_links'] = array();
menu_tree_collect_node_links($data['tree'], $data['node_links']);
@@ -856,7 +856,7 @@ function menu_tree_page_data($menu_name = 'navigation') {
// Load the menu item corresponding to the current page.
if ($item = menu_get_item()) {
// Generate a cache ID (cid) specific for this page.
- $cid = 'links:'. $menu_name .':page-cid:'. $item['href'] .':'. (int)$item['access'];
+ $cid = 'links:' . $menu_name . ':page-cid:' . $item['href'] . ':' . (int)$item['access'];
if (!isset($tree[$cid])) {
// If the static variable doesn't have the data, check {cache_menu}.
@@ -880,7 +880,7 @@ function menu_tree_page_data($menu_name = 'navigation') {
$args[] = '';
$placeholders .= ", '%s'";
}
- $parents = db_fetch_array(db_query("SELECT p1, p2, p3, p4, p5, p6, p7, p8 FROM {menu_links} WHERE menu_name = '%s' AND link_path IN (". $placeholders .")", $args));
+ $parents = db_fetch_array(db_query("SELECT p1, p2, p3, p4, p5, p6, p7, p8 FROM {menu_links} WHERE menu_name = '%s' AND link_path IN (" . $placeholders . ")", $args));
if (empty($parents)) {
// If no link exists, we may be on a local task that's not in the links.
@@ -899,7 +899,7 @@ function menu_tree_page_data($menu_name = 'navigation') {
// Collect all the links set to be expanded, and then add all of
// their children to the list as well.
do {
- $result = db_query("SELECT mlid FROM {menu_links} WHERE menu_name = '%s' AND expanded = 1 AND has_children = 1 AND plid IN (". $placeholders .') AND mlid NOT IN ('. $placeholders .')', array_merge(array($menu_name), $args, $args));
+ $result = db_query("SELECT mlid FROM {menu_links} WHERE menu_name = '%s' AND expanded = 1 AND has_children = 1 AND plid IN (" . $placeholders . ') AND mlid NOT IN (' . $placeholders . ')', array_merge(array($menu_name), $args, $args));
$num_rows = FALSE;
while ($item = db_fetch_array($result)) {
$args[] = $item['mlid'];
@@ -922,7 +922,7 @@ function menu_tree_page_data($menu_name = 'navigation') {
$data['tree'] = menu_tree_data(db_query("
SELECT m.load_functions, m.to_arg_functions, m.access_callback, m.access_arguments, m.page_callback, m.page_arguments, m.title, m.title_callback, m.title_arguments, m.type, m.description, ml.*
FROM {menu_links} ml LEFT JOIN {menu_router} m ON m.path = ml.router_path
- WHERE ml.menu_name = '%s' AND ml.plid IN (". $placeholders .")
+ WHERE ml.menu_name = '%s' AND ml.plid IN (" . $placeholders . ")
ORDER BY p1 ASC, p2 ASC, p3 ASC, p4 ASC, p5 ASC, p6 ASC, p7 ASC, p8 ASC, p9 ASC", $args), $parents);
$data['node_links'] = array();
menu_tree_collect_node_links($data['tree'], $data['node_links']);
@@ -948,7 +948,7 @@ function menu_tree_page_data($menu_name = 'navigation') {
* Helper function - compute the real cache ID for menu tree data.
*/
function _menu_tree_cid($menu_name, $data) {
- return 'links:'. $menu_name .':tree-data:'. md5(serialize($data));
+ return 'links:' . $menu_name . ':tree-data:' . md5(serialize($data));
}
/**
@@ -977,8 +977,8 @@ function menu_tree_check_access(&$tree, $node_links = array()) {
if ($node_links) {
// Use db_rewrite_sql to evaluate view access without loading each full node.
$nids = array_keys($node_links);
- $placeholders = '%d'. str_repeat(', %d', count($nids) - 1);
- $result = db_query(db_rewrite_sql("SELECT n.nid FROM {node} n WHERE n.status = 1 AND n.nid IN (". $placeholders .")"), $nids);
+ $placeholders = '%d' . str_repeat(', %d', count($nids) - 1);
+ $result = db_query(db_rewrite_sql("SELECT n.nid FROM {node} n WHERE n.status = 1 AND n.nid IN (" . $placeholders . ")"), $nids);
while ($node = db_fetch_array($result)) {
$nid = $node['nid'];
foreach ($node_links[$nid] as $mlid => $link) {
@@ -1005,7 +1005,7 @@ function _menu_tree_check_access(&$tree) {
// The weights are made a uniform 5 digits by adding 50000 as an offset.
// After _menu_link_translate(), $item['title'] has the localized link title.
// Adding the mlid to the end of the index insures that it is unique.
- $new_tree[(50000 + $item['weight']) .' '. $item['title'] .' '. $item['mlid']] = $tree[$key];
+ $new_tree[(50000 + $item['weight']) . ' ' . $item['title'] . ' ' . $item['mlid']] = $tree[$key];
}
}
// Sort siblings in the tree based on the weights and localized titles.
@@ -1112,7 +1112,7 @@ function theme_menu_item_link($link) {
* @ingroup themeable
*/
function theme_menu_tree($tree) {
- return '';
+ return '';
}
/**
@@ -1123,12 +1123,12 @@ function theme_menu_tree($tree) {
function theme_menu_item($link, $has_children, $menu = '', $in_active_trail = FALSE, $extra_class = NULL) {
$class = ($menu ? 'expanded' : ($has_children ? 'collapsed' : 'leaf'));
if (!empty($extra_class)) {
- $class .= ' '. $extra_class;
+ $class .= ' ' . $extra_class;
}
if ($in_active_trail) {
$class .= ' active-trail';
}
- return ''. $link . $menu ." \n";
+ return '' . $link . $menu . " \n";
}
/**
@@ -1137,7 +1137,7 @@ function theme_menu_item($link, $has_children, $menu = '', $in_active_trail = FA
* @ingroup themeable
*/
function theme_menu_local_task($link, $active = FALSE) {
- return ''. $link ." \n";
+ return '' . $link . " \n";
}
/**
@@ -1162,12 +1162,12 @@ function menu_get_active_help() {
if (module_hook($name, 'help')) {
// Lookup help for this path.
if ($help = module_invoke($name, 'help', $router_path, $arg)) {
- $output .= $help ."\n";
+ $output .= $help . "\n";
}
// Add "more help" link on admin pages if the module provides a
// standalone help page.
- if ($arg[0] == "admin" && module_exists('help') && module_invoke($name, 'help', 'admin/help#'. $arg[2], $empty_arg) && $help) {
- $output .= theme("more_help_link", url('admin/help/'. $arg[2]));
+ if ($arg[0] == "admin" && module_exists('help') && module_invoke($name, 'help', 'admin/help#' . $arg[2], $empty_arg) && $help) {
+ $output .= theme("more_help_link", url('admin/help/' . $arg[2]));
}
}
}
@@ -1258,7 +1258,7 @@ function menu_navigation_links($menu_name, $level = 0) {
$l['href'] = $item['link']['href'];
$l['title'] = $item['link']['title'];
// Keyed with unique menu id to generate classes from theme_links().
- $links['menu-'. $item['link']['mlid']] = $l;
+ $links['menu-' . $item['link']['mlid']] = $l;
}
}
return $links;
@@ -1424,10 +1424,10 @@ function theme_menu_local_tasks() {
$output = '';
if ($primary = menu_primary_local_tasks()) {
- $output .= "\n";
+ $output .= "\n";
}
if ($secondary = menu_secondary_local_tasks()) {
- $output .= "\n";
+ $output .= "\n";
}
return $output;
@@ -1608,11 +1608,11 @@ function menu_cache_clear($menu_name = 'navigation') {
static $cache_cleared = array();
if (empty($cache_cleared[$menu_name])) {
- cache_clear_all('links:'. $menu_name .':', 'cache_menu', TRUE);
+ cache_clear_all('links:' . $menu_name . ':', 'cache_menu', TRUE);
$cache_cleared[$menu_name] = 1;
}
elseif ($cache_cleared[$menu_name] == 1) {
- register_shutdown_function('cache_clear_all', 'links:'. $menu_name .':', 'cache_menu', TRUE);
+ register_shutdown_function('cache_clear_all', 'links:' . $menu_name . ':', 'cache_menu', TRUE);
$cache_cleared[$menu_name] = 2;
}
}
@@ -1663,7 +1663,7 @@ function menu_router_build($reset = FALSE) {
// a given item came from.
$callbacks = array();
foreach (module_implements('menu') as $module) {
- $router_items = call_user_func($module .'_menu');
+ $router_items = call_user_func($module . '_menu');
if (isset($router_items) && is_array($router_items)) {
foreach (array_keys($router_items) as $path) {
$router_items[$path]['module'] = $module;
@@ -1865,10 +1865,10 @@ function menu_link_save(&$item) {
do {
$parent = FALSE;
$parent_path = substr($parent_path, 0, strrpos($parent_path, '/'));
- $result = db_query("SELECT COUNT(*) FROM {menu_links} ". $where, $parent_path, $arg2);
+ $result = db_query("SELECT COUNT(*) FROM {menu_links} " . $where, $parent_path, $arg2);
// Only valid if we get a unique result.
if (db_result($result) == 1) {
- $parent = db_fetch_array(db_query("SELECT * FROM {menu_links} ". $where, $parent_path, $arg2));
+ $parent = db_fetch_array(db_query("SELECT * FROM {menu_links} " . $where, $parent_path, $arg2));
}
} while ($parent === FALSE && $parent_path);
}
@@ -2077,10 +2077,10 @@ function menu_link_children_relative_depth($item) {
while ($i <= MENU_MAX_DEPTH && $item[$p]) {
$match .= " AND $p = %d";
$args[] = $item[$p];
- $p = 'p'. ++$i;
+ $p = 'p' . ++$i;
}
- $max_depth = db_result(db_query_range("SELECT depth FROM {menu_links} WHERE menu_name = '%s'". $match ." ORDER BY depth DESC", $args, 0, 1));
+ $max_depth = db_result(db_query_range("SELECT depth FROM {menu_links} WHERE menu_name = '%s'" . $match . " ORDER BY depth DESC", $args, 0, 1));
return ($max_depth > $item['depth']) ? $max_depth - $item['depth'] : 0;
}
@@ -2098,16 +2098,16 @@ function _menu_link_move_children($item, $existing_item) {
$i = 1;
while ($i <= $item['depth']) {
- $p = 'p'. $i++;
+ $p = 'p' . $i++;
$set[] = "$p = %d";
$args[] = $item[$p];
}
$j = $existing_item['depth'] + 1;
while ($i <= MENU_MAX_DEPTH && $j <= MENU_MAX_DEPTH) {
- $set[] = 'p'. $i++ .' = p'. $j++;
+ $set[] = 'p' . $i++ . ' = p' . $j++;
}
while ($i <= MENU_MAX_DEPTH) {
- $set[] = 'p'. $i++ .' = 0';
+ $set[] = 'p' . $i++ . ' = 0';
}
$shift = $item['depth'] - $existing_item['depth'];
@@ -2129,12 +2129,12 @@ function _menu_link_move_children($item, $existing_item) {
$where[] = "menu_name = '%s'";
$args[] = $existing_item['menu_name'];
$p = 'p1';
- for ($i = 1; $i <= MENU_MAX_DEPTH && $existing_item[$p]; $p = 'p'. ++$i) {
+ for ($i = 1; $i <= MENU_MAX_DEPTH && $existing_item[$p]; $p = 'p' . ++$i) {
$where[] = "$p = %d";
$args[] = $existing_item[$p];
}
- db_query("UPDATE {menu_links} SET ". implode(', ', $set) ." WHERE ". implode(' AND ', $where), $args);
+ db_query("UPDATE {menu_links} SET " . implode(', ', $set) . " WHERE " . implode(' AND ', $where), $args);
// Check the has_children status of the parent, while excluding this item.
_menu_update_parental_status($existing_item, TRUE);
}
@@ -2148,7 +2148,7 @@ function _menu_update_parental_status($item, $exclude = FALSE) {
// We may want to exclude the passed link as a possible child.
$where = $exclude ? " AND mlid != %d" : '';
// Check if at least one visible child exists in the table.
- $parent_has_children = (bool)db_result(db_query_range("SELECT mlid FROM {menu_links} WHERE menu_name = '%s' AND plid = %d AND hidden = 0". $where, $item['menu_name'], $item['plid'], $item['mlid'], 0, 1));
+ $parent_has_children = (bool)db_result(db_query_range("SELECT mlid FROM {menu_links} WHERE menu_name = '%s' AND plid = %d AND hidden = 0" . $where, $item['menu_name'], $item['plid'], $item['mlid'], 0, 1));
db_query("UPDATE {menu_links} SET has_children = %d WHERE mlid = %d", $parent_has_children, $item['plid']);
}
}
@@ -2159,14 +2159,14 @@ function _menu_update_parental_status($item, $exclude = FALSE) {
function _menu_link_parents_set(&$item, $parent) {
$i = 1;
while ($i < $item['depth']) {
- $p = 'p'. $i++;
+ $p = 'p' . $i++;
$item[$p] = $parent[$p];
}
- $p = 'p'. $i++;
+ $p = 'p' . $i++;
// The parent (p1 - p9) corresponding to the depth always equals the mlid.
$item[$p] = $item['mlid'];
while ($i <= MENU_MAX_DEPTH) {
- $p = 'p'. $i++;
+ $p = 'p' . $i++;
$item[$p] = 0;
}
}
@@ -2198,13 +2198,13 @@ function _menu_router_build($callbacks) {
$load_functions[$k] = NULL;
}
else {
- if (function_exists($matches[1] .'_to_arg')) {
- $to_arg_functions[$k] = $matches[1] .'_to_arg';
+ if (function_exists($matches[1] . '_to_arg')) {
+ $to_arg_functions[$k] = $matches[1] . '_to_arg';
$load_functions[$k] = NULL;
$match = TRUE;
}
- if (function_exists($matches[1] .'_load')) {
- $function = $matches[1] .'_load';
+ if (function_exists($matches[1] . '_load')) {
+ $function = $matches[1] . '_load';
// Create an array of arguments that will be passed to the _load
// function when this menu path is checked, if 'load arguments'
// exists.
@@ -2330,7 +2330,7 @@ function _menu_router_build($callbacks) {
// Calculate out the file to be included for each callback, if any.
if ($item['file']) {
$file_path = $item['file path'] ? $item['file path'] : drupal_get_path('module', $item['module']);
- $item['include file'] = $file_path .'/'. $item['file'];
+ $item['include file'] = $file_path . '/' . $item['file'];
}
$title_arguments = $item['title arguments'] ? serialize($item['title arguments']) : '';
@@ -2395,7 +2395,7 @@ function _menu_site_is_offline() {
return $_GET['q'] != 'user' && $_GET['q'] != 'user/login';
}
// Logged in users are unprivileged here, so they are logged out.
- require_once drupal_get_path('module', 'user') .'/user.pages.inc';
+ require_once drupal_get_path('module', 'user') . '/user.pages.inc';
user_logout();
}
}
diff --git a/includes/module.inc b/includes/module.inc
index 034f54ed7..c87393c7b 100644
--- a/includes/module.inc
+++ b/includes/module.inc
@@ -113,7 +113,7 @@ function module_rebuild_cache() {
foreach ($files as $filename => $file) {
// Look for the info file.
- $file->info = drupal_parse_info_file(dirname($file->filename) .'/'. $file->name .'.info');
+ $file->info = drupal_parse_info_file(dirname($file->filename) . '/' . $file->name . '.info');
// Skip modules that don't provide info.
if (empty($file->info)) {
@@ -256,7 +256,7 @@ function module_load_include($type, $module, $name = NULL) {
$name = $module;
}
- $file = './'. drupal_get_path('module', $module) ."/$name.$type";
+ $file = './' . drupal_get_path('module', $module) . "/$name.$type";
if (is_file($file)) {
require_once $file;
@@ -383,7 +383,7 @@ function module_disable($module_list) {
* implemented in that module.
*/
function module_hook($module, $hook) {
- return function_exists($module .'_'. $hook);
+ return function_exists($module . '_' . $hook);
}
/**
@@ -445,7 +445,7 @@ function module_invoke() {
$module = $args[0];
$hook = $args[1];
unset($args[0], $args[1]);
- $function = $module .'_'. $hook;
+ $function = $module . '_' . $hook;
if (module_hook($module, $hook)) {
return call_user_func_array($function, $args);
}
@@ -467,7 +467,7 @@ function module_invoke_all() {
unset($args[0]);
$return = array();
foreach (module_implements($hook) as $module) {
- $function = $module .'_'. $hook;
+ $function = $module . '_' . $hook;
$result = call_user_func_array($function, $args);
if (isset($result) && is_array($result)) {
$return = array_merge_recursive($return, $result);
diff --git a/includes/path.inc b/includes/path.inc
index df20c0eb1..8f2939c33 100644
--- a/includes/path.inc
+++ b/includes/path.inc
@@ -231,7 +231,7 @@ function drupal_match_path($path, $patterns) {
static $regexps;
if (!isset($regexps[$patterns])) {
- $regexps[$patterns] = '/^('. preg_replace(array('/(\r\n?|\n)/', '/\\\\\*/', '/(^|\|)\\\\($|\|)/'), array('|', '.*', '\1'. preg_quote(variable_get('site_frontpage', 'node'), '/') .'\2'), preg_quote($patterns, '/')) .')$/';
+ $regexps[$patterns] = '/^(' . preg_replace(array('/(\r\n?|\n)/', '/\\\\\*/', '/(^|\|)\\\\($|\|)/'), array('|', '.*', '\1' . preg_quote(variable_get('site_frontpage', 'node'), '/') . '\2'), preg_quote($patterns, '/')) . ')$/';
}
return preg_match($regexps[$patterns], $path);
}
diff --git a/includes/session.inc b/includes/session.inc
index 74ddb2c3f..25d2479d4 100644
--- a/includes/session.inc
+++ b/includes/session.inc
@@ -110,7 +110,7 @@ function sess_regenerate() {
*/
function sess_count($timestamp = 0, $anonymous = true) {
$query = $anonymous ? ' AND uid = 0' : ' AND uid > 0';
- return db_result(db_query('SELECT COUNT(sid) AS count FROM {sessions} WHERE timestamp >= %d'. $query, $timestamp));
+ return db_result(db_query('SELECT COUNT(sid) AS count FROM {sessions} WHERE timestamp >= %d' . $query, $timestamp));
}
/**
diff --git a/includes/tablesort.inc b/includes/tablesort.inc
index 9c39c5ce8..3c2068e1b 100644
--- a/includes/tablesort.inc
+++ b/includes/tablesort.inc
@@ -86,9 +86,9 @@ function tablesort_header($cell, $header, $ts) {
}
if (!empty($ts['query_string'])) {
- $ts['query_string'] = '&'. $ts['query_string'];
+ $ts['query_string'] = '&' . $ts['query_string'];
}
- $cell['data'] = l($cell['data'] . $image, $_GET['q'], array('attributes' => array('title' => $title), 'query' => 'sort='. $ts['sort'] .'&order='. urlencode($cell['data']) . $ts['query_string'], 'html' => TRUE));
+ $cell['data'] = l($cell['data'] . $image, $_GET['q'], array('attributes' => array('title' => $title), 'query' => 'sort=' . $ts['sort'] . '&order=' . urlencode($cell['data']) . $ts['query_string'], 'html' => TRUE));
unset($cell['field'], $cell['sort']);
}
diff --git a/includes/theme.inc b/includes/theme.inc
index 7693a482a..8f389a0cc 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -153,14 +153,14 @@ function _init_theme($theme, $base_theme = array(), $registry_callback = '_theme
// Initialize the theme.
if (isset($theme->engine)) {
// Include the engine.
- include_once './'. $theme->owner;
+ include_once './' . $theme->owner;
$theme_engine = $theme->engine;
- if (function_exists($theme_engine .'_init')) {
+ if (function_exists($theme_engine . '_init')) {
foreach ($base_theme as $base) {
- call_user_func($theme_engine .'_init', $base);
+ call_user_func($theme_engine . '_init', $base);
}
- call_user_func($theme_engine .'_init', $theme);
+ call_user_func($theme_engine . '_init', $theme);
}
}
else {
@@ -168,12 +168,12 @@ function _init_theme($theme, $base_theme = array(), $registry_callback = '_theme
foreach ($base_theme as $base) {
// Include the theme file or the engine.
if (!empty($base->owner)) {
- include_once './'. $base->owner;
+ include_once './' . $base->owner;
}
}
// and our theme gets one too.
if (!empty($theme->owner)) {
- include_once './'. $theme->owner;
+ include_once './' . $theme->owner;
}
}
@@ -261,7 +261,7 @@ function drupal_rebuild_theme_registry() {
* over how and when the preprocess functions are run.
*/
function _theme_process_registry(&$cache, $name, $type, $theme, $path) {
- $function = $name .'_theme';
+ $function = $name . '_theme';
if (function_exists($function)) {
$result = $function($cache, $type, $theme, $path);
@@ -271,7 +271,7 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) {
// if function and file are left out, default to standard naming
// conventions.
if (!isset($info['template']) && !isset($info['function'])) {
- $result[$hook]['function'] = ($type == 'module' ? 'theme_' : $name .'_') . $hook;
+ $result[$hook]['function'] = ($type == 'module' ? 'theme_' : $name . '_') . $hook;
}
// If a path is set in the info, use what was set. Otherwise use the
// default path. This is mostly so system.module can declare theme
@@ -279,15 +279,15 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) {
// All files are included to be safe. Conditionally included
// files can prevent them from getting registered.
if (isset($info['file']) && !isset($info['path'])) {
- $result[$hook]['file'] = $path .'/'. $info['file'];
+ $result[$hook]['file'] = $path . '/' . $info['file'];
include_once($result[$hook]['file']);
}
elseif (isset($info['file']) && isset($info['path'])) {
- include_once($info['path'] .'/'. $info['file']);
+ include_once($info['path'] . '/' . $info['file']);
}
if (isset($info['template']) && !isset($info['path'])) {
- $result[$hook]['template'] = $path .'/'. $info['template'];
+ $result[$hook]['template'] = $path . '/' . $info['template'];
}
// If 'arguments' have been defined previously, carry them forward.
// This should happen if a theme overrides a Drupal defined theme
@@ -316,7 +316,7 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) {
}
elseif ($type == 'theme_engine') {
// Theme engines get an extra set that come before the normally named preprocessors.
- $prefixes[] = $name .'_engine';
+ $prefixes[] = $name . '_engine';
// The theme engine also registers on behalf of the theme. The theme or engine name can be used.
$prefixes[] = $name;
$prefixes[] = $theme;
@@ -327,11 +327,11 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) {
}
foreach ($prefixes as $prefix) {
- if (function_exists($prefix .'_preprocess')) {
- $info['preprocess functions'][] = $prefix .'_preprocess';
+ if (function_exists($prefix . '_preprocess')) {
+ $info['preprocess functions'][] = $prefix . '_preprocess';
}
- if (function_exists($prefix .'_preprocess_'. $hook)) {
- $info['preprocess functions'][] = $prefix .'_preprocess_'. $hook;
+ if (function_exists($prefix . '_preprocess_' . $hook)) {
+ $info['preprocess functions'][] = $prefix . '_preprocess_' . $hook;
}
}
}
@@ -582,7 +582,7 @@ function theme() {
if (!empty($info['file'])) {
$include_file = $info['file'];
if (isset($info['path'])) {
- $include_file = $info['path'] .'/'. $include_file;
+ $include_file = $info['path'] . '/' . $include_file;
}
include_once($include_file);
}
@@ -613,10 +613,10 @@ function theme() {
// If theme or theme engine is implementing this, it may have
// a different extension and a different renderer.
if ($info['type'] != 'module') {
- if (function_exists($theme_engine .'_render_template')) {
- $render_function = $theme_engine .'_render_template';
+ if (function_exists($theme_engine . '_render_template')) {
+ $render_function = $theme_engine . '_render_template';
}
- $extension_function = $theme_engine .'_extension';
+ $extension_function = $theme_engine . '_extension';
if (function_exists($extension_function)) {
$extension = $extension_function();
}
@@ -654,7 +654,7 @@ function theme() {
if (empty($template_file)) {
$template_file = $info['template'] . $extension;
if (isset($info['path'])) {
- $template_file = $info['path'] .'/'. $template_file;
+ $template_file = $info['path'] . '/' . $template_file;
}
}
$output = $render_function($template_file, $variables);
@@ -678,7 +678,7 @@ function drupal_discover_template($paths, $suggestions, $extension = '.tpl.php')
foreach ($suggestions as $suggestion) {
if (!empty($suggestion)) {
foreach ($paths as $path) {
- if (file_exists($file = $path .'/'. $suggestion . $extension)) {
+ if (file_exists($file = $path . '/' . $suggestion . $extension)) {
return $file;
}
}
@@ -718,10 +718,10 @@ function drupal_find_theme_functions($cache, $prefixes) {
foreach ($cache as $hook => $info) {
foreach ($prefixes as $prefix) {
if (!empty($info['pattern'])) {
- $matches = preg_grep('/^'. $prefix .'_'. $info['pattern'] .'/', $functions['user']);
+ $matches = preg_grep('/^' . $prefix . '_' . $info['pattern'] . '/', $functions['user']);
if ($matches) {
foreach ($matches as $match) {
- $new_hook = str_replace($prefix .'_', '', $match);
+ $new_hook = str_replace($prefix . '_', '', $match);
$templates[$new_hook] = array(
'function' => $match,
'arguments' => $info['arguments'],
@@ -729,9 +729,9 @@ function drupal_find_theme_functions($cache, $prefixes) {
}
}
}
- if (function_exists($prefix .'_'. $hook)) {
+ if (function_exists($prefix . '_' . $hook)) {
$templates[$hook] = array(
- 'function' => $prefix .'_'. $hook,
+ 'function' => $prefix . '_' . $hook,
);
}
}
@@ -774,7 +774,7 @@ function drupal_find_theme_templates($cache, $extension, $path) {
$subtheme_paths = isset($theme_paths[$theme]) ? $theme_paths[$theme] : array();
// Escape the periods in the extension.
- $regex = str_replace('.', '\.', $extension) .'$';
+ $regex = str_replace('.', '\.', $extension) . '$';
// Because drupal_system_listing works the way it does, we check for real
// templates separately from checking for patterns.
$files = drupal_system_listing($regex, $path, 'name', 0);
@@ -808,7 +808,7 @@ function drupal_find_theme_templates($cache, $extension, $path) {
// for the purposes of searching.
$pattern = strtr($info['pattern'], '_', '-');
- $matches = preg_grep('/^'. $pattern .'/', $patterns);
+ $matches = preg_grep('/^' . $pattern . '/', $patterns);
if ($matches) {
foreach ($matches as $match) {
$file = substr($match, 0, strpos($match, '.'));
@@ -865,13 +865,13 @@ function theme_get_settings($key = NULL) {
if (module_exists('node')) {
foreach (node_get_types() as $type => $name) {
- $defaults['toggle_node_info_'. $type] = 1;
+ $defaults['toggle_node_info_' . $type] = 1;
}
}
$settings = array_merge($defaults, variable_get('theme_settings', array()));
if ($key) {
- $settings = array_merge($settings, variable_get(str_replace('/', '_', 'theme_'. $key .'_settings'), array()));
+ $settings = array_merge($settings, variable_get(str_replace('/', '_', 'theme_' . $key . '_settings'), array()));
}
// Only offer search box if search.module is enabled.
@@ -918,7 +918,7 @@ function theme_get_setting($setting_name, $refresh = FALSE) {
if ($settings['toggle_logo']) {
if ($settings['default_logo']) {
- $settings['logo'] = base_path() . dirname($theme_object->filename) .'/logo.png';
+ $settings['logo'] = base_path() . dirname($theme_object->filename) . '/logo.png';
}
elseif ($settings['logo_path']) {
$settings['logo'] = base_path() . $settings['logo_path'];
@@ -927,11 +927,11 @@ function theme_get_setting($setting_name, $refresh = FALSE) {
if ($settings['toggle_favicon']) {
if ($settings['default_favicon']) {
- if (file_exists($favicon = dirname($theme_object->filename) .'/favicon.ico')) {
+ if (file_exists($favicon = dirname($theme_object->filename) . '/favicon.ico')) {
$settings['favicon'] = base_path() . $favicon;
}
else {
- $settings['favicon'] = base_path() .'misc/favicon.ico';
+ $settings['favicon'] = base_path() . 'misc/favicon.ico';
}
}
elseif ($settings['favicon_path']) {
@@ -1042,7 +1042,7 @@ function theme_render_template($file, $variables) {
* The formatted text (html).
*/
function theme_placeholder($text) {
- return ''. check_plain($text) .' ';
+ return '' . check_plain($text) . ' ';
}
/**
@@ -1062,7 +1062,7 @@ function theme_status_messages($display = NULL) {
if (count($messages) > 1) {
$output .= " \n";
foreach ($messages as $message) {
- $output .= ' '. $message ." \n";
+ $output .= ' ' . $message . " \n";
}
$output .= " \n";
}
@@ -1088,7 +1088,7 @@ function theme_links($links, $attributes = array('class' => 'links')) {
$output = '';
if (count($links) > 0) {
- $output = '';
+ $output = '';
$num_links = count($links);
$i = 1;
@@ -1106,7 +1106,7 @@ function theme_links($links, $attributes = array('class' => 'links')) {
if (isset($link['href']) && ($link['href'] == $_GET['q'] || ($link['href'] == '' && drupal_is_front_page()))) {
$class .= ' active';
}
- $output .= '';
+ $output .= ' ';
if (isset($link['href'])) {
// Pass in $link as $options, they share the same keys.
@@ -1121,7 +1121,7 @@ function theme_links($links, $attributes = array('class' => 'links')) {
if (isset($link['attributes'])) {
$span_attributes = drupal_attributes($link['attributes']);
}
- $output .= ''. $link['title'] .' ';
+ $output .= '' . $link['title'] . ' ';
}
$i++;
@@ -1154,7 +1154,7 @@ function theme_image($path, $alt = '', $title = '', $attributes = NULL, $getsize
if (!$getsize || (is_file($path) && (list($width, $height, $type, $image_attributes) = @getimagesize($path)))) {
$attributes = drupal_attributes($attributes);
$url = (url($path) == $path) ? $path : (base_path() . $path);
- return ' ';
+ return ' ';
}
}
@@ -1167,7 +1167,7 @@ function theme_image($path, $alt = '', $title = '', $attributes = NULL, $getsize
*/
function theme_breadcrumb($breadcrumb) {
if (!empty($breadcrumb)) {
- return ''. implode(' » ', $breadcrumb) .'
';
+ return '' . implode(' » ', $breadcrumb) . '
';
}
}
@@ -1178,7 +1178,7 @@ function theme_breadcrumb($breadcrumb) {
*/
function theme_help() {
if ($help = menu_get_active_help()) {
- return ''. $help .'
';
+ return '' . $help . '
';
}
}
@@ -1189,7 +1189,7 @@ function theme_help() {
* An array of links.
*/
function theme_submenu($links) {
- return '';
+ return '';
}
/**
@@ -1242,13 +1242,13 @@ function theme_table($header, $rows, $attributes = array(), $caption = NULL) {
drupal_add_js('misc/tableheader.js');
// Add 'sticky-enabled' class to the table to identify it for JS.
// This is needed to target tables constructed by this function.
- $attributes['class'] = empty($attributes['class']) ? 'sticky-enabled' : ($attributes['class'] .' sticky-enabled');
+ $attributes['class'] = empty($attributes['class']) ? 'sticky-enabled' : ($attributes['class'] . ' sticky-enabled');
}
- $output = '\n";
+ $output = '\n";
if (isset($caption)) {
- $output .= ''. $caption ." \n";
+ $output .= '' . $caption . " \n";
}
// Format the table header:
@@ -1294,14 +1294,14 @@ function theme_table($header, $rows, $attributes = array(), $caption = NULL) {
// Add odd/even class
$class = $flip[$class];
if (isset($attributes['class'])) {
- $attributes['class'] .= ' '. $class;
+ $attributes['class'] .= ' ' . $class;
}
else {
$attributes['class'] = $class;
}
// Build row
- $output .= ' ';
+ $output .= ' ';
$i = 0;
foreach ($cells as $cell) {
$cell = tablesort_cell($cell, $header, $ts, $i++);
@@ -1356,7 +1356,7 @@ function theme_tablesort_indicator($style) {
* A string containing the box output.
*/
function theme_box($title, $content, $region = 'main') {
- $output = ''. $title .' '. $content .'
';
+ $output = '' . $title . ' ' . $content . '
';
return $output;
}
@@ -1374,10 +1374,10 @@ function theme_mark($type = MARK_NEW) {
global $user;
if ($user->uid) {
if ($type == MARK_NEW) {
- return ' '. t('new') .' ';
+ return ' ' . t('new') . ' ';
}
else if ($type == MARK_UPDATED) {
- return ' '. t('updated') .' ';
+ return ' ' . t('updated') . ' ';
}
}
}
@@ -1403,11 +1403,11 @@ function theme_mark($type = MARK_NEW) {
function theme_item_list($items = array(), $title = NULL, $type = 'ul', $attributes = NULL) {
$output = '';
if (isset($title)) {
- $output .= '
'. $title .' ';
+ $output .= '
' . $title . ' ';
}
if (!empty($items)) {
- $output .= "<$type". drupal_attributes($attributes) .'>';
+ $output .= "<$type" . drupal_attributes($attributes) . '>';
$num_items = count($items);
foreach ($items as $i => $item) {
$attributes = array();
@@ -1432,12 +1432,12 @@ function theme_item_list($items = array(), $title = NULL, $type = 'ul', $attribu
$data .= theme_item_list($children, NULL, $type, $attributes); // Render nested list
}
if ($i == 0) {
- $attributes['class'] = empty($attributes['class']) ? 'first' : ($attributes['class'] .' first');
+ $attributes['class'] = empty($attributes['class']) ? 'first' : ($attributes['class'] . ' first');
}
if ($i == $num_items - 1) {
- $attributes['class'] = empty($attributes['class']) ? 'last' : ($attributes['class'] .' last');
+ $attributes['class'] = empty($attributes['class']) ? 'last' : ($attributes['class'] . ' last');
}
- $output .= '
'. $data ." \n";
+ $output .= '
' . $data . " \n";
}
$output .= "$type>";
}
@@ -1449,7 +1449,7 @@ function theme_item_list($items = array(), $title = NULL, $type = 'ul', $attribu
* Returns code that emits the 'more help'-link.
*/
function theme_more_help_link($url) {
- return '
'. t('
More help ', array('@link' => check_url($url))) .'
';
+ return '
' . t('
More help ', array('@link' => check_url($url))) . '
';
}
/**
@@ -1463,7 +1463,7 @@ function theme_more_help_link($url) {
*/
function theme_xml_icon($url) {
if ($image = theme('image', 'misc/xml.png', t('XML feed'), t('XML feed'))) {
- return '
'. $image .' ';
+ return '
' . $image . ' ';
}
}
@@ -1477,7 +1477,7 @@ function theme_xml_icon($url) {
*/
function theme_feed_icon($url, $title) {
if ($image = theme('image', 'misc/feed.png', t('Syndicate content'), $title)) {
- return '
'. $image .' ';
+ return '
' . $image . ' ';
}
}
@@ -1490,7 +1490,7 @@ function theme_feed_icon($url, $title) {
* A descriptive verb for the link, like 'Read more'
*/
function theme_more_link($url, $title) {
- return '
'. t('
more ', array('@link' => check_url($url), '@title' => $title)) .'
';
+ return '
' . t('
more ', array('@link' => check_url($url), '@title' => $title)) . '
';
}
/**
@@ -1545,14 +1545,14 @@ function theme_username($object) {
if ($object->uid && $object->name) {
// Shorten the name when it is too long or it will break many tables.
if (drupal_strlen($object->name) > 20) {
- $name = drupal_substr($object->name, 0, 15) .'...';
+ $name = drupal_substr($object->name, 0, 15) . '...';
}
else {
$name = $object->name;
}
if (user_access('access user profiles')) {
- $output = l($name, 'user/'. $object->uid, array('title' => t('View user profile.')));
+ $output = l($name, 'user/' . $object->uid, array('title' => t('View user profile.')));
}
else {
$output = check_plain($name);
@@ -1570,7 +1570,7 @@ function theme_username($object) {
$output = check_plain($object->name);
}
- $output .= ' ('. t('not verified') .')';
+ $output .= ' (' . t('not verified') . ')';
}
else {
$output = variable_get('anonymous', t('Anonymous'));
@@ -1591,9 +1591,9 @@ function theme_username($object) {
*/
function theme_progress_bar($percent, $message) {
$output = '
';
- $output .= '
';
- $output .= '
'. $percent .'%
';
- $output .= '
'. $message .'
';
+ $output .= '
';
+ $output .= '
' . $percent . '%
';
+ $output .= '
' . $message . '
';
$output .= '
';
return $output;
@@ -1702,7 +1702,7 @@ function template_preprocess(&$variables, $hook) {
function template_preprocess_page(&$variables) {
// Add favicon
if (theme_get_setting('toggle_favicon')) {
- drupal_set_html_head('
');
+ drupal_set_html_head('
');
}
global $theme;
@@ -1786,10 +1786,10 @@ function template_preprocess_page(&$variables) {
// type (e.g. node, admin, user, etc.). To avoid illegal characters in the class,
// we're removing everything disallowed. We are not using 'a-z' as that might leave
// in certain international characters (e.g. German umlauts).
- $body_classes[] = preg_replace('![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s', '', 'page-'. form_clean_id(drupal_strtolower(arg(0))));
+ $body_classes[] = preg_replace('![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s', '', 'page-' . form_clean_id(drupal_strtolower(arg(0))));
// If on an individual node page, add the node type.
if (isset($variables['node']) && $variables['node']->type) {
- $body_classes[] = 'node-type-'. form_clean_id($variables['node']->type);
+ $body_classes[] = 'node-type-' . form_clean_id($variables['node']->type);
}
// Add information about the number of sidebars.
if ($variables['layout'] == 'both') {
@@ -1799,7 +1799,7 @@ function template_preprocess_page(&$variables) {
$body_classes[] = 'no-sidebars';
}
else {
- $body_classes[] = 'one-sidebar sidebar-'. $variables['layout'];
+ $body_classes[] = 'one-sidebar sidebar-' . $variables['layout'];
}
// Implode with spaces.
$variables['body_classes'] = implode(' ', $body_classes);
@@ -1818,9 +1818,9 @@ function template_preprocess_page(&$variables) {
$suggestion = 'page';
$suggestions = array();
while ($arg = arg($i++)) {
- $suggestions[] = $suggestion .'-'. $arg;
+ $suggestions[] = $suggestion . '-' . $arg;
if (!is_numeric($arg)) {
- $suggestion .= '-'. $arg;
+ $suggestion .= '-' . $arg;
}
}
if (drupal_is_front_page()) {
@@ -1868,7 +1868,7 @@ function template_preprocess_node(&$variables) {
$variables['date'] = format_date($node->created);
$variables['links'] = !empty($node->links) ? theme('links', $node->links, array('class' => 'links inline')) : '';
$variables['name'] = theme('username', $node);
- $variables['node_url'] = url('node/'. $node->nid);
+ $variables['node_url'] = url('node/' . $node->nid);
$variables['terms'] = theme('links', $variables['taxonomy'], array('class' => 'links inline'));
$variables['title'] = check_plain($node->title);
@@ -1876,7 +1876,7 @@ function template_preprocess_node(&$variables) {
$variables = array_merge((array)$node, $variables);
// Display info only on certain node types.
- if (theme_get_setting('toggle_node_info_'. $node->type)) {
+ if (theme_get_setting('toggle_node_info_' . $node->type)) {
$variables['submitted'] = theme('node_submitted', $node);
$variables['picture'] = theme_get_setting('toggle_node_user_picture') ? theme('user_picture', $node) : '';
}
@@ -1885,7 +1885,7 @@ function template_preprocess_node(&$variables) {
$variables['picture'] = '';
}
// Clean up name so there are no underscores.
- $variables['template_files'][] = 'node-'. $node->type;
+ $variables['template_files'][] = 'node-' . $node->type;
}
/**
@@ -1915,8 +1915,8 @@ function template_preprocess_block(&$variables) {
$variables['block_zebra'] = ($block_counter[$variables['block']->region] % 2) ? 'odd' : 'even';
$variables['block_id'] = $block_counter[$variables['block']->region]++;
- $variables['template_files'][] = 'block-'. $variables['block']->region;
- $variables['template_files'][] = 'block-'. $variables['block']->module;
- $variables['template_files'][] = 'block-'. $variables['block']->module .'-'. $variables['block']->delta;
+ $variables['template_files'][] = 'block-' . $variables['block']->region;
+ $variables['template_files'][] = 'block-' . $variables['block']->module;
+ $variables['template_files'][] = 'block-' . $variables['block']->module . '-' . $variables['block']->delta;
}
diff --git a/includes/theme.maintenance.inc b/includes/theme.maintenance.inc
index 9a99e833e..965eed450 100644
--- a/includes/theme.maintenance.inc
+++ b/includes/theme.maintenance.inc
@@ -62,10 +62,10 @@ function _drupal_maintenance_theme() {
// These are usually added from system_init() -except maintenance.css.
// When the database is inactive it's not called so we add it here.
- drupal_add_css(drupal_get_path('module', 'system') .'/defaults.css', 'module');
- drupal_add_css(drupal_get_path('module', 'system') .'/system.css', 'module');
- drupal_add_css(drupal_get_path('module', 'system') .'/system-menus.css', 'module');
- drupal_add_css(drupal_get_path('module', 'system') .'/maintenance.css', 'module');
+ drupal_add_css(drupal_get_path('module', 'system') . '/defaults.css', 'module');
+ drupal_add_css(drupal_get_path('module', 'system') . '/system.css', 'module');
+ drupal_add_css(drupal_get_path('module', 'system') . '/system-menus.css', 'module');
+ drupal_add_css(drupal_get_path('module', 'system') . '/maintenance.css', 'module');
}
/**
@@ -92,7 +92,7 @@ function theme_task_list($items, $active = NULL) {
else {
$class = $done ? 'done' : '';
}
- $output .= '
'. $item .' ';
+ $output .= '
' . $item . ' ';
}
$output .= '';
return $output;
@@ -120,22 +120,22 @@ function theme_install_page($content) {
$messages = drupal_set_message();
if (isset($messages['error'])) {
$title = count($messages['error']) > 1 ? st('The following errors must be resolved before you can continue the installation process') : st('The following error must be resolved before you can continue the installation process');
- $variables['messages'] .= '
'. $title .': ';
+ $variables['messages'] .= '
' . $title . ': ';
$variables['messages'] .= theme('status_messages', 'error');
- $variables['content'] .= '
'. st('Please check the error messages and try again .', array('!url' => request_uri())) .'
';
+ $variables['content'] .= '
' . st('Please check the error messages and try again .', array('!url' => request_uri())) . '
';
}
// Special handling of warning messages
if (isset($messages['warning'])) {
$title = count($messages['warning']) > 1 ? st('The following installation warnings should be carefully reviewed') : st('The following installation warning should be carefully reviewed');
- $variables['messages'] .= '
'. $title .': ';
+ $variables['messages'] .= '
' . $title . ': ';
$variables['messages'] .= theme('status_messages', 'warning');
}
// Special handling of status messages
if (isset($messages['status'])) {
$title = count($messages['status']) > 1 ? st('The following installation warnings should be carefully reviewed, but in most cases may be safely ignored') : st('The following installation warning should be carefully reviewed, but in most cases may be safely ignored');
- $variables['messages'] .= '
'. $title .': ';
+ $variables['messages'] .= '
' . $title . ': ';
$variables['messages'] .= theme('status_messages', 'status');
}
@@ -173,7 +173,7 @@ function theme_update_page($content, $show_messages = TRUE) {
$messages = drupal_set_message();
if (isset($messages['warning'])) {
$title = count($messages['warning']) > 1 ? 'The following update warnings should be carefully reviewed before continuing' : 'The following update warning should be carefully reviewed before continuing';
- $variables['messages'] .= '
'. $title .': ';
+ $variables['messages'] .= '
' . $title . ': ';
$variables['messages'] .= theme('status_messages', 'warning');
}
@@ -205,7 +205,7 @@ function theme_update_page($content, $show_messages = TRUE) {
function template_preprocess_maintenance_page(&$variables) {
// Add favicon
if (theme_get_setting('toggle_favicon')) {
- drupal_set_html_head('
');
+ drupal_set_html_head('
');
}
global $theme;
@@ -276,7 +276,7 @@ function template_preprocess_maintenance_page(&$variables) {
$body_classes[] = 'no-sidebars';
}
else {
- $body_classes[] = 'one-sidebar sidebar-'. $variables['layout'];
+ $body_classes[] = 'one-sidebar sidebar-' . $variables['layout'];
}
$variables['body_classes'] = implode(' ', $body_classes);
diff --git a/includes/unicode.inc b/includes/unicode.inc
index 19c74422b..cb3b0a8fc 100644
--- a/includes/unicode.inc
+++ b/includes/unicode.inc
@@ -178,7 +178,7 @@ function drupal_convert_to_utf8($data, $encoding) {
$out = @mb_convert_encoding($data, 'utf-8', $encoding);
}
else if (function_exists('recode_string')) {
- $out = @recode_string($encoding .'..utf-8', $data);
+ $out = @recode_string($encoding . '..utf-8', $data);
}
else {
watchdog('php', 'Unsupported encoding %s. Please install iconv, GNU recode or mbstring for PHP.', array('%s' => $encoding), WATCHDOG_ERROR);
@@ -283,7 +283,7 @@ function mime_header_encode($string) {
$output = '';
while ($len > 0) {
$chunk = drupal_truncate_bytes($string, $chunk_size);
- $output .= ' =?UTF-8?B?'. base64_encode($chunk) ."?=\n";
+ $output .= ' =?UTF-8?B?' . base64_encode($chunk) . "?=\n";
$c = strlen($chunk);
$string = substr($string, $c);
$len -= $c;
diff --git a/includes/xmlrpc.inc b/includes/xmlrpc.inc
index c7751e1c1..569871b8f 100644
--- a/includes/xmlrpc.inc
+++ b/includes/xmlrpc.inc
@@ -90,32 +90,32 @@ function xmlrpc_value_calculate_type(&$xmlrpc_value) {
function xmlrpc_value_get_xml($xmlrpc_value) {
switch ($xmlrpc_value->type) {
case 'boolean':
- return '
'. (($xmlrpc_value->data) ? '1' : '0') .' ';
+ return '
' . (($xmlrpc_value->data) ? '1' : '0') . ' ';
break;
case 'int':
- return '
'. $xmlrpc_value->data .' ';
+ return '
' . $xmlrpc_value->data . ' ';
break;
case 'double':
- return '
'. $xmlrpc_value->data .' ';
+ return '
' . $xmlrpc_value->data . ' ';
break;
case 'string':
// Note: we don't escape apostrophes because of the many blogging clients
// that don't support numerical entities (and XML in general) properly.
- return '
'. htmlspecialchars($xmlrpc_value->data) .' ';
+ return '
' . htmlspecialchars($xmlrpc_value->data) . ' ';
break;
case 'array':
- $return = '
'."\n";
+ $return = '' . "\n";
foreach ($xmlrpc_value->data as $item) {
- $return .= ' '. xmlrpc_value_get_xml($item) ." \n";
+ $return .= ' ' . xmlrpc_value_get_xml($item) . " \n";
}
$return .= ' ';
return $return;
break;
case 'struct':
- $return = ''."\n";
+ $return = '' . "\n";
foreach ($xmlrpc_value->data as $name => $value) {
- $return .= " ". check_plain($name) ." ";
- $return .= xmlrpc_value_get_xml($value) ." \n";
+ $return .= " " . check_plain($name) . " ";
+ $return .= xmlrpc_value_get_xml($value) . " \n";
}
$return .= ' ';
return $return;
@@ -158,7 +158,7 @@ function xmlrpc_message($message) {
*/
function xmlrpc_message_parse(&$xmlrpc_message) {
// First remove the XML declaration
- $xmlrpc_message->message = preg_replace('/<\?xml(.*)?\?'.'>/', '', $xmlrpc_message->message);
+ $xmlrpc_message->message = preg_replace('/<\?xml(.*)?\?' . '>/', '', $xmlrpc_message->message);
if (trim($xmlrpc_message->message) == '') {
return FALSE;
}
@@ -403,7 +403,7 @@ function xmlrpc_date($time) {
}
function xmlrpc_date_get_xml($xmlrpc_date) {
- return ''. $xmlrpc_date->year . $xmlrpc_date->month . $xmlrpc_date->day .'T'. $xmlrpc_date->hour .':'. $xmlrpc_date->minute .':'. $xmlrpc_date->second .' ';
+ return '' . $xmlrpc_date->year . $xmlrpc_date->month . $xmlrpc_date->day . 'T' . $xmlrpc_date->hour . ':' . $xmlrpc_date->minute . ':' . $xmlrpc_date->second . ' ';
}
function xmlrpc_base64($data) {
@@ -414,7 +414,7 @@ function xmlrpc_base64($data) {
}
function xmlrpc_base64_get_xml($xmlrpc_base64) {
- return ''. base64_encode($xmlrpc_base64->data) .' ';
+ return '' . base64_encode($xmlrpc_base64->data) . ' ';
}
/**
diff --git a/includes/xmlrpcs.inc b/includes/xmlrpcs.inc
index 11744a98e..33e5bb209 100644
--- a/includes/xmlrpcs.inc
+++ b/includes/xmlrpcs.inc
@@ -77,9 +77,9 @@ function xmlrpc_server($callbacks) {
- '.
+ ' .
xmlrpc_value_get_xml($r)
- .'
+ . '
@@ -105,11 +105,11 @@ function xmlrpc_server_error($error, $message = FALSE) {
}
function xmlrpc_server_output($xml) {
- $xml = ''."\n". $xml;
+ $xml = '' . "\n" . $xml;
header('Connection: close');
- header('Content-Length: '. strlen($xml));
+ header('Content-Length: ' . strlen($xml));
header('Content-Type: text/xml');
- header('Date: '. date('r'));
+ header('Date: ' . date('r'));
echo $xml;
exit;
}
diff --git a/install.php b/install.php
index aa3b8a4b1..034150000 100644
--- a/install.php
+++ b/install.php
@@ -159,7 +159,7 @@ function install_verify_settings() {
$db_host = urldecode($url['host']);
$db_port = isset($url['port']) ? urldecode($url['port']) : '';
$db_path = ltrim(urldecode($url['path']), '/');
- $settings_file = './'. conf_path(FALSE, TRUE) .'/settings.php';
+ $settings_file = './' . conf_path(FALSE, TRUE) . '/settings.php';
$form_state = array();
_install_settings_form_validate($db_prefix, $db_type, $db_user, $db_pass, $db_host, $db_port, $db_path, $settings_file, $form_state);
@@ -182,8 +182,8 @@ function install_change_settings($profile = 'default', $install_locale = '') {
$db_host = isset($url['host']) ? urldecode($url['host']) : '';
$db_port = isset($url['port']) ? urldecode($url['port']) : '';
$db_path = ltrim(urldecode($url['path']), '/');
- $conf_path = './'. conf_path(FALSE, TRUE);
- $settings_file = $conf_path .'/settings.php';
+ $conf_path = './' . conf_path(FALSE, TRUE);
+ $settings_file = $conf_path . '/settings.php';
// We always need this because we want to run form_get_errors.
include_once './includes/form.inc';
@@ -227,7 +227,7 @@ function install_settings_form(&$form_state, $profile, $install_locale, $setting
$form['basic_options'] = array(
'#type' => 'fieldset',
'#title' => st('Basic options'),
- '#description' => ''. st('To set up your @drupal database, enter the following information.', array('@drupal' => drupal_install_profile_name())) .'
',
+ '#description' => '' . st('To set up your @drupal database, enter the following information.', array('@drupal' => drupal_install_profile_name())) . '
',
);
if (count($db_types) > 1) {
@@ -312,7 +312,7 @@ function install_settings_form(&$form_state, $profile, $install_locale, $setting
);
// Table prefix
- $prefix = ($profile == 'default') ? 'drupal_' : $profile .'_';
+ $prefix = ($profile == 'default') ? 'drupal_' : $profile . '_';
$form['advanced_options']['db_prefix'] = array(
'#type' => 'textfield',
'#title' => st('Table prefix'),
@@ -330,7 +330,7 @@ function install_settings_form(&$form_state, $profile, $install_locale, $setting
$form['errors'] = array();
$form['settings_file'] = array('#type' => 'value', '#value' => $settings_file);
$form['_db_url'] = array('#type' => 'value');
- $form['#action'] = "install.php?profile=$profile". ($install_locale ? "&locale=$install_locale" : '');
+ $form['#action'] = "install.php?profile=$profile" . ($install_locale ? "&locale=$install_locale" : '');
$form['#redirect'] = FALSE;
}
return $form;
@@ -370,13 +370,13 @@ function _install_settings_form_validate($db_prefix, $db_type, $db_user, $db_pas
}
else {
// Verify
- $db_url = $db_type .'://'. urlencode($db_user) . ($db_pass ? ':'. urlencode($db_pass) : '') .'@'. ($db_host ? urlencode($db_host) : 'localhost') . ($db_port ? ":$db_port" : '') .'/'. urlencode($db_path);
+ $db_url = $db_type . '://' . urlencode($db_user) . ($db_pass ? ':' . urlencode($db_pass) : '') . '@' . ($db_host ? urlencode($db_host) : 'localhost') . ($db_port ? ":$db_port" : '') . '/' . urlencode($db_path);
if (isset($form)) {
form_set_value($form['_db_url'], $db_url, $form_state);
}
$success = array();
- $function = 'drupal_test_'. $db_type;
+ $function = 'drupal_test_' . $db_type;
if (!$function($db_url, $success)) {
if (isset($success['CONNECT'])) {
form_set_error('db_type', st('In order for Drupal to work, and to continue with the installation process, you must resolve all permission issues reported above. We were able to verify that we have permission for the following commands: %commands. For more help with configuring your database server, see the Installation and upgrading handbook . If you are unsure what any of this means you should probably contact your hosting provider.', array('%commands' => implode($success, ', '))));
@@ -406,7 +406,7 @@ function install_settings_form_submit($form, &$form_state) {
drupal_rewrite_settings($settings);
// Continue to install profile step
- install_goto("install.php?profile=$profile". ($install_locale ? "&locale=$install_locale" : ''));
+ install_goto("install.php?profile=$profile" . ($install_locale ? "&locale=$install_locale" : ''));
}
/**
@@ -454,7 +454,7 @@ function install_select_profile_form(&$form_state, $profiles) {
foreach ($profiles as $profile) {
include_once($profile->filename);
// Load profile details.
- $function = $profile->name .'_profile_details';
+ $function = $profile->name . '_profile_details';
if (function_exists($function)) {
$details = $function();
}
@@ -480,7 +480,7 @@ function install_select_profile_form(&$form_state, $profiles) {
* Find all .po files for the current profile.
*/
function install_find_locales($profilename) {
- $locales = file_scan_directory('./profiles/'. $profilename .'/translations', '\.po$', array('.', '..', 'CVS'), 0, FALSE);
+ $locales = file_scan_directory('./profiles/' . $profilename . '/translations', '\.po$', array('.', '..', 'CVS'), 0, FALSE);
array_unshift($locales, (object) array('name' => 'en'));
return $locales;
}
@@ -507,16 +507,16 @@ function install_select_locale($profilename) {
install_task_list('locale-select');
drupal_set_title(st('Choose language'));
if (!empty($_GET['localize'])) {
- $output = ''. st('With the addition of an appropriate translation package, this installer is capable of proceeding in another language of your choice. To install and use Drupal in a language other than English:') .'
';
- $output .= ''. st('Determine if a translation of this Drupal version is available in your language of choice. A translation is provided via a translation package; each translation package enables the display of a specific version of Drupal in a specific language. Not all languages are available for every version of Drupal.', array('@translations' => 'http://drupal.org/project/translations')) .' ';
- $output .= ''. st('If an alternative translation package of your choice is available, download and extract its contents to your Drupal root directory.') .' ';
- $output .= ''. st('Return to choose language using the second link below and select your desired language from the displayed list. Reloading the page allows the list to automatically adjust to the presence of new translation packages.') .' ';
- $output .= ''. st('Alternatively, to install and use Drupal in English, or to defer the selection of an alternative language until after installation, select the first link below.') .'
';
- $output .= ''. st('How should the installation continue?') .'
';
- $output .= '';
+ $output = '' . st('With the addition of an appropriate translation package, this installer is capable of proceeding in another language of your choice. To install and use Drupal in a language other than English:') . '
';
+ $output .= '' . st('Determine if a translation of this Drupal version is available in your language of choice. A translation is provided via a translation package; each translation package enables the display of a specific version of Drupal in a specific language. Not all languages are available for every version of Drupal.', array('@translations' => 'http://drupal.org/project/translations')) . ' ';
+ $output .= '' . st('If an alternative translation package of your choice is available, download and extract its contents to your Drupal root directory.') . ' ';
+ $output .= '' . st('Return to choose language using the second link below and select your desired language from the displayed list. Reloading the page allows the list to automatically adjust to the presence of new translation packages.') . ' ';
+ $output .= '' . st('Alternatively, to install and use Drupal in English, or to defer the selection of an alternative language until after installation, select the first link below.') . '
';
+ $output .= '' . st('How should the installation continue?') . '
';
+ $output .= '';
}
else {
- $output = '';
+ $output = '';
}
print theme('install_page', $output);
exit;
@@ -527,7 +527,7 @@ function install_select_locale($profilename) {
}
else {
// Allow profile to pre-select the language, skipping the selection.
- $function = $profilename .'_profile_details';
+ $function = $profilename . '_profile_details';
if (function_exists($function)) {
$details = $function();
if (isset($details['language'])) {
@@ -563,13 +563,13 @@ function install_select_locale_form(&$form_state, $locales) {
// Try to use verbose locale name
$name = $locale->name;
if (isset($languages[$name])) {
- $name = $languages[$name][0] . (isset($languages[$name][1]) ? ' '. st('(@language)', array('@language' => $languages[$name][1])) : '');
+ $name = $languages[$name][0] . (isset($languages[$name][1]) ? ' ' . st('(@language)', array('@language' => $languages[$name][1])) : '');
}
$form['locale'][$locale->name] = array(
'#type' => 'radio',
'#return_value' => $locale->name,
'#default_value' => ($locale->name == 'en' ? TRUE : FALSE),
- '#title' => $name . ($locale->name == 'en' ? ' '. st('(built-in)') : ''),
+ '#title' => $name . ($locale->name == 'en' ? ' ' . st('(built-in)') : ''),
'#parents' => array('locale')
);
}
@@ -586,7 +586,7 @@ function install_select_locale_form(&$form_state, $locales) {
function install_no_profile_error() {
install_task_list('profile-select');
drupal_set_title(st('No profiles available'));
- print theme('install_page', ''. st('We were unable to find any installer profiles. Installer profiles tell us what modules to enable and what schema to install in the database. A profile is necessary to continue with the installation process.') .'
');
+ print theme('install_page', '' . st('We were unable to find any installer profiles. Installer profiles tell us what modules to enable and what schema to install in the database. A profile is necessary to continue with the installation process.') . '
');
exit;
}
@@ -614,7 +614,7 @@ function install_tasks($profile, $task) {
$_SESSION['messages'] = $messages;
// URL used to direct page requests.
- $url = $base_url .'/install.php?locale='. $install_locale .'&profile='. $profile;
+ $url = $base_url . '/install.php?locale=' . $install_locale . '&profile=' . $profile;
// Build a page for final tasks.
if (empty($task)) {
@@ -697,8 +697,8 @@ function install_tasks($profile, $task) {
drupal_set_title(st('Configure site'));
// Warn about settings.php permissions risk
- $settings_dir = './'. conf_path();
- $settings_file = $settings_dir .'/settings.php';
+ $settings_dir = './' . conf_path();
+ $settings_file = $settings_dir . '/settings.php';
if (!drupal_verify_install_file($settings_file, FILE_EXIST|FILE_READABLE|FILE_NOT_WRITABLE) || !drupal_verify_install_file($settings_dir, FILE_NOT_WRITABLE, 'dir')) {
drupal_set_message(st('All necessary changes to %dir and %file have been made, so you should remove write permissions to them now in order to avoid security risks. If you are unsure how to do so, please consult the on-line handbook .', array('%dir' => $settings_dir, '%file' => $settings_file, '@handbook_url' => 'http://drupal.org/getting-started')), 'error');
}
@@ -708,7 +708,7 @@ function install_tasks($profile, $task) {
// Add JavaScript validation.
_user_password_dynamic_validation();
- drupal_add_js(drupal_get_path('module', 'system') .'/system.js', 'module');
+ drupal_add_js(drupal_get_path('module', 'system') . '/system.js', 'module');
// We add these strings as settings because JavaScript translation does not
// work on install time.
drupal_add_js(array('copyFieldValue' => array('edit-site-mail' => array('edit-account-mail')), 'cleanURL' => array('success' => st('Your server has been successfully tested to support this feature.'), 'failure' => st('Your system configuration does not currently support this feature. The handbook page on Clean URLs has additional troubleshooting information.'), 'testing' => st('Testing clean URLs...'))), 'setting');
@@ -733,7 +733,7 @@ if (Drupal.jsEnabled) {
// reserved for profiles, hand over the control to the profile,
// so it can run any number of custom tasks it defines.
if (!in_array($task, install_reserved_tasks())) {
- $function = $profile .'_profile_tasks';
+ $function = $profile . '_profile_tasks';
if (function_exists($function)) {
// The profile needs to run more code, maybe even more tasks.
// $task is sent through as a reference and may be changed!
@@ -778,8 +778,8 @@ if (Drupal.jsEnabled) {
if ($task == 'finished') {
drupal_set_title(st('@drupal installation complete', array('@drupal' => drupal_install_profile_name())));
$messages = drupal_set_message();
- $output = ''. st('Congratulations, @drupal has been successfully installed.', array('@drupal' => drupal_install_profile_name())) .'
';
- $output .= ''. (isset($messages['error']) ? st('Please review the messages above before continuing on to your new site .', array('@url' => url(''))) : st('You may now visit your new site .', array('@url' => url('')))) .'
';
+ $output = '' . st('Congratulations, @drupal has been successfully installed.', array('@drupal' => drupal_install_profile_name())) . '
';
+ $output .= '' . (isset($messages['error']) ? st('Please review the messages above before continuing on to your new site .', array('@url' => url(''))) : st('You may now visit your new site .', array('@url' => url('')))) . '
';
$task = 'done';
}
@@ -821,7 +821,7 @@ function _install_module_batch($module, $module_name, &$context) {
// steps.
module_enable(array($module));
$context['results'][] = $module;
- $context['message'] = 'Installed '. $module_name .' module.';
+ $context['message'] = 'Installed ' . $module_name . ' module.';
}
/**
@@ -866,8 +866,8 @@ function install_check_requirements($profile, $verify) {
// If Drupal is not set up already, we need to create a settings file.
if (!$verify) {
$writable = FALSE;
- $conf_path = './'. conf_path(FALSE, TRUE);
- $settings_file = $conf_path .'/settings.php';
+ $conf_path = './' . conf_path(FALSE, TRUE);
+ $settings_file = $conf_path . '/settings.php';
$file = $conf_path;
// Verify that the directory exists.
if (drupal_verify_install_file($conf_path, FILE_EXIST, 'dir')) {
@@ -899,7 +899,7 @@ function install_check_requirements($profile, $verify) {
if (isset($requirement['severity']) && $requirement['severity'] == REQUIREMENT_ERROR) {
$message = $requirement['description'];
if (isset($requirement['value']) && $requirement['value']) {
- $message .= ' ('. st('Currently using !item !version', array('!item' => $requirement['title'], '!version' => $requirement['value'])) .')';
+ $message .= ' (' . st('Currently using !item !version', array('!item' => $requirement['title'], '!version' => $requirement['value'])) . ')';
}
drupal_set_message($message, 'error');
}
@@ -911,7 +911,7 @@ function install_check_requirements($profile, $verify) {
if (isset($requirement['severity']) && $requirement['severity'] == REQUIREMENT_WARNING) {
$message = $requirement['description'];
if (isset($requirement['value']) && $requirement['value']) {
- $message .= ' ('. st('Currently using !item !version', array('!item' => $requirement['title'], '!version' => $requirement['value'])) .')';
+ $message .= ' (' . st('Currently using !item !version', array('!item' => $requirement['title'], '!version' => $requirement['value'])) . ')';
}
drupal_set_message($message, 'warning');
}
@@ -947,7 +947,7 @@ function install_task_list($active = NULL) {
// Add tasks defined by the profile.
if ($profile) {
- $function = $profile .'_profile_task_list';
+ $function = $profile . '_profile_task_list';
if (function_exists($function)) {
$result = $function();
if (is_array($result)) {
@@ -1013,7 +1013,7 @@ function install_configure_form(&$form_state, $url) {
);
$form['admin_account']['account']['#tree'] = TRUE;
$form['admin_account']['markup'] = array(
- '#value' => ''. st('The administrator account has complete access to the site; it will automatically be granted all permissions and can perform any administrative activity. This will be the only account that can perform certain activities, so keep its credentials safe.') .'
',
+ '#value' => '' . st('The administrator account has complete access to the site; it will automatically be granted all permissions and can perform any administrative activity. This will be the only account that can perform certain activities, so keep its credentials safe.') . '
',
'#weight' => -10,
);
@@ -1085,7 +1085,7 @@ function install_configure_form(&$form_state, $url) {
// Allow the profile to alter this form. $form_state isn't available
// here, but to conform to the hook_form_alter() signature, we pass
// an empty array.
- $hook_form_alter = $_GET['profile'] .'_form_alter';
+ $hook_form_alter = $_GET['profile'] . '_form_alter';
if (function_exists($hook_form_alter)) {
$hook_form_alter($form, array(), 'install_configure');
}
diff --git a/modules/aggregator/aggregator.admin.inc b/modules/aggregator/aggregator.admin.inc
index 2f1485cf5..38b273c8f 100644
--- a/modules/aggregator/aggregator.admin.inc
+++ b/modules/aggregator/aggregator.admin.inc
@@ -22,7 +22,7 @@ function aggregator_admin_overview() {
function aggregator_view() {
$result = db_query('SELECT f.*, COUNT(i.iid) AS items FROM {aggregator_feed} f LEFT JOIN {aggregator_item} i ON f.fid = i.fid GROUP BY f.fid, f.title, f.url, f.refresh, f.checked, f.link, f.description, f.etag, f.modified, f.image, f.block ORDER BY f.title');
- $output = ''. t('Feed overview') .' ';
+ $output = '' . t('Feed overview') . ' ';
$header = array(t('Title'), t('Items'), t('Last update'), t('Next update'), array('data' => t('Operations'), 'colspan' => '3'));
$rows = array();
@@ -33,7 +33,7 @@ function aggregator_view() {
$result = db_query('SELECT c.cid, c.title, count(ci.iid) as items FROM {aggregator_category} c LEFT JOIN {aggregator_category_item} ci ON c.cid = ci.cid GROUP BY c.cid, c.title ORDER BY title');
- $output .= ''. t('Category overview') .' ';
+ $output .= '' . t('Category overview') . ' ';
$header = array(t('Title'), t('Items'), t('Operations'));
$rows = array();
@@ -153,7 +153,7 @@ function aggregator_form_feed_submit($form, &$form_state) {
return;
}
else {
- $form_state['redirect'] = 'aggregator/sources/'. $form_state['values']['fid'];
+ $form_state['redirect'] = 'aggregator/sources/' . $form_state['values']['fid'];
return;
}
}
@@ -317,7 +317,7 @@ function aggregator_form_category_submit($form, &$form_state) {
return;
}
else {
- $form_state['redirect'] = 'aggregator/categories/'. $form_state['values']['cid'];
+ $form_state['redirect'] = 'aggregator/categories/' . $form_state['values']['cid'];
return;
}
}
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module
index 36f5eb0eb..7b749ec28 100644
--- a/modules/aggregator/aggregator.module
+++ b/modules/aggregator/aggregator.module
@@ -12,18 +12,18 @@
function aggregator_help($path, $arg) {
switch ($path) {
case 'admin/help#aggregator':
- $output = ''. t('The aggregator is a powerful on-site syndicator and news reader that gathers fresh content from RSS-, RDF-, and Atom-based feeds made available across the web. Thousands of sites (particularly news sites and blogs) publish their latest headlines and posts in feeds, using a number of standardized XML-based formats. Formats supported by the aggregator include RSS , RDF , and Atom .', array('@rss' => 'http://cyber.law.harvard.edu/rss/', '@rdf' => 'http://www.w3.org/RDF/', '@atom' => 'http://www.atomenabled.org')) .'
';
- $output .= ''. t('Feeds contain feed items, or individual posts published by the site providing the feed. Feeds may be grouped in categories, generally by topic. Users view feed items in the main aggregator display or by their source . Administrators can add, edit and delete feeds and choose how often to check each feed for newly updated items. The most recent items in either a feed or category can be displayed as a block through the blocks administration page . A machine-readable OPML file of all feeds is available. A correctly configured cron maintenance task is required to update feeds automatically.', array('@aggregator' => url('aggregator'), '@aggregator-sources' => url('aggregator/sources'), '@feededit' => url('admin/content/aggregator'), '@admin-block' => url('admin/build/block'), '@aggregator-opml' => url('aggregator/opml'), '@cron' => url('admin/reports/status'))) .'
';
- $output .= ''. t('For more information, see the online handbook entry for Aggregator module .', array('@aggregator' => 'http://drupal.org/handbook/modules/aggregator/')) .'
';
+ $output = '' . t('The aggregator is a powerful on-site syndicator and news reader that gathers fresh content from RSS-, RDF-, and Atom-based feeds made available across the web. Thousands of sites (particularly news sites and blogs) publish their latest headlines and posts in feeds, using a number of standardized XML-based formats. Formats supported by the aggregator include RSS , RDF , and Atom .', array('@rss' => 'http://cyber.law.harvard.edu/rss/', '@rdf' => 'http://www.w3.org/RDF/', '@atom' => 'http://www.atomenabled.org')) . '
';
+ $output .= '' . t('Feeds contain feed items, or individual posts published by the site providing the feed. Feeds may be grouped in categories, generally by topic. Users view feed items in the main aggregator display or by their source . Administrators can add, edit and delete feeds and choose how often to check each feed for newly updated items. The most recent items in either a feed or category can be displayed as a block through the blocks administration page . A machine-readable OPML file of all feeds is available. A correctly configured cron maintenance task is required to update feeds automatically.', array('@aggregator' => url('aggregator'), '@aggregator-sources' => url('aggregator/sources'), '@feededit' => url('admin/content/aggregator'), '@admin-block' => url('admin/build/block'), '@aggregator-opml' => url('aggregator/opml'), '@cron' => url('admin/reports/status'))) . '
';
+ $output .= '' . t('For more information, see the online handbook entry for Aggregator module .', array('@aggregator' => 'http://drupal.org/handbook/modules/aggregator/')) . '
';
return $output;
case 'admin/content/aggregator':
- $output = ''. t('Thousands of sites (particularly news sites and blogs) publish their latest headlines and posts in feeds, using a number of standardized XML-based formats. Formats supported by the aggregator include RSS , RDF , and Atom .', array('@rss' => 'http://cyber.law.harvard.edu/rss/', '@rdf' => 'hsttp://www.w3.org/RDF/', '@atom' => 'http://www.atomenabled.org')) .'
';
- $output .= ''. t('Current feeds are listed below, and new feeds may be added . For each feed or feed category, the latest items block may be enabled at the blocks administration page .', array('@addfeed' => url('admin/content/aggregator/add/feed'), '@block' => url('admin/build/block'))) .'
';
+ $output = '' . t('Thousands of sites (particularly news sites and blogs) publish their latest headlines and posts in feeds, using a number of standardized XML-based formats. Formats supported by the aggregator include RSS , RDF , and Atom .', array('@rss' => 'http://cyber.law.harvard.edu/rss/', '@rdf' => 'hsttp://www.w3.org/RDF/', '@atom' => 'http://www.atomenabled.org')) . '
';
+ $output .= '' . t('Current feeds are listed below, and new feeds may be added . For each feed or feed category, the latest items block may be enabled at the blocks administration page .', array('@addfeed' => url('admin/content/aggregator/add/feed'), '@block' => url('admin/build/block'))) . '
';
return $output;
case 'admin/content/aggregator/add/feed':
- return ''. t('Add a feed in RSS, RDF or Atom format. A feed may only have one entry.') .'
';
+ return '' . t('Add a feed in RSS, RDF or Atom format. A feed may only have one entry.') . '
';
case 'admin/content/aggregator/add/category':
- return ''. t('Categories allow feed items from different feeds to be grouped together. For example, several sport-related feeds may belong to a category named Sports . Feed items may be grouped automatically (by selecting a category when creating or editing a feed) or manually (via the Categorize page available from feed item listings). Each category provides its own feed page and block.') .'
';
+ return '' . t('Categories allow feed items from different feeds to be grouped together. For example, several sport-related feeds may belong to a category named Sports . Feed items may be grouped automatically (by selecting a category when creating or editing a feed) or manually (via the Categorize page available from feed item listings). Each category provides its own feed page and block.') . '
';
}
}
@@ -260,7 +260,7 @@ function _aggregator_category_title($category) {
* Implementation of hook_init().
*/
function aggregator_init() {
- drupal_add_css(drupal_get_path('module', 'aggregator') .'/aggregator.css');
+ drupal_add_css(drupal_get_path('module', 'aggregator') . '/aggregator.css');
}
/**
@@ -305,11 +305,11 @@ function aggregator_block($op = 'list', $delta = '', $edit = array()) {
if ($op == 'list') {
$result = db_query('SELECT cid, title FROM {aggregator_category} ORDER BY title');
while ($category = db_fetch_object($result)) {
- $block['category-'. $category->cid]['info'] = t('!title category latest items', array('!title' => $category->title));
+ $block['category-' . $category->cid]['info'] = t('!title category latest items', array('!title' => $category->title));
}
$result = db_query('SELECT fid, title FROM {aggregator_feed} ORDER BY fid');
while ($feed = db_fetch_object($result)) {
- $block['feed-'. $feed->fid]['info'] = t('!title feed latest items', array('!title' => $feed->title));
+ $block['feed-' . $feed->fid]['info'] = t('!title feed latest items', array('!title' => $feed->title));
}
}
else if ($op == 'configure') {
@@ -339,7 +339,7 @@ function aggregator_block($op = 'list', $delta = '', $edit = array()) {
if ($feed = db_fetch_object(db_query('SELECT fid, title, block FROM {aggregator_feed} WHERE fid = %d', $id))) {
$block['subject'] = check_plain($feed->title);
$result = db_query_range('SELECT * FROM {aggregator_item} WHERE fid = %d ORDER BY timestamp DESC, iid DESC', $feed->fid, 0, $feed->block);
- $read_more = theme('more_link', url('aggregator/sources/'. $feed->fid), t("View this feed's recent news."));
+ $read_more = theme('more_link', url('aggregator/sources/' . $feed->fid), t("View this feed's recent news."));
}
break;
@@ -347,7 +347,7 @@ function aggregator_block($op = 'list', $delta = '', $edit = array()) {
if ($category = db_fetch_object(db_query('SELECT cid, title, block FROM {aggregator_category} WHERE cid = %d', $id))) {
$block['subject'] = check_plain($category->title);
$result = db_query_range('SELECT i.* FROM {aggregator_category_item} ci LEFT JOIN {aggregator_item} i ON ci.iid = i.iid WHERE ci.cid = %d ORDER BY i.timestamp DESC, i.iid DESC', $category->cid, 0, $category->block);
- $read_more = theme('more_link', url('aggregator/categories/'. $category->cid), t("View this category's recent news."));
+ $read_more = theme('more_link', url('aggregator/categories/' . $category->cid), t("View this category's recent news."));
}
break;
}
@@ -419,7 +419,7 @@ function aggregator_save_feed($edit) {
$items[] = "iid = $item->iid";
}
if (!empty($items)) {
- db_query('DELETE FROM {aggregator_category_item} WHERE '. implode(' OR ', $items));
+ db_query('DELETE FROM {aggregator_category_item} WHERE ' . implode(' OR ', $items));
}
db_query('DELETE FROM {aggregator_feed} WHERE fid = %d', $edit['fid']);
db_query('DELETE FROM {aggregator_item} WHERE fid = %d', $edit['fid']);
@@ -453,7 +453,7 @@ function aggregator_remove($feed) {
$items[] = "iid = $item->iid";
}
if (!empty($items)) {
- db_query('DELETE FROM {aggregator_category_item} WHERE '. implode(' OR ', $items));
+ db_query('DELETE FROM {aggregator_category_item} WHERE ' . implode(' OR ', $items));
}
db_query('DELETE FROM {aggregator_item} WHERE fid = %d', $feed['fid']);
db_query("UPDATE {aggregator_feed} SET checked = 0, etag = '', modified = 0 WHERE fid = %d", $feed['fid']);
@@ -588,7 +588,7 @@ function aggregator_refresh($feed) {
$headers['If-None-Match'] = $feed['etag'];
}
if ($feed['modified']) {
- $headers['If-Modified-Since'] = gmdate('D, d M Y H:i:s', $feed['modified']) .' GMT';
+ $headers['If-Modified-Since'] = gmdate('D, d M Y H:i:s', $feed['modified']) . ' GMT';
}
// Request feed.
@@ -623,7 +623,7 @@ function aggregator_refresh($feed) {
if (!empty($image['LINK']) && !empty($image['URL']) && !empty($image['TITLE'])) {
// Note, we should really use theme_image() here but that only works with local images it won't work with images fetched with a URL unless PHP version > 5
- $image = ' ';
+ $image = ' ';
}
else {
$image = NULL;
@@ -643,8 +643,8 @@ function aggregator_refresh($feed) {
$result->error = t('feed not parseable');
// Deliberate no break.
default:
- watchdog('aggregator', 'The feed from %site seems to be broken, due to "%error".', array('%site' => $feed['title'], '%error' => $result->code .' '. $result->error), WATCHDOG_WARNING);
- drupal_set_message(t('The feed from %site seems to be broken, because of error "%error".', array('%site' => $feed['title'], '%error' => $result->code .' '. $result->error)));
+ watchdog('aggregator', 'The feed from %site seems to be broken, due to "%error".', array('%site' => $feed['title'], '%error' => $result->code . ' ' . $result->error), WATCHDOG_WARNING);
+ drupal_set_message(t('The feed from %site seems to be broken, because of error "%error".', array('%site' => $feed['title'], '%error' => $result->code . ' ' . $result->error)));
module_invoke('system', 'check_http_request');
}
}
@@ -811,7 +811,7 @@ function aggregator_parse_feed(&$data, $feed) {
$num_rows = TRUE;
}
if ($num_rows) {
- db_query('DELETE FROM {aggregator_category_item} WHERE iid IN ('. implode(', ', $items) .')');
+ db_query('DELETE FROM {aggregator_category_item} WHERE iid IN (' . implode(', ', $items) . ')');
db_query('DELETE FROM {aggregator_item} WHERE fid = %d AND timestamp < %d', $feed['fid'], $age);
}
@@ -892,12 +892,12 @@ function theme_aggregator_block_item($item, $feed = 0) {
$output = '';
if ($user->uid && module_exists('blog') && user_access('create blog entries')) {
if ($image = theme('image', 'misc/blog.png', t('blog it'), t('blog it'))) {
- $output .= ''. l($image, 'node/add/blog', array('attributes' => array('title' => t('Comment on this news item in your personal blog.'), 'class' => 'blog-it'), 'query' => "iid=$item->iid", 'html' => TRUE)) .'
';
+ $output .= '' . l($image, 'node/add/blog', array('attributes' => array('title' => t('Comment on this news item in your personal blog.'), 'class' => 'blog-it'), 'query' => "iid=$item->iid", 'html' => TRUE)) . '
';
}
}
// Display the external link to the item.
- $output .= ''. check_plain($item->title) ." \n";
+ $output .= '' . check_plain($item->title) . " \n";
return $output;
}
diff --git a/modules/aggregator/aggregator.pages.inc b/modules/aggregator/aggregator.pages.inc
index 2e90379bd..e2e708a4b 100644
--- a/modules/aggregator/aggregator.pages.inc
+++ b/modules/aggregator/aggregator.pages.inc
@@ -13,7 +13,7 @@
* The items HTML.
*/
function aggregator_page_last() {
- drupal_add_feed(url('aggregator/rss'), variable_get('site_name', 'Drupal') .' '. t('aggregator'));
+ drupal_add_feed(url('aggregator/rss'), variable_get('site_name', 'Drupal') . ' ' . t('aggregator'));
$items = aggregator_feed_items_load('SELECT i.*, f.title AS ftitle, f.link AS flink FROM {aggregator_item} i INNER JOIN {aggregator_feed} f ON i.fid = f.fid ORDER BY i.timestamp DESC, i.iid DESC');
@@ -42,7 +42,7 @@ function aggregator_page_source($arg1, $arg2 = NULL) {
// It is safe to include the fid in the query because it's loaded from the
// database by aggregator_feed_load.
- $items = aggregator_feed_items_load('SELECT * FROM {aggregator_item} WHERE fid = '. $feed->fid .' ORDER BY timestamp DESC, iid DESC');
+ $items = aggregator_feed_items_load('SELECT * FROM {aggregator_item} WHERE fid = ' . $feed->fid . ' ORDER BY timestamp DESC, iid DESC');
return _aggregator_page_list($items, arg(3), $feed_source);
}
@@ -65,11 +65,11 @@ function aggregator_page_category($arg1, $arg2 = NULL) {
// $form_state and $arg2 is $category. Otherwise, $arg1 is $category.
$category = is_array($arg2) ? $arg2 : $arg1;
- drupal_add_feed(url('aggregator/rss/'. $category['cid']), variable_get('site_name', 'Drupal') .' '. t('aggregator - @title', array('@title' => $category['title'])));
+ drupal_add_feed(url('aggregator/rss/' . $category['cid']), variable_get('site_name', 'Drupal') . ' ' . t('aggregator - @title', array('@title' => $category['title'])));
// It is safe to include the cid in the query because it's loaded from the
// database by aggregator_category_load.
- $items = aggregator_feed_items_load('SELECT i.*, f.title AS ftitle, f.link AS flink FROM {aggregator_category_item} c LEFT JOIN {aggregator_item} i ON c.iid = i.iid LEFT JOIN {aggregator_feed} f ON i.fid = f.fid WHERE cid = '. $category['cid'] .' ORDER BY timestamp DESC, i.iid DESC');
+ $items = aggregator_feed_items_load('SELECT i.*, f.title AS ftitle, f.link AS flink FROM {aggregator_category_item} c LEFT JOIN {aggregator_item} i ON c.iid = i.iid LEFT JOIN {aggregator_feed} f ON i.fid = f.fid WHERE cid = ' . $category['cid'] . ' ORDER BY timestamp DESC, i.iid DESC');
return _aggregator_page_list($items, arg(3));
}
@@ -267,7 +267,7 @@ function template_preprocess_aggregator_item(&$variables) {
$variables['categories'] = array();
foreach ($item->categories as $category) {
- $variables['categories'][$category->cid] = l($category->title, 'aggregator/categories/'. $category->cid);
+ $variables['categories'][$category->cid] = l($category->title, 'aggregator/categories/' . $category->cid);
}
}
@@ -287,7 +287,7 @@ function aggregator_page_sources() {
$summary_items[] = theme('aggregator_summary_item', $item);
}
}
- $feed->url = url('aggregator/sources/'. $feed->fid);
+ $feed->url = url('aggregator/sources/' . $feed->fid);
$output .= theme('aggregator_summary_items', $summary_items, $feed);
}
$output .= theme('feed_icon', url('aggregator/opml'), t('OPML feed'));
@@ -310,7 +310,7 @@ function aggregator_page_categories() {
$summary_items[] = theme('aggregator_summary_item', $item);
}
}
- $category->url = url('aggregator/categories/'. $category->cid);
+ $category->url = url('aggregator/categories/' . $category->cid);
$output .= theme('aggregator_summary_items', $summary_items, $category);
}
@@ -361,7 +361,7 @@ function theme_aggregator_page_rss($feeds, $category = NULL) {
case 'teaser':
$teaser = node_teaser($feed->description);
if ($teaser != $feed->description) {
- $teaser .= ''. t('read more') ."
\n";
+ $teaser .= '' . t('read more') . "
\n";
}
$feed->description = $teaser;
break;
@@ -369,11 +369,11 @@ function theme_aggregator_page_rss($feeds, $category = NULL) {
$feed->description = '';
break;
}
- $items .= format_rss_item($feed->ftitle .': '. $feed->title, $feed->link, $feed->description, array('pubDate' => date('r', $feed->timestamp)));
+ $items .= format_rss_item($feed->ftitle . ': ' . $feed->title, $feed->link, $feed->description, array('pubDate' => date('r', $feed->timestamp)));
}
$site_name = variable_get('site_name', 'Drupal');
- $url = url((isset($category) ? 'aggregator/categories/'. $category->cid : 'aggregator'), array('absolute' => TRUE));
+ $url = url((isset($category) ? 'aggregator/categories/' . $category->cid : 'aggregator'), array('absolute' => TRUE));
$description = isset($category) ? t('@site_name - aggregated feeds in category @title', array('@site_name' => $site_name, '@title' => $category->title)) : t('@site_name - aggregated feeds', array('@site_name' => $site_name));
$output = "\n";
@@ -422,12 +422,12 @@ function theme_aggregator_page_opml($feeds) {
$output = "\n";
$output .= "\n";
$output .= "\n";
- $output .= ''. check_plain(variable_get('site_name', 'Drupal')) ." \n";
- $output .= ''. gmdate('r') ." \n";
+ $output .= '' . check_plain(variable_get('site_name', 'Drupal')) . " \n";
+ $output .= '' . gmdate('r') . " \n";
$output .= "\n";
$output .= "\n";
foreach ($feeds as $feed) {
- $output .= ' \n";
+ $output .= ' \n";
}
$output .= "\n";
$output .= " \n";
diff --git a/modules/block/block-admin-display-form.tpl.php b/modules/block/block-admin-display-form.tpl.php
index 91d805137..369d09346 100644
--- a/modules/block/block-admin-display-form.tpl.php
+++ b/modules/block/block-admin-display-form.tpl.php
@@ -29,10 +29,10 @@
$title) {
- drupal_add_tabledrag('blocks', 'match', 'sibling', 'block-region-select', 'block-region-'. $region, NULL, FALSE);
- drupal_add_tabledrag('blocks', 'order', 'sibling', 'block-weight', 'block-weight-'. $region);
+ drupal_add_tabledrag('blocks', 'match', 'sibling', 'block-region-select', 'block-region-' . $region, NULL, FALSE);
+ drupal_add_tabledrag('blocks', 'order', 'sibling', 'block-weight', 'block-weight-' . $region);
}
?>
@@ -57,7 +57,7 @@
$data): ?>
-
+
block_title; ?>
region_select; ?>
weight_select; ?>
diff --git a/modules/block/block.admin.inc b/modules/block/block.admin.inc
index 8ef68d554..ab125d792 100644
--- a/modules/block/block.admin.inc
+++ b/modules/block/block.admin.inc
@@ -29,23 +29,23 @@ function block_admin_display_form(&$form_state, $blocks, $theme = NULL) {
global $theme_key, $custom_theme;
// Add CSS
- drupal_add_css(drupal_get_path('module', 'block') .'/block.css', 'module', 'all', FALSE);
+ drupal_add_css(drupal_get_path('module', 'block') . '/block.css', 'module', 'all', FALSE);
// If non-default theme configuration has been selected, set the custom theme.
$custom_theme = isset($theme) ? $theme : variable_get('theme_default', 'garland');
init_theme();
$throttle = module_exists('throttle');
- $block_regions = system_region_list($theme_key) + array(BLOCK_REGION_NONE => '<'. t('none') .'>');
+ $block_regions = system_region_list($theme_key) + array(BLOCK_REGION_NONE => '<' . t('none') . '>');
// Build form tree
$form = array(
- '#action' => arg(3) ? url('admin/build/block/list/'. $theme_key) : url('admin/build/block'),
+ '#action' => arg(3) ? url('admin/build/block/list/' . $theme_key) : url('admin/build/block'),
'#tree' => TRUE,
);
foreach ($blocks as $i => $block) {
- $key = $block['module'] .'_'. $block['delta'];
+ $key = $block['module'] . '_' . $block['delta'];
$form[$key]['module'] = array(
'#type' => 'value',
'#value' => $block['module'],
@@ -74,9 +74,9 @@ function block_admin_display_form(&$form_state, $blocks, $theme = NULL) {
if ($throttle) {
$form[$key]['throttle'] = array('#type' => 'checkbox', '#default_value' => isset($block['throttle']) ? $block['throttle'] : FALSE);
}
- $form[$key]['configure'] = array('#value' => l(t('configure'), 'admin/build/block/configure/'. $block['module'] .'/'. $block['delta']));
+ $form[$key]['configure'] = array('#value' => l(t('configure'), 'admin/build/block/configure/' . $block['module'] . '/' . $block['delta']));
if ($block['module'] == 'block') {
- $form[$key]['delete'] = array('#value' => l(t('delete'), 'admin/build/block/delete/'. $block['delta']));
+ $form[$key]['delete'] = array('#value' => l(t('delete'), 'admin/build/block/delete/' . $block['delta']));
}
}
@@ -234,7 +234,7 @@ function block_admin_configure(&$form_state, $module = NULL, $delta = 0) {
if ($access) {
$options[] = t('Show if the following PHP code returns TRUE
(PHP-mode, experts only).');
- $description .= ' '. t('If the PHP-mode is chosen, enter PHP code between %php. Note that executing incorrect PHP-code can break your Drupal site.', array('%php' => ''));
+ $description .= ' ' . t('If the PHP-mode is chosen, enter PHP code between %php. Note that executing incorrect PHP-code can break your Drupal site.', array('%php' => ''));
}
$form['page_vis_settings']['visibility'] = array(
'#type' => 'radios',
@@ -359,7 +359,7 @@ function template_preprocess_block_admin_display_form(&$variables) {
foreach ($block_regions as $key => $value) {
// Highlight regions on page to provide visual reference.
- drupal_set_content($key, ''. $value .'
');
+ drupal_set_content($key, '' . $value . '
');
// Initialize an empty array for the region.
$variables['block_listing'][$key] = array();
}
@@ -378,8 +378,8 @@ function template_preprocess_block_admin_display_form(&$variables) {
$region = $block['region']['#default_value'];
// Set special classes needed for table drag and drop.
- $variables['form'][$i]['region']['#attributes']['class'] = 'block-region-select block-region-'. $region;
- $variables['form'][$i]['weight']['#attributes']['class'] = 'block-weight block-weight-'. $region;
+ $variables['form'][$i]['region']['#attributes']['class'] = 'block-region-select block-region-' . $region;
+ $variables['form'][$i]['weight']['#attributes']['class'] = 'block-weight block-weight-' . $region;
$variables['block_listing'][$region][$i]->row_class = isset($block['#attributes']['class']) ? $block['#attributes']['class'] : '';
$variables['block_listing'][$region][$i]->block_modified = isset($block['#attributes']['class']) && strpos($block['#attributes']['class'], 'block-modified') !== FALSE ? TRUE : FALSE;
diff --git a/modules/block/block.module b/modules/block/block.module
index 7ca8a6594..c6e9ebd0b 100644
--- a/modules/block/block.module
+++ b/modules/block/block.module
@@ -67,29 +67,29 @@ define('BLOCK_CACHE_GLOBAL', 0x0008);
function block_help($path, $arg) {
switch ($path) {
case 'admin/help#block':
- $output = ''. t('Blocks are boxes of content rendered into an area, or region, of a web page. The default theme Garland, for example, implements the regions "left sidebar", "right sidebar", "content", "header", and "footer", and a block may appear in any one of these areas. The blocks administration page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions.', array('@blocks' => url('admin/build/block'))) .'
';
- $output .= ''. t('Although blocks are usually generated automatically by modules (like the User login block, for example), administrators can also define custom blocks. Custom blocks have a title, description, and body. The body of the block can be as long as necessary, and can contain content supported by any available input format .', array('@input-format' => url('admin/settings/filters'))) .'
';
- $output .= ''. t('When working with blocks, remember that:') .'
';
- $output .= ''. t('since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis.') .' ';
- $output .= ''. t('disabled blocks, or blocks not in a region, are never shown.') .' ';
- $output .= ''. t('when throttle module is enabled, throttled blocks (blocks with the Throttle checkbox selected) are hidden during high server loads.') .' ';
- $output .= ''. t('blocks can be configured to be visible only on certain pages.') .' ';
- $output .= ''. t('blocks can be configured to be visible only when specific conditions are true.') .' ';
- $output .= ''. t('blocks can be configured to be visible only for certain user roles.') .' ';
- $output .= ''. t('when allowed by an administrator, specific blocks may be enabled or disabled on a per-user basis using the My account page.') .' ';
- $output .= ''. t('some dynamic blocks, such as those generated by modules, will be displayed only on certain pages.') .' ';
- $output .= ''. t('For more information, see the online handbook entry for Block module .', array('@block' => 'http://drupal.org/handbook/modules/block/')) .'
';
+ $output = '' . t('Blocks are boxes of content rendered into an area, or region, of a web page. The default theme Garland, for example, implements the regions "left sidebar", "right sidebar", "content", "header", and "footer", and a block may appear in any one of these areas. The blocks administration page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions.', array('@blocks' => url('admin/build/block'))) . '
';
+ $output .= '' . t('Although blocks are usually generated automatically by modules (like the User login block, for example), administrators can also define custom blocks. Custom blocks have a title, description, and body. The body of the block can be as long as necessary, and can contain content supported by any available input format .', array('@input-format' => url('admin/settings/filters'))) . '
';
+ $output .= '' . t('When working with blocks, remember that:') . '
';
+ $output .= '' . t('since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis.') . ' ';
+ $output .= '' . t('disabled blocks, or blocks not in a region, are never shown.') . ' ';
+ $output .= '' . t('when throttle module is enabled, throttled blocks (blocks with the Throttle checkbox selected) are hidden during high server loads.') . ' ';
+ $output .= '' . t('blocks can be configured to be visible only on certain pages.') . ' ';
+ $output .= '' . t('blocks can be configured to be visible only when specific conditions are true.') . ' ';
+ $output .= '' . t('blocks can be configured to be visible only for certain user roles.') . ' ';
+ $output .= '' . t('when allowed by an administrator, specific blocks may be enabled or disabled on a per-user basis using the My account page.') . ' ';
+ $output .= '' . t('some dynamic blocks, such as those generated by modules, will be displayed only on certain pages.') . ' ';
+ $output .= '' . t('For more information, see the online handbook entry for Block module .', array('@block' => 'http://drupal.org/handbook/modules/block/')) . '
';
return $output;
case 'admin/build/block':
$throttle = module_exists('throttle');
- $output = ''. t('This page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. To change the region or order of a block, grab a drag-and-drop handle under the Block column and drag the block to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the Save blocks button at the bottom of the page.') .'
';
+ $output = '' . t('This page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. To change the region or order of a block, grab a drag-and-drop handle under the Block column and drag the block to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the Save blocks button at the bottom of the page.') . '
';
if ($throttle) {
- $output .= ''. t('To reduce CPU usage, database traffic or bandwidth, blocks may be automatically disabled during high server loads by selecting their Throttle checkbox. Adjust throttle thresholds on the throttle configuration page .', array('@throttleconfig' => url('admin/settings/throttle'))) .'
';
+ $output .= '' . t('To reduce CPU usage, database traffic or bandwidth, blocks may be automatically disabled during high server loads by selecting their Throttle checkbox. Adjust throttle thresholds on the throttle configuration page .', array('@throttleconfig' => url('admin/settings/throttle'))) . '
';
}
- $output .= ''. t('Click the configure link next to each block to configure its specific title and visibility settings. Use the add block page to create a custom block.', array('@add-block' => url('admin/build/block/add'))) .'
';
+ $output .= '' . t('Click the configure link next to each block to configure its specific title and visibility settings. Use the add block page to create a custom block.', array('@add-block' => url('admin/build/block/add'))) . '
';
return $output;
case 'admin/build/block/add':
- return ''. t('Use this page to create a new custom block. New blocks are disabled by default, and must be moved to a region on the blocks administration page to be visible.', array('@blocks' => url('admin/build/block'))) .'
';
+ return '' . t('Use this page to create a new custom block. New blocks are disabled by default, and must be moved to a region on the blocks administration page to be visible.', array('@blocks' => url('admin/build/block'))) . '
';
}
}
@@ -161,7 +161,7 @@ function block_menu() {
);
$default = variable_get('theme_default', 'garland');
foreach (list_themes() as $key => $theme) {
- $items['admin/build/block/list/'. $key] = array(
+ $items['admin/build/block/list/' . $key] = array(
'title' => check_plain($theme->info['name']),
'page arguments' => array($key),
'type' => $key == $default ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
@@ -356,7 +356,7 @@ function block_user($type, $edit, &$account, $category = NULL) {
case 'form':
if ($category == 'account') {
$rids = array_keys($account->roles);
- $result = db_query("SELECT DISTINCT b.* FROM {blocks} b LEFT JOIN {blocks_roles} r ON b.module = r.module AND b.delta = r.delta WHERE b.status = 1 AND b.custom != 0 AND (r.rid IN (". db_placeholders($rids) .") OR r.rid IS NULL) ORDER BY b.weight, b.module", $rids);
+ $result = db_query("SELECT DISTINCT b.* FROM {blocks} b LEFT JOIN {blocks_roles} r ON b.module = r.module AND b.delta = r.delta WHERE b.status = 1 AND b.custom != 0 AND (r.rid IN (" . db_placeholders($rids) . ") OR r.rid IS NULL) ORDER BY b.weight, b.module", $rids);
$form['block'] = array('#type' => 'fieldset', '#title' => t('Block configuration'), '#weight' => 3, '#collapsible' => TRUE, '#tree' => TRUE);
while ($block = db_fetch_object($result)) {
$data = module_invoke($block->module, 'block', 'list');
@@ -421,7 +421,7 @@ function _block_load_blocks() {
$blocks = array();
$rids = array_keys($user->roles);
- $result = db_query(db_rewrite_sql("SELECT DISTINCT b.* FROM {blocks} b LEFT JOIN {blocks_roles} r ON b.module = r.module AND b.delta = r.delta WHERE b.theme = '%s' AND b.status = 1 AND (r.rid IN (". db_placeholders($rids) .") OR r.rid IS NULL) ORDER BY b.region, b.weight, b.module", 'b', 'bid'), array_merge(array($theme_key), $rids));
+ $result = db_query(db_rewrite_sql("SELECT DISTINCT b.* FROM {blocks} b LEFT JOIN {blocks_roles} r ON b.module = r.module AND b.delta = r.delta WHERE b.theme = '%s' AND b.status = 1 AND (r.rid IN (" . db_placeholders($rids) . ") OR r.rid IS NULL) ORDER BY b.region, b.weight, b.module", 'b', 'bid'), array_merge(array($theme_key), $rids));
while ($block = db_fetch_object($result)) {
if (!isset($blocks[$block->region])) {
$blocks[$block->region] = array();
@@ -560,7 +560,7 @@ function _block_get_cache_id($block) {
// resource drag for sites with many users, so when a module is being
// equivocal, we favor the less expensive 'PER_ROLE' pattern.
if ($block->cache & BLOCK_CACHE_PER_ROLE) {
- $cid_parts[] = 'r.'. implode(',', array_keys($user->roles));
+ $cid_parts[] = 'r.' . implode(',', array_keys($user->roles));
}
elseif ($block->cache & BLOCK_CACHE_PER_USER) {
$cid_parts[] = "u.$user->uid";
diff --git a/modules/blog/blog.module b/modules/blog/blog.module
index 0e6f0a013..d483d48f9 100644
--- a/modules/blog/blog.module
+++ b/modules/blog/blog.module
@@ -61,11 +61,11 @@ function blog_user($type, &$edit, &$user) {
function blog_help($path, $arg) {
switch ($path) {
case 'admin/help#blog':
- $output = ''. t('The blog module allows registered users to maintain an online journal, or blog . Blogs are made up of individual blog entries , and the blog entries are most often displayed in descending order by creation time.') .'
';
- $output .= ''. t('There is an (optional) Blogs menu item added to the Navigation menu, which displays all blogs available on your site, and a My blog item displaying the current user\'s blog entries. The Blog entry menu item under Create content allows new blog entries to be created.') .'
';
- $output .= ''. t('Each blog entry is displayed with an automatic link to other blogs created by the same user. By default, blog entries have comments enabled and are automatically promoted to the site front page. The blog module also creates a Recent blog posts block that may be enabled at the blocks administration page .', array('@blocks' => url('admin/build/block'))) .'
';
- $output .= ''. t('When using the aggregator module an automatic blog it icon is displayed next to the items in a feed\'s latest items block. Clicking this icon populates a blog entry with a title (the title of the feed item) and body (a link to the source item on its original site and illustrative content suitable for use in a block quote). Blog authors can use this feature to easily comment on items of interest that appear in aggregator feeds from other sites. To use this feature, be sure to enable the aggregator module, add and configure a feed from another site, and position the feed\'s latest items block.', array('@modules' => url('admin/build/modules'), '@feeds' => url('admin/content/aggregator'), '@blocks' => url('admin/build/block'))) .'
';
- $output .= ''. t('For more information, see the online handbook entry for Blog module .', array('@blog' => 'http://drupal.org/handbook/modules/blog/')) .'
';
+ $output = '' . t('The blog module allows registered users to maintain an online journal, or blog . Blogs are made up of individual blog entries , and the blog entries are most often displayed in descending order by creation time.') . '
';
+ $output .= '' . t('There is an (optional) Blogs menu item added to the Navigation menu, which displays all blogs available on your site, and a My blog item displaying the current user\'s blog entries. The Blog entry menu item under Create content allows new blog entries to be created.') . '
';
+ $output .= '' . t('Each blog entry is displayed with an automatic link to other blogs created by the same user. By default, blog entries have comments enabled and are automatically promoted to the site front page. The blog module also creates a Recent blog posts block that may be enabled at the blocks administration page .', array('@blocks' => url('admin/build/block'))) . '
';
+ $output .= '' . t('When using the aggregator module an automatic blog it icon is displayed next to the items in a feed\'s latest items block. Clicking this icon populates a blog entry with a title (the title of the feed item) and body (a link to the source item on its original site and illustrative content suitable for use in a block quote). Blog authors can use this feature to easily comment on items of interest that appear in aggregator feeds from other sites. To use this feature, be sure to enable the aggregator module, add and configure a feed from another site, and position the feed\'s latest items block.', array('@modules' => url('admin/build/modules'), '@feeds' => url('admin/content/aggregator'), '@blocks' => url('admin/build/block'))) . '
';
+ $output .= '' . t('For more information, see the online handbook entry for Blog module .', array('@blog' => 'http://drupal.org/handbook/modules/blog/')) . '
';
return $output;
}
}
@@ -83,13 +83,13 @@ function blog_form(&$node) {
// If the user clicked a "blog it" link, we load the data from the
// database and quote it in the blog.
if ($nid && $blog = node_load($nid)) {
- $node->body = ''. $blog->body .' ['. l($blog->name, "node/$nid") .']';
+ $node->body = '' . $blog->body . ' [' . l($blog->name, "node/$nid") . ']';
}
if ($iid && $item = db_fetch_object(db_query('SELECT i.*, f.title as ftitle, f.link as flink FROM {aggregator_item} i, {aggregator_feed} f WHERE i.iid = %d AND i.fid = f.fid', $iid))) {
$node->title = $item->title;
// Note: $item->description has been validated on aggregation.
- $node->body = ''. check_plain($item->title) .' - '. $item->description .' ['. check_plain($item->ftitle) ." ]\n";
+ $node->body = '' . check_plain($item->title) . ' - ' . $item->description . ' [' . check_plain($item->ftitle) . " ]\n";
}
}
@@ -105,7 +105,7 @@ function blog_form(&$node) {
function blog_view($node, $teaser = FALSE, $page = FALSE) {
if ($page) {
// Breadcrumb navigation
- drupal_set_breadcrumb(array(l(t('Home'), NULL), l(t('Blogs'), 'blog'), l(t("@name's blog", array('@name' => $node->name)), 'blog/'. $node->uid)));
+ drupal_set_breadcrumb(array(l(t('Home'), NULL), l(t('Blogs'), 'blog'), l(t("@name's blog", array('@name' => $node->name)), 'blog/' . $node->uid)));
}
return node_prepare($node, $teaser);
}
diff --git a/modules/blog/blog.pages.inc b/modules/blog/blog.pages.inc
index 8548ede62..caa47a207 100644
--- a/modules/blog/blog.pages.inc
+++ b/modules/blog/blog.pages.inc
@@ -44,7 +44,7 @@ function blog_page_user($account) {
drupal_set_message(t('!author has not created any blog entries.', array('!author' => theme('username', $account))));
}
}
- drupal_add_feed(url('blog/'. $account->uid .'/feed'), t('RSS - !title', array('!title' => $title)));
+ drupal_add_feed(url('blog/' . $account->uid . '/feed'), t('RSS - !title', array('!title' => $title)));
return $output;
}
@@ -88,8 +88,8 @@ function blog_page_last() {
*/
function blog_feed_user($account) {
$result = db_query_range(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1 ORDER BY n.created DESC"), $account->uid, 0, variable_get('feed_default_items', 10));
- $channel['title'] = $account->name ."'s blog";
- $channel['link'] = url('blog/'. $account->uid, array('absolute' => TRUE));
+ $channel['title'] = $account->name . "'s blog";
+ $channel['link'] = url('blog/' . $account->uid, array('absolute' => TRUE));
$items = array();
while ($row = db_fetch_object($result)) {
@@ -103,7 +103,7 @@ function blog_feed_user($account) {
*/
function blog_feed_last() {
$result = db_query_range(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC"), 0, variable_get('feed_default_items', 10));
- $channel['title'] = variable_get('site_name', 'Drupal') .' blogs';
+ $channel['title'] = variable_get('site_name', 'Drupal') . ' blogs';
$channel['link'] = url('blog', array('absolute' => TRUE));
$items = array();
diff --git a/modules/blogapi/blogapi.install b/modules/blogapi/blogapi.install
index c7cc3e561..1855b4935 100644
--- a/modules/blogapi/blogapi.install
+++ b/modules/blogapi/blogapi.install
@@ -10,7 +10,7 @@
* Inform users about the new permission.
*/
function blogapi_update_6000() {
- drupal_set_message("Blog API module does not depend on blog module's permissions anymore, but provides its own 'administer content with blog api' permission instead. Until 'module-blogapi')) .'">this permission is assigned to at least one user role, only the site administrator will be able to use Blog API features.');
+ drupal_set_message("Blog API module does not depend on blog module's permissions anymore, but provides its own 'administer content with blog api' permission instead. Until 'module-blogapi')) . '">this permission is assigned to at least one user role, only the site administrator will be able to use Blog API features.');
return array();
}
diff --git a/modules/blogapi/blogapi.module b/modules/blogapi/blogapi.module
index b23f288d4..598e14a3f 100644
--- a/modules/blogapi/blogapi.module
+++ b/modules/blogapi/blogapi.module
@@ -12,10 +12,10 @@
function blogapi_help($path, $arg) {
switch ($path) {
case 'admin/help#blogapi':
- $output = ''. t("The Blog API module allows your site's users to access and post to their blogs from external blogging clients. External blogging clients are available for a wide range of desktop operating systems, and generally provide a feature-rich graphical environment for creating and editing posts.") .'
';
- $output .= ''. t('Ecto , a blogging client available for both Mac OS X and Microsoft Windows, can be used with Blog API. Blog API also supports Blogger API , MetaWeblog API , and most of the Movable Type API . Blogging clients and other services (e.g. Flickr\'s "post to blog") that support these APIs may also be compatible.', array('@ecto-link' => url('http://infinite-sushi.com/software/ecto/'), '@blogger-api' => url('http://www.blogger.com/developers/api/1_docs/'), '@metaweblog-api' => url('http://www.xmlrpc.com/metaWeblogApi'), '@movabletype-api' => url('http://www.movabletype.org/docs/mtmanual_programmatic.html'), '@flickr' => url('http://www.flickr.com'))) .'
';
- $output .= ''. t('Select the content types available to external clients on the Blog API settings page . If supported and available, each content type will be displayed as a separate "blog" by the external client.', array('@blogapi-settings' => url('admin/settings/blogapi'))) .'
';
- $output .= ''. t('For more information, see the online handbook entry for Blog API module .', array('@blogapi' => url('http://drupal.org/handbook/modules/blogapi/'))) .'
';
+ $output = '' . t("The Blog API module allows your site's users to access and post to their blogs from external blogging clients. External blogging clients are available for a wide range of desktop operating systems, and generally provide a feature-rich graphical environment for creating and editing posts.") . '
';
+ $output .= '' . t('Ecto , a blogging client available for both Mac OS X and Microsoft Windows, can be used with Blog API. Blog API also supports Blogger API , MetaWeblog API , and most of the Movable Type API . Blogging clients and other services (e.g. Flickr\'s "post to blog") that support these APIs may also be compatible.', array('@ecto-link' => url('http://infinite-sushi.com/software/ecto/'), '@blogger-api' => url('http://www.blogger.com/developers/api/1_docs/'), '@metaweblog-api' => url('http://www.xmlrpc.com/metaWeblogApi'), '@movabletype-api' => url('http://www.movabletype.org/docs/mtmanual_programmatic.html'), '@flickr' => url('http://www.flickr.com'))) . '
';
+ $output .= '' . t('Select the content types available to external clients on the Blog API settings page . If supported and available, each content type will be displayed as a separate "blog" by the external client.', array('@blogapi-settings' => url('admin/settings/blogapi'))) . '
';
+ $output .= '' . t('For more information, see the online handbook entry for Blog API module .', array('@blogapi' => url('http://drupal.org/handbook/modules/blogapi/'))) . '
';
return $output;
}
}
@@ -147,7 +147,7 @@ function blogapi_blogger_get_users_blogs($appid, $username, $password) {
$types = _blogapi_get_node_types();
$structs = array();
foreach ($types as $type) {
- $structs[] = array('url' => url('blog/'. $user->uid, array('absolute' => TRUE)), 'blogid' => $type, 'blogName' => $user->name .": ". $type);
+ $structs[] = array('url' => url('blog/' . $user->uid, array('absolute' => TRUE)), 'blogid' => $type, 'blogName' => $user->name . ": " . $type);
}
return $structs;
}
@@ -170,7 +170,7 @@ function blogapi_blogger_get_user_info($appkey, $username, $password) {
'firstname' => $name[0],
'nickname' => $user->name,
'email' => $user->mail,
- 'url' => url('blog/'. $user->uid, array('absolute' => TRUE)));
+ 'url' => url('blog/' . $user->uid, array('absolute' => TRUE)));
}
else {
return blogapi_error($user);
@@ -194,11 +194,11 @@ function blogapi_blogger_new_post($appkey, $blogid, $username, $password, $conte
$edit = array();
$edit['type'] = $blogid;
// get the node type defaults
- $node_type_default = variable_get('node_options_'. $edit['type'], array('status', 'promote'));
+ $node_type_default = variable_get('node_options_' . $edit['type'], array('status', 'promote'));
$edit['uid'] = $user->uid;
$edit['name'] = $user->name;
$edit['promote'] = in_array('promote', $node_type_default);
- $edit['comment'] = variable_get('comment_'. $edit['type'], 2);
+ $edit['comment'] = variable_get('comment_' . $edit['type'], 2);
$edit['revision'] = in_array('revision', $node_type_default);
$edit['format'] = FILTER_FORMAT_DEFAULT;
$edit['status'] = $publish;
@@ -405,7 +405,7 @@ function blogapi_metaweblog_get_category_list($blogid, $username, $password) {
foreach ($terms as $term) {
$term_name = $term->name;
foreach (module_invoke('taxonomy', 'get_parents', $term->tid, 'tid') as $parent) {
- $term_name = $parent->name .'/'. $term_name;
+ $term_name = $parent->name . '/' . $term_name;
}
$categories[] = array('categoryName' => $term_name, 'categoryId' => $term->tid);
}
@@ -442,7 +442,7 @@ function blogapi_mt_get_post_categories($postid, $username, $password) {
foreach ($terms as $term) {
$term_name = $term->name;
foreach (module_invoke('taxonomy', 'get_parents', $term->tid, 'tid') as $parent) {
- $term_name = $parent->name .'/'. $term_name;
+ $term_name = $parent->name . '/' . $term_name;
}
$categories[] = array('categoryName' => $term_name, 'categoryId' => $term->tid, 'isPrimary' => TRUE);
}
@@ -604,7 +604,7 @@ function blogapi_init() {
function blogapi_rsd() {
global $base_url;
- $xmlrpc = $base_url .'/xmlrpc.php';
+ $xmlrpc = $base_url . '/xmlrpc.php';
$base = url('', array('absolute' => TRUE));
$blogid = 1; # until we figure out how to handle multiple bloggers
@@ -653,10 +653,10 @@ function _blogapi_mt_extra(&$node, $struct) {
// merge the 3 body sections (description, mt_excerpt, mt_text_more) into
// one body
if ($struct['mt_excerpt']) {
- $node->body = $struct['mt_excerpt'] .''. $node->body;
+ $node->body = $struct['mt_excerpt'] . '' . $node->body;
}
if ($struct['mt_text_more']) {
- $node->body = $node->body .''. $struct['mt_text_more'];
+ $node->body = $node->body . '' . $struct['mt_text_more'];
}
// mt_convert_breaks
@@ -680,8 +680,8 @@ function _blogapi_get_post($node, $bodies = TRUE) {
'dateCreated' => xmlrpc_date($node->created),
'title' => $node->title,
'postid' => $node->nid,
- 'link' => url('node/'. $node->nid, array('absolute' => TRUE)),
- 'permaLink' => url('node/'. $node->nid, array('absolute' => TRUE)),
+ 'link' => url('node/' . $node->nid, array('absolute' => TRUE)),
+ 'permaLink' => url('node/' . $node->nid, array('absolute' => TRUE)),
);
if ($bodies) {
if ($node->comment == 1) {
diff --git a/modules/book/book.admin.inc b/modules/book/book.admin.inc
index ed53c6926..1b9bb30bf 100644
--- a/modules/book/book.admin.inc
+++ b/modules/book/book.admin.inc
@@ -12,7 +12,7 @@
function book_admin_overview() {
$rows = array();
foreach (book_get_books() as $book) {
- $rows[] = array(l($book['title'], $book['href'], $book['options']), l(t('edit order and titles'), "admin/content/book/". $book['nid']));
+ $rows[] = array(l($book['title'], $book['href'], $book['options']), l(t('edit order and titles'), "admin/content/book/" . $book['nid']));
}
$headers = array(t('Book'), t('Operations'));
@@ -115,7 +115,7 @@ function book_admin_edit_submit($form, &$form_state) {
$node->revision = 1;
$node->log = t('Title changed from %original to %current.', array('%original' => $node->title, '%current' => $values['title']));
node_save($node);
- watchdog('content', 'book: updated %title.', array('%title' => $node->title), WATCHDOG_NOTICE, l(t('view'), 'node/'. $node->nid));
+ watchdog('content', 'book: updated %title.', array('%title' => $node->title), WATCHDOG_NOTICE, l(t('view'), 'node/' . $node->nid));
}
}
}
@@ -212,14 +212,14 @@ function theme_book_admin_table($form) {
drupal_render($form[$key]['weight']),
drupal_render($form[$key]['plid']) . drupal_render($form[$key]['mlid']),
l(t('view'), $href),
- $access ? l(t('edit'), 'node/'. $nid .'/edit', array('query' => $destination)) : ' ',
- $access ? l(t('delete'), 'node/'. $nid .'/delete', array('query' => $destination) ) : ' ',
+ $access ? l(t('edit'), 'node/' . $nid . '/edit', array('query' => $destination)) : ' ',
+ $access ? l(t('delete'), 'node/' . $nid . '/delete', array('query' => $destination) ) : ' ',
);
$row = array('data' => $data);
if (isset($form[$key]['#attributes'])) {
$row = array_merge($row, $form[$key]['#attributes']);
}
- $row['class'] = empty($row['class']) ? 'draggable' : $row['class'] .' draggable';
+ $row['class'] = empty($row['class']) ? 'draggable' : $row['class'] . ' draggable';
$rows[] = $row;
}
diff --git a/modules/book/book.install b/modules/book/book.install
index 88ed1a64a..7b8cbf473 100644
--- a/modules/book/book.install
+++ b/modules/book/book.install
@@ -212,9 +212,9 @@ function book_update_6000() {
$book += array(
'module' => 'book',
- 'link_path' => 'node/'. $book['nid'],
+ 'link_path' => 'node/' . $book['nid'],
'router_path' => 'node/%',
- 'menu_name' => 'book-toc-'. $book['bid'],
+ 'menu_name' => 'book-toc-' . $book['bid'],
);
$book = array_merge($book, db_fetch_array(db_query("SELECT title AS link_title FROM {node} WHERE nid = %d", $book['nid'])));
diff --git a/modules/book/book.module b/modules/book/book.module
index ff94c662a..cc58531ee 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -60,14 +60,14 @@ function book_link($type, $node = NULL, $teaser = FALSE) {
if ((user_access('add content to books') || user_access('administer book outlines')) && node_access('create', $child_type) && $node->status == 1 && $node->book['depth'] < MENU_MAX_DEPTH) {
$links['book_add_child'] = array(
'title' => t('Add child page'),
- 'href' => "node/add/". str_replace('_', '-', $child_type),
- 'query' => "parent=". $node->book['mlid'],
+ 'href' => "node/add/" . str_replace('_', '-', $child_type),
+ 'query' => "parent=" . $node->book['mlid'],
);
}
if (user_access('access printer-friendly version')) {
$links['book_printer'] = array(
'title' => t('Printer-friendly version'),
- 'href' => 'book/export/html/'. $node->nid,
+ 'href' => 'book/export/html/' . $node->nid,
'attributes' => array('title' => t('Show a printer-friendly version of this book page and its sub-pages.'))
);
}
@@ -169,7 +169,7 @@ function _book_outline_remove_access($node) {
* Implementation of hook_init(). Add's the book module's CSS.
*/
function book_init() {
- drupal_add_css(drupal_get_path('module', 'book') .'/book.css');
+ drupal_add_css(drupal_get_path('module', 'book') . '/book.css');
}
/**
@@ -269,7 +269,7 @@ function book_get_books() {
$nids[] = $book['bid'];
}
if ($nids) {
- $result2 = db_query(db_rewrite_sql("SELECT n.type, n.title, b.*, ml.* FROM {book} b INNER JOIN {node} n on b.nid = n.nid INNER JOIN {menu_links} ml ON b.mlid = ml.mlid WHERE n.nid IN (". implode(',', $nids) .") AND n.status = 1 ORDER BY ml.weight, ml.link_title"));
+ $result2 = db_query(db_rewrite_sql("SELECT n.type, n.title, b.*, ml.* FROM {book} b INNER JOIN {node} n on b.nid = n.nid INNER JOIN {menu_links} ml ON b.mlid = ml.mlid WHERE n.nid IN (" . implode(',', $nids) . ") AND n.status = 1 ORDER BY ml.weight, ml.link_title"));
while ($link = db_fetch_array($result2)) {
$link['href'] = $link['link_path'];
$link['options'] = unserialize($link['options']);
@@ -288,7 +288,7 @@ function book_get_books() {
*/
function book_form_alter(&$form, $form_state, $form_id) {
- if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'] .'_node_form' == $form_id) {
+ if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'] . '_node_form' == $form_id) {
// Add elements to the node form
$node = $form['#node'];
@@ -339,14 +339,14 @@ function _book_parent_select($book_link) {
if ($book_link['nid'] === $book_link['bid']) {
// This is a book - at the top level.
if ($book_link['original_bid'] === $book_link['bid']) {
- $form['#prefix'] .= ''. t('This is the top-level page in this book.') .' ';
+ $form['#prefix'] .= '' . t('This is the top-level page in this book.') . ' ';
}
else {
- $form['#prefix'] .= ''. t('This will be the top-level page in this book.') .' ';
+ $form['#prefix'] .= '' . t('This will be the top-level page in this book.') . ' ';
}
}
elseif (!$book_link['bid']) {
- $form['#prefix'] .= ''. t('No book selected.') .' ';
+ $form['#prefix'] .= '' . t('No book selected.') . ' ';
}
else {
$form = array(
@@ -410,11 +410,11 @@ function _book_add_form_elements(&$form, $node) {
if (user_access('create new books') && ($nid == 'new' || ($nid != $node->book['original_bid']))) {
// The node can become a new book, if it is not one already.
- $options = array($nid => '<'. t('create a new book') .'>') + $options;
+ $options = array($nid => '<' . t('create a new book') . '>') + $options;
}
if (!$node->book['mlid']) {
// The node is not currently in a the hierarchy.
- $options = array(0 => '<'. t('none') .'>') + $options;
+ $options = array(0 => '<' . t('none') . '>') + $options;
}
// Add a drop-down to select the destination book.
@@ -447,7 +447,7 @@ function _book_update_outline(&$node) {
}
$new = empty($node->book['mlid']);
- $node->book['link_path'] = 'node/'. $node->nid;
+ $node->book['link_path'] = 'node/' . $node->nid;
$node->book['link_title'] = $node->title;
$node->book['parent_mismatch'] = FALSE; // The normal case.
@@ -494,14 +494,14 @@ function book_update_bid($book_link) {
$match[] = "p$i = %d";
$args[] = $book_link["p$i"];
}
- $result = db_query("SELECT mlid FROM {menu_links} WHERE ". implode(' AND ', $match), $args);
+ $result = db_query("SELECT mlid FROM {menu_links} WHERE " . implode(' AND ', $match), $args);
$mlids = array();
while ($a = db_fetch_array($result)) {
$mlids[] = $a['mlid'];
}
if ($mlids) {
- db_query("UPDATE {book} SET bid = %d WHERE mlid IN (". implode(',', $mlids) .")", $book_link['bid']);
+ db_query("UPDATE {book} SET bid = %d WHERE mlid IN (" . implode(',', $mlids) . ")", $book_link['bid']);
}
}
@@ -616,7 +616,7 @@ function book_children($book_link) {
* Generate the corresponding menu name from a book ID.
*/
function book_menu_name($bid) {
- return 'book-toc-'. $bid;
+ return 'book-toc-' . $bid;
}
/**
@@ -765,7 +765,7 @@ function book_form_node_delete_confirm_alter(&$form, $form_state) {
if (isset($node->book) && $node->book['has_children']) {
$form['book_warning'] = array(
- '#value' => ''. t('%title is part of a book outline, and has associated child pages. If you proceed with deletion, the child pages will be relocated automatically.', array('%title' => $node->title)) .'
',
+ '#value' => '' . t('%title is part of a book outline, and has associated child pages. If you proceed with deletion, the child pages will be relocated automatically.', array('%title' => $node->title)) . '
',
'#weight' => -10,
);
}
@@ -792,7 +792,7 @@ function template_preprocess_book_navigation(&$variables) {
// Provide extra variables for themers. Not needed by default.
$variables['book_id'] = $book_link['bid'];
$variables['book_title'] = check_plain($book_link['link_title']);
- $variables['book_url'] = 'node/'. $book_link['bid'];
+ $variables['book_url'] = 'node/' . $book_link['bid'];
$variables['current_depth'] = $book_link['depth'];
$variables['tree'] = '';
@@ -844,9 +844,9 @@ function _book_toc_recurse($tree, $indent, &$toc, $exclude, $depth_limit) {
break;
}
if (!in_array($data['link']['mlid'], $exclude)) {
- $toc[$data['link']['mlid']] = $indent .' '. truncate_utf8($data['link']['title'], 30, TRUE, TRUE);
+ $toc[$data['link']['mlid']] = $indent . ' ' . truncate_utf8($data['link']['title'], 30, TRUE, TRUE);
if ($data['below']) {
- _book_toc_recurse($data['below'], $indent .'--', $toc, $exclude, $depth_limit);
+ _book_toc_recurse($data['below'], $indent . '--', $toc, $exclude, $depth_limit);
}
}
}
@@ -1008,17 +1008,17 @@ function book_node_type($op, $type) {
function book_help($path, $arg) {
switch ($path) {
case 'admin/help#book':
- $output = ''. t('The book module is suited for creating structured, multi-page hypertexts such as site resource guides, manuals, and Frequently Asked Questions (FAQs). It permits a document to have chapters, sections, subsections, etc. Authors with suitable permissions can add pages to a collaborative book, placing them into the existing document by adding them to a table of contents menu.') .'
';
- $output .= ''. t('Pages in the book hierarchy have navigation elements at the bottom of the page for moving through the text. These links lead to the previous and next pages in the book, and to the level above the current page in the book\'s structure. More comprehensive navigation may be provided by enabling the book navigation block on the blocks administration page .', array('@admin-block' => url('admin/build/block'))) .'
';
- $output .= ''. t('Users can select the printer-friendly version link visible at the bottom of a book page to generate a printer-friendly display of the page and all of its subsections. ') .'
';
- $output .= ''. t("Users with the administer book outlines permission can add a post of any content type to a book, by selecting the appropriate book while editing the post or by using the interface available on the post's outline tab.") .'
';
- $output .= ''. t('Administrators can view a list of all books on the book administration page . The Outline page for each book allows section titles to be edited or rearranged.', array('@admin-node-book' => url('admin/content/book'))) .'
';
- $output .= ''. t('For more information, see the online handbook entry for Book module .', array('@book' => 'http://drupal.org/handbook/modules/book/')) .'
';
+ $output = '' . t('The book module is suited for creating structured, multi-page hypertexts such as site resource guides, manuals, and Frequently Asked Questions (FAQs). It permits a document to have chapters, sections, subsections, etc. Authors with suitable permissions can add pages to a collaborative book, placing them into the existing document by adding them to a table of contents menu.') . '
';
+ $output .= '' . t('Pages in the book hierarchy have navigation elements at the bottom of the page for moving through the text. These links lead to the previous and next pages in the book, and to the level above the current page in the book\'s structure. More comprehensive navigation may be provided by enabling the book navigation block on the blocks administration page .', array('@admin-block' => url('admin/build/block'))) . '
';
+ $output .= '' . t('Users can select the printer-friendly version link visible at the bottom of a book page to generate a printer-friendly display of the page and all of its subsections. ') . '
';
+ $output .= '' . t("Users with the administer book outlines permission can add a post of any content type to a book, by selecting the appropriate book while editing the post or by using the interface available on the post's outline tab.") . '
';
+ $output .= '' . t('Administrators can view a list of all books on the book administration page . The Outline page for each book allows section titles to be edited or rearranged.', array('@admin-node-book' => url('admin/content/book'))) . '
';
+ $output .= '' . t('For more information, see the online handbook entry for Book module .', array('@book' => 'http://drupal.org/handbook/modules/book/')) . '
';
return $output;
case 'admin/content/book':
- return ''. t('The book module offers a means to organize a collection of related posts, collectively known as a book. When viewed, these posts automatically display links to adjacent book pages, providing a simple navigation system for creating and reviewing structured content.') .'
';
+ return '' . t('The book module offers a means to organize a collection of related posts, collectively known as a book. When viewed, these posts automatically display links to adjacent book pages, providing a simple navigation system for creating and reviewing structured content.') . '
';
case 'node/%/outline':
- return ''. t('The outline feature allows you to include posts in the book hierarchy , as well as move them within the hierarchy or to reorder an entire book .', array('@book' => url('book'), '@book-admin' => url('admin/content/book'))) .'
';
+ return '' . t('The outline feature allows you to include posts in the book hierarchy , as well as move them within the hierarchy or to reorder an entire book .', array('@book' => url('book'), '@book-admin' => url('admin/content/book'))) . '
';
}
}
@@ -1050,7 +1050,7 @@ function book_menu_subtree_data($item) {
static $tree = array();
// Generate a cache ID (cid) specific for this $menu_name and $item.
- $cid = 'links:'. $item['menu_name'] .':subtree-cid:'. $item['mlid'];
+ $cid = 'links:' . $item['menu_name'] . ':subtree-cid:' . $item['mlid'];
if (!isset($tree[$cid])) {
$cache = cache_get($cid, 'cache_menu');
@@ -1076,14 +1076,14 @@ function book_menu_subtree_data($item) {
SELECT b.*, m.load_functions, m.to_arg_functions, m.access_callback, m.access_arguments, m.page_callback, m.page_arguments, m.title, m.title_callback, m.title_arguments, m.type, ml.*
FROM {menu_links} ml INNER JOIN {menu_router} m ON m.path = ml.router_path
INNER JOIN {book} b ON ml.mlid = b.mlid
- WHERE ". implode(' AND ', $match) ."
+ WHERE " . implode(' AND ', $match) . "
ORDER BY p1 ASC, p2 ASC, p3 ASC, p4 ASC, p5 ASC, p6 ASC, p7 ASC, p8 ASC, p9 ASC";
$data['tree'] = menu_tree_data(db_query($sql, $args), array(), $item['depth']);
$data['node_links'] = array();
menu_tree_collect_node_links($data['tree'], $data['node_links']);
// Compute the real cid for book subtree data.
- $tree_cid = 'links:'. $menu_name .':subtree-data:'. md5(serialize($data));
+ $tree_cid = 'links:' . $menu_name . ':subtree-data:' . md5(serialize($data));
// Cache the data, if it is not already in the cache.
if (!cache_get($tree_cid, 'cache_menu')) {
cache_set($tree_cid, $data, 'cache_menu');
diff --git a/modules/book/book.pages.inc b/modules/book/book.pages.inc
index a744e97a4..72121c808 100644
--- a/modules/book/book.pages.inc
+++ b/modules/book/book.pages.inc
@@ -43,7 +43,7 @@ function book_export($type, $nid) {
$type = drupal_strtolower($type);
- $export_function = 'book_export_'. $type;
+ $export_function = 'book_export_' . $type;
if (function_exists($export_function)) {
print call_user_func($export_function, $nid);
@@ -144,7 +144,7 @@ function book_outline_form(&$form_state, $node) {
* @see book_outline_form()
*/
function book_remove_button_submit($form, &$form_state) {
- $form_state['redirect'] = 'node/'. $form['#node']->nid .'/outline/remove';
+ $form_state['redirect'] = 'node/' . $form['#node']->nid . '/outline/remove';
}
/**
@@ -154,7 +154,7 @@ function book_remove_button_submit($form, &$form_state) {
*/
function book_outline_form_submit($form, &$form_state) {
$node = $form['#node'];
- $form_state['redirect'] = "node/". $node->nid;
+ $form_state['redirect'] = "node/" . $node->nid;
$book_link = $form_state['values']['book'];
if (!$book_link['bid']) {
drupal_set_message(t('No changes were made'));
@@ -167,7 +167,7 @@ function book_outline_form_submit($form, &$form_state) {
if ($node->book['parent_mismatch']) {
// This will usually only happen when JS is disabled.
drupal_set_message(t('The post has been added to the selected book. You may now position it relative to other pages.'));
- $form_state['redirect'] = "node/". $node->nid ."/outline";
+ $form_state['redirect'] = "node/" . $node->nid . "/outline";
}
else {
drupal_set_message(t('The book outline has been updated.'));
@@ -196,7 +196,7 @@ function book_remove_form(&$form_state, $node) {
$description = t('%title may be added to hierarchy again using the Outline tab.', $title);
}
- return confirm_form($form, t('Are you sure you want to remove %title from the book hierarchy?', $title), 'node/'. $node->nid, $description, t('Remove'));
+ return confirm_form($form, t('Are you sure you want to remove %title from the book hierarchy?', $title), 'node/' . $node->nid, $description, t('Remove'));
}
/**
@@ -212,7 +212,7 @@ function book_remove_form_submit($form, &$form_state) {
db_query('DELETE FROM {book} WHERE nid = %d', $node->nid);
drupal_set_message(t('The post has been removed from the book.'));
}
- $form_state['redirect'] = 'node/'. $node->nid;
+ $form_state['redirect'] = 'node/' . $node->nid;
}
/**
@@ -231,7 +231,7 @@ function book_remove_form_submit($form, &$form_state) {
* Prints the replacement HTML in JSON format.
*/
function book_form_update() {
- $cid = 'form_'. $_POST['form_build_id'];
+ $cid = 'form_' . $_POST['form_build_id'];
$bid = $_POST['book']['bid'];
$cache = cache_get($cid, 'cache_form');
if ($cache) {
diff --git a/modules/color/color.module b/modules/color/color.module
index 5fa207014..b7491344f 100644
--- a/modules/color/color.module
+++ b/modules/color/color.module
@@ -7,10 +7,10 @@
function color_help($path, $arg) {
switch ($path) {
case 'admin/help#color':
- $output = ''. t('The color module allows a site administrator to quickly and easily change the color scheme of certain themes. Although not all themes support color module, both Garland (the default theme) and Minnelli were designed to take advantage of its features. By using color module with a compatible theme, you can easily change the color of links, backgrounds, text, and other theme elements. Color module requires that your file download method be set to public.', array('@url' => url('admin/settings/file-system'))) .'
';
- $output .= ''. t("It is important to remember that color module saves a modified copy of the theme's specified stylesheets in the files directory. This means that if you make any manual changes to your theme's stylesheet, you must save your color settings again, even if they haven't changed. This causes the color module generated version of the stylesheets in the files directory to be recreated using the new version of the original file.") .'
';
- $output .= ''. t('To change the color settings for a compatible theme, select the "configure" link for the theme on the themes administration page .', array('@themes' => url('admin/build/themes'))) .'
';
- $output .= ''. t('For more information, see the online handbook entry for Color module .', array('@color' => 'http://drupal.org/handbook/modules/color/')) .'
';
+ $output = '' . t('The color module allows a site administrator to quickly and easily change the color scheme of certain themes. Although not all themes support color module, both Garland (the default theme) and Minnelli were designed to take advantage of its features. By using color module with a compatible theme, you can easily change the color of links, backgrounds, text, and other theme elements. Color module requires that your file download method be set to public.', array('@url' => url('admin/settings/file-system'))) . '
';
+ $output .= '' . t("It is important to remember that color module saves a modified copy of the theme's specified stylesheets in the files directory. This means that if you make any manual changes to your theme's stylesheet, you must save your color settings again, even if they haven't changed. This causes the color module generated version of the stylesheets in the files directory to be recreated using the new version of the original file.") . '
';
+ $output .= '' . t('To change the color settings for a compatible theme, select the "configure" link for the theme on the themes administration page .', array('@themes' => url('admin/build/themes'))) . '
';
+ $output .= '' . t('For more information, see the online handbook entry for Color module .', array('@color' => 'http://drupal.org/handbook/modules/color/')) . '
';
return $output;
}
}
@@ -54,7 +54,7 @@ function color_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'system_theme_select_form' || $form_id == 'system_themes') {
$themes = list_themes();
foreach (element_children($form) as $theme) {
- if ($screenshot = variable_get('color_'. $theme .'_screenshot', NULL)) {
+ if ($screenshot = variable_get('color_' . $theme . '_screenshot', NULL)) {
if (isset($form[$theme]['screenshot'])) {
$form[$theme]['screenshot']['#value'] = theme('image', $screenshot, '', '', array('class' => 'screenshot'), FALSE);
}
@@ -70,7 +70,7 @@ function _color_page_alter(&$vars) {
global $language, $theme_key;
// Override stylesheets.
- $color_paths = variable_get('color_'. $theme_key .'_stylesheets', array());
+ $color_paths = variable_get('color_' . $theme_key . '_stylesheets', array());
if (!empty($color_paths)) {
// Loop over theme CSS files and try to rebuild CSS array with rewritten
// stylesheets. Keep the orginal order intact for CSS cascading.
@@ -110,8 +110,8 @@ function _color_page_alter(&$vars) {
}
// Override logo.
- $logo = variable_get('color_'. $theme_key .'_logo', NULL);
- if ($logo && $vars['logo'] && preg_match('!'. $theme_key .'/logo.png$!', $vars['logo'])) {
+ $logo = variable_get('color_' . $theme_key . '_logo', NULL);
+ if ($logo && $vars['logo'] && preg_match('!' . $theme_key . '/logo.png$!', $vars['logo'])) {
$vars['logo'] = base_path() . $logo;
}
}
@@ -121,7 +121,7 @@ function _color_page_alter(&$vars) {
*/
function color_get_info($theme) {
$path = drupal_get_path('theme', $theme);
- $file = $path .'/color/color.inc';
+ $file = $path . '/color/color.inc';
if ($path && file_exists($file)) {
include $file;
return $info;
@@ -141,7 +141,7 @@ function color_get_palette($theme, $default = false) {
}
// Load variable
- return $default ? $palette : variable_get('color_'. $theme .'_palette', $palette);
+ return $default ? $palette : variable_get('color_' . $theme . '_palette', $palette);
}
/**
@@ -156,14 +156,14 @@ function color_scheme_form(&$form_state, $theme) {
drupal_add_js('misc/farbtastic/farbtastic.js');
// Add custom CSS/JS
- drupal_add_css($base .'/color.css', 'module', 'all', FALSE);
- drupal_add_js($base .'/color.js');
+ drupal_add_css($base . '/color.css', 'module', 'all', FALSE);
+ drupal_add_js($base . '/color.js');
drupal_add_js(array('color' => array(
'reference' => color_get_palette($theme, true)
)), 'setting');
// See if we're using a predefined scheme
- $current = implode(',', variable_get('color_'. $theme .'_palette', array()));
+ $current = implode(',', variable_get('color_' . $theme . '_palette', array()));
// Note: we use the original theme when the default scheme is chosen.
$current = isset($info['schemes'][$current]) ? $current : ($current == '' ? reset($info['schemes']) : '');
@@ -209,7 +209,7 @@ function theme_color_scheme_form($form) {
// Include stylesheet
$theme = $form['theme']['#value'];
$info = $form['info']['#value'];
- $path = drupal_get_path('theme', $theme) .'/';
+ $path = drupal_get_path('theme', $theme) . '/';
drupal_add_css($path . $info['preview_css']);
$output = '';
// Wrapper
@@ -227,8 +227,8 @@ function theme_color_scheme_form($form) {
// Preview
$output .= drupal_render($form);
- $output .= ''. t('Preview') .' ';
- $output .= 'Lorem ipsum dolor Sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
';
+ $output .= '' . t('Preview') . ' ';
+ $output .= 'Lorem ipsum dolor Sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
';
// Close wrapper
$output .= '';
@@ -259,7 +259,7 @@ function color_scheme_form_submit($form, &$form_state) {
// Make sure enough memory is available, if PHP's memory limit is compiled in.
if (function_exists('memory_get_usage')) {
// Fetch source image dimensions.
- $source = drupal_get_path('theme', $theme) .'/'. $info['base_image'];
+ $source = drupal_get_path('theme', $theme) . '/' . $info['base_image'];
list($width, $height) = getimagesize($source);
// We need at least a copy of the source and a target buffer of the same
@@ -274,7 +274,7 @@ function color_scheme_form_submit($form, &$form_state) {
}
// Delete old files
- foreach (variable_get('color_'. $theme .'_files', array()) as $file) {
+ foreach (variable_get('color_' . $theme . '_files', array()) as $file) {
@unlink($file);
}
if (isset($file) && $file = dirname($file)) {
@@ -284,29 +284,29 @@ function color_scheme_form_submit($form, &$form_state) {
// Don't render the default colorscheme, use the standard theme instead.
if (implode(',', color_get_palette($theme, true)) == implode(',', $palette)
|| $form_state['values']['op'] == t('Reset to defaults')) {
- variable_del('color_'. $theme .'_palette');
- variable_del('color_'. $theme .'_stylesheets');
- variable_del('color_'. $theme .'_logo');
- variable_del('color_'. $theme .'_files');
- variable_del('color_'. $theme .'_screenshot');
+ variable_del('color_' . $theme . '_palette');
+ variable_del('color_' . $theme . '_stylesheets');
+ variable_del('color_' . $theme . '_logo');
+ variable_del('color_' . $theme . '_files');
+ variable_del('color_' . $theme . '_screenshot');
return;
}
// Prepare target locations for generated files.
- $id = $theme .'-'. substr(md5(serialize($palette) . microtime()), 0, 8);
- $paths['color'] = file_directory_path() .'/color';
- $paths['target'] = $paths['color'] .'/'. $id;
+ $id = $theme . '-' . substr(md5(serialize($palette) . microtime()), 0, 8);
+ $paths['color'] = file_directory_path() . '/color';
+ $paths['target'] = $paths['color'] . '/' . $id;
foreach ($paths as $path) {
file_check_directory($path, FILE_CREATE_DIRECTORY);
}
- $paths['target'] = $paths['target'] .'/';
+ $paths['target'] = $paths['target'] . '/';
$paths['id'] = $id;
- $paths['source'] = drupal_get_path('theme', $theme) .'/';
+ $paths['source'] = drupal_get_path('theme', $theme) . '/';
$paths['files'] = $paths['map'] = array();
// Save palette and logo location.
- variable_set('color_'. $theme .'_palette', $palette);
- variable_set('color_'. $theme .'_logo', $paths['target'] .'logo.png');
+ variable_set('color_' . $theme . '_palette', $palette);
+ variable_set('color_' . $theme . '_logo', $paths['target'] . 'logo.png');
// Copy over neutral images.
foreach ($info['copy'] as $file) {
@@ -344,7 +344,7 @@ function color_scheme_form_submit($form, &$form_state) {
// Return the path to where this CSS file originated from, stripping
// off the name of the file at the end of the path.
- $base = base_path() . dirname($paths['source'] . $file) .'/';
+ $base = base_path() . dirname($paths['source'] . $file) . '/';
_drupal_build_css_path(NULL, $base);
// Prefix all paths within this CSS file, ignoring absolute paths.
@@ -359,8 +359,8 @@ function color_scheme_form_submit($form, &$form_state) {
}
// Maintain list of files.
- variable_set('color_'. $theme .'_stylesheets', $css);
- variable_set('color_'. $theme .'_files', $paths['files']);
+ variable_set('color_' . $theme . '_stylesheets', $css);
+ variable_set('color_' . $theme . '_files', $paths['files']);
}
/**
@@ -455,7 +455,7 @@ function _color_save_stylesheet($file, $style, &$paths) {
function _color_render_images($theme, &$info, &$paths, $palette) {
// Prepare template image.
- $source = $paths['source'] .'/'. $info['base_image'];
+ $source = $paths['source'] . '/' . $info['base_image'];
$source = imagecreatefrompng($source);
$width = imagesx($source);
$height = imagesy($source);
@@ -491,7 +491,7 @@ function _color_render_images($theme, &$info, &$paths, $palette) {
if ($file == 'screenshot.png') {
$slice = imagecreatetruecolor(150, 90);
imagecopyresampled($slice, $target, 0, 0, $x, $y, 150, 90, $width, $height);
- variable_set('color_'. $theme .'_screenshot', $image);
+ variable_set('color_' . $theme . '_screenshot', $image);
}
else {
$slice = imagecreatetruecolor($width, $height);
@@ -617,7 +617,7 @@ function _color_pack($rgb, $normalize = false) {
foreach ($rgb as $k => $v) {
$out |= (($v * ($normalize ? 255 : 1)) << (16 - $k * 8));
}
- return '#'. str_pad(dechex($out), 6, 0, STR_PAD_LEFT);
+ return '#' . str_pad(dechex($out), 6, 0, STR_PAD_LEFT);
}
/**
diff --git a/modules/comment/comment-folded.tpl.php b/modules/comment/comment-folded.tpl.php
index 016656bfb..37f77a5a8 100644
--- a/modules/comment/comment-folded.tpl.php
+++ b/modules/comment/comment-folded.tpl.php
@@ -17,5 +17,5 @@
*/
?>
diff --git a/modules/comment/comment.admin.inc b/modules/comment/comment.admin.inc
index a40502a6b..144804e36 100644
--- a/modules/comment/comment.admin.inc
+++ b/modules/comment/comment.admin.inc
@@ -57,18 +57,18 @@ function comment_admin_overview($type = 'new', $arg) {
array('data' => t('Time'), 'field' => 'timestamp', 'sort' => 'desc'),
array('data' => t('Operations'))
));
- $result = pager_query('SELECT c.subject, c.nid, c.cid, c.comment, c.timestamp, c.status, c.name, c.homepage, u.name AS registered_name, u.uid, n.title as node_title FROM {comments} c INNER JOIN {users} u ON u.uid = c.uid INNER JOIN {node} n ON n.nid = c.nid WHERE c.status = %d'. tablesort_sql($form['header']['#value']), 50, 0, NULL, $status);
+ $result = pager_query('SELECT c.subject, c.nid, c.cid, c.comment, c.timestamp, c.status, c.name, c.homepage, u.name AS registered_name, u.uid, n.title as node_title FROM {comments} c INNER JOIN {users} u ON u.uid = c.uid INNER JOIN {node} n ON n.nid = c.nid WHERE c.status = %d' . tablesort_sql($form['header']['#value']), 50, 0, NULL, $status);
// build a table listing the appropriate comments
$destination = drupal_get_destination();
while ($comment = db_fetch_object($result)) {
$comments[$comment->cid] = '';
$comment->name = $comment->uid ? $comment->registered_name : $comment->name;
- $form['subject'][$comment->cid] = array('#value' => l($comment->subject, 'node/'. $comment->nid, array('title' => truncate_utf8($comment->comment, 128), 'fragment' => 'comment-'. $comment->cid)));
+ $form['subject'][$comment->cid] = array('#value' => l($comment->subject, 'node/' . $comment->nid, array('title' => truncate_utf8($comment->comment, 128), 'fragment' => 'comment-' . $comment->cid)));
$form['username'][$comment->cid] = array('#value' => theme('username', $comment));
- $form['node_title'][$comment->cid] = array('#value' => l($comment->node_title, 'node/'. $comment->nid));
+ $form['node_title'][$comment->cid] = array('#value' => l($comment->node_title, 'node/' . $comment->nid));
$form['timestamp'][$comment->cid] = array('#value' => format_date($comment->timestamp, 'small'));
- $form['operations'][$comment->cid] = array('#value' => l(t('edit'), 'comment/edit/'. $comment->cid, array('query' => $destination)));
+ $form['operations'][$comment->cid] = array('#value' => l(t('edit'), 'comment/edit/' . $comment->cid, array('query' => $destination)));
}
$form['comments'] = array('#type' => 'checkboxes', '#options' => isset($comments) ? $comments: array());
$form['pager'] = array('#value' => theme('pager', NULL, 50, 0));
@@ -108,7 +108,7 @@ function comment_admin_overview_submit($form, &$form_state) {
// Allow modules to respond to the updating of a comment.
comment_invoke_comment($comment, $form_state['values']['operation']);
// Add an entry to the watchdog log.
- watchdog('content', 'Comment: updated %subject.', array('%subject' => $comment->subject), WATCHDOG_NOTICE, l(t('view'), 'node/'. $comment->nid, array('fragment' => 'comment-'. $comment->cid)));
+ watchdog('content', 'Comment: updated %subject.', array('%subject' => $comment->subject), WATCHDOG_NOTICE, l(t('view'), 'node/' . $comment->nid, array('fragment' => 'comment-' . $comment->cid)));
}
}
cache_clear_all();
@@ -173,7 +173,7 @@ function comment_multiple_delete_confirm(&$form_state) {
$comment = comment_load($cid);
if (is_object($comment) && is_numeric($comment->cid)) {
$subject = db_result(db_query('SELECT subject FROM {comments} WHERE cid = %d', $cid));
- $form['comments'][$cid] = array('#type' => 'hidden', '#value' => $cid, '#prefix' => '', '#suffix' => check_plain($subject) .' ');
+ $form['comments'][$cid] = array('#type' => 'hidden', '#value' => $cid, '#prefix' => '', '#suffix' => check_plain($subject) . ' ');
$comment_counter++;
}
}
@@ -243,7 +243,7 @@ function comment_confirm_delete(&$form_state, $comment) {
return confirm_form(
$form,
t('Are you sure you want to delete the comment %title?', array('%title' => $comment->subject)),
- 'node/'. $comment->nid,
+ 'node/' . $comment->nid,
t('Any replies to this comment will be lost. This action cannot be undone.'),
t('Delete'),
t('Cancel'),
diff --git a/modules/comment/comment.install b/modules/comment/comment.install
index 82dec3488..3a6cd974a 100644
--- a/modules/comment/comment.install
+++ b/modules/comment/comment.install
@@ -51,7 +51,7 @@ function comment_update_6002() {
foreach ($settings as $setting => $default) {
$value = variable_get($setting, $default);
foreach ($types as $type => $object) {
- variable_set($setting .'_'. $type, $value);
+ variable_set($setting . '_' . $type, $value);
}
variable_del($setting);
}
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index ca2d522e1..031bb61a5 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -126,14 +126,14 @@ define('COMMENT_PREVIEW_REQUIRED', 1);
function comment_help($path, $arg) {
switch ($path) {
case 'admin/help#comment':
- $output = ''. t('The comment module allows visitors to comment on your posts, creating ad hoc discussion boards. Any content type may have its Default comment setting set to Read/Write to allow comments, or Disabled , to prevent comments. Comment display settings and other controls may also be customized for each content type (some display settings are customizable by individual users).', array('@content-type' => url('admin/build/types'))) .'
';
- $output .= ''. t('Comment permissions are assigned to user roles, and are used to determine whether anonymous users (or other roles) are allowed to comment on posts. If anonymous users are allowed to comment, their individual contact information may be retained in cookies stored on their local computer for use in later comment submissions. When a comment has no replies, it may be (optionally) edited by its author. The comment module uses the same input formats and HTML tags available when creating other forms of content.') .'
';
- $output .= ''. t('For more information, see the online handbook entry for Comment module .', array('@comment' => 'http://drupal.org/handbook/modules/comment/')) .'
';
+ $output = '' . t('The comment module allows visitors to comment on your posts, creating ad hoc discussion boards. Any content type may have its Default comment setting set to Read/Write to allow comments, or Disabled , to prevent comments. Comment display settings and other controls may also be customized for each content type (some display settings are customizable by individual users).', array('@content-type' => url('admin/build/types'))) . '
';
+ $output .= '' . t('Comment permissions are assigned to user roles, and are used to determine whether anonymous users (or other roles) are allowed to comment on posts. If anonymous users are allowed to comment, their individual contact information may be retained in cookies stored on their local computer for use in later comment submissions. When a comment has no replies, it may be (optionally) edited by its author. The comment module uses the same input formats and HTML tags available when creating other forms of content.') . '
';
+ $output .= '' . t('For more information, see the online handbook entry for Comment module .', array('@comment' => 'http://drupal.org/handbook/modules/comment/')) . '
';
return $output;
case 'admin/content/comment':
- return ''. t("Below is a list of the latest comments posted to your site. Click on a subject to see the comment, the author's name to edit the author's user information, 'edit' to modify the text, and 'delete' to remove their submission.") .'
';
+ return '' . t("Below is a list of the latest comments posted to your site. Click on a subject to see the comment, the author's name to edit the author's user information, 'edit' to modify the text, and 'delete' to remove their submission.") . '
';
case 'admin/content/comment/approval':
- return ''. t("Below is a list of the comments posted to your site that need approval. To approve a comment, click on 'edit' and then change its 'moderation status' to Approved. Click on a subject to see the comment, the author's name to edit the author's user information, 'edit' to modify the text, and 'delete' to remove their submission.") .'
';
+ return '' . t("Below is a list of the comments posted to your site that need approval. To approve a comment, click on 'edit' and then change its 'moderation status' to Approved. Click on a subject to see the comment, the author's name to edit the author's user information, 'edit' to modify the text, and 'delete' to remove their submission.") . '
';
}
}
@@ -261,7 +261,7 @@ function comment_node_type($op, $info) {
switch ($op) {
case 'delete':
foreach ($settings as $setting) {
- variable_del($setting .'_'. $info->type);
+ variable_del($setting . '_' . $info->type);
}
break;
}
@@ -343,7 +343,7 @@ function comment_get_recent($number = 10) {
if (!empty($nids)) {
// From among the comments on the nodes selected in the first query,
// find the $number most recent comments.
- $result = db_query_range('SELECT c.nid, c.subject, c.cid, c.timestamp FROM {comments} c INNER JOIN {node} n ON n.nid = c.nid WHERE c.nid IN ('. implode(',', $nids) .') AND n.status = 1 AND c.status = %d ORDER BY c.cid DESC', COMMENT_PUBLISHED, 0, $number);
+ $result = db_query_range('SELECT c.nid, c.subject, c.cid, c.timestamp FROM {comments} c INNER JOIN {node} n ON n.nid = c.nid WHERE c.nid IN (' . implode(',', $nids) . ') AND n.status = 1 AND c.status = %d ORDER BY c.cid DESC', COMMENT_PUBLISHED, 0, $number);
while ($comment = db_fetch_object($result)) {
$comments[] = $comment;
}
@@ -386,20 +386,20 @@ function comment_new_page_count($num_comments, $new_replies, $node) {
// Newest first: find the last thread with new comment
$result = db_query('(SELECT thread FROM {comments} WHERE nid = %d AND status = 0 ORDER BY timestamp DESC LIMIT %d) ORDER BY thread DESC LIMIT 1', $node->nid, $new_replies);
$thread = db_result($result);
- $result_count = db_query("SELECT COUNT(*) FROM {comments} WHERE nid = %d AND status = 0 AND thread > '". $thread ."'", $node->nid);
+ $result_count = db_query("SELECT COUNT(*) FROM {comments} WHERE nid = %d AND status = 0 AND thread > '" . $thread . "'", $node->nid);
}
else {
// Oldest first: find the first thread with new comment
$result = db_query('(SELECT thread FROM {comments} WHERE nid = %d AND status = 0 ORDER BY timestamp DESC LIMIT %d) ORDER BY SUBSTRING(thread, 1, (LENGTH(thread) - 1)) LIMIT 1', $node->nid, $new_replies);
$thread = substr(db_result($result), 0, -1);
- $result_count = db_query("SELECT COUNT(*) FROM {comments} WHERE nid = %d AND status = 0 AND SUBSTRING(thread, 1, (LENGTH(thread) - 1)) < '". $thread ."'", $node->nid);
+ $result_count = db_query("SELECT COUNT(*) FROM {comments} WHERE nid = %d AND status = 0 AND SUBSTRING(thread, 1, (LENGTH(thread) - 1)) < '" . $thread . "'", $node->nid);
}
$count = db_result($result_count);
}
$pageno = $count / $comments_per_page;
}
if ($pageno >= 1) {
- $pagenum = "page=". intval($pageno);
+ $pagenum = "page=" . intval($pageno);
}
return $pagenum;
}
@@ -415,7 +415,7 @@ function theme_comment_block() {
$items = array();
$number = variable_get('comment_block_count', 10);
foreach (comment_get_recent($number) as $comment) {
- $items[] = l($comment->subject, 'node/'. $comment->nid, array('fragment' => 'comment-'. $comment->cid)) .' '. t('@time ago', array('@time' => format_interval(time() - $comment->timestamp)));
+ $items[] = l($comment->subject, 'node/' . $comment->nid, array('fragment' => 'comment-' . $comment->cid)) . ' ' . t('@time ago', array('@time' => format_interval(time() - $comment->timestamp)));
}
if ($items) {
return theme('item_list', $items);
@@ -479,7 +479,7 @@ function comment_link($type, $node = NULL, $teaser = FALSE) {
if ($node->comment == COMMENT_NODE_READ_WRITE) {
if (user_access('post comments')) {
- if (variable_get('comment_form_location_'. $node->type, COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_SEPARATE_PAGE) {
+ if (variable_get('comment_form_location_' . $node->type, COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_SEPARATE_PAGE) {
$links['comment_add'] = array(
'title' => t('Add new comment'),
'href' => "comment/reply/$node->nid",
@@ -519,35 +519,35 @@ function comment_form_alter(&$form, $form_state, $form_id) {
$form['comment']['comment'] = array(
'#type' => 'radios',
'#title' => t('Default comment setting'),
- '#default_value' => variable_get('comment_'. $form['#node_type']->type, COMMENT_NODE_READ_WRITE),
+ '#default_value' => variable_get('comment_' . $form['#node_type']->type, COMMENT_NODE_READ_WRITE),
'#options' => array(t('Disabled'), t('Read only'), t('Read/Write')),
'#description' => t('Users with the administer comments permission will be able to override this setting.'),
);
$form['comment']['comment_default_mode'] = array(
'#type' => 'radios',
'#title' => t('Default display mode'),
- '#default_value' => variable_get('comment_default_mode_'. $form['#node_type']->type, COMMENT_MODE_THREADED_EXPANDED),
+ '#default_value' => variable_get('comment_default_mode_' . $form['#node_type']->type, COMMENT_MODE_THREADED_EXPANDED),
'#options' => _comment_get_modes(),
'#description' => t('The default view for comments. Expanded views display the body of the comment. Threaded views keep replies together.'),
);
$form['comment']['comment_default_order'] = array(
'#type' => 'radios',
'#title' => t('Default display order'),
- '#default_value' => variable_get('comment_default_order_'. $form['#node_type']->type, COMMENT_ORDER_NEWEST_FIRST),
+ '#default_value' => variable_get('comment_default_order_' . $form['#node_type']->type, COMMENT_ORDER_NEWEST_FIRST),
'#options' => _comment_get_orders(),
'#description' => t('The default sorting for new users and anonymous users while viewing comments. These users may change their view using the comment control panel. For registered users, this change is remembered as a persistent user preference.'),
);
$form['comment']['comment_default_per_page'] = array(
'#type' => 'select',
'#title' => t('Default comments per page'),
- '#default_value' => variable_get('comment_default_per_page_'. $form['#node_type']->type, 50),
+ '#default_value' => variable_get('comment_default_per_page_' . $form['#node_type']->type, 50),
'#options' => _comment_per_page(),
'#description' => t('Default number of comments for each page: more comments are distributed in several pages.'),
);
$form['comment']['comment_controls'] = array(
'#type' => 'radios',
'#title' => t('Comment controls'),
- '#default_value' => variable_get('comment_controls_'. $form['#node_type']->type, COMMENT_CONTROLS_HIDDEN),
+ '#default_value' => variable_get('comment_controls_' . $form['#node_type']->type, COMMENT_CONTROLS_HIDDEN),
'#options' => array(
t('Display above the comments'),
t('Display below the comments'),
@@ -558,7 +558,7 @@ function comment_form_alter(&$form, $form_state, $form_id) {
$form['comment']['comment_anonymous'] = array(
'#type' => 'radios',
'#title' => t('Anonymous commenting'),
- '#default_value' => variable_get('comment_anonymous_'. $form['#node_type']->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT),
+ '#default_value' => variable_get('comment_anonymous_' . $form['#node_type']->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT),
'#options' => array(
COMMENT_ANONYMOUS_MAYNOT_CONTACT => t('Anonymous posters may not enter their contact information'),
COMMENT_ANONYMOUS_MAY_CONTACT => t('Anonymous posters may leave their contact information'),
@@ -571,26 +571,26 @@ function comment_form_alter(&$form, $form_state, $form_id) {
$form['comment']['comment_subject_field'] = array(
'#type' => 'radios',
'#title' => t('Comment subject field'),
- '#default_value' => variable_get('comment_subject_field_'. $form['#node_type']->type, 1),
+ '#default_value' => variable_get('comment_subject_field_' . $form['#node_type']->type, 1),
'#options' => array(t('Disabled'), t('Enabled')),
'#description' => t('Can users provide a unique subject for their comments?'),
);
$form['comment']['comment_preview'] = array(
'#type' => 'radios',
'#title' => t('Preview comment'),
- '#default_value' => variable_get('comment_preview_'. $form['#node_type']->type, COMMENT_PREVIEW_REQUIRED),
+ '#default_value' => variable_get('comment_preview_' . $form['#node_type']->type, COMMENT_PREVIEW_REQUIRED),
'#options' => array(t('Optional'), t('Required')),
'#description' => t("Forces a user to look at their comment by clicking on a 'Preview' button before they can actually add the comment"),
);
$form['comment']['comment_form_location'] = array(
'#type' => 'radios',
'#title' => t('Location of comment submission form'),
- '#default_value' => variable_get('comment_form_location_'. $form['#node_type']->type, COMMENT_FORM_SEPARATE_PAGE),
+ '#default_value' => variable_get('comment_form_location_' . $form['#node_type']->type, COMMENT_FORM_SEPARATE_PAGE),
'#options' => array(t('Display on separate page'), t('Display below post or comments')),
);
}
elseif (isset($form['type']) && isset($form['#node'])) {
- if ($form['type']['#value'] .'_node_form' == $form_id) {
+ if ($form['type']['#value'] . '_node_form' == $form_id) {
$node = $form['#node'];
$form['comment_settings'] = array(
'#type' => 'fieldset',
@@ -638,7 +638,7 @@ function comment_nodeapi(&$node, $op, $arg = 0) {
$text = '';
$comments = db_query('SELECT subject, comment, format FROM {comments} WHERE nid = %d AND status = %d', $node->nid, COMMENT_PUBLISHED);
while ($comment = db_fetch_object($comments)) {
- $text .= ''. check_plain($comment->subject) .' '. check_markup($comment->comment, $comment->format, FALSE);
+ $text .= '' . check_plain($comment->subject) . ' ' . check_markup($comment->comment, $comment->format, FALSE);
}
return $text;
@@ -648,7 +648,7 @@ function comment_nodeapi(&$node, $op, $arg = 0) {
case 'rss item':
if ($node->comment != COMMENT_NODE_DISABLED) {
- return array(array('key' => 'comments', 'value' => url('node/'. $node->nid, array('fragment' => 'comments', 'absolute' => TRUE))));
+ return array(array('key' => 'comments', 'value' => url('node/' . $node->nid, array('fragment' => 'comments', 'absolute' => TRUE))));
}
else {
return array();
@@ -696,7 +696,7 @@ function comment_access($op, $comment) {
* The 0th and the 1st path components joined by a slash.
*/
function comment_node_url() {
- return arg(0) .'/'. arg(1);
+ return arg(0) . '/' . arg(1);
}
/**
@@ -727,7 +727,7 @@ function comment_save($edit) {
comment_invoke_comment($edit, 'update');
// Add an entry to the watchdog log.
- watchdog('content', 'Comment: updated %subject.', array('%subject' => $edit['subject']), WATCHDOG_NOTICE, l(t('view'), 'node/'. $edit['nid'], array('fragment' => 'comment-'. $edit['cid'])));
+ watchdog('content', 'Comment: updated %subject.', array('%subject' => $edit['subject']), WATCHDOG_NOTICE, l(t('view'), 'node/' . $edit['nid'], array('fragment' => 'comment-' . $edit['cid'])));
}
else {
// Add the comment to database.
@@ -742,7 +742,7 @@ function comment_save($edit) {
$max = rtrim($max, '/');
// Finally, build the thread field for this new comment.
- $thread = int2vancode(vancode2int($max) + 1) .'/';
+ $thread = int2vancode(vancode2int($max) + 1) . '/';
}
else {
// This is comment with a parent comment: we increase
@@ -759,7 +759,7 @@ function comment_save($edit) {
if ($max == '') {
// First child of this parent.
- $thread = $parent->thread .'.'. int2vancode(0) .'/';
+ $thread = $parent->thread . '.' . int2vancode(0) . '/';
}
else {
// Strip the "/" at the end of the thread.
@@ -771,7 +771,7 @@ function comment_save($edit) {
$last = $parts[$parent_depth];
// Finally, build the thread field for this new comment.
- $thread = $parent->thread .'.'. int2vancode(vancode2int($last) + 1) .'/';
+ $thread = $parent->thread . '.' . int2vancode(vancode2int($last) + 1) . '/';
}
}
@@ -788,7 +788,7 @@ function comment_save($edit) {
comment_invoke_comment($edit, 'insert');
// Add an entry to the watchdog log.
- watchdog('content', 'Comment: added %subject.', array('%subject' => $edit['subject']), WATCHDOG_NOTICE, l(t('view'), 'node/'. $edit['nid'], array('fragment' => 'comment-'. $edit['cid'])));
+ watchdog('content', 'Comment: added %subject.', array('%subject' => $edit['subject']), WATCHDOG_NOTICE, l(t('view'), 'node/' . $edit['nid'], array('fragment' => 'comment-' . $edit['cid'])));
}
_comment_update_node_statistics($edit['nid']);
@@ -1014,7 +1014,7 @@ function comment_render($node, $cid = 0) {
$divs = 0;
$num_rows = FALSE;
$comments = '';
- drupal_add_css(drupal_get_path('module', 'comment') .'/comment.css');
+ drupal_add_css(drupal_get_path('module', 'comment') . '/comment.css');
while ($comment = db_fetch_object($result)) {
$comment = drupal_unpack($comment);
$comment->name = $comment->uid ? $comment->registered_name : $comment->name;
@@ -1052,7 +1052,7 @@ function comment_render($node, $cid = 0) {
$comments .= '';
}
- $comment_controls = variable_get('comment_controls_'. $node->type, COMMENT_CONTROLS_HIDDEN);
+ $comment_controls = variable_get('comment_controls_' . $node->type, COMMENT_CONTROLS_HIDDEN);
if ($num_rows && ($comment_controls == COMMENT_CONTROLS_ABOVE || $comment_controls == COMMENT_CONTROLS_ABOVE_BELOW)) {
$output .= drupal_get_form('comment_controls', $mode, $order, $comments_per_page);
}
@@ -1067,7 +1067,7 @@ function comment_render($node, $cid = 0) {
// If enabled, show new comment form if it's not already being displayed.
$reply = arg(0) == 'comment' && arg(1) == 'reply';
- if (user_access('post comments') && node_comment_mode($nid) == COMMENT_NODE_READ_WRITE && (variable_get('comment_form_location_'. $node->type, COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_BELOW) && !$reply) {
+ if (user_access('post comments') && node_comment_mode($nid) == COMMENT_NODE_READ_WRITE && (variable_get('comment_form_location_' . $node->type, COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_BELOW) && !$reply) {
$output .= comment_form_box(array('nid' => $nid), t('Post new comment'));
}
@@ -1089,20 +1089,20 @@ function comment_render($node, $cid = 0) {
function comment_operations($action = NULL) {
if ($action == 'publish') {
$operations = array(
- 'publish' => array(t('Publish the selected comments'), 'UPDATE {comments} SET status = '. COMMENT_PUBLISHED .' WHERE cid = %d'),
+ 'publish' => array(t('Publish the selected comments'), 'UPDATE {comments} SET status = ' . COMMENT_PUBLISHED . ' WHERE cid = %d'),
'delete' => array(t('Delete the selected comments'), '')
);
}
else if ($action == 'unpublish') {
$operations = array(
- 'unpublish' => array(t('Unpublish the selected comments'), 'UPDATE {comments} SET status = '. COMMENT_NOT_PUBLISHED .' WHERE cid = %d'),
+ 'unpublish' => array(t('Unpublish the selected comments'), 'UPDATE {comments} SET status = ' . COMMENT_NOT_PUBLISHED . ' WHERE cid = %d'),
'delete' => array(t('Delete the selected comments'), '')
);
}
else {
$operations = array(
- 'publish' => array(t('Publish the selected comments'), 'UPDATE {comments} SET status = '. COMMENT_PUBLISHED .' WHERE cid = %d'),
- 'unpublish' => array(t('Unpublish the selected comments'), 'UPDATE {comments} SET status = '. COMMENT_NOT_PUBLISHED .' WHERE cid = %d'),
+ 'publish' => array(t('Publish the selected comments'), 'UPDATE {comments} SET status = ' . COMMENT_PUBLISHED . ' WHERE cid = %d'),
+ 'unpublish' => array(t('Unpublish the selected comments'), 'UPDATE {comments} SET status = ' . COMMENT_NOT_PUBLISHED . ' WHERE cid = %d'),
'delete' => array(t('Delete the selected comments'), '')
);
}
@@ -1218,7 +1218,7 @@ function comment_validate($edit) {
// Check validity of name, mail and homepage (if given)
if (!$user->uid || isset($edit['is_anonymous'])) {
$node = node_load($edit['nid']);
- if (variable_get('comment_anonymous_'. $node->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT) > COMMENT_ANONYMOUS_MAYNOT_CONTACT) {
+ if (variable_get('comment_anonymous_' . $node->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT) > COMMENT_ANONYMOUS_MAYNOT_CONTACT) {
if ($edit['name']) {
$taken = db_result(db_query("SELECT COUNT(uid) FROM {users} WHERE LOWER(name) = '%s'", $edit['name']));
@@ -1227,7 +1227,7 @@ function comment_validate($edit) {
}
}
- else if (variable_get('comment_anonymous_'. $node->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT) == COMMENT_ANONYMOUS_MUST_CONTACT) {
+ else if (variable_get('comment_anonymous_' . $node->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT) == COMMENT_ANONYMOUS_MUST_CONTACT) {
form_set_error('name', t('You have to leave your name.'));
}
@@ -1236,7 +1236,7 @@ function comment_validate($edit) {
form_set_error('mail', t('The e-mail address you specified is not valid.'));
}
}
- else if (variable_get('comment_anonymous_'. $node->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT) == COMMENT_ANONYMOUS_MUST_CONTACT) {
+ else if (variable_get('comment_anonymous_' . $node->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT) == COMMENT_ANONYMOUS_MUST_CONTACT) {
form_set_error('mail', t('You have to leave an e-mail address.'));
}
@@ -1266,8 +1266,8 @@ function comment_form(&$form_state, $edit, $title = NULL) {
$op = isset($_POST['op']) ? $_POST['op'] : '';
$node = node_load($edit['nid']);
- if (!$user->uid && variable_get('comment_anonymous_'. $node->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT) != COMMENT_ANONYMOUS_MAYNOT_CONTACT) {
- drupal_add_js(drupal_get_path('module', 'comment') .'/comment.js');
+ if (!$user->uid && variable_get('comment_anonymous_' . $node->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT) != COMMENT_ANONYMOUS_MAYNOT_CONTACT) {
+ drupal_add_js(drupal_get_path('module', 'comment') . '/comment.js');
}
$edit += array('name' => '', 'mail' => '', 'homepage' => '');
if ($user->uid) {
@@ -1359,7 +1359,7 @@ function comment_form(&$form_state, $edit, $title = NULL) {
$form['author'] = array('#type' => 'value', '#value' => $user->name);
}
}
- else if (variable_get('comment_anonymous_'. $node->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT) == COMMENT_ANONYMOUS_MAY_CONTACT) {
+ else if (variable_get('comment_anonymous_' . $node->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT) == COMMENT_ANONYMOUS_MAY_CONTACT) {
$form['name'] = array('#type' => 'textfield', '#title' => t('Your name'), '#maxlength' => 60, '#size' => 30, '#default_value' => $edit['name'] ? $edit['name'] : variable_get('anonymous', t('Anonymous'))
);
@@ -1368,7 +1368,7 @@ function comment_form(&$form_state, $edit, $title = NULL) {
$form['homepage'] = array('#type' => 'textfield', '#title' => t('Homepage'), '#maxlength' => 255, '#size' => 30, '#default_value' => $edit['homepage']);
}
- else if (variable_get('comment_anonymous_'. $node->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT) == COMMENT_ANONYMOUS_MUST_CONTACT) {
+ else if (variable_get('comment_anonymous_' . $node->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT) == COMMENT_ANONYMOUS_MUST_CONTACT) {
$form['name'] = array('#type' => 'textfield', '#title' => t('Your name'), '#maxlength' => 60, '#size' => 30, '#default_value' => $edit['name'] ? $edit['name'] : variable_get('anonymous', t('Anonymous')), '#required' => TRUE);
$form['mail'] = array('#type' => 'textfield', '#title' => t('E-mail'), '#maxlength' => 64, '#size' => 30, '#default_value' => $edit['mail'], '#description' => t('The content of this field is kept private and will not be shown publicly.'), '#required' => TRUE);
@@ -1376,7 +1376,7 @@ function comment_form(&$form_state, $edit, $title = NULL) {
$form['homepage'] = array('#type' => 'textfield', '#title' => t('Homepage'), '#maxlength' => 255, '#size' => 30, '#default_value' => $edit['homepage']);
}
- if (variable_get('comment_subject_field_'. $node->type, 1) == 1) {
+ if (variable_get('comment_subject_field_' . $node->type, 1) == 1) {
$form['subject'] = array('#type' => 'textfield', '#title' => t('Subject'), '#maxlength' => 64, '#default_value' => !empty($edit['subject']) ? $edit['subject'] : '');
}
@@ -1407,19 +1407,19 @@ function comment_form(&$form_state, $edit, $title = NULL) {
// Only show save button if preview is optional or if we are in preview mode.
// We show the save button in preview mode even if there are form errors so that
// optional form elements (e.g., captcha) can be updated in preview mode.
- if (!form_get_errors() && ((variable_get('comment_preview_'. $node->type, COMMENT_PREVIEW_REQUIRED) == COMMENT_PREVIEW_OPTIONAL) || ($op == t('Preview')) || ($op == t('Save')))) {
+ if (!form_get_errors() && ((variable_get('comment_preview_' . $node->type, COMMENT_PREVIEW_REQUIRED) == COMMENT_PREVIEW_OPTIONAL) || ($op == t('Preview')) || ($op == t('Save')))) {
$form['submit'] = array('#type' => 'submit', '#value' => t('Save'), '#weight' => 19);
}
$form['preview'] = array('#type' => 'button', '#value' => t('Preview'), '#weight' => 20);
- $form['#token'] = 'comment'. $edit['nid'] . (isset($edit['pid']) ? $edit['pid'] : '');
+ $form['#token'] = 'comment' . $edit['nid'] . (isset($edit['pid']) ? $edit['pid'] : '');
if ($op == t('Preview')) {
$form['#after_build'] = array('comment_form_add_preview');
}
if (empty($edit['cid']) && empty($edit['pid'])) {
- $form['#action'] = url('comment/reply/'. $edit['nid']);
+ $form['#action'] = url('comment/reply/' . $edit['nid']);
}
return $form;
@@ -1511,7 +1511,7 @@ function comment_form_validate($form, &$form_state) {
foreach (array('name', 'homepage', 'mail') as $field) {
// Set cookie for 365 days.
if (isset($form_state['values'][$field])) {
- setcookie('comment_info_'. $field, $form_state['values'][$field], time() + 31536000, '/');
+ setcookie('comment_info_' . $field, $form_state['values'][$field], time() + 31536000, '/');
}
}
}
@@ -1560,7 +1560,7 @@ function comment_form_submit($form, &$form_state) {
if ($cid = comment_save($form_state['values'])) {
$node = node_load($form_state['values']['nid']);
$page = comment_new_page_count($node->comment_count, 1, $node);
- $form_state['redirect'] = array('node/'. $node->nid, $page, "comment-$cid");
+ $form_state['redirect'] = array('node/' . $node->nid, $page, "comment-$cid");
return;
}
}
@@ -1660,7 +1660,7 @@ function theme_comment_controls($form) {
$output = '';
$output .= drupal_render($form);
$output .= '
';
- $output .= ''. t('Select your preferred way to display the comments and click "Save settings" to activate your changes.') .'
';
+ $output .= '' . t('Select your preferred way to display the comments and click "Save settings" to activate your changes.') . '
';
return theme('box', t('Comment viewing options'), $output);
}
@@ -1708,7 +1708,7 @@ function template_preprocess_comment(&$variables) {
$variables['signature'] = $comment->signature;
$variables['submitted'] = theme('comment_submitted', $comment);
$variables['title'] = l($comment->subject, $_GET['q'], array('fragment' => "comment-$comment->cid"));
- $variables['template_files'][] = 'comment-'. $node->type;
+ $variables['template_files'][] = 'comment-' . $node->type;
// set status to a string representation of comment->status.
if (isset($comment->preview)) {
$variables['status'] = 'comment-preview';
@@ -1729,7 +1729,7 @@ function template_preprocess_comment_folded(&$variables) {
$variables['author'] = theme('username', $comment);
$variables['date'] = format_date($comment->timestamp);
$variables['new'] = $comment->new ? t('new') : '';
- $variables['title'] = l($comment->subject, comment_node_url() .'/'. $comment->cid, array('fragment' => "comment-$comment->cid"));
+ $variables['title'] = l($comment->subject, comment_node_url() . '/' . $comment->cid, array('fragment' => "comment-$comment->cid"));
}
/**
@@ -1805,11 +1805,11 @@ function theme_comment_post_forbidden($node) {
if ($authenticated_post_comments) {
// We cannot use drupal_get_destination() because these links
// sometimes appear on /node and taxonomy listing pages.
- if (variable_get('comment_form_location_'. $node->type, COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_SEPARATE_PAGE) {
- $destination = 'destination='. drupal_urlencode("comment/reply/$node->nid#comment-form");
+ if (variable_get('comment_form_location_' . $node->type, COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_SEPARATE_PAGE) {
+ $destination = 'destination=' . drupal_urlencode("comment/reply/$node->nid#comment-form");
}
else {
- $destination = 'destination='. drupal_urlencode("node/$node->nid#comment-form");
+ $destination = 'destination=' . drupal_urlencode("node/$node->nid#comment-form");
}
if (variable_get('user_register', 1)) {
@@ -1834,8 +1834,8 @@ function template_preprocess_comment_wrapper(&$variables) {
// Provide contextual information.
$variables['display_mode'] = _comment_get_display_setting('mode', $variables['node']);
$variables['display_order'] = _comment_get_display_setting('sort', $variables['node']);
- $variables['comment_controls_state'] = variable_get('comment_controls_'. $variables['node']->type, COMMENT_CONTROLS_HIDDEN);
- $variables['template_files'][] = 'comment-wrapper-'. $variables['node']->type;
+ $variables['comment_controls_state'] = variable_get('comment_controls_' . $variables['node']->type, COMMENT_CONTROLS_HIDDEN);
+ $variables['template_files'][] = 'comment-wrapper-' . $variables['node']->type;
}
/**
@@ -1907,15 +1907,15 @@ function _comment_get_display_setting($setting, $node) {
// get the setting's site default
switch ($setting) {
case 'mode':
- $default = variable_get('comment_default_mode_'. $node->type, COMMENT_MODE_THREADED_EXPANDED);
+ $default = variable_get('comment_default_mode_' . $node->type, COMMENT_MODE_THREADED_EXPANDED);
break;
case 'sort':
- $default = variable_get('comment_default_order_'. $node->type, COMMENT_ORDER_NEWEST_FIRST);
+ $default = variable_get('comment_default_order_' . $node->type, COMMENT_ORDER_NEWEST_FIRST);
break;
case 'comments_per_page':
- $default = variable_get('comment_default_per_page_'. $node->type, 50);
+ $default = variable_get('comment_default_per_page_' . $node->type, 50);
}
- if (variable_get('comment_controls_'. $node->type, COMMENT_CONTROLS_HIDDEN) == COMMENT_CONTROLS_HIDDEN) {
+ if (variable_get('comment_controls_' . $node->type, COMMENT_CONTROLS_HIDDEN) == COMMENT_CONTROLS_HIDDEN) {
// if comment controls are disabled use site default
$value = $default;
}
@@ -1924,8 +1924,8 @@ function _comment_get_display_setting($setting, $node) {
if (isset($user->$setting) && $user->$setting) {
$value = $user->$setting;
}
- else if (isset($_SESSION['comment_'. $setting]) && $_SESSION['comment_'. $setting]) {
- $value = $_SESSION['comment_'. $setting];
+ else if (isset($_SESSION['comment_' . $setting]) && $_SESSION['comment_' . $setting]) {
+ $value = $_SESSION['comment_' . $setting];
}
else {
$value = $default;
@@ -1974,7 +1974,7 @@ function _comment_update_node_statistics($nid) {
function comment_invoke_comment(&$comment, $op) {
$return = array();
foreach (module_implements('comment') as $name) {
- $function = $name .'_comment';
+ $function = $name . '_comment';
$result = $function($comment, $op);
if (isset($result) && is_array($result)) {
$return = array_merge($return, $result);
@@ -2090,7 +2090,7 @@ function comment_unpublish_by_keyword_action_form($context) {
$form['keywords'] = array(
'#title' => t('Keywords'),
'#type' => 'textarea',
- '#description' => t('The comment will be unpublished if it contains any of the character sequences above. Use a comma-separated list of character sequences. Example: funny, bungee jumping, "Company, Inc.". Character sequences are case-sensitive.'),
+ '#description' => t('The comment will be unpublished if it contains any of the character sequences above. Use a comma-separated list of character sequences. Example: funny, bungee jumping, "Company, Inc." . Character sequences are case-sensitive.'),
'#default_value' => isset($context['keywords']) ? drupal_implode_tags($context['keywords']) : '',
);
return $form;
diff --git a/modules/comment/comment.pages.inc b/modules/comment/comment.pages.inc
index f4b770677..a83fc54df 100644
--- a/modules/comment/comment.pages.inc
+++ b/modules/comment/comment.pages.inc
@@ -50,7 +50,7 @@ function comment_edit($cid) {
*/
function comment_reply($node, $pid = NULL) {
// Set the breadcrumb trail.
- drupal_set_breadcrumb(array(l(t('Home'), NULL), l($node->title, 'node/'. $node->nid)));
+ drupal_set_breadcrumb(array(l(t('Home'), NULL), l($node->title, 'node/' . $node->nid)));
$op = isset($_POST['op']) ? $_POST['op'] : '';
$output = '';
diff --git a/modules/comment/comment.tpl.php b/modules/comment/comment.tpl.php
index 220724682..69a5ff521 100644
--- a/modules/comment/comment.tpl.php
+++ b/modules/comment/comment.tpl.php
@@ -26,7 +26,7 @@
* @see theme_comment()
*/
?>
-