summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-04-14 17:48:46 +0000
committerDries Buytaert <dries@buytaert.net>2008-04-14 17:48:46 +0000
commit56d2664a904119f73e7df4fb355e4c525e040b70 (patch)
tree0ac2302d485b4b0769d269825880975428bd3b0c
parent46cda4c6ae388cd2e918ae2aec887e617e5bd44e (diff)
downloadbrdo-56d2664a904119f73e7df4fb355e4c525e040b70.tar.gz
brdo-56d2664a904119f73e7df4fb355e4c525e040b70.tar.bz2
- 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.
-rw-r--r--includes/actions.inc4
-rw-r--r--includes/batch.inc8
-rw-r--r--includes/bootstrap.inc24
-rw-r--r--includes/cache.inc18
-rw-r--r--includes/common.inc158
-rw-r--r--includes/database.inc20
-rw-r--r--includes/database.mysql-common.inc66
-rw-r--r--includes/database.mysql.inc26
-rw-r--r--includes/database.mysqli.inc24
-rw-r--r--includes/database.pgsql.inc104
-rw-r--r--includes/file.inc40
-rw-r--r--includes/form.inc154
-rw-r--r--includes/image.gd.inc4
-rw-r--r--includes/image.inc6
-rw-r--r--includes/install.inc44
-rw-r--r--includes/install.mysql.inc2
-rw-r--r--includes/install.pgsql.inc10
-rw-r--r--includes/language.inc2
-rw-r--r--includes/locale.inc84
-rw-r--r--includes/mail.inc26
-rw-r--r--includes/menu.inc90
-rw-r--r--includes/module.inc10
-rw-r--r--includes/path.inc2
-rw-r--r--includes/session.inc2
-rw-r--r--includes/tablesort.inc4
-rw-r--r--includes/theme.inc154
-rw-r--r--includes/theme.maintenance.inc24
-rw-r--r--includes/unicode.inc4
-rw-r--r--includes/xmlrpc.inc24
-rw-r--r--includes/xmlrpcs.inc10
-rw-r--r--install.php76
-rw-r--r--modules/aggregator/aggregator.admin.inc8
-rw-r--r--modules/aggregator/aggregator.module42
-rw-r--r--modules/aggregator/aggregator.pages.inc26
-rw-r--r--modules/block/block-admin-display-form.tpl.php8
-rw-r--r--modules/block/block.admin.inc20
-rw-r--r--modules/block/block.module40
-rw-r--r--modules/blog/blog.module16
-rw-r--r--modules/blog/blog.pages.inc8
-rw-r--r--modules/blogapi/blogapi.install2
-rw-r--r--modules/blogapi/blogapi.module30
-rw-r--r--modules/book/book.admin.inc10
-rw-r--r--modules/book/book.install4
-rw-r--r--modules/book/book.module60
-rw-r--r--modules/book/book.pages.inc14
-rw-r--r--modules/color/color.module72
-rw-r--r--modules/comment/comment-folded.tpl.php2
-rw-r--r--modules/comment/comment.admin.inc14
-rw-r--r--modules/comment/comment.install2
-rw-r--r--modules/comment/comment.module132
-rw-r--r--modules/comment/comment.pages.inc2
-rw-r--r--modules/comment/comment.tpl.php2
-rw-r--r--modules/contact/contact.admin.inc4
-rw-r--r--modules/contact/contact.module18
-rw-r--r--modules/contact/contact.pages.inc4
-rw-r--r--modules/dblog/dblog.admin.inc10
-rw-r--r--modules/dblog/dblog.module12
-rw-r--r--modules/filter/filter.admin.inc26
-rw-r--r--modules/filter/filter.install6
-rw-r--r--modules/filter/filter.module134
-rw-r--r--modules/filter/filter.pages.inc6
-rw-r--r--modules/forum/forum.admin.inc10
-rw-r--r--modules/forum/forum.module52
-rw-r--r--modules/help/help.admin.inc10
-rw-r--r--modules/help/help.module8
-rw-r--r--modules/locale/locale.install10
-rw-r--r--modules/locale/locale.module66
-rw-r--r--modules/menu/menu.admin.inc48
-rw-r--r--modules/menu/menu.module32
-rw-r--r--modules/node/content_types.inc18
-rw-r--r--modules/node/node.admin.inc30
-rw-r--r--modules/node/node.module112
-rw-r--r--modules/node/node.pages.inc36
-rw-r--r--modules/openid/openid.inc28
-rw-r--r--modules/openid/openid.module24
-rw-r--r--modules/openid/openid.pages.inc8
-rw-r--r--modules/openid/xrds.inc4
-rw-r--r--modules/path/path.admin.inc2
-rw-r--r--modules/path/path.module32
-rw-r--r--modules/php/php.install2
-rw-r--r--modules/php/php.module44
-rw-r--r--modules/poll/poll.module18
-rw-r--r--modules/poll/poll.pages.inc4
-rw-r--r--modules/profile/profile.admin.inc30
-rw-r--r--modules/profile/profile.module42
-rw-r--r--modules/search/search.admin.inc4
-rw-r--r--modules/search/search.module116
-rw-r--r--modules/search/search.pages.inc8
-rw-r--r--modules/statistics/statistics.admin.inc4
-rw-r--r--modules/statistics/statistics.module36
-rw-r--r--modules/statistics/statistics.pages.inc4
-rw-r--r--modules/syslog/syslog.module22
-rw-r--r--modules/system/block.tpl.php2
-rw-r--r--modules/system/system.admin.inc94
-rw-r--r--modules/system/system.install80
-rw-r--r--modules/system/system.module102
-rw-r--r--modules/taxonomy/taxonomy.admin.inc30
-rw-r--r--modules/taxonomy/taxonomy.module60
-rw-r--r--modules/taxonomy/taxonomy.pages.inc16
-rw-r--r--modules/throttle/throttle.module10
-rw-r--r--modules/tracker/tracker.module6
-rw-r--r--modules/tracker/tracker.pages.inc4
-rw-r--r--modules/translation/translation.module30
-rw-r--r--modules/translation/translation.pages.inc8
-rw-r--r--modules/trigger/trigger.admin.inc8
-rw-r--r--modules/trigger/trigger.module20
-rw-r--r--modules/update/update.compare.inc2
-rw-r--r--modules/update/update.fetch.inc4
-rw-r--r--modules/update/update.module24
-rw-r--r--modules/update/update.report.inc40
-rw-r--r--modules/upload/upload.admin.inc32
-rw-r--r--modules/upload/upload.module26
-rw-r--r--modules/user/user.admin.inc46
-rw-r--r--modules/user/user.install4
-rw-r--r--modules/user/user.module90
-rw-r--r--modules/user/user.pages.inc10
-rw-r--r--themes/bluemarine/comment.tpl.php2
-rw-r--r--themes/chameleon/chameleon.theme28
-rw-r--r--themes/engines/phptemplate/phptemplate.engine2
-rw-r--r--themes/garland/block.tpl.php2
-rw-r--r--themes/garland/comment.tpl.php2
-rw-r--r--themes/garland/maintenance-page.tpl.php10
-rw-r--r--themes/garland/page.tpl.php16
-rw-r--r--themes/garland/template.php12
-rw-r--r--themes/pushbutton/comment.tpl.php2
-rw-r--r--update.php54
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'] .'<br/>'. $batch['error_message'],
+ 'errorMessage' => $current_set['error_message'] . '<br/>' . $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'] .'<br/>'. $batch['error_message'];
+ $fallback = $current_set['error_message'] . '<br/>' . $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('<meta http-equiv="Refresh" content="0; URL='. $url .'">');
+ drupal_set_html_head('<meta http-equiv="Refresh" content="0; URL=' . $url . '">');
$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) .'<br/>';
+ $message = strtr($progress_message, $values) . '<br/>';
$message .= $task_message ? $task_message : '&nbsp';
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 .= '<p>'. t('Go to the <a href="@contact-page">contact page</a>.', array('@contact-page' => url('contact'))) .'</p>';
+ * $output .= '<p>' . t('Go to the <a href="@contact-page">contact page</a>.', array('@contact-page' => url('contact'))) . '</p>';
* @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 = "<channel>\n";
- $output .= ' <title>'. check_plain($title) ."</title>\n";
- $output .= ' <link>'. check_url($link) ."</link>\n";
+ $output .= ' <title>' . check_plain($title) . "</title>\n";
+ $output .= ' <link>' . check_url($link) . "</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 &amp becoming &amp;amp;).
- $output .= ' <description>'. check_plain(decode_entities(strip_tags($description))) ."</description>\n";
- $output .= ' <language>'. check_plain($langcode) ."</language>\n";
+ $output .= ' <description>' . check_plain(decode_entities(strip_tags($description))) . "</description>\n";
+ $output .= ' <language>' . check_plain($langcode) . "</language>\n";
$output .= format_xml_elements($args);
$output .= $items;
$output .= "</channel>\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 = "<item>\n";
- $output .= ' <title>'. check_plain($title) ."</title>\n";
- $output .= ' <link>'. check_url($link) ."</link>\n";
- $output .= ' <description>'. check_plain($description) ."</description>\n";
+ $output .= ' <title>' . check_plain($title) . "</title>\n";
+ $output .= ' <link>' . check_url($link) . "</link>\n";
+ $output .= ' <description>' . check_plain($description) . "</description>\n";
$output .= format_xml_elements($args);
$output .= "</item>\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 '<a href="'. check_url(url($path, $options)) .'"'. drupal_attributes($options['attributes']) .'>'. ($options['html'] ? $text : check_plain($text)) .'</a>';
+ return '<a href="' . check_url(url($path, $options)) . '"' . drupal_attributes($options['attributes']) . '>' . ($options['html'] ? $text : check_plain($text)) . '</a>';
}
/**
@@ -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 <link> tag to the page's HEAD.
*/
function drupal_add_link($attributes) {
- drupal_set_html_head('<link'. drupal_attributes($attributes) ." />\n");
+ drupal_set_html_head('<link' . drupal_attributes($attributes) . " />\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 .= '<link type="text/css" rel="stylesheet" media="'. $media .'" href="'. base_path() . $file . $query_string .'" />'."\n";
+ $no_module_preprocess .= '<link type="text/css" rel="stylesheet" media="' . $media . '" href="' . base_path() . $file . $query_string . '" />' . "\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 .= '<link type="text/css" rel="stylesheet" media="'. $media .'" href="'. base_path() . $file . $query_string .'" />'."\n";
+ $no_theme_preprocess .= '<link type="text/css" rel="stylesheet" media="' . $media . '" href="' . base_path() . $file . $query_string . '" />' . "\n";
}
else {
- $output .= '<link type="text/css" rel="stylesheet" media="'. $media .'" href="'. base_path() . $file . $query_string .'" />'."\n";
+ $output .= '<link type="text/css" rel="stylesheet" media="' . $media . '" href="' . base_path() . $file . $query_string . '" />' . "\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 .= '<link type="text/css" rel="stylesheet" media="'. $media .'" href="'. base_path() . $preprocess_file .'" />'."\n";
+ $output .= '<link type="text/css" rel="stylesheet" media="' . $media . '" href="' . base_path() . $preprocess_file . '" />' . "\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 .= '<script type="text/javascript">jQuery.extend(Drupal.settings, '. drupal_to_js(call_user_func_array('array_merge_recursive', $data)) .");</script>\n";
+ $output .= '<script type="text/javascript">jQuery.extend(Drupal.settings, ' . drupal_to_js(call_user_func_array('array_merge_recursive', $data)) . ");</script>\n";
break;
case 'inline':
foreach ($data as $info) {
- $output .= '<script type="text/javascript"'. ($info['defer'] ? ' defer="defer"' : '') .'>'. $info['code'] ."</script>\n";
+ $output .= '<script type="text/javascript"' . ($info['defer'] ? ' defer="defer"' : '') . '>' . $info['code'] . "</script>\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] .= '<script type="text/javascript"'. ($info['defer'] ? ' defer="defer"' : '') .' src="'. base_path() . $path . ($info['cache'] ? $query_string : '?'. time()) ."\"></script>\n";
+ $no_preprocess[$type] .= '<script type="text/javascript"' . ($info['defer'] ? ' defer="defer"' : '') . ' src="' . base_path() . $path . ($info['cache'] ? $query_string : '?' . time()) . "\"></script>\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 .= '<script type="text/javascript" src="'. base_path() . $preprocess_file .'"></script>'."\n";
+ $preprocessed .= '<script type="text/javascript" src="' . base_path() . $preprocess_file . '"></script>' . "\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 .= '<hr /><p><small>If you are the maintainer of this site, please check your database settings in the <code>settings.php</code> file and ensure that your hosting provider\'s database server is running. For more help, see the <a href="http://drupal.org/node/258">handbook</a>, or contact your hosting provider.</small></p>';
if ($error && ini_get('display_errors')) {
- $message .= '<p><small>The '. theme('placeholder', $db_type) .' error was: '. theme('placeholder', $error) .'.</small></p>';
+ $message .= '<p><small>The ' . theme('placeholder', $db_type) . ' error was: ' . theme('placeholder', $error) . '.</small></p>';
}
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 '<p>query: '. $query .'<br />error:'. mysql_error($active_db) .'</p>';
+ print '<p>query: ' . $query . '<br />error:' . mysql_error($active_db) . '</p>';
}
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 . ')';
// (?<!text) is a negative look-behind (no need to rewrite queries that already use DISTINCT).
- return preg_replace('/(SELECT.*)(?:'. $table .'\.|\s)(?<!DISTINCT\()(?<!DISTINCT\('. $table .'\.)'. $field .'(.*FROM )/AUsi', '\1 '. $field_to_select .'\2', $query);
+ return preg_replace('/(SELECT.*)(?:' . $table . '\.|\s)(?<!DISTINCT\()(?<!DISTINCT\(' . $table . '\.)' . $field . '(.*FROM )/AUsi', '\1 ' . $field_to_select . '\2', $query);
}
/**
diff --git a/includes/database.mysqli.inc b/includes/database.mysqli.inc
index 4cc3945d0..a20ba31d9 100644
--- a/includes/database.mysqli.inc
+++ b/includes/database.mysqli.inc
@@ -104,13 +104,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 = 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 '<p>query: '. $query .'<br />error:'. mysqli_error($active_db) .'</p>';
+ print '<p>query: ' . $query . '<br />error:' . mysqli_error($active_db) . '</p>';
}
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 . ')';
// (?<!text) is a negative look-behind (no need to rewrite queries that already use DISTINCT).
- return preg_replace('/(SELECT.*)(?:'. $table .'\.|\s)(?<!DISTINCT\()(?<!DISTINCT\('. $table .'\.)'. $field .'(.*FROM )/AUsi', '\1 '. $field_to_select .'\2', $query);
+ return preg_replace('/(SELECT.*)(?:' . $table . '\.|\s)(?<!DISTINCT\()(?<!DISTINCT\(' . $table . '\.)' . $field . '(.*FROM )/AUsi', '\1 ' . $field_to_select . '\2', $query);
}
/**
diff --git a/includes/database.pgsql.inc b/includes/database.pgsql.inc
index 3362ebaab..ed5921fe6 100644
--- a/includes/database.pgsql.inc
+++ b/includes/database.pgsql.inc
@@ -55,19 +55,19 @@ function db_connect($url) {
// 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']);
}
// pg_last_error() does not return a useful error message for database
@@ -139,7 +139,7 @@ function _db_query($query, $debug = 0) {
if (variable_get('dev_query', 0)) {
$bt = debug_backtrace();
- $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;
@@ -147,7 +147,7 @@ function _db_query($query, $debug = 0) {
}
if ($debug) {
- print '<p>query: '. $query .'<br />error:'. pg_last_error($active_db) .'</p>';
+ print '<p>query: ' . $query . '<br />error:' . pg_last_error($active_db) . '</p>';
}
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";
// (?<!text) is a negative look-behind (no need to rewrite queries that already use DISTINCT).
- $query = preg_replace('/(SELECT.*)(?:'. $table .'\.|\s)(?<!DISTINCT\()(?<!DISTINCT\('. $table .'\.)'. $field .'(.*FROM )/AUsi', '\1 '. $field_to_select .'\2', $query);
- $query = preg_replace('/(ORDER BY )(?!'. $table .'\.'. $field .')/', '\1'."$table.$field, ", $query);
+ $query = preg_replace('/(SELECT.*)(?:' . $table . '\.|\s)(?<!DISTINCT\()(?<!DISTINCT\(' . $table . '\.)' . $field . '(.*FROM )/AUsi', '\1 ' . $field_to_select . '\2', $query);
+ $query = preg_replace('/(ORDER BY )(?!' . $table . '\.' . $field . ')/', '\1' . "$table.$field, ", $query);
return $query;
}
@@ -498,15 +498,15 @@ function db_create_table_sql($name, $table) {
$sql_keys = array();
if (isset($table['primary key']) && is_array($table['primary key'])) {
- $sql_keys[] = 'PRIMARY KEY ('. implode(', ', $table['primary key']) .')';
+ $sql_keys[] = 'PRIMARY KEY (' . implode(', ', $table['primary key']) . ')';
}
if (isset($table['unique keys']) && is_array($table['unique keys'])) {
foreach ($table['unique keys'] as $key_name => $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' => '<br />'. nl2br(check_plain($htaccess_lines)));
+ $variables = array('%directory' => $directory, '!htaccess' => '<br />' . 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: <code>!htaccess</code>", $variables));
watchdog('security', "Security warning: Couldn't write .htaccess file. Please create a .htaccess file in your %directory directory which contains the following lines: <code>!htaccess</code>", $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 .= '<ul><li>'. implode('</li><li>', $errors) .'</li></ul>';
+ $message .= '<ul><li>' . implode('</li><li>', $errors) . '</li></ul>';
}
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, '<select name="'. $element['#name'] .''. ($multiple ? '[]' : '') .'"'. ($multiple ? ' multiple="multiple" ' : '') . drupal_attributes($element['#attributes']) .' id="'. $element['#id'] .'" '. $size .'>'. form_select_options($element) .'</select>');
+ return theme('form_element', $element, '<select name="' . $element['#name'] . '' . ($multiple ? '[]' : '') . '"' . ($multiple ? ' multiple="multiple" ' : '') . drupal_attributes($element['#attributes']) . ' id="' . $element['#id'] . '" ' . $size . '>' . form_select_options($element) . '</select>');
}
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 .= '<optgroup label="'. $key .'">';
+ $options .= '<optgroup label="' . $key . '">';
$options .= form_select_options($element, $choice);
$options .= '</optgroup>';
}
@@ -1407,7 +1407,7 @@ function form_select_options($element, $choices = NULL) {
else {
$selected = '';
}
- $options .= '<option value="'. check_plain($key) .'"'. $selected .'>'. check_plain($choice) .'</option>';
+ $options .= '<option value="' . check_plain($key) . '"' . $selected . '>' . check_plain($choice) . '</option>';
}
}
return $options;
@@ -1488,7 +1488,7 @@ function theme_fieldset($element) {
}
}
- return '<fieldset'. drupal_attributes($element['#attributes']) .'>'. ($element['#title'] ? '<legend>'. $element['#title'] .'</legend>' : '') . (isset($element['#description']) && $element['#description'] ? '<div class="description">'. $element['#description'] .'</div>' : '') . (!empty($element['#children']) ? $element['#children'] : '') . $element['#value'] ."</fieldset>\n";
+ return '<fieldset' . drupal_attributes($element['#attributes']) . '>' . ($element['#title'] ? '<legend>' . $element['#title'] . '</legend>' : '') . (isset($element['#description']) && $element['#description'] ? '<div class="description">' . $element['#description'] . '</div>' : '') . (!empty($element['#children']) ? $element['#children'] : '') . $element['#value'] . "</fieldset>\n";
}
/**
@@ -1505,12 +1505,12 @@ function theme_fieldset($element) {
function theme_radio($element) {
_form_set_class($element, array('form-radio'));
$output = '<input type="radio" ';
- $output .= 'name="'. $element['#name'] .'" ';
- $output .= 'value="'. $element['#return_value'] .'" ';
+ $output .= 'name="' . $element['#name'] . '" ';
+ $output .= 'value="' . $element['#return_value'] . '" ';
$output .= (check_plain($element['#value']) == $element['#return_value']) ? ' checked="checked" ' : ' ';
- $output .= drupal_attributes($element['#attributes']) .' />';
+ $output .= drupal_attributes($element['#attributes']) . ' />';
if (!is_null($element['#title'])) {
- $output = '<label class="option">'. $output .' '. $element['#title'] .'</label>';
+ $output = '<label class="option">' . $output . ' ' . $element['#title'] . '</label>';
}
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'] = '<div class="'. $class .'">'. (!empty($element['#children']) ? $element['#children'] : '') .'</div>';
+ $element['#children'] = '<div class="' . $class . '">' . (!empty($element['#children']) ? $element['#children'] : '') . '</div>';
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, '<div class="container-inline">'. $element['#children'] .'</div>');
+ return theme('form_element', $element, '<div class="container-inline">' . $element['#children'] . '</div>');
}
/**
@@ -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 = '<input ';
$checkbox .= 'type="checkbox" ';
- $checkbox .= 'name="'. $element['#name'] .'" ';
- $checkbox .= 'id="'. $element['#id'] .'" ' ;
- $checkbox .= 'value="'. $element['#return_value'] .'" ';
+ $checkbox .= 'name="' . $element['#name'] . '" ';
+ $checkbox .= 'id="' . $element['#id'] . '" ' ;
+ $checkbox .= 'value="' . $element['#return_value'] . '" ';
$checkbox .= $element['#value'] ? ' checked="checked" ' : ' ';
- $checkbox .= drupal_attributes($element['#attributes']) .' />';
+ $checkbox .= drupal_attributes($element['#attributes']) . ' />';
if (!is_null($element['#title'])) {
- $checkbox = '<label class="option">'. $checkbox .' '. $element['#title'] .'</label>';
+ $checkbox = '<label class="option">' . $checkbox . ' ' . $element['#title'] . '</label>';
}
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'] = '<div class="'. $class .'">'. (!empty($element['#children']) ? $element['#children'] : '') .'</div>';
+ $element['#children'] = '<div class="' . $class . '">' . (!empty($element['#children']) ? $element['#children'] : '') . '</div>';
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 '<input type="submit" '. (empty($element['#name']) ? '' : 'name="'. $element['#name'] .'" ') .'id="'. $element['#id'] .'" value="'. check_plain($element['#value']) .'" '. drupal_attributes($element['#attributes']) ." />\n";
+ return '<input type="submit" ' . (empty($element['#name']) ? '' : 'name="' . $element['#name'] . '" ') . 'id="' . $element['#id'] . '" value="' . check_plain($element['#value']) . '" ' . drupal_attributes($element['#attributes']) . " />\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 '<input type="image" name="'. $element['#name'] .'" '.
- (!empty($element['#value']) ? ('value="'. check_plain($element['#value']) .'" ') : '') .
- 'id="'. $element['#id'] .'" '.
+ return '<input type="image" name="' . $element['#name'] . '" ' .
+ (!empty($element['#value']) ? ('value="' . check_plain($element['#value']) . '" ') : '') .
+ 'id="' . $element['#id'] . '" ' .
drupal_attributes($element['#attributes']) .
- ' src="'. base_path() . $element['#src'] .'" '.
- (!empty($element['#title']) ? 'alt="'. check_plain($element['#title']) .'" title="'. check_plain($element['#title']) .'" ' : '' ) .
+ ' src="' . base_path() . $element['#src'] . '" ' .
+ (!empty($element['#title']) ? 'alt="' . check_plain($element['#title']) . '" title="' . check_plain($element['#title']) . '" ' : '' ) .
"/>\n";
}
@@ -1957,7 +1957,7 @@ function theme_image_button($element) {
* @ingroup themeable
*/
function theme_hidden($element) {
- return '<input type="hidden" name="'. $element['#name'] .'" id="'. $element['#id'] .'" value="'. check_plain($element['#value']) ."\" ". drupal_attributes($element['#attributes']) ." />\n";
+ return '<input type="hidden" name="' . $element['#name'] . '" id="' . $element['#id'] . '" value="' . check_plain($element['#value']) . "\" " . drupal_attributes($element['#attributes']) . " />\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 = '<input class="autocomplete" type="hidden" id="'. $element['#id'] .'-autocomplete" value="'. check_url(url($element['#autocomplete_path'], array('absolute' => TRUE))) .'" disabled="disabled" />';
+ $extra = '<input class="autocomplete" type="hidden" id="' . $element['#id'] . '-autocomplete" value="' . check_url(url($element['#autocomplete_path'], array('absolute' => TRUE))) . '" disabled="disabled" />';
}
_form_set_class($element, $class);
if (isset($element['#field_prefix'])) {
- $output .= '<span class="field-prefix">'. $element['#field_prefix'] .'</span> ';
+ $output .= '<span class="field-prefix">' . $element['#field_prefix'] . '</span> ';
}
- $output .= '<input type="text"'. $maxlength .' name="'. $element['#name'] .'" id="'. $element['#id'] .'"'. $size .' value="'. check_plain($element['#value']) .'"'. drupal_attributes($element['#attributes']) .' />';
+ $output .= '<input type="text"' . $maxlength . ' name="' . $element['#name'] . '" id="' . $element['#id'] . '"' . $size . ' value="' . check_plain($element['#value']) . '"' . drupal_attributes($element['#attributes']) . ' />';
if (isset($element['#field_suffix'])) {
- $output .= ' <span class="field-suffix">'. $element['#field_suffix'] .'</span>';
+ $output .= ' <span class="field-suffix">' . $element['#field_suffix'] . '</span>';
}
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 '<form '. $action .' accept-charset="UTF-8" method="'. $element['#method'] .'" id="'. $element['#id'] .'"'. drupal_attributes($element['#attributes']) .">\n<div>". $element['#children'] ."\n</div></form>\n";
+ $action = $element['#action'] ? 'action="' . check_url($element['#action']) . '" ' : '';
+ return '<form ' . $action . ' accept-charset="UTF-8" method="' . $element['#method'] . '" id="' . $element['#id'] . '"' . drupal_attributes($element['#attributes']) . ">\n<div>" . $element['#children'] . "\n</div></form>\n";
}
/**
@@ -2054,7 +2054,7 @@ function theme_textarea($element) {
}
_form_set_class($element, $class);
- return theme('form_element', $element, '<textarea cols="'. $element['#cols'] .'" rows="'. $element['#rows'] .'" name="'. $element['#name'] .'" id="'. $element['#id'] .'" '. drupal_attributes($element['#attributes']) .'>'. check_plain($element['#value']) .'</textarea>');
+ return theme('form_element', $element, '<textarea cols="' . $element['#cols'] . '" rows="' . $element['#rows'] . '" name="' . $element['#name'] . '" id="' . $element['#id'] . '" ' . drupal_attributes($element['#attributes']) . '>' . check_plain($element['#value']) . '</textarea>');
}
/**
@@ -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 = '<input type="password" name="'. $element['#name'] .'" id="'. $element['#id'] .'" '. $maxlength . $size . drupal_attributes($element['#attributes']) .' />';
+ $output = '<input type="password" name="' . $element['#name'] . '" id="' . $element['#id'] . '" ' . $maxlength . $size . drupal_attributes($element['#attributes']) . ' />';
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, '<input type="file" name="'. $element['#name'] .'"'. ($element['#attributes'] ? ' '. drupal_attributes($element['#attributes']) : '') .' id="'. $element['#id'] .'" size="'. $element['#size'] ."\" />\n");
+ return theme('form_element', $element, '<input type="file" name="' . $element['#name'] . '"' . ($element['#attributes'] ? ' ' . drupal_attributes($element['#attributes']) : '') . ' id="' . $element['#id'] . '" size="' . $element['#size'] . "\" />\n");
}
/**
@@ -2154,25 +2154,25 @@ function theme_form_element($element, $value) {
$output = '<div class="form-item"';
if (!empty($element['#id'])) {
- $output .= ' id="'. $element['#id'] .'-wrapper"';
+ $output .= ' id="' . $element['#id'] . '-wrapper"';
}
$output .= ">\n";
- $required = !empty($element['#required']) ? '<span class="form-required" title="'. $t('This field is required.') .'">*</span>' : '';
+ $required = !empty($element['#required']) ? '<span class="form-required" title="' . $t('This field is required.') . '">*</span>' : '';
if (!empty($element['#title'])) {
$title = $element['#title'];
if (!empty($element['#id'])) {
- $output .= ' <label for="'. $element['#id'] .'">'. $t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) ."</label>\n";
+ $output .= ' <label for="' . $element['#id'] . '">' . $t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) . "</label>\n";
}
else {
- $output .= ' <label>'. $t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) ."</label>\n";
+ $output .= ' <label>' . $t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) . "</label>\n";
}
}
$output .= " $value\n";
if (!empty($element['#description'])) {
- $output .= ' <div class="description">'. $element['#description'] ."</div>\n";
+ $output .= ' <div class="description">' . $element['#description'] . "</div>\n";
}
$output .= "</div>\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] = '<em>'. check_plain($value) .'</em>';
+ $args[$key] = '<em>' . check_plain($value) . '</em>';
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),
- '<strong>'. drupal_render($form['name'][$key]) .'</strong>',
+ '<strong>' . drupal_render($form['name'][$key]) . '</strong>',
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 <EMAIL@ADDRESS>\\n\"\n";
$header .= "\"Language-Team: LANGUAGE <EMAIL@ADDRESS>\\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 <EMAIL@ADDRESS>\\n\"\n";
$header .= "\"Language-Team: LANGUAGE <EMAIL@ADDRESS>\\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)) .'<br /><small>'. $value['location'] .'</small>'),
+ array('data' => check_plain(truncate_utf8($value['source'], 150, FALSE, TRUE)) . '<br /><small>' . $value['location'] . '</small>'),
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 .' ' : "<em class=\"locale-untranslated\">$langcode</em> ";
+ $output .= (!empty($translation[$langcode])) ? $langcode . ' ' : "<em class=\"locale-untranslated\">$langcode</em> ";
}
}
@@ -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[] = '<front>';
$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 '<ul class="menu">'. $tree .'</ul>';
+ return '<ul class="menu">' . $tree . '</ul>';
}
/**
@@ -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 '<li class="'. $class .'">'. $link . $menu ."</li>\n";
+ return '<li class="' . $class . '">' . $link . $menu . "</li>\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 '<li '. ($active ? 'class="active" ' : '') .'>'. $link ."</li>\n";
+ return '<li ' . ($active ? 'class="active" ' : '') . '>' . $link . "</li>\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 .= "<ul class=\"tabs primary\">\n". $primary ."</ul>\n";
+ $output .= "<ul class=\"tabs primary\">\n" . $primary . "</ul>\n";
}
if ($secondary = menu_secondary_local_tasks()) {
- $output .= "<ul class=\"tabs secondary\">\n". $secondary ."</ul>\n";
+ $output .= "<ul class=\"tabs secondary\">\n" . $secondary . "</ul>\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)/', '/\\\\\*/', '/(^|\|)\\\\<front\\\\>($|\|)/'), array('|', '.*', '\1'. preg_quote(variable_get('site_frontpage', 'node'), '/') .'\2'), preg_quote($patterns, '/')) .')$/';
+ $regexps[$patterns] = '/^(' . preg_replace(array('/(\r\n?|\n)/', '/\\\\\*/', '/(^|\|)\\\\<front\\\\>($|\|)/'), 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 '<em>'. check_plain($text) .'</em>';
+ return '<em>' . check_plain($text) . '</em>';
}
/**
@@ -1062,7 +1062,7 @@ function theme_status_messages($display = NULL) {
if (count($messages) > 1) {
$output .= " <ul>\n";
foreach ($messages as $message) {
- $output .= ' <li>'. $message ."</li>\n";
+ $output .= ' <li>' . $message . "</li>\n";
}
$output .= " </ul>\n";
}
@@ -1088,7 +1088,7 @@ function theme_links($links, $attributes = array('class' => 'links')) {
$output = '';
if (count($links) > 0) {
- $output = '<ul'. drupal_attributes($attributes) .'>';
+ $output = '<ul' . drupal_attributes($attributes) . '>';
$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'] == '<front>' && drupal_is_front_page()))) {
$class .= ' active';
}
- $output .= '<li class="'. $class .'">';
+ $output .= '<li class="' . $class . '">';
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 .= '<span'. $span_attributes .'>'. $link['title'] .'</span>';
+ $output .= '<span' . $span_attributes . '>' . $link['title'] . '</span>';
}
$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 '<img src="'. check_url($url) .'" alt="'. check_plain($alt) .'" title="'. check_plain($title) .'" '. (isset($image_attributes) ? $image_attributes : '') . $attributes .' />';
+ return '<img src="' . check_url($url) . '" alt="' . check_plain($alt) . '" title="' . check_plain($title) . '" ' . (isset($image_attributes) ? $image_attributes : '') . $attributes . ' />';
}
}
@@ -1167,7 +1167,7 @@ function theme_image($path, $alt = '', $title = '', $attributes = NULL, $getsize
*/
function theme_breadcrumb($breadcrumb) {
if (!empty($breadcrumb)) {
- return '<div class="breadcrumb">'. implode(' » ', $breadcrumb) .'</div>';
+ return '<div class="breadcrumb">' . implode(' » ', $breadcrumb) . '</div>';
}
}
@@ -1178,7 +1178,7 @@ function theme_breadcrumb($breadcrumb) {
*/
function theme_help() {
if ($help = menu_get_active_help()) {
- return '<div class="help">'. $help .'</div>';
+ return '<div class="help">' . $help . '</div>';
}
}
@@ -1189,7 +1189,7 @@ function theme_help() {
* An array of links.
*/
function theme_submenu($links) {
- return '<div class="submenu">'. implode(' | ', $links) .'</div>';
+ return '<div class="submenu">' . implode(' | ', $links) . '</div>';
}
/**
@@ -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 = '<table'. drupal_attributes($attributes) .">\n";
+ $output = '<table' . drupal_attributes($attributes) . ">\n";
if (isset($caption)) {
- $output .= '<caption>'. $caption ."</caption>\n";
+ $output .= '<caption>' . $caption . "</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 .= ' <tr'. drupal_attributes($attributes) .'>';
+ $output .= ' <tr' . drupal_attributes($attributes) . '>';
$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 = '<h2 class="title">'. $title .'</h2><div>'. $content .'</div>';
+ $output = '<h2 class="title">' . $title . '</h2><div>' . $content . '</div>';
return $output;
}
@@ -1374,10 +1374,10 @@ function theme_mark($type = MARK_NEW) {
global $user;
if ($user->uid) {
if ($type == MARK_NEW) {
- return ' <span class="marker">'. t('new') .'</span>';
+ return ' <span class="marker">' . t('new') . '</span>';
}
else if ($type == MARK_UPDATED) {
- return ' <span class="marker">'. t('updated') .'</span>';
+ return ' <span class="marker">' . t('updated') . '</span>';
}
}
}
@@ -1403,11 +1403,11 @@ function theme_mark($type = MARK_NEW) {
function theme_item_list($items = array(), $title = NULL, $type = 'ul', $attributes = NULL) {
$output = '<div class="item-list">';
if (isset($title)) {
- $output .= '<h3>'. $title .'</h3>';
+ $output .= '<h3>' . $title . '</h3>';
}
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 .= '<li'. drupal_attributes($attributes) .'>'. $data ."</li>\n";
+ $output .= '<li' . drupal_attributes($attributes) . '>' . $data . "</li>\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 '<div class="more-help-link">'. t('<a href="@link">More help</a>', array('@link' => check_url($url))) .'</div>';
+ return '<div class="more-help-link">' . t('<a href="@link">More help</a>', array('@link' => check_url($url))) . '</div>';
}
/**
@@ -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 '<a href="'. check_url($url) .'" class="xml-icon">'. $image .'</a>';
+ return '<a href="' . check_url($url) . '" class="xml-icon">' . $image . '</a>';
}
}
@@ -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 '<a href="'. check_url($url) .'" class="feed-icon">'. $image .'</a>';
+ return '<a href="' . check_url($url) . '" class="feed-icon">' . $image . '</a>';
}
}
@@ -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 '<div class="more-link">'. t('<a href="@link" title="@title">more</a>', array('@link' => check_url($url), '@title' => $title)) .'</div>';
+ return '<div class="more-link">' . t('<a href="@link" title="@title">more</a>', array('@link' => check_url($url), '@title' => $title)) . '</div>';
}
/**
@@ -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 = '<div id="progress" class="progress">';
- $output .= '<div class="bar"><div class="filled" style="width: '. $percent .'%"></div></div>';
- $output .= '<div class="percentage">'. $percent .'%</div>';
- $output .= '<div class="message">'. $message .'</div>';
+ $output .= '<div class="bar"><div class="filled" style="width: ' . $percent . '%"></div></div>';
+ $output .= '<div class="percentage">' . $percent . '%</div>';
+ $output .= '<div class="message">' . $message . '</div>';
$output .= '</div>';
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('<link rel="shortcut icon" href="'. check_url(theme_get_setting('favicon')) .'" type="image/x-icon" />');
+ drupal_set_html_head('<link rel="shortcut icon" href="' . check_url(theme_get_setting('favicon')) . '" type="image/x-icon" />');
}
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 .= '<li class="'. $class .'">'. $item .'</li>';
+ $output .= '<li class="' . $class . '">' . $item . '</li>';
}
$output .= '</ol>';
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'] .= '<h3>'. $title .':</h3>';
+ $variables['messages'] .= '<h3>' . $title . ':</h3>';
$variables['messages'] .= theme('status_messages', 'error');
- $variables['content'] .= '<p>'. st('Please check the error messages and <a href="!url">try again</a>.', array('!url' => request_uri())) .'</p>';
+ $variables['content'] .= '<p>' . st('Please check the error messages and <a href="!url">try again</a>.', array('!url' => request_uri())) . '</p>';
}
// 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'] .= '<h4>'. $title .':</h4>';
+ $variables['messages'] .= '<h4>' . $title . ':</h4>';
$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'] .= '<h4>'. $title .':</h4>';
+ $variables['messages'] .= '<h4>' . $title . ':</h4>';
$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'] .= '<h4>'. $title .':</h4>';
+ $variables['messages'] .= '<h4>' . $title . ':</h4>';
$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('<link rel="shortcut icon" href="'. check_url(theme_get_setting('favicon')) .'" type="image/x-icon" />');
+ drupal_set_html_head('<link rel="shortcut icon" href="' . check_url(theme_get_setting('favicon')) . '" type="image/x-icon" />');
}
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 '<boolean>'. (($xmlrpc_value->data) ? '1' : '0') .'</boolean>';
+ return '<boolean>' . (($xmlrpc_value->data) ? '1' : '0') . '</boolean>';
break;
case 'int':
- return '<int>'. $xmlrpc_value->data .'</int>';
+ return '<int>' . $xmlrpc_value->data . '</int>';
break;
case 'double':
- return '<double>'. $xmlrpc_value->data .'</double>';
+ return '<double>' . $xmlrpc_value->data . '</double>';
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 '<string>'. htmlspecialchars($xmlrpc_value->data) .'</string>';
+ return '<string>' . htmlspecialchars($xmlrpc_value->data) . '</string>';
break;
case 'array':
- $return = '<array><data>'."\n";
+ $return = '<array><data>' . "\n";
foreach ($xmlrpc_value->data as $item) {
- $return .= ' <value>'. xmlrpc_value_get_xml($item) ."</value>\n";
+ $return .= ' <value>' . xmlrpc_value_get_xml($item) . "</value>\n";
}
$return .= '</data></array>';
return $return;
break;
case 'struct':
- $return = '<struct>'."\n";
+ $return = '<struct>' . "\n";
foreach ($xmlrpc_value->data as $name => $value) {
- $return .= " <member><name>". check_plain($name) ."</name><value>";
- $return .= xmlrpc_value_get_xml($value) ."</value></member>\n";
+ $return .= " <member><name>" . check_plain($name) . "</name><value>";
+ $return .= xmlrpc_value_get_xml($value) . "</value></member>\n";
}
$return .= '</struct>';
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 '<dateTime.iso8601>'. $xmlrpc_date->year . $xmlrpc_date->month . $xmlrpc_date->day .'T'. $xmlrpc_date->hour .':'. $xmlrpc_date->minute .':'. $xmlrpc_date->second .'</dateTime.iso8601>';
+ return '<dateTime.iso8601>' . $xmlrpc_date->year . $xmlrpc_date->month . $xmlrpc_date->day . 'T' . $xmlrpc_date->hour . ':' . $xmlrpc_date->minute . ':' . $xmlrpc_date->second . '</dateTime.iso8601>';
}
function xmlrpc_base64($data) {
@@ -414,7 +414,7 @@ function xmlrpc_base64($data) {
}
function xmlrpc_base64_get_xml($xmlrpc_base64) {
- return '<base64>'. base64_encode($xmlrpc_base64->data) .'</base64>';
+ return '<base64>' . base64_encode($xmlrpc_base64->data) . '</base64>';
}
/**
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) {
<methodResponse>
<params>
<param>
- <value>'.
+ <value>' .
xmlrpc_value_get_xml($r)
- .'</value>
+ . '</value>
</param>
</params>
</methodResponse>
@@ -105,11 +105,11 @@ function xmlrpc_server_error($error, $message = FALSE) {
}
function xmlrpc_server_output($xml) {
- $xml = '<?xml version="1.0"?>'."\n". $xml;
+ $xml = '<?xml version="1.0"?>' . "\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' => '<p>'. st('To set up your @drupal database, enter the following information.', array('@drupal' => drupal_install_profile_name())) .'</p>',
+ '#description' => '<p>' . st('To set up your @drupal database, enter the following information.', array('@drupal' => drupal_install_profile_name())) . '</p>',
);
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 <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. 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 = '<p>'. 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:') .'</p>';
- $output .= '<ul><li>'. st('Determine if <a href="@translations" target="_blank">a translation of this Drupal version</a> 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')) .'</li>';
- $output .= '<li>'. st('If an alternative translation package of your choice is available, download and extract its contents to your Drupal root directory.') .'</li>';
- $output .= '<li>'. 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.') .'</li>';
- $output .= '</ul><p>'. 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.') .'</p>';
- $output .= '<p>'. st('How should the installation continue?') .'</p>';
- $output .= '<ul><li><a href="install.php?profile='. $profilename .'&amp;locale=en">'. st('Continue installation in English') .'</a></li><li><a href="install.php?profile='. $profilename .'">'. st('Return to choose a language') .'</a></li></ul>';
+ $output = '<p>' . 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:') . '</p>';
+ $output .= '<ul><li>' . st('Determine if <a href="@translations" target="_blank">a translation of this Drupal version</a> 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')) . '</li>';
+ $output .= '<li>' . st('If an alternative translation package of your choice is available, download and extract its contents to your Drupal root directory.') . '</li>';
+ $output .= '<li>' . 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.') . '</li>';
+ $output .= '</ul><p>' . 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.') . '</p>';
+ $output .= '<p>' . st('How should the installation continue?') . '</p>';
+ $output .= '<ul><li><a href="install.php?profile=' . $profilename . '&amp;locale=en">' . st('Continue installation in English') . '</a></li><li><a href="install.php?profile=' . $profilename . '">' . st('Return to choose a language') . '</a></li></ul>';
}
else {
- $output = '<ul><li><a href="install.php?profile='. $profilename .'&amp;locale=en">'. st('Install Drupal in English') .'</a></li><li><a href="install.php?profile='. $profilename .'&amp;localize=true">'. st('Learn how to install Drupal in other languages') .'</a></li></ul>';
+ $output = '<ul><li><a href="install.php?profile=' . $profilename . '&amp;locale=en">' . st('Install Drupal in English') . '</a></li><li><a href="install.php?profile=' . $profilename . '&amp;localize=true">' . st('Learn how to install Drupal in other languages') . '</a></li></ul>';
}
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', '<p>'. 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.') .'</p>');
+ print theme('install_page', '<p>' . 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.') . '</p>');
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 <a href="@handbook_url">on-line handbook</a>.', 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 <a href="http://drupal.org/node/15365">handbook page on Clean URLs</a> 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 = '<p>'. st('Congratulations, @drupal has been successfully installed.', array('@drupal' => drupal_install_profile_name())) .'</p>';
- $output .= '<p>'. (isset($messages['error']) ? st('Please review the messages above before continuing on to <a href="@url">your new site</a>.', array('@url' => url(''))) : st('You may now visit <a href="@url">your new site</a>.', array('@url' => url('')))) .'</p>';
+ $output = '<p>' . st('Congratulations, @drupal has been successfully installed.', array('@drupal' => drupal_install_profile_name())) . '</p>';
+ $output .= '<p>' . (isset($messages['error']) ? st('Please review the messages above before continuing on to <a href="@url">your new site</a>.', array('@url' => url(''))) : st('You may now visit <a href="@url">your new site</a>.', array('@url' => url('')))) . '</p>';
$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' => '<p class="description">'. 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.') .'</p>',
+ '#value' => '<p class="description">' . 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.') . '</p>',
'#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 = '<h3>'. t('Feed overview') .'</h3>';
+ $output = '<h3>' . t('Feed overview') . '</h3>';
$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 .= '<h3>'. t('Category overview') .'</h3>';
+ $output .= '<h3>' . t('Category overview') . '</h3>';
$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 = '<p>'. 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 <a href="@rss">RSS</a>, <a href="@rdf">RDF</a>, and <a href="@atom">Atom</a>.', array('@rss' => 'http://cyber.law.harvard.edu/rss/', '@rdf' => 'http://www.w3.org/RDF/', '@atom' => 'http://www.atomenabled.org')) .'</p>';
- $output .= '<p>'. 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 <a href="@aggregator">main aggregator display</a> or by <a href="@aggregator-sources">their source</a>. Administrators can <a href="@feededit">add, edit and delete feeds</a> 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 <a href="@admin-block">blocks administration page</a>. A <a href="@aggregator-opml">machine-readable OPML file</a> of all feeds is available. A correctly configured <a href="@cron">cron maintenance task</a> 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'))) .'</p>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@aggregator">Aggregator module</a>.', array('@aggregator' => 'http://drupal.org/handbook/modules/aggregator/')) .'</p>';
+ $output = '<p>' . 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 <a href="@rss">RSS</a>, <a href="@rdf">RDF</a>, and <a href="@atom">Atom</a>.', array('@rss' => 'http://cyber.law.harvard.edu/rss/', '@rdf' => 'http://www.w3.org/RDF/', '@atom' => 'http://www.atomenabled.org')) . '</p>';
+ $output .= '<p>' . 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 <a href="@aggregator">main aggregator display</a> or by <a href="@aggregator-sources">their source</a>. Administrators can <a href="@feededit">add, edit and delete feeds</a> 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 <a href="@admin-block">blocks administration page</a>. A <a href="@aggregator-opml">machine-readable OPML file</a> of all feeds is available. A correctly configured <a href="@cron">cron maintenance task</a> 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'))) . '</p>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@aggregator">Aggregator module</a>.', array('@aggregator' => 'http://drupal.org/handbook/modules/aggregator/')) . '</p>';
return $output;
case 'admin/content/aggregator':
- $output = '<p>'. 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 <a href="@rss">RSS</a>, <a href="@rdf">RDF</a>, and <a href="@atom">Atom</a>.', array('@rss' => 'http://cyber.law.harvard.edu/rss/', '@rdf' => 'hsttp://www.w3.org/RDF/', '@atom' => 'http://www.atomenabled.org')) .'</p>';
- $output .= '<p>'. t('Current feeds are listed below, and <a href="@addfeed">new feeds may be added</a>. For each feed or feed category, the <em>latest items</em> block may be enabled at the <a href="@block">blocks administration page</a>.', array('@addfeed' => url('admin/content/aggregator/add/feed'), '@block' => url('admin/build/block'))) .'</p>';
+ $output = '<p>' . 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 <a href="@rss">RSS</a>, <a href="@rdf">RDF</a>, and <a href="@atom">Atom</a>.', array('@rss' => 'http://cyber.law.harvard.edu/rss/', '@rdf' => 'hsttp://www.w3.org/RDF/', '@atom' => 'http://www.atomenabled.org')) . '</p>';
+ $output .= '<p>' . t('Current feeds are listed below, and <a href="@addfeed">new feeds may be added</a>. For each feed or feed category, the <em>latest items</em> block may be enabled at the <a href="@block">blocks administration page</a>.', array('@addfeed' => url('admin/content/aggregator/add/feed'), '@block' => url('admin/build/block'))) . '</p>';
return $output;
case 'admin/content/aggregator/add/feed':
- return '<p>'. t('Add a feed in RSS, RDF or Atom format. A feed may only have one entry.') .'</p>';
+ return '<p>' . t('Add a feed in RSS, RDF or Atom format. A feed may only have one entry.') . '</p>';
case 'admin/content/aggregator/add/category':
- return '<p>'. t('Categories allow feed items from different feeds to be grouped together. For example, several sport-related feeds may belong to a category named <em>Sports</em>. Feed items may be grouped automatically (by selecting a category when creating or editing a feed) or manually (via the <em>Categorize</em> page available from feed item listings). Each category provides its own feed page and block.') .'</p>';
+ return '<p>' . t('Categories allow feed items from different feeds to be grouped together. For example, several sport-related feeds may belong to a category named <em>Sports</em>. Feed items may be grouped automatically (by selecting a category when creating or editing a feed) or manually (via the <em>Categorize</em> page available from feed item listings). Each category provides its own feed page and block.') . '</p>';
}
}
@@ -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 = '<a href="'. check_url($image['LINK']) .'" class="feed-image"><img src="'. check_url($image['URL']) .'" alt="'. check_plain($image['TITLE']) .'" /></a>';
+ $image = '<a href="' . check_url($image['LINK']) . '" class="feed-image"><img src="' . check_url($image['URL']) . '" alt="' . check_plain($image['TITLE']) . '" /></a>';
}
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 .= '<div class="icon">'. 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)) .'</div>';
+ $output .= '<div class="icon">' . 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)) . '</div>';
}
}
// Display the external link to the item.
- $output .= '<a href="'. check_url($item->link) .'">'. check_plain($item->title) ."</a>\n";
+ $output .= '<a href="' . check_url($item->link) . '">' . check_plain($item->title) . "</a>\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 .= '<p><a href="'. check_url($feed->link) .'">'. t('read more') ."</a></p>\n";
+ $teaser .= '<p><a href="' . check_url($feed->link) . '">' . t('read more') . "</a></p>\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 = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
@@ -422,12 +422,12 @@ function theme_aggregator_page_opml($feeds) {
$output = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
$output .= "<opml version=\"1.1\">\n";
$output .= "<head>\n";
- $output .= '<title>'. check_plain(variable_get('site_name', 'Drupal')) ."</title>\n";
- $output .= '<dateModified>'. gmdate('r') ."</dateModified>\n";
+ $output .= '<title>' . check_plain(variable_get('site_name', 'Drupal')) . "</title>\n";
+ $output .= '<dateModified>' . gmdate('r') . "</dateModified>\n";
$output .= "</head>\n";
$output .= "<body>\n";
foreach ($feeds as $feed) {
- $output .= '<outline text="'. check_plain($feed->title) .'" xmlUrl="'. check_url($feed->url) ."\" />\n";
+ $output .= '<outline text="' . check_plain($feed->title) . '" xmlUrl="' . check_url($feed->url) . "\" />\n";
}
$output .= "</body>\n";
$output .= "</opml>\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 @@
<?php
// Add table javascript.
drupal_add_js('misc/tableheader.js');
- drupal_add_js(drupal_get_path('module', 'block') .'/block.js');
+ drupal_add_js(drupal_get_path('module', 'block') . '/block.js');
foreach ($block_regions as $region => $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);
}
?>
<table id="blocks" class="sticky-enabled">
@@ -57,7 +57,7 @@
<td colspan="<?php print $throttle ? '6' : '5'; ?>"><em><?php print t('No blocks in this region'); ?></em></td>
</tr>
<?php foreach ($block_listing[$region] as $delta => $data): ?>
- <tr class="draggable <?php print $row % 2 == 0 ? 'odd' : 'even'; ?><?php print $data->row_class ? ' '. $data->row_class : ''; ?>">
+ <tr class="draggable <?php print $row % 2 == 0 ? 'odd' : 'even'; ?><?php print $data->row_class ? ' ' . $data->row_class : ''; ?>">
<td class="block"><?php print $data->block_title; ?></td>
<td><?php print $data->region_select; ?></td>
<td><?php print $data->weight_select; ?></td>
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 <code>TRUE</code> (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' => '<?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' => '<?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, '<div class="block-region">'. $value .'</div>');
+ drupal_set_content($key, '<div class="block-region">' . $value . '</div>');
// 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 = '<p>'. 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 <a href="@blocks">blocks administration page</a> 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'))) .'</p>';
- $output .= '<p>'. t('Although blocks are usually generated automatically by modules (like the <em>User login</em> 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 <a href="@input-format">input format</a>.', array('@input-format' => url('admin/settings/filters'))) .'</p>';
- $output .= '<p>'. t('When working with blocks, remember that:') .'</p>';
- $output .= '<ul><li>'. t('since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis.') .'</li>';
- $output .= '<li>'. t('disabled blocks, or blocks not in a region, are never shown.') .'</li>';
- $output .= '<li>'. t('when throttle module is enabled, throttled blocks (blocks with the <em>Throttle</em> checkbox selected) are hidden during high server loads.') .'</li>';
- $output .= '<li>'. t('blocks can be configured to be visible only on certain pages.') .'</li>';
- $output .= '<li>'. t('blocks can be configured to be visible only when specific conditions are true.') .'</li>';
- $output .= '<li>'. t('blocks can be configured to be visible only for certain user roles.') .'</li>';
- $output .= '<li>'. t('when allowed by an administrator, specific blocks may be enabled or disabled on a per-user basis using the <em>My account</em> page.') .'</li>';
- $output .= '<li>'. t('some dynamic blocks, such as those generated by modules, will be displayed only on certain pages.') .'</li></ul>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@block">Block module</a>.', array('@block' => 'http://drupal.org/handbook/modules/block/')) .'</p>';
+ $output = '<p>' . 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 <a href="@blocks">blocks administration page</a> 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'))) . '</p>';
+ $output .= '<p>' . t('Although blocks are usually generated automatically by modules (like the <em>User login</em> 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 <a href="@input-format">input format</a>.', array('@input-format' => url('admin/settings/filters'))) . '</p>';
+ $output .= '<p>' . t('When working with blocks, remember that:') . '</p>';
+ $output .= '<ul><li>' . t('since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis.') . '</li>';
+ $output .= '<li>' . t('disabled blocks, or blocks not in a region, are never shown.') . '</li>';
+ $output .= '<li>' . t('when throttle module is enabled, throttled blocks (blocks with the <em>Throttle</em> checkbox selected) are hidden during high server loads.') . '</li>';
+ $output .= '<li>' . t('blocks can be configured to be visible only on certain pages.') . '</li>';
+ $output .= '<li>' . t('blocks can be configured to be visible only when specific conditions are true.') . '</li>';
+ $output .= '<li>' . t('blocks can be configured to be visible only for certain user roles.') . '</li>';
+ $output .= '<li>' . t('when allowed by an administrator, specific blocks may be enabled or disabled on a per-user basis using the <em>My account</em> page.') . '</li>';
+ $output .= '<li>' . t('some dynamic blocks, such as those generated by modules, will be displayed only on certain pages.') . '</li></ul>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@block">Block module</a>.', array('@block' => 'http://drupal.org/handbook/modules/block/')) . '</p>';
return $output;
case 'admin/build/block':
$throttle = module_exists('throttle');
- $output = '<p>'. 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 <em>Block</em> 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 <em>Save blocks</em> button at the bottom of the page.') .'</p>';
+ $output = '<p>' . 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 <em>Block</em> 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 <em>Save blocks</em> button at the bottom of the page.') . '</p>';
if ($throttle) {
- $output .= '<p>'. t('To reduce CPU usage, database traffic or bandwidth, blocks may be automatically disabled during high server loads by selecting their <em>Throttle</em> checkbox. Adjust throttle thresholds on the <a href="@throttleconfig">throttle configuration page</a>.', array('@throttleconfig' => url('admin/settings/throttle'))) .'</p>';
+ $output .= '<p>' . t('To reduce CPU usage, database traffic or bandwidth, blocks may be automatically disabled during high server loads by selecting their <em>Throttle</em> checkbox. Adjust throttle thresholds on the <a href="@throttleconfig">throttle configuration page</a>.', array('@throttleconfig' => url('admin/settings/throttle'))) . '</p>';
}
- $output .= '<p>'. t('Click the <em>configure</em> link next to each block to configure its specific title and visibility settings. Use the <a href="@add-block">add block page</a> to create a custom block.', array('@add-block' => url('admin/build/block/add'))) .'</p>';
+ $output .= '<p>' . t('Click the <em>configure</em> link next to each block to configure its specific title and visibility settings. Use the <a href="@add-block">add block page</a> to create a custom block.', array('@add-block' => url('admin/build/block/add'))) . '</p>';
return $output;
case 'admin/build/block/add':
- return '<p>'. 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 <a href="@blocks">blocks administration page</a> to be visible.', array('@blocks' => url('admin/build/block'))) .'</p>';
+ return '<p>' . 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 <a href="@blocks">blocks administration page</a> to be visible.', array('@blocks' => url('admin/build/block'))) . '</p>';
}
}
@@ -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 = '<p>'. t('The blog module allows registered users to maintain an online journal, or <em>blog</em>. Blogs are made up of individual <em>blog entries</em>, and the blog entries are most often displayed in descending order by creation time.') .'</p>';
- $output .= '<p>'. t('There is an (optional) <em>Blogs</em> menu item added to the Navigation menu, which displays all blogs available on your site, and a <em>My blog</em> item displaying the current user\'s blog entries. The <em>Blog entry</em> menu item under <em>Create content</em> allows new blog entries to be created.') .'</p>';
- $output .= '<p>'. 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 <em>Recent blog posts</em> block that may be enabled at the <a href="@blocks">blocks administration page</a>.', array('@blocks' => url('admin/build/block'))) .'</p>';
- $output .= '<p>'. t('When using the aggregator module an automatic <em>blog it</em> icon is displayed next to the items in a feed\'s <em>latest items</em> block. Clicking this icon populates a <em>blog entry</em> 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 <a href="@modules">enable</a> the aggregator module, <a href="@feeds">add and configure</a> a feed from another site, and <a href="@blocks">position</a> the feed\'s <em>latest items</em> block.', array('@modules' => url('admin/build/modules'), '@feeds' => url('admin/content/aggregator'), '@blocks' => url('admin/build/block'))) .'</p>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@blog">Blog module</a>.', array('@blog' => 'http://drupal.org/handbook/modules/blog/')) .'</p>';
+ $output = '<p>' . t('The blog module allows registered users to maintain an online journal, or <em>blog</em>. Blogs are made up of individual <em>blog entries</em>, and the blog entries are most often displayed in descending order by creation time.') . '</p>';
+ $output .= '<p>' . t('There is an (optional) <em>Blogs</em> menu item added to the Navigation menu, which displays all blogs available on your site, and a <em>My blog</em> item displaying the current user\'s blog entries. The <em>Blog entry</em> menu item under <em>Create content</em> allows new blog entries to be created.') . '</p>';
+ $output .= '<p>' . 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 <em>Recent blog posts</em> block that may be enabled at the <a href="@blocks">blocks administration page</a>.', array('@blocks' => url('admin/build/block'))) . '</p>';
+ $output .= '<p>' . t('When using the aggregator module an automatic <em>blog it</em> icon is displayed next to the items in a feed\'s <em>latest items</em> block. Clicking this icon populates a <em>blog entry</em> 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 <a href="@modules">enable</a> the aggregator module, <a href="@feeds">add and configure</a> a feed from another site, and <a href="@blocks">position</a> the feed\'s <em>latest items</em> block.', array('@modules' => url('admin/build/modules'), '@feeds' => url('admin/content/aggregator'), '@blocks' => url('admin/build/block'))) . '</p>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@blog">Blog module</a>.', array('@blog' => 'http://drupal.org/handbook/modules/blog/')) . '</p>';
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 = '<em>'. $blog->body .'</em> ['. l($blog->name, "node/$nid") .']';
+ $node->body = '<em>' . $blog->body . '</em> [' . 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 = '<a href="'. check_url($item->link) .'">'. check_plain($item->title) .'</a> - <em>'. $item->description .'</em> [<a href="'. check_url($item->flink) .'">'. check_plain($item->ftitle) ."</a>]\n";
+ $node->body = '<a href="' . check_url($item->link) . '">' . check_plain($item->title) . '</a> - <em>' . $item->description . '</em> [<a href="' . check_url($item->flink) . '">' . check_plain($item->ftitle) . "</a>]\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 <a href=\"". url('admin/user/permissions', array('fragment' => 'module-blogapi')) .'">this permission is assigned</a> 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 <a href=\"" . url('admin/user/permissions', array('fragment' => 'module-blogapi')) . '">this permission is assigned</a> 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 = '<p>'. 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.") .'</p>';
- $output .= '<p>'. t('<a href="@ecto-link">Ecto</a>, a blogging client available for both Mac OS X and Microsoft Windows, can be used with Blog API. Blog API also supports <a href="@blogger-api">Blogger API</a>, <a href="@metaweblog-api">MetaWeblog API</a>, and most of the <a href="@movabletype-api">Movable Type API</a>. Blogging clients and other services (e.g. <a href="@flickr">Flickr\'s</a> "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'))) .'</p>';
- $output .= '<p>'. t('Select the content types available to external clients on the <a href="@blogapi-settings">Blog API settings page</a>. 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'))) .'</p>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@blogapi">Blog API module</a>.', array('@blogapi' => url('http://drupal.org/handbook/modules/blogapi/'))) .'</p>';
+ $output = '<p>' . 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.") . '</p>';
+ $output .= '<p>' . t('<a href="@ecto-link">Ecto</a>, a blogging client available for both Mac OS X and Microsoft Windows, can be used with Blog API. Blog API also supports <a href="@blogger-api">Blogger API</a>, <a href="@metaweblog-api">MetaWeblog API</a>, and most of the <a href="@movabletype-api">Movable Type API</a>. Blogging clients and other services (e.g. <a href="@flickr">Flickr\'s</a> "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'))) . '</p>';
+ $output .= '<p>' . t('Select the content types available to external clients on the <a href="@blogapi-settings">Blog API settings page</a>. 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'))) . '</p>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@blogapi">Blog API module</a>.', array('@blogapi' => url('http://drupal.org/handbook/modules/blogapi/'))) . '</p>';
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'] .'<!--break-->'. $node->body;
+ $node->body = $struct['mt_excerpt'] . '<!--break-->' . $node->body;
}
if ($struct['mt_text_more']) {
- $node->body = $node->body .'<!--extended-->'. $struct['mt_text_more'];
+ $node->body = $node->body . '<!--extended-->' . $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)) : '&nbsp',
- $access ? l(t('delete'), 'node/'. $nid .'/delete', array('query' => $destination) ) : '&nbsp',
+ $access ? l(t('edit'), 'node/' . $nid . '/edit', array('query' => $destination)) : '&nbsp',
+ $access ? l(t('delete'), 'node/' . $nid . '/delete', array('query' => $destination) ) : '&nbsp',
);
$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'] .= '<em>'. t('This is the top-level page in this book.') .'</em>';
+ $form['#prefix'] .= '<em>' . t('This is the top-level page in this book.') . '</em>';
}
else {
- $form['#prefix'] .= '<em>'. t('This will be the top-level page in this book.') .'</em>';
+ $form['#prefix'] .= '<em>' . t('This will be the top-level page in this book.') . '</em>';
}
}
elseif (!$book_link['bid']) {
- $form['#prefix'] .= '<em>'. t('No book selected.') .'</em>';
+ $form['#prefix'] .= '<em>' . t('No book selected.') . '</em>';
}
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' => '<p>'. 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)) .'</p>',
+ '#value' => '<p>' . 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)) . '</p>',
'#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 = '<p>'. 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.') .'</p>';
- $output .= '<p>'. 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 <em>book navigation block</em> on the <a href="@admin-block">blocks administration page</a>.', array('@admin-block' => url('admin/build/block'))) .'</p>';
- $output .= '<p>'. t('Users can select the <em>printer-friendly version</em> link visible at the bottom of a book page to generate a printer-friendly display of the page and all of its subsections. ') .'</p>';
- $output .= '<p>'. t("Users with the <em>administer book outlines</em> 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 <em>outline</em> tab.") .'</p>';
- $output .= '<p>'. t('Administrators can view a list of all books on the <a href="@admin-node-book">book administration page</a>. The <em>Outline</em> page for each book allows section titles to be edited or rearranged.', array('@admin-node-book' => url('admin/content/book'))) .'</p>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@book">Book module</a>.', array('@book' => 'http://drupal.org/handbook/modules/book/')) .'</p>';
+ $output = '<p>' . 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.') . '</p>';
+ $output .= '<p>' . 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 <em>book navigation block</em> on the <a href="@admin-block">blocks administration page</a>.', array('@admin-block' => url('admin/build/block'))) . '</p>';
+ $output .= '<p>' . t('Users can select the <em>printer-friendly version</em> link visible at the bottom of a book page to generate a printer-friendly display of the page and all of its subsections. ') . '</p>';
+ $output .= '<p>' . t("Users with the <em>administer book outlines</em> 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 <em>outline</em> tab.") . '</p>';
+ $output .= '<p>' . t('Administrators can view a list of all books on the <a href="@admin-node-book">book administration page</a>. The <em>Outline</em> page for each book allows section titles to be edited or rearranged.', array('@admin-node-book' => url('admin/content/book'))) . '</p>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@book">Book module</a>.', array('@book' => 'http://drupal.org/handbook/modules/book/')) . '</p>';
return $output;
case 'admin/content/book':
- return '<p>'. 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.') .'</p>';
+ return '<p>' . 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.') . '</p>';
case 'node/%/outline':
- return '<p>'. t('The outline feature allows you to include posts in the <a href="@book">book hierarchy</a>, as well as move them within the hierarchy or to <a href="@book-admin">reorder an entire book</a>.', array('@book' => url('book'), '@book-admin' => url('admin/content/book'))) .'</p>';
+ return '<p>' . t('The outline feature allows you to include posts in the <a href="@book">book hierarchy</a>, as well as move them within the hierarchy or to <a href="@book-admin">reorder an entire book</a>.', array('@book' => url('book'), '@book-admin' => url('admin/content/book'))) . '</p>';
}
}
@@ -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 = '<p>'. 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 <a href="@url">file download method</a> be set to public.', array('@url' => url('admin/settings/file-system'))) .'</p>';
- $output .= '<p>'. 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.") .'</p>';
- $output .= '<p>'. t('To change the color settings for a compatible theme, select the "configure" link for the theme on the <a href="@themes">themes administration page</a>.', array('@themes' => url('admin/build/themes'))) .'</p>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@color">Color module</a>.', array('@color' => 'http://drupal.org/handbook/modules/color/')) .'</p>';
+ $output = '<p>' . 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 <a href="@url">file download method</a> be set to public.', array('@url' => url('admin/settings/file-system'))) . '</p>';
+ $output .= '<p>' . 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.") . '</p>';
+ $output .= '<p>' . t('To change the color settings for a compatible theme, select the "configure" link for the theme on the <a href="@themes">themes administration page</a>.', array('@themes' => url('admin/build/themes'))) . '</p>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@color">Color module</a>.', array('@color' => 'http://drupal.org/handbook/modules/color/')) . '</p>';
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 .= '<h2>'. t('Preview') .'</h2>';
- $output .= '<div id="preview"><div id="text"><h2>Lorem ipsum dolor</h2><p>Sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud <a href="#">exercitation ullamco</a> 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.</p></div><div id="img" style="background-image: url('. base_path() . $path . $info['preview_image'] .')"></div></div>';
+ $output .= '<h2>' . t('Preview') . '</h2>';
+ $output .= '<div id="preview"><div id="text"><h2>Lorem ipsum dolor</h2><p>Sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud <a href="#">exercitation ullamco</a> 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.</p></div><div id="img" style="background-image: url(' . base_path() . $path . $info['preview_image'] . ')"></div></div>';
// Close wrapper
$output .= '</div>';
@@ -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 @@
*/
?>
<div class="comment-folded">
- <span class="subject"><?php print $title .' '. $new; ?></span><span class="credit"><?php print t('by') .' '. $author; ?></span>
+ <span class="subject"><?php print $title . ' ' . $new; ?></span><span class="credit"><?php print t('by') . ' ' . $author; ?></span>
</div>
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' => '<li>', '#suffix' => check_plain($subject) .'</li>');
+ $form['comments'][$cid] = array('#type' => 'hidden', '#value' => $cid, '#prefix' => '<li>', '#suffix' => check_plain($subject) . '</li>');
$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 = '<p>'. t('The comment module allows visitors to comment on your posts, creating ad hoc discussion boards. Any <a href="@content-type">content type</a> may have its <em>Default comment setting</em> set to <em>Read/Write</em> to allow comments, or <em>Disabled</em>, 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'))) .'</p>';
- $output .= '<p>'. 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.') .'</p>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@comment">Comment module</a>.', array('@comment' => 'http://drupal.org/handbook/modules/comment/')) .'</p>';
+ $output = '<p>' . t('The comment module allows visitors to comment on your posts, creating ad hoc discussion boards. Any <a href="@content-type">content type</a> may have its <em>Default comment setting</em> set to <em>Read/Write</em> to allow comments, or <em>Disabled</em>, 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'))) . '</p>';
+ $output .= '<p>' . 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.') . '</p>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@comment">Comment module</a>.', array('@comment' => 'http://drupal.org/handbook/modules/comment/')) . '</p>';
return $output;
case 'admin/content/comment':
- return '<p>'. 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.") .'</p>';
+ return '<p>' . 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.") . '</p>';
case 'admin/content/comment/approval':
- return '<p>'. 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.") .'</p>';
+ return '<p>' . 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.") . '</p>';
}
}
@@ -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)) .'<br />'. t('@time ago', array('@time' => format_interval(time() - $comment->timestamp)));
+ $items[] = l($comment->subject, 'node/' . $comment->nid, array('fragment' => 'comment-' . $comment->cid)) . '<br />' . 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 <em>administer comments</em> 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 .= '<h2>'. check_plain($comment->subject) .'</h2>'. check_markup($comment->comment, $comment->format, FALSE);
+ $text .= '<h2>' . check_plain($comment->subject) . '</h2>' . 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 .= '</div>';
}
- $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 = '<div class="container-inline">';
$output .= drupal_render($form);
$output .= '</div>';
- $output .= '<div class="description">'. t('Select your preferred way to display the comments and click "Save settings" to activate your changes.') .'</div>';
+ $output .= '<div class="description">' . t('Select your preferred way to display the comments and click "Save settings" to activate your changes.') . '</div>';
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()
*/
?>
-<div class="comment<?php print ($comment->new) ? ' comment-new' : ''; print ' '. $status ?> clear-block">
+<div class="comment<?php print ($comment->new) ? ' comment-new' : ''; print ' ' . $status ?> clear-block">
<?php print $picture ?>
<?php if ($comment->new): ?>
diff --git a/modules/contact/contact.admin.inc b/modules/contact/contact.admin.inc
index 38360d4fb..16178078c 100644
--- a/modules/contact/contact.admin.inc
+++ b/modules/contact/contact.admin.inc
@@ -13,7 +13,7 @@ function contact_admin_categories() {
$result = db_query('SELECT cid, category, recipients, selected FROM {contact} ORDER BY weight, category');
$rows = array();
while ($category = db_fetch_object($result)) {
- $rows[] = array($category->category, $category->recipients, ($category->selected ? t('Yes') : t('No')), l(t('edit'), 'admin/build/contact/edit/'. $category->cid), l(t('delete'), 'admin/build/contact/delete/'. $category->cid));
+ $rows[] = array($category->category, $category->recipients, ($category->selected ? t('Yes') : t('No')), l(t('edit'), 'admin/build/contact/edit/' . $category->cid), l(t('delete'), 'admin/build/contact/delete/' . $category->cid));
}
$header = array(t('Category'), t('Recipients'), t('Selected'), array('data' => t('Operations'), 'colspan' => 2));
@@ -46,7 +46,7 @@ function contact_admin_edit($form_state = array(), $op, $contact = NULL) {
$form['recipients'] = array('#type' => 'textarea',
'#title' => t('Recipients'),
'#default_value' => $contact['recipients'],
- '#description' => t("Example: 'webmaster@example.com' or 'sales@example.com,support@example.com'. To specify multiple recipients, separate each e-mail address with a comma."),
+ '#description' => t("Example: 'webmaster@example.com' or 'sales@example.com,support@example.com' . To specify multiple recipients, separate each e-mail address with a comma."),
'#required' => TRUE,
);
$form['reply'] = array('#type' => 'textarea',
diff --git a/modules/contact/contact.module b/modules/contact/contact.module
index 7883fe869..94ebc0922 100644
--- a/modules/contact/contact.module
+++ b/modules/contact/contact.module
@@ -12,22 +12,22 @@
function contact_help($path, $arg) {
switch ($path) {
case 'admin/help#contact':
- $output = '<p>'. t('The contact module facilitates communication via e-mail, by allowing your site\'s visitors to contact one another (personal contact forms), and by providing a simple way to direct messages to a set of administrator-defined recipients (the <a href="@contact">contact page</a>). With either form, users specify a subject, write their message, and (optionally) have a copy of their message sent to their own e-mail address.', array('@contact' => url('contact'))) .'</p>';
- $output .= '<p>'. t("Personal contact forms allow users to be contacted via e-mail, while keeping recipient e-mail addresses private. Users may enable or disable their personal contact forms by editing their <em>My account</em> page. If enabled, a <em>Contact</em> tab leading to their personal contact form is available on their user profile. Site administrators have access to all personal contact forms (even if they have been disabled). The <em>Contact</em> tab is only visible when viewing another user's profile (users do not see their own <em>Contact</em> tab).") .'</p>';
- $output .= '<p>'. t('The <a href="@contact">contact page</a> provides a simple form for visitors to leave comments, feedback, or other requests. Messages are routed by selecting a category from a list of administrator-defined options; each category has its own set of e-mail recipients. Common categories for a business site include, for example, "Website feedback" (messages are forwarded to web site administrators) and "Product information" (messages are forwarded to members of the sales department). The actual e-mail addresses defined within a category are not displayed. Only users in roles with the <em>access site-wide contact form</em> permission may access the <a href="@contact">contact page</a>.', array('@contact' => url('contact'))) .'</p>';
- $output .= '<p>'. t('A link to your site\'s <a href="@contact">contact page</a> from the main <em>Navigation</em> menu is created, but is disabled by default. Create a similar link on another menu by adding a menu item pointing to the path "contact"', array('@contact' => url('contact'))) .'</p>';
- $output .= '<p>'. t('Customize the <a href="@contact">contact page</a> with additional information (like physical location, mailing address, and telephone number) using the <a href="@contact-settings">contact form settings page</a>. The <a href="@contact-settings">settings page</a> also provides configuration options for the maximum number of contact form submissions a user may perform per hour, and the default status of users\' personal contact forms.', array('@contact-settings' => url('admin/build/contact/settings'), '@contact' => url('contact'))) .'</p>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@contact">Contact module</a>.', array('@contact' => url('http://drupal.org/handbook/modules/contact/', array('absolute' => TRUE)))) .'</p>';
+ $output = '<p>' . t('The contact module facilitates communication via e-mail, by allowing your site\'s visitors to contact one another (personal contact forms), and by providing a simple way to direct messages to a set of administrator-defined recipients (the <a href="@contact">contact page</a>). With either form, users specify a subject, write their message, and (optionally) have a copy of their message sent to their own e-mail address.', array('@contact' => url('contact'))) . '</p>';
+ $output .= '<p>' . t("Personal contact forms allow users to be contacted via e-mail, while keeping recipient e-mail addresses private. Users may enable or disable their personal contact forms by editing their <em>My account</em> page. If enabled, a <em>Contact</em> tab leading to their personal contact form is available on their user profile. Site administrators have access to all personal contact forms (even if they have been disabled). The <em>Contact</em> tab is only visible when viewing another user's profile (users do not see their own <em>Contact</em> tab).") . '</p>';
+ $output .= '<p>' . t('The <a href="@contact">contact page</a> provides a simple form for visitors to leave comments, feedback, or other requests. Messages are routed by selecting a category from a list of administrator-defined options; each category has its own set of e-mail recipients. Common categories for a business site include, for example, "Website feedback" (messages are forwarded to web site administrators) and "Product information" (messages are forwarded to members of the sales department). The actual e-mail addresses defined within a category are not displayed. Only users in roles with the <em>access site-wide contact form</em> permission may access the <a href="@contact">contact page</a>.', array('@contact' => url('contact'))) . '</p>';
+ $output .= '<p>' . t('A link to your site\'s <a href="@contact">contact page</a> from the main <em>Navigation</em> menu is created, but is disabled by default. Create a similar link on another menu by adding a menu item pointing to the path "contact"', array('@contact' => url('contact'))) . '</p>';
+ $output .= '<p>' . t('Customize the <a href="@contact">contact page</a> with additional information (like physical location, mailing address, and telephone number) using the <a href="@contact-settings">contact form settings page</a>. The <a href="@contact-settings">settings page</a> also provides configuration options for the maximum number of contact form submissions a user may perform per hour, and the default status of users\' personal contact forms.', array('@contact-settings' => url('admin/build/contact/settings'), '@contact' => url('contact'))) . '</p>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@contact">Contact module</a>.', array('@contact' => url('http://drupal.org/handbook/modules/contact/', array('absolute' => TRUE)))) . '</p>';
return $output;
case 'admin/build/contact':
- $output = '<p>'. t('This page lets you set up <a href="@form">your site-wide contact form</a>. To do so, add one or more categories. You can associate different recipients with each category to route e-mails to different people. For example, you can route website feedback to the webmaster and direct product information requests to the sales department. On the <a href="@settings">settings page</a>, you can customize the information shown above the contact form. This can be useful to provide additional contact information such as your postal address and telephone number.', array('@settings' => url('admin/build/contact/settings'), '@form' => url('contact'))) .'</p>';
+ $output = '<p>' . t('This page lets you set up <a href="@form">your site-wide contact form</a>. To do so, add one or more categories. You can associate different recipients with each category to route e-mails to different people. For example, you can route website feedback to the webmaster and direct product information requests to the sales department. On the <a href="@settings">settings page</a>, you can customize the information shown above the contact form. This can be useful to provide additional contact information such as your postal address and telephone number.', array('@settings' => url('admin/build/contact/settings'), '@form' => url('contact'))) . '</p>';
if (!module_exists('menu')) {
$menu_note = t('The menu item can be customized and configured only once the menu module has been <a href="@modules-page">enabled</a>.', array('@modules-page' => url('admin/settings/modules')));
}
else {
$menu_note = '';
}
- $output .= '<p>'. t('The contact module also adds a <a href="@menu-settings">menu item</a> (disabled by default) to the navigation block.', array('@menu-settings' => url('admin/build/menu'))) .' '. $menu_note .'</p>';
+ $output .= '<p>' . t('The contact module also adds a <a href="@menu-settings">menu item</a> (disabled by default) to the navigation block.', array('@menu-settings' => url('admin/build/menu'))) . ' ' . $menu_note . '</p>';
return $output;
}
}
@@ -182,7 +182,7 @@ function contact_mail($key, &$message, $params) {
case 'user_copy':
$user = $params['user'];
$account = $params['account'];
- $message['subject'] .= '['. variable_get('site_name', 'Drupal') .'] '. $params['subject'];
+ $message['subject'] .= '[' . variable_get('site_name', 'Drupal') . '] ' . $params['subject'];
$message['body'][] = "$account->name,";
$message['body'][] = t("!name (!name-url) has sent you a message via your contact form (!form-url) at !site.", array('!name' => $user->name, '!name-url' => url("user/$user->uid", array('absolute' => TRUE, 'language' => $language)), '!form-url' => url($_GET['q'], array('absolute' => TRUE, 'language' => $language)), '!site' => variable_get('site_name', 'Drupal')), $language->language);
$message['body'][] = t("If you don't want to receive such e-mails, you can change your settings at !url.", array('!url' => url("user/$account->uid", array('absolute' => TRUE, 'language' => $language))), $language->language);
diff --git a/modules/contact/contact.pages.inc b/modules/contact/contact.pages.inc
index 5a53eeddd..d801024f9 100644
--- a/modules/contact/contact.pages.inc
+++ b/modules/contact/contact.pages.inc
@@ -143,7 +143,7 @@ function contact_mail_page_submit($form, &$form_state) {
}
flood_register_event('contact');
- watchdog('mail', '%name-from sent an e-mail regarding %category.', array('%name-from' => $values['name'] ." [$from]", '%category' => $contact['category']));
+ watchdog('mail', '%name-from sent an e-mail regarding %category.', array('%name-from' => $values['name'] . " [$from]", '%category' => $contact['category']));
drupal_set_message(t('Your message has been sent.'));
// Jump to home page rather than back to contact page to avoid
@@ -177,7 +177,7 @@ function contact_mail_user(&$form_state, $recipient) {
$form['recipient'] = array('#type' => 'value', '#value' => $recipient);
$form['from'] = array('#type' => 'item',
'#title' => t('From'),
- '#value' => check_plain($user->name) .' &lt;'. check_plain($user->mail) .'&gt;',
+ '#value' => check_plain($user->name) . ' &lt;' . check_plain($user->mail) . '&gt;',
);
$form['to'] = array('#type' => 'item',
'#title' => t('To'),
diff --git a/modules/dblog/dblog.admin.inc b/modules/dblog/dblog.admin.inc
index 2c5924bb5..4a38e8c62 100644
--- a/modules/dblog/dblog.admin.inc
+++ b/modules/dblog/dblog.admin.inc
@@ -55,7 +55,7 @@ function dblog_overview() {
$sql = "SELECT w.wid, w.uid, w.severity, w.type, w.timestamp, w.message, w.variables, w.link, u.name FROM {watchdog} w INNER JOIN {users} u ON w.uid = u.uid";
$tablesort = tablesort_sql($header);
if (!empty($filter['where'])) {
- $result = pager_query($sql ." WHERE ". $filter['where'] . $tablesort, 50, 0, NULL, $filter['args']);
+ $result = pager_query($sql . " WHERE " . $filter['where'] . $tablesort, 50, 0, NULL, $filter['args']);
}
else {
$result = pager_query($sql . $tablesort, 50);
@@ -68,12 +68,12 @@ function dblog_overview() {
$icons[$dblog->severity],
t($dblog->type),
format_date($dblog->timestamp, 'small'),
- l(truncate_utf8(_dblog_format_message($dblog), 56, TRUE, TRUE), 'admin/reports/event/'. $dblog->wid, array('html' => TRUE)),
+ l(truncate_utf8(_dblog_format_message($dblog), 56, TRUE, TRUE), 'admin/reports/event/' . $dblog->wid, array('html' => TRUE)),
theme('username', $dblog),
$dblog->link,
),
// Attributes for tr
- 'class' => "dblog-". preg_replace('/[^a-z]/i', '-', $dblog->type) .' '. $classes[$dblog->severity]
+ 'class' => "dblog-" . preg_replace('/[^a-z]/i', '-', $dblog->type) . ' ' . $classes[$dblog->severity]
);
}
@@ -98,7 +98,7 @@ function dblog_top($type) {
array('data' => t('Message'), 'field' => 'message')
);
- $result = pager_query("SELECT COUNT(wid) AS count, message, variables FROM {watchdog} WHERE type = '%s' GROUP BY message, variables ". tablesort_sql($header), 30, 0, "SELECT COUNT(DISTINCT(message)) FROM {watchdog} WHERE type = '%s'", $type);
+ $result = pager_query("SELECT COUNT(wid) AS count, message, variables FROM {watchdog} WHERE type = '%s' GROUP BY message, variables " . tablesort_sql($header), 30, 0, "SELECT COUNT(DISTINCT(message)) FROM {watchdog} WHERE type = '%s'", $type);
$rows = array();
while ($dblog = db_fetch_object($result)) {
@@ -186,7 +186,7 @@ function dblog_build_filter_query() {
$args[] = $value;
}
if (!empty($filter_where)) {
- $where[] = '('. implode(' OR ', $filter_where) .')';
+ $where[] = '(' . implode(' OR ', $filter_where) . ')';
}
}
$where = !empty($where) ? implode(' AND ', $where) : '';
diff --git a/modules/dblog/dblog.module b/modules/dblog/dblog.module
index 04529d64a..0fb1d093c 100644
--- a/modules/dblog/dblog.module
+++ b/modules/dblog/dblog.module
@@ -18,12 +18,12 @@
function dblog_help($path, $arg) {
switch ($path) {
case 'admin/help#dblog':
- $output = '<p>'. t('The dblog module monitors your system, capturing system events in a log to be reviewed by an authorized individual at a later time. This is useful for site administrators who want a quick overview of activities on their site. The logs also record the sequence of events, so it can be useful for debugging site errors.') .'</p>';
- $output .= '<p>'. t('The dblog log is simply a list of recorded events containing usage data, performance data, errors, warnings and operational information. Administrators should check the dblog report on a regular basis to ensure their site is working properly.') .'</p>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@dblog">Dblog module</a>.', array('@dblog' => 'http://drupal.org/handbook/modules/dblog/')) .'</p>';
+ $output = '<p>' . t('The dblog module monitors your system, capturing system events in a log to be reviewed by an authorized individual at a later time. This is useful for site administrators who want a quick overview of activities on their site. The logs also record the sequence of events, so it can be useful for debugging site errors.') . '</p>';
+ $output .= '<p>' . t('The dblog log is simply a list of recorded events containing usage data, performance data, errors, warnings and operational information. Administrators should check the dblog report on a regular basis to ensure their site is working properly.') . '</p>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@dblog">Dblog module</a>.', array('@dblog' => 'http://drupal.org/handbook/modules/dblog/')) . '</p>';
return $output;
case 'admin/reports/dblog':
- return '<p>'. t('The dblog module monitors your website, capturing system events in a log to be reviewed by an authorized individual at a later time. The dblog log is simply a list of recorded events containing usage data, performance data, errors, warnings and operational information. It is vital to check the dblog report on a regular basis as it is often the only way to tell what is going on.') .'</p>';
+ return '<p>' . t('The dblog module monitors your website, capturing system events in a log to be reviewed by an authorized individual at a later time. The dblog log is simply a list of recorded events containing usage data, performance data, errors, warnings and operational information. It is vital to check the dblog report on a regular basis as it is often the only way to tell what is going on.') . '</p>';
}
}
@@ -84,7 +84,7 @@ function dblog_menu() {
function dblog_init() {
if (arg(0) == 'admin' && arg(1) == 'reports') {
// Add the CSS for this module
- drupal_add_css(drupal_get_path('module', 'dblog') .'/dblog.css', 'module', 'all', FALSE);
+ drupal_add_css(drupal_get_path('module', 'dblog') . '/dblog.css', 'module', 'all', FALSE);
}
}
@@ -153,7 +153,7 @@ function theme_dblog_filters($form) {
foreach (element_children($form['status']) as $key) {
$output .= drupal_render($form['status'][$key]);
}
- $output .= '<div id="dblog-admin-buttons">'. drupal_render($form['buttons']) .'</div>';
+ $output .= '<div id="dblog-admin-buttons">' . drupal_render($form['buttons']) . '</div>';
return $output;
}
diff --git a/modules/filter/filter.admin.inc b/modules/filter/filter.admin.inc
index 83b918cb8..60214e47b 100644
--- a/modules/filter/filter.admin.inc
+++ b/modules/filter/filter.admin.inc
@@ -32,8 +32,8 @@ function filter_admin_overview() {
$options[$id] = '';
$form[$id]['name'] = array('#value' => $format->name);
$form[$id]['roles'] = array('#value' => $default ? t('All roles may use default format') : ($roles ? implode(', ', $roles) : t('No roles may use this format')));
- $form[$id]['configure'] = array('#value' => l(t('configure'), 'admin/settings/filters/'. $id));
- $form[$id]['delete'] = array('#value' => $default ? '' : l(t('delete'), 'admin/settings/filters/delete/'. $id));
+ $form[$id]['configure'] = array('#value' => l(t('configure'), 'admin/settings/filters/' . $id));
+ $form[$id]['delete'] = array('#value' => $default ? '' : l(t('delete'), 'admin/settings/filters/delete/' . $id));
$form[$id]['weight'] = array('#type' => 'weight', '#default_value' => $format->weight);
}
$form['default'] = array('#type' => 'radios', '#options' => $options, '#default_value' => variable_get('filter_default_format', 1));
@@ -159,14 +159,14 @@ function filter_admin_format_form(&$form_state, $format) {
// Composition tips (guidelines)
$tips = _filter_tips($format->format, FALSE);
- $extra = '<p>'. l(t('More information about formatting options'), 'filter/tips') .'</p>';
+ $extra = '<p>' . l(t('More information about formatting options'), 'filter/tips') . '</p>';
$tiplist = theme('filter_tips', $tips, FALSE, $extra);
if (!$tiplist) {
- $tiplist = '<p>'. t('No guidelines available.') .'</p>';
+ $tiplist = '<p>' . t('No guidelines available.') . '</p>';
}
- $group = '<p>'. t('These are the guidelines that users will see for posting in this input format. They are automatically generated from the filter settings.') .'</p>';
+ $group = '<p>' . t('These are the guidelines that users will see for posting in this input format. They are automatically generated from the filter settings.') . '</p>';
$group .= $tiplist;
- $form['tips'] = array('#value' => '<h2>'. t('Formatting guidelines') .'</h2>'. $group);
+ $form['tips'] = array('#value' => '<h2>' . t('Formatting guidelines') . '</h2>' . $group);
}
$form['submit'] = array('#type' => 'submit', '#value' => t('Save configuration'));
@@ -231,20 +231,20 @@ function filter_admin_format_form_submit($form, &$form_state) {
}
}
if (!empty($form_state['values']['default_format'])) {
- $roles = ','. implode(',', array_keys(user_roles())) .',';
+ $roles = ',' . implode(',', array_keys(user_roles())) . ',';
}
else {
- $roles = ','. implode(',', $roles) .',';
+ $roles = ',' . implode(',', $roles) . ',';
}
db_query("UPDATE {filter_formats} SET cache = %d, name='%s', roles = '%s' WHERE format = %d", $cache, $name, $roles, $format);
- cache_clear_all($format .':', 'cache_filter', TRUE);
+ cache_clear_all($format . ':', 'cache_filter', TRUE);
// If a new filter was added, return to the main list of filters. Otherwise, stay on edit filter page to show new changes.
$return = 'admin/settings/filters';
if (!empty($new)) {
- $return .= '/'. $format;
+ $return .= '/' . $format;
}
$form_state['redirect'] = $return;
return;
@@ -290,7 +290,7 @@ function filter_admin_delete_submit($form, &$form_state) {
db_query("UPDATE {comments} SET format = %d WHERE format = %d", $default, $form_state['values']['format']);
db_query("UPDATE {boxes} SET format = %d WHERE format = %d", $default, $form_state['values']['format']);
- cache_clear_all($form_state['values']['format'] .':', 'cache_filter', TRUE);
+ cache_clear_all($form_state['values']['format'] . ':', 'cache_filter', TRUE);
drupal_set_message(t('Deleted input format %format.', array('%format' => $form_state['values']['name'])));
$form_state['redirect'] = 'admin/settings/filters';
@@ -336,7 +336,7 @@ function filter_admin_configure(&$form_state, $format) {
* Clear the filter's cache when configuration settings are saved.
*/
function filter_admin_configure_submit($form, &$form_state) {
- cache_clear_all($form_state['values']['format'] .':', 'cache_filter', TRUE);
+ cache_clear_all($form_state['values']['format'] . ':', 'cache_filter', TRUE);
}
/**
@@ -406,5 +406,5 @@ function filter_admin_order_submit($form, &$form_state) {
}
drupal_set_message(t('The filter ordering has been saved.'));
- cache_clear_all($form_state['values']['format'] .':', 'cache_filter', TRUE);
+ cache_clear_all($form_state['values']['format'] . ':', 'cache_filter', TRUE);
}
diff --git a/modules/filter/filter.install b/modules/filter/filter.install
index fc01608a8..27f7a98fd 100644
--- a/modules/filter/filter.install
+++ b/modules/filter/filter.install
@@ -115,10 +115,10 @@ function filter_update_7001() {
$result = db_query("SELECT format FROM {filter_formats}");
while ($format = db_fetch_object($result)) {
// Deprecated constants FILTER_HTML_STRIP = 1 and FILTER_HTML_ESCAPE = 2.
- if (variable_get('filter_html_'. $format->format, 1) == 2) {
- $ret[] = update_sql("INSERT INTO {filters} (format, module, delta, weight) VALUES (". $format->format .", 'filter', 4, 0)");
+ if (variable_get('filter_html_' . $format->format, 1) == 2) {
+ $ret[] = update_sql("INSERT INTO {filters} (format, module, delta, weight) VALUES (" . $format->format . ", 'filter', 4, 0)");
}
- variable_del('filter_html_'. $format->format);
+ variable_del('filter_html_' . $format->format);
}
return $ret;
}
diff --git a/modules/filter/filter.module b/modules/filter/filter.module
index 61ea76d5e..98bbba41b 100644
--- a/modules/filter/filter.module
+++ b/modules/filter/filter.module
@@ -20,22 +20,22 @@ define('FILTER_FORMAT_DEFAULT', 0);
function filter_help($path, $arg) {
switch ($path) {
case 'admin/help#filter':
- $output = '<p>'. t("The filter module allows administrators to configure text input formats for use on your site. An input format defines the HTML tags, codes, and other input allowed in both content and comments, and is a key feature in guarding against potentially damaging input from malicious users. Two input formats included by default are <em>Filtered HTML</em> (which allows only an administrator-approved subset of HTML tags) and <em>Full HTML</em> (which allows the full set of HTML tags). Additional input formats may be created by an administrator.") .'</p>';
- $output .= '<p>'. t('Each input format uses filters to manipulate text, and most input formats apply several different filters to text in a specific order. Each filter is designed for a specific purpose, and generally either adds, removes or transforms elements within user-entered text before it is displayed. A filter does not change the actual content of a post, but instead, modifies it temporarily before it is displayed. A filter may remove unapproved HTML tags, for instance, while another automatically adds HTML to make links referenced in text clickable.') .'</p>';
- $output .= '<p>'. t('Users with access to more than one input format can use the <em>Input format</em> fieldset to choose between available input formats when creating or editing multi-line content. Administrators determine the input formats available to each user role, select a default input format, and control the order of formats listed in the <em>Input format</em> fieldset.') .'</p>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@filter">Filter module</a>.', array('@filter' => 'http://drupal.org/handbook/modules/filter/')) .'</p>';
+ $output = '<p>' . t("The filter module allows administrators to configure text input formats for use on your site. An input format defines the HTML tags, codes, and other input allowed in both content and comments, and is a key feature in guarding against potentially damaging input from malicious users. Two input formats included by default are <em>Filtered HTML</em> (which allows only an administrator-approved subset of HTML tags) and <em>Full HTML</em> (which allows the full set of HTML tags). Additional input formats may be created by an administrator.") . '</p>';
+ $output .= '<p>' . t('Each input format uses filters to manipulate text, and most input formats apply several different filters to text in a specific order. Each filter is designed for a specific purpose, and generally either adds, removes or transforms elements within user-entered text before it is displayed. A filter does not change the actual content of a post, but instead, modifies it temporarily before it is displayed. A filter may remove unapproved HTML tags, for instance, while another automatically adds HTML to make links referenced in text clickable.') . '</p>';
+ $output .= '<p>' . t('Users with access to more than one input format can use the <em>Input format</em> fieldset to choose between available input formats when creating or editing multi-line content. Administrators determine the input formats available to each user role, select a default input format, and control the order of formats listed in the <em>Input format</em> fieldset.') . '</p>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@filter">Filter module</a>.', array('@filter' => 'http://drupal.org/handbook/modules/filter/')) . '</p>';
return $output;
case 'admin/settings/filters':
- $output = '<p>'. t('Use the list below to review the input formats available to each user role, to select a default input format, and to control the order of formats listed in the <em>Input format</em> fieldset. (The <em>Input format</em> fieldset is displayed below textareas when users with access to more than one input format create multi-line content.) The input format selected as <em>Default</em> is available to all users and, unless another format is selected, is applied to all content. All input formats are available to users in roles with the "administer filters" permission.') .'</p>';
- $output .= '<p>'. t('Since input formats, if available, are presented in the same order as the list below, it may be helpful to arrange the formats in descending order of your preference for their use. To change the order of an input format, grab a drag-and-drop handle under the <em>Name</em> column and drag to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the <em>Save changes</em> button at the bottom of the page.') .'</p>';
+ $output = '<p>' . t('Use the list below to review the input formats available to each user role, to select a default input format, and to control the order of formats listed in the <em>Input format</em> fieldset. (The <em>Input format</em> fieldset is displayed below textareas when users with access to more than one input format create multi-line content.) The input format selected as <em>Default</em> is available to all users and, unless another format is selected, is applied to all content. All input formats are available to users in roles with the "administer filters" permission.') . '</p>';
+ $output .= '<p>' . t('Since input formats, if available, are presented in the same order as the list below, it may be helpful to arrange the formats in descending order of your preference for their use. To change the order of an input format, grab a drag-and-drop handle under the <em>Name</em> column and drag to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the <em>Save changes</em> button at the bottom of the page.') . '</p>';
return $output;
case 'admin/settings/filters/%':
- return '<p>'. t('Every <em>filter</em> performs one particular change on the user input, for example stripping out malicious HTML or making URLs clickable. Choose which filters you want to apply to text in this input format. If you notice some filters are causing conflicts in the output, you can <a href="@rearrange">rearrange them</a>.', array('@rearrange' => url('admin/settings/filters/'. $arg[3] .'/order'))) .'</p>';
+ return '<p>' . t('Every <em>filter</em> performs one particular change on the user input, for example stripping out malicious HTML or making URLs clickable. Choose which filters you want to apply to text in this input format. If you notice some filters are causing conflicts in the output, you can <a href="@rearrange">rearrange them</a>.', array('@rearrange' => url('admin/settings/filters/' . $arg[3] . '/order'))) . '</p>';
case 'admin/settings/filters/%/configure':
- return '<p>'. t('If you cannot find the settings for a certain filter, make sure you have enabled it on the <a href="@url">view tab</a> first.', array('@url' => url('admin/settings/filters/'. $arg[3]))) .'</p>';
+ return '<p>' . t('If you cannot find the settings for a certain filter, make sure you have enabled it on the <a href="@url">view tab</a> first.', array('@url' => url('admin/settings/filters/' . $arg[3]))) . '</p>';
case 'admin/settings/filters/%/order':
- $output = '<p>'. t('Because of the flexible filtering system, you might encounter a situation where one filter prevents another from doing its job. For example: a word in an URL gets converted into a glossary term, before the URL can be converted to a clickable link. When this happens, rearrange the order of the filters.') .'</p>';
- $output .= '<p>'. t("Filters are executed from top-to-bottom. To change the order of the filters, modify the values in the <em>Weight</em> column or grab a drag-and-drop handle under the <em>Name</em> column and drag filters to new locations in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the <em>Save configuration</em> button at the bottom of the page.") .'</p>';
+ $output = '<p>' . t('Because of the flexible filtering system, you might encounter a situation where one filter prevents another from doing its job. For example: a word in an URL gets converted into a glossary term, before the URL can be converted to a clickable link. When this happens, rearrange the order of the filters.') . '</p>';
+ $output .= '<p>' . t("Filters are executed from top-to-bottom. To change the order of the filters, modify the values in the <em>Weight</em> column or grab a drag-and-drop handle under the <em>Name</em> column and drag filters to new locations in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the <em>Save configuration</em> button at the bottom of the page.") . '</p>';
return $output;
}
}
@@ -176,49 +176,49 @@ function filter_filter_tips($delta, $format, $long = FALSE) {
case 0:
return t('Allowed HTML tags: @tags', array('@tags' => $allowed_html));
case 1:
- $output = '<p>'. t('Allowed HTML tags: @tags', array('@tags' => $allowed_html)) .'</p>';
+ $output = '<p>' . t('Allowed HTML tags: @tags', array('@tags' => $allowed_html)) . '</p>';
if (!variable_get("filter_html_help_$format", 1)) {
return $output;
}
- $output .= '<p>'. t('This site allows HTML content. While learning all of HTML may feel intimidating, learning how to use a very small number of the most basic HTML "tags" is very easy. This table provides examples for each tag that is enabled on this site.') .'</p>';
- $output .= '<p>'. t('For more information see W3C\'s <a href="@html-specifications">HTML Specifications</a> or use your favorite search engine to find other sites that explain HTML.', array('@html-specifications' => 'http://www.w3.org/TR/html/')) .'</p>';
+ $output .= '<p>' . t('This site allows HTML content. While learning all of HTML may feel intimidating, learning how to use a very small number of the most basic HTML "tags" is very easy. This table provides examples for each tag that is enabled on this site.') . '</p>';
+ $output .= '<p>' . t('For more information see W3C\'s <a href="@html-specifications">HTML Specifications</a> or use your favorite search engine to find other sites that explain HTML.', array('@html-specifications' => 'http://www.w3.org/TR/html/')) . '</p>';
$tips = array(
- 'a' => array( t('Anchors are used to make links to other pages.'), '<a href="'. $base_url .'">'. variable_get('site_name', 'Drupal') .'</a>'),
+ 'a' => array( t('Anchors are used to make links to other pages.'), '<a href="' . $base_url . '">' . variable_get('site_name', 'Drupal') . '</a>'),
'br' => array( t('By default line break tags are automatically added, so use this tag to add additional ones. Use of this tag is different because it is not used with an open/close pair like all the others. Use the extra " /" inside the tag to maintain XHTML 1.0 compatibility'), t('Text with <br />line break')),
- 'p' => array( t('By default paragraph tags are automatically added, so use this tag to add additional ones.'), '<p>'. t('Paragraph one.') .'</p> <p>'. t('Paragraph two.') .'</p>'),
- 'strong' => array( t('Strong'), '<strong>'. t('Strong') .'</strong>'),
- 'em' => array( t('Emphasized'), '<em>'. t('Emphasized') .'</em>'),
- 'cite' => array( t('Cited'), '<cite>'. t('Cited') .'</cite>'),
- 'code' => array( t('Coded text used to show programming source code'), '<code>'. t('Coded') .'</code>'),
- 'b' => array( t('Bolded'), '<b>'. t('Bolded') .'</b>'),
- 'u' => array( t('Underlined'), '<u>'. t('Underlined') .'</u>'),
- 'i' => array( t('Italicized'), '<i>'. t('Italicized') .'</i>'),
+ 'p' => array( t('By default paragraph tags are automatically added, so use this tag to add additional ones.'), '<p>' . t('Paragraph one.') . '</p> <p>' . t('Paragraph two.') . '</p>'),
+ 'strong' => array( t('Strong'), '<strong>' . t('Strong') . '</strong>'),
+ 'em' => array( t('Emphasized'), '<em>' . t('Emphasized') . '</em>'),
+ 'cite' => array( t('Cited'), '<cite>' . t('Cited') . '</cite>'),
+ 'code' => array( t('Coded text used to show programming source code'), '<code>' . t('Coded') . '</code>'),
+ 'b' => array( t('Bolded'), '<b>' . t('Bolded') . '</b>'),
+ 'u' => array( t('Underlined'), '<u>' . t('Underlined') . '</u>'),
+ 'i' => array( t('Italicized'), '<i>' . t('Italicized') . '</i>'),
'sup' => array( t('Superscripted'), t('<sup>Super</sup>scripted')),
'sub' => array( t('Subscripted'), t('<sub>Sub</sub>scripted')),
- 'pre' => array( t('Preformatted'), '<pre>'. t('Preformatted') .'</pre>'),
+ 'pre' => array( t('Preformatted'), '<pre>' . t('Preformatted') . '</pre>'),
'abbr' => array( t('Abbreviation'), t('<abbr title="Abbreviation">Abbrev.</abbr>')),
'acronym' => array( t('Acronym'), t('<acronym title="Three-Letter Acronym">TLA</acronym>')),
- 'blockquote' => array( t('Block quoted'), '<blockquote>'. t('Block quoted') .'</blockquote>'),
- 'q' => array( t('Quoted inline'), '<q>'. t('Quoted inline') .'</q>'),
+ 'blockquote' => array( t('Block quoted'), '<blockquote>' . t('Block quoted') . '</blockquote>'),
+ 'q' => array( t('Quoted inline'), '<q>' . t('Quoted inline') . '</q>'),
// Assumes and describes tr, td, th.
- 'table' => array( t('Table'), '<table> <tr><th>'. t('Table header') .'</th></tr> <tr><td>'. t('Table cell') .'</td></tr> </table>'),
+ 'table' => array( t('Table'), '<table> <tr><th>' . t('Table header') . '</th></tr> <tr><td>' . t('Table cell') . '</td></tr> </table>'),
'tr' => NULL, 'td' => NULL, 'th' => NULL,
- 'del' => array( t('Deleted'), '<del>'. t('Deleted') .'</del>'),
- 'ins' => array( t('Inserted'), '<ins>'. t('Inserted') .'</ins>'),
+ 'del' => array( t('Deleted'), '<del>' . t('Deleted') . '</del>'),
+ 'ins' => array( t('Inserted'), '<ins>' . t('Inserted') . '</ins>'),
// Assumes and describes li.
- 'ol' => array( t('Ordered list - use the &lt;li&gt; to begin each list item'), '<ol> <li>'. t('First item') .'</li> <li>'. t('Second item') .'</li> </ol>'),
- 'ul' => array( t('Unordered list - use the &lt;li&gt; to begin each list item'), '<ul> <li>'. t('First item') .'</li> <li>'. t('Second item') .'</li> </ul>'),
+ 'ol' => array( t('Ordered list - use the &lt;li&gt; to begin each list item'), '<ol> <li>' . t('First item') . '</li> <li>' . t('Second item') . '</li> </ol>'),
+ 'ul' => array( t('Unordered list - use the &lt;li&gt; to begin each list item'), '<ul> <li>' . t('First item') . '</li> <li>' . t('Second item') . '</li> </ul>'),
'li' => NULL,
// Assumes and describes dt and dd.
- 'dl' => array( t('Definition lists are similar to other HTML lists. &lt;dl&gt; begins the definition list, &lt;dt&gt; begins the definition term and &lt;dd&gt; begins the definition description.'), '<dl> <dt>'. t('First term') .'</dt> <dd>'. t('First definition') .'</dd> <dt>'. t('Second term') .'</dt> <dd>'. t('Second definition') .'</dd> </dl>'),
+ 'dl' => array( t('Definition lists are similar to other HTML lists. &lt;dl&gt; begins the definition list, &lt;dt&gt; begins the definition term and &lt;dd&gt; begins the definition description.'), '<dl> <dt>' . t('First term') . '</dt> <dd>' . t('First definition') . '</dd> <dt>' . t('Second term') . '</dt> <dd>' . t('Second definition') . '</dd> </dl>'),
'dt' => NULL, 'dd' => NULL,
- 'h1' => array( t('Header'), '<h1>'. t('Title') .'</h1>'),
- 'h2' => array( t('Header'), '<h2>'. t('Subtitle') .'</h2>'),
- 'h3' => array( t('Header'), '<h3>'. t('Subtitle three') .'</h3>'),
- 'h4' => array( t('Header'), '<h4>'. t('Subtitle four') .'</h4>'),
- 'h5' => array( t('Header'), '<h5>'. t('Subtitle five') .'</h5>'),
- 'h6' => array( t('Header'), '<h6>'. t('Subtitle six') .'</h6>')
+ 'h1' => array( t('Header'), '<h1>' . t('Title') . '</h1>'),
+ 'h2' => array( t('Header'), '<h2>' . t('Subtitle') . '</h2>'),
+ 'h3' => array( t('Header'), '<h3>' . t('Subtitle three') . '</h3>'),
+ 'h4' => array( t('Header'), '<h4>' . t('Subtitle four') . '</h4>'),
+ 'h5' => array( t('Header'), '<h5>' . t('Subtitle five') . '</h5>'),
+ 'h6' => array( t('Header'), '<h6>' . t('Subtitle six') . '</h6>')
);
$header = array(t('Tag Description'), t('You Type'), t('You Get'));
preg_match_all('/<([a-z0-9]+)[^a-z0-9]/i', $allowed_html, $out);
@@ -227,7 +227,7 @@ function filter_filter_tips($delta, $format, $long = FALSE) {
if ($tips[$tag]) {
$rows[] = array(
array('data' => $tips[$tag][0], 'class' => 'description'),
- array('data' => '<code>'. check_plain($tips[$tag][1]) .'</code>', 'class' => 'type'),
+ array('data' => '<code>' . check_plain($tips[$tag][1]) . '</code>', 'class' => 'type'),
array('data' => $tips[$tag][1], 'class' => 'get')
);
}
@@ -240,8 +240,8 @@ function filter_filter_tips($delta, $format, $long = FALSE) {
}
$output .= theme('table', $header, $rows);
- $output .= '<p>'. t('Most unusual characters can be directly entered without any problems.') .'</p>';
- $output .= '<p>'. t('If you do encounter problems, try using HTML character entities. A common example looks like &amp;amp; for an ampersand &amp; character. For a full list of entities see HTML\'s <a href="@html-entities">entities</a> page. Some of the available characters include:', array('@html-entities' => 'http://www.w3.org/TR/html4/sgml/entities.html')) .'</p>';
+ $output .= '<p>' . t('Most unusual characters can be directly entered without any problems.') . '</p>';
+ $output .= '<p>' . t('If you do encounter problems, try using HTML character entities. A common example looks like &amp;amp; for an ampersand &amp; character. For a full list of entities see HTML\'s <a href="@html-entities">entities</a> page. Some of the available characters include:', array('@html-entities' => 'http://www.w3.org/TR/html4/sgml/entities.html')) . '</p>';
$entities = array(
array( t('Ampersand'), '&amp;'),
@@ -254,7 +254,7 @@ function filter_filter_tips($delta, $format, $long = FALSE) {
foreach ($entities as $entity) {
$rows[] = array(
array('data' => $entity[0], 'class' => 'description'),
- array('data' => '<code>'. check_plain($entity[1]) .'</code>', 'class' => 'type'),
+ array('data' => '<code>' . check_plain($entity[1]) . '</code>', 'class' => 'type'),
array('data' => $entity[1], 'class' => 'get')
);
}
@@ -307,11 +307,11 @@ function filter_formats($index = NULL) {
$where[] = "roles LIKE '%%,%d,%%'";
$args[] = $rid;
}
- $query .= ' WHERE '. implode(' OR ', $where) .' OR format = %d';
+ $query .= ' WHERE ' . implode(' OR ', $where) . ' OR format = %d';
$args[] = variable_get('filter_default_format', 1);
}
- $result = db_query($query .' ORDER by weight', $args);
+ $result = db_query($query . ' ORDER by weight', $args);
while ($format = db_fetch_object($result)) {
$formats[$format->format] = $format;
}
@@ -332,7 +332,7 @@ function filter_list_all() {
$list = module_invoke($module, 'filter', 'list');
if (isset($list) && is_array($list)) {
foreach ($list as $delta => $name) {
- $filters[$module .'/'. $delta] = (object)array('module' => $module, 'delta' => $delta, 'name' => $name);
+ $filters[$module . '/' . $delta] = (object)array('module' => $module, 'delta' => $delta, 'name' => $name);
}
}
}
@@ -380,7 +380,7 @@ function filter_list_format($format) {
$list = module_invoke($filter->module, 'filter', 'list');
if (isset($list) && is_array($list) && isset($list[$filter->delta])) {
$filter->name = $list[$filter->delta];
- $filters[$format][$filter->module .'/'. $filter->delta] = $filter;
+ $filters[$format][$filter->module . '/' . $filter->delta] = $filter;
}
}
}
@@ -424,7 +424,7 @@ function check_markup($text, $format = FILTER_FORMAT_DEFAULT, $check = TRUE) {
$format = filter_resolve_format($format);
// Check for a cached version of this piece of text.
- $cache_id = $format .':'. md5($text);
+ $cache_id = $format . ':' . md5($text);
if ($cached = cache_get($cache_id, 'cache_filter')) {
return $cached->data;
}
@@ -502,7 +502,7 @@ function filter_form($value = FILTER_FORMAT_DEFAULT, $weight = NULL, $parents =
'#return_value' => $format->format,
'#parents' => $parents,
'#description' => theme('filter_tips', _filter_tips($format->format, FALSE)),
- '#id' => form_clean_id('edit-'. implode('-', $parents_for_id)),
+ '#id' => form_clean_id('edit-' . implode('-', $parents_for_id)),
);
}
}
@@ -583,7 +583,7 @@ function _filter_tips($format, $long = FALSE) {
* @ingroup themeable
*/
function theme_filter_tips_more_info() {
- return '<p>'. l(t('More information about formatting options'), 'filter/tips') .'</p>';
+ return '<p>' . l(t('More information about formatting options'), 'filter/tips') . '</p>';
}
/**
@@ -708,10 +708,10 @@ function _filter_url_settings($format) {
'#title' => t('URL filter'),
'#collapsible' => TRUE,
);
- $form['filter_urlfilter']['filter_url_length_'. $format] = array(
+ $form['filter_urlfilter']['filter_url_length_' . $format] = array(
'#type' => 'textfield',
'#title' => t('Maximum link text length'),
- '#default_value' => variable_get('filter_url_length_'. $format, 72),
+ '#default_value' => variable_get('filter_url_length_' . $format, 72),
'#maxlength' => 4,
'#description' => t('URLs longer than this number of characters will be truncated to prevent long strings that break formatting. The link itself will be retained; just the text portion of the link will be truncated.'),
);
@@ -724,9 +724,9 @@ function _filter_url_settings($format) {
*/
function _filter_url($text, $format) {
// Pass length to regexp callback
- _filter_url_trim(NULL, variable_get('filter_url_length_'. $format, 72));
+ _filter_url_trim(NULL, variable_get('filter_url_length_' . $format, 72));
- $text = ' '. $text .' ';
+ $text = ' ' . $text . ' ';
// Match absolute URLs.
$text = preg_replace_callback("`(<p>|<li>|<br\s*/?>|[ \n\r\t\(])((http://|https://|ftp://|mailto:|smb://|afp://|file://|gopher://|news://|ssl://|sslv2://|sslv3://|tls://|tcp://|udp://)([a-zA-Z0-9@:%_+*~#?&=.,/;-]*[a-zA-Z0-9@:%_+*~#&=/;-]))([.,?!]*?)(?=(</p>|</li>|<br\s*/?>|[ \n\r\t\)]))`i", '_filter_url_parse_full_links', $text);
@@ -779,7 +779,7 @@ function _filter_htmlcorrector($text) {
if (in_array($tagname, $stack)) {
// Close other tags lingering first.
do {
- $output .= '</'. $stack[0] .'>';
+ $output .= '</' . $stack[0] . '>';
} while (array_shift($stack) != $tagname);
}
// Otherwise, discard it.
@@ -789,7 +789,7 @@ function _filter_htmlcorrector($text) {
else {
// See if we have an identical 'no nesting' tag already open and close it if found.
if (count($stack) && ($stack[0] == $tagname) && isset($no_nesting[$stack[0]])) {
- $output .= '</'. array_shift($stack) .'>';
+ $output .= '</' . array_shift($stack) . '>';
}
// Push non-single-use tags onto the stack
if (!isset($single_use[$tagname])) {
@@ -797,9 +797,9 @@ function _filter_htmlcorrector($text) {
}
// Add trailing slash to single-use tags as per X(HT)ML.
else {
- $value = rtrim($value, ' /') .' /';
+ $value = rtrim($value, ' /') . ' /';
}
- $output .= '<'. $value .'>';
+ $output .= '<' . $value . '>';
}
}
else {
@@ -810,7 +810,7 @@ function _filter_htmlcorrector($text) {
}
// Close remaining tags.
while (count($stack) > 0) {
- $output .= '</'. array_shift($stack) .'>';
+ $output .= '</' . array_shift($stack) . '>';
}
return $output;
}
@@ -822,7 +822,7 @@ function _filter_url_parse_full_links($match) {
$match[2] = decode_entities($match[2]);
$caption = check_plain(_filter_url_trim($match[2]));
$match[2] = check_url($match[2]);
- return $match[1] .'<a href="'. $match[2] .'" title="'. $match[2] .'">'. $caption .'</a>'. $match[5];
+ return $match[1] . '<a href="' . $match[2] . '" title="' . $match[2] . '">' . $caption . '</a>' . $match[5];
}
/**
@@ -832,7 +832,7 @@ function _filter_url_parse_partial_links($match) {
$match[2] = decode_entities($match[2]);
$caption = check_plain(_filter_url_trim($match[2]));
$match[2] = check_plain($match[2]);
- return $match[1] .'<a href="http://'. $match[2] .'" title="'. $match[2] .'">'. $caption .'</a>'. $match[3];
+ return $match[1] . '<a href="http://' . $match[2] . '" title="' . $match[2] . '">' . $caption . '</a>' . $match[3];
}
/**
@@ -846,7 +846,7 @@ function _filter_url_trim($text, $length = NULL) {
// Use +3 for '...' string length.
if (strlen($text) > $_length + 3) {
- $text = substr($text, 0, $_length) .'...';
+ $text = substr($text, 0, $_length) . '...';
}
return $text;
@@ -888,20 +888,20 @@ function _filter_autop($text) {
}
}
else if (!$ignore) {
- $chunk = preg_replace('|\n*$|', '', $chunk) ."\n\n"; // just to make things a little easier, pad the end
+ $chunk = preg_replace('|\n*$|', '', $chunk) . "\n\n"; // just to make things a little easier, pad the end
$chunk = preg_replace('|<br />\s*<br />|', "\n\n", $chunk);
- $chunk = preg_replace('!(<'. $block .'[^>]*>)!', "\n$1", $chunk); // Space things out a little
- $chunk = preg_replace('!(</'. $block .'>)!', "$1\n\n", $chunk); // Space things out a little
+ $chunk = preg_replace('!(<' . $block . '[^>]*>)!', "\n$1", $chunk); // Space things out a little
+ $chunk = preg_replace('!(</' . $block . '>)!', "$1\n\n", $chunk); // Space things out a little
$chunk = preg_replace("/\n\n+/", "\n\n", $chunk); // take care of duplicates
$chunk = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "<p>$1</p>\n", $chunk); // make paragraphs, including one at the end
$chunk = preg_replace('|<p>\s*</p>\n|', '', $chunk); // under certain strange conditions it could create a P of entirely whitespace
$chunk = preg_replace("|<p>(<li.+?)</p>|", "$1", $chunk); // problem with nested lists
$chunk = preg_replace('|<p><blockquote([^>]*)>|i', "<blockquote$1><p>", $chunk);
$chunk = str_replace('</blockquote></p>', '</p></blockquote>', $chunk);
- $chunk = preg_replace('!<p>\s*(</?'. $block .'[^>]*>)!', "$1", $chunk);
- $chunk = preg_replace('!(</?'. $block .'[^>]*>)\s*</p>!', "$1", $chunk);
+ $chunk = preg_replace('!<p>\s*(</?' . $block . '[^>]*>)!', "$1", $chunk);
+ $chunk = preg_replace('!(</?' . $block . '[^>]*>)\s*</p>!', "$1", $chunk);
$chunk = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $chunk); // make line breaks
- $chunk = preg_replace('!(</?'. $block .'[^>]*>)\s*<br />!', "$1", $chunk);
+ $chunk = preg_replace('!(</?' . $block . '[^>]*>)\s*<br />!', "$1", $chunk);
$chunk = preg_replace('!<br />(\s*</?(?:p|li|div|th|pre|td|ul|ol)>)!', '$1', $chunk);
$chunk = preg_replace('/&([^#])(?![A-Za-z0-9]{1,8};)/', '&amp;$1', $chunk);
}
@@ -1036,7 +1036,7 @@ function _filter_xss_split($m, $store = FALSE) {
// Clean up attributes
$attr2 = implode(' ', _filter_xss_attributes($attrlist));
$attr2 = preg_replace('/[<>]/', '', $attr2);
- $attr2 = strlen($attr2) ? ' '. $attr2 : '';
+ $attr2 = strlen($attr2) ? ' ' . $attr2 : '';
return "<$elem$attr2$xhtml_slash>";
}
diff --git a/modules/filter/filter.pages.inc b/modules/filter/filter.pages.inc
index 20c42095d..46af8bdcd 100644
--- a/modules/filter/filter.pages.inc
+++ b/modules/filter/filter.pages.inc
@@ -32,7 +32,7 @@ function theme_filter_tips($tips, $long = FALSE, $extra = '') {
$multiple = count($tips) > 1;
if ($multiple) {
- $output = t('input formats') .':';
+ $output = t('input formats') . ':';
}
if (count($tips)) {
@@ -42,13 +42,13 @@ function theme_filter_tips($tips, $long = FALSE, $extra = '') {
foreach ($tips as $name => $tiplist) {
if ($multiple) {
$output .= '<li>';
- $output .= '<strong>'. $name .'</strong>:<br />';
+ $output .= '<strong>' . $name . '</strong>:<br />';
}
if (count($tiplist) > 0) {
$output .= '<ul class="tips">';
foreach ($tiplist as $tip) {
- $output .= '<li'. ($long ? ' id="filter-'. str_replace("/", "-", $tip['id']) .'">' : '>') . $tip['tip'] .'</li>';
+ $output .= '<li' . ($long ? ' id="filter-' . str_replace("/", "-", $tip['id']) . '">' : '>') . $tip['tip'] . '</li>';
}
$output .= '</ul>';
}
diff --git a/modules/forum/forum.admin.inc b/modules/forum/forum.admin.inc
index e7b12d335..ce910f932 100644
--- a/modules/forum/forum.admin.inc
+++ b/modules/forum/forum.admin.inc
@@ -225,12 +225,12 @@ function forum_overview(&$form_state) {
foreach (element_children($form) as $key) {
if (isset($form[$key]['#term'])) {
$term = $form[$key]['#term'];
- $form[$key]['view']['#value'] = l($term['name'], 'forum/'. $term['tid']);
+ $form[$key]['view']['#value'] = l($term['name'], 'forum/' . $term['tid']);
if (in_array($form[$key]['#term']['tid'], variable_get('forum_containers', array()))) {
- $form[$key]['edit']['#value'] = l(t('edit container'), 'admin/content/forum/edit/container/'. $term['tid']);
+ $form[$key]['edit']['#value'] = l(t('edit container'), 'admin/content/forum/edit/container/' . $term['tid']);
}
else {
- $form[$key]['edit']['#value'] = l(t('edit forum'), 'admin/content/forum/edit/forum/'. $term['tid']);
+ $form[$key]['edit']['#value'] = l(t('edit forum'), 'admin/content/forum/edit/forum/' . $term['tid']);
}
}
}
@@ -242,7 +242,7 @@ function forum_overview(&$form_state) {
$form['#theme'] = 'taxonomy_overview_terms';
$form['#submit'] = array('taxonomy_overview_terms_submit'); // Use the existing taxonomy overview submit handler.
$form['#validate'] = array('taxonomy_overview_terms_validate');
- $form['#empty_text'] = '<em>'. t('There are no existing containers or forums. Containers and forums may be added using the <a href="@container">add container</a> and <a href="@forum">add forum</a> pages.', array('@container' => url('admin/content/forum/add/container'), '@forum' => url('admin/content/forum/add/forum'))) .'</em>';
+ $form['#empty_text'] = '<em>' . t('There are no existing containers or forums. Containers and forums may be added using the <a href="@container">add container</a> and <a href="@forum">add forum</a> pages.', array('@container' => url('admin/content/forum/add/container'), '@forum' => url('admin/content/forum/add/forum'))) . '</em>';
return $form;
}
@@ -274,7 +274,7 @@ function _forum_parent_select($tid, $title, $child_type) {
$exclude[] = $tid;
$tree = taxonomy_get_tree($vid);
- $options[0] = '<'. t('root') .'>';
+ $options[0] = '<' . t('root') . '>';
if ($tree) {
foreach ($tree as $term) {
if (!in_array($term->tid, $exclude)) {
diff --git a/modules/forum/forum.module b/modules/forum/forum.module
index 4bf6ec907..16cda7bd9 100644
--- a/modules/forum/forum.module
+++ b/modules/forum/forum.module
@@ -12,23 +12,23 @@
function forum_help($path, $arg) {
switch ($path) {
case 'admin/help#forum':
- $output = '<p>'. t('The forum module lets you create threaded discussion forums with functionality similar to other message board systems. Forums are useful because they allow community members to discuss topics with one another while ensuring those conversations are archived for later reference. The <a href="@create-topic">forum topic</a> menu item (under <em>Create content</em> on the Navigation menu) creates the initial post of a new threaded discussion, or thread.', array('@create-topic' => url('node/add/forum'))) .'</p>';
- $output .= '<p>'. t('A threaded discussion occurs as people leave comments on a forum topic (or on other comments within that topic). A forum topic is contained within a forum, which may hold many similar or related forum topics. Forums are (optionally) nested within a container, which may hold many similar or related forums. Both containers and forums may be nested within other containers and forums, and provide structure for your message board. By carefully planning this structure, you make it easier for users to find and comment on a specific forum topic.') .'</p>';
- $output .= '<p>'. t('When administering a forum, note that:') .'</p>';
- $output .= '<ul><li>'. t('a forum topic (and all of its comments) may be moved between forums by selecting a different forum while editing a forum topic.') .'</li>';
- $output .= '<li>'. t('when moving a forum topic between forums, the <em>Leave shadow copy</em> option creates a link in the original forum pointing to the new location.') .'</li>';
- $output .= '<li>'. t('selecting <em>Read only</em> under <em>Comment settings</em> while editing a forum topic will lock (prevent new comments) on the thread.') .'</li>';
- $output .= '<li>'. t('selecting <em>Disabled</em> under <em>Comment settings</em> while editing a forum topic will hide all existing comments on the thread, and prevent new ones.') .'</li></ul>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@forum">Forum module</a>.', array('@forum' => 'http://drupal.org/handbook/modules/forum/')) .'</p>';
+ $output = '<p>' . t('The forum module lets you create threaded discussion forums with functionality similar to other message board systems. Forums are useful because they allow community members to discuss topics with one another while ensuring those conversations are archived for later reference. The <a href="@create-topic">forum topic</a> menu item (under <em>Create content</em> on the Navigation menu) creates the initial post of a new threaded discussion, or thread.', array('@create-topic' => url('node/add/forum'))) . '</p>';
+ $output .= '<p>' . t('A threaded discussion occurs as people leave comments on a forum topic (or on other comments within that topic). A forum topic is contained within a forum, which may hold many similar or related forum topics. Forums are (optionally) nested within a container, which may hold many similar or related forums. Both containers and forums may be nested within other containers and forums, and provide structure for your message board. By carefully planning this structure, you make it easier for users to find and comment on a specific forum topic.') . '</p>';
+ $output .= '<p>' . t('When administering a forum, note that:') . '</p>';
+ $output .= '<ul><li>' . t('a forum topic (and all of its comments) may be moved between forums by selecting a different forum while editing a forum topic.') . '</li>';
+ $output .= '<li>' . t('when moving a forum topic between forums, the <em>Leave shadow copy</em> option creates a link in the original forum pointing to the new location.') . '</li>';
+ $output .= '<li>' . t('selecting <em>Read only</em> under <em>Comment settings</em> while editing a forum topic will lock (prevent new comments) on the thread.') . '</li>';
+ $output .= '<li>' . t('selecting <em>Disabled</em> under <em>Comment settings</em> while editing a forum topic will hide all existing comments on the thread, and prevent new ones.') . '</li></ul>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@forum">Forum module</a>.', array('@forum' => 'http://drupal.org/handbook/modules/forum/')) . '</p>';
return $output;
case 'admin/content/forum':
- return '<p>'. t('This page displays a list of existing forums and containers. Containers (optionally) hold forums, and forums hold forum topics (a forum topic is the initial post to a threaded discussion). To provide structure, both containers and forums may be placed inside other containers and forums. To rearrange forums and containers, grab a drag-and-drop handle under the <em>Name</em> column and drag the forum or container to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the <em>Save</em> button at the bottom of the page.') .'</p>';
+ return '<p>' . t('This page displays a list of existing forums and containers. Containers (optionally) hold forums, and forums hold forum topics (a forum topic is the initial post to a threaded discussion). To provide structure, both containers and forums may be placed inside other containers and forums. To rearrange forums and containers, grab a drag-and-drop handle under the <em>Name</em> column and drag the forum or container to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the <em>Save</em> button at the bottom of the page.') . '</p>';
case 'admin/content/forum/add/container':
- return '<p>'. t('By grouping related or similar forums, containers help organize forums. For example, a container named "Food" may hold two forums named "Fruit" and "Vegetables", respectively.') .'</p>';
+ return '<p>' . t('By grouping related or similar forums, containers help organize forums. For example, a container named "Food" may hold two forums named "Fruit" and "Vegetables", respectively.') . '</p>';
case 'admin/content/forum/add/forum':
- return '<p>'. t('A forum holds related or similar forum topics (a forum topic is the initial post to a threaded discussion). For example, a forum named "Fruit" may contain forum topics titled "Apples" and "Bananas", respectively.') .'</p>';
+ return '<p>' . t('A forum holds related or similar forum topics (a forum topic is the initial post to a threaded discussion). For example, a forum named "Fruit" may contain forum topics titled "Apples" and "Bananas", respectively.') . '</p>';
case 'admin/content/forum/settings':
- return '<p>'. t('These settings allow you to adjust the display of your forum topics. The content types available for use within a forum may be selected by editing the <em>Content types</em> on the <a href="@forum-vocabulary">forum vocabulary page</a>.', array('@forum-vocabulary' => url('admin/content/taxonomy/edit/vocabulary/'. variable_get('forum_nav_vocabulary', '')))) .'</p>';
+ return '<p>' . t('These settings allow you to adjust the display of your forum topics. The content types available for use within a forum may be selected by editing the <em>Content types</em> on the <a href="@forum-vocabulary">forum vocabulary page</a>.', array('@forum-vocabulary' => url('admin/content/taxonomy/edit/vocabulary/' . variable_get('forum_nav_vocabulary', '')))) . '</p>';
}
}
@@ -154,7 +154,7 @@ function forum_menu() {
* Implementation of hook_init().
*/
function forum_init() {
- drupal_add_css(drupal_get_path('module', 'forum') .'/forum.css');
+ drupal_add_css(drupal_get_path('module', 'forum') . '/forum.css');
}
/**
@@ -194,7 +194,7 @@ function forum_nodeapi(&$node, $op, $teaser, $page) {
if ($parents = taxonomy_get_parents_all($node->tid)) {
$parents = array_reverse($parents);
foreach ($parents as $p) {
- $breadcrumb[] = l($p->name, 'forum/'. $p->tid);
+ $breadcrumb[] = l($p->name, 'forum/' . $p->tid);
}
}
drupal_set_breadcrumb($breadcrumb);
@@ -409,11 +409,11 @@ function forum_block($op = 'list', $delta = '', $edit = array()) {
return $blocks;
case 'configure':
- $form['forum_block_num_'. $delta] = array('#type' => 'select', '#title' => t('Number of topics'), '#default_value' => variable_get('forum_block_num_'. $delta, '5'), '#options' => drupal_map_assoc(array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20)));
+ $form['forum_block_num_' . $delta] = array('#type' => 'select', '#title' => t('Number of topics'), '#default_value' => variable_get('forum_block_num_' . $delta, '5'), '#options' => drupal_map_assoc(array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20)));
return $form;
case 'save':
- variable_set('forum_block_num_'. $delta, $edit['forum_block_num_'. $delta]);
+ variable_set('forum_block_num_' . $delta, $edit['forum_block_num_' . $delta]);
break;
case 'view':
@@ -661,7 +661,7 @@ function template_preprocess_forums(&$variables) {
$title = $p->name;
}
else {
- $breadcrumb[] = l($p->name, 'forum/'. $p->tid);
+ $breadcrumb[] = l($p->name, 'forum/' . $p->tid);
}
}
}
@@ -678,7 +678,7 @@ function template_preprocess_forums(&$variables) {
if (node_access('create', $type)) {
// Fetch the "General" name of the content type;
// Push the link with title and url to the array.
- $forum_types[$type] = array('title' => t('Post new @node_type', array('@node_type' => node_get_types('name', $type))), 'href' => 'node/add/'. str_replace('_', '-', $type) .'/'. $variables['tid']);
+ $forum_types[$type] = array('title' => t('Post new @node_type', array('@node_type' => node_get_types('name', $type))), 'href' => 'node/add/' . str_replace('_', '-', $type) . '/' . $variables['tid']);
}
}
@@ -703,7 +703,7 @@ function template_preprocess_forums(&$variables) {
if ($variables['tid'] && !in_array($variables['tid'], variable_get('forum_containers', array()))) {
$variables['topics'] = theme('forum_topic_list', $variables['tid'], $variables['topics'], $variables['sortby'], $variables['forum_per_page']);
- drupal_add_feed(url('taxonomy/term/'. $variables['tid'] .'/0/feed'), 'RSS - '. $title);
+ drupal_add_feed(url('taxonomy/term/' . $variables['tid'] . '/0/feed'), 'RSS - ' . $title);
}
else {
$variables['topics'] = '';
@@ -713,16 +713,16 @@ function template_preprocess_forums(&$variables) {
// Check both variables to be safe then the inverse. Forums with topic ID's take precedence.
if ($variables['forums'] && !$variables['topics']) {
$variables['template_files'][] = 'forums-containers';
- $variables['template_files'][] = 'forums-'. $variables['tid'];
- $variables['template_files'][] = 'forums-containers-'. $variables['tid'];
+ $variables['template_files'][] = 'forums-' . $variables['tid'];
+ $variables['template_files'][] = 'forums-containers-' . $variables['tid'];
}
elseif (!$variables['forums'] && $variables['topics']) {
$variables['template_files'][] = 'forums-topics';
- $variables['template_files'][] = 'forums-'. $variables['tid'];
- $variables['template_files'][] = 'forums-topics-'. $variables['tid'];
+ $variables['template_files'][] = 'forums-' . $variables['tid'];
+ $variables['template_files'][] = 'forums-topics-' . $variables['tid'];
}
else {
- $variables['template_files'][] = 'forums-'. $variables['tid'];
+ $variables['template_files'][] = 'forums-' . $variables['tid'];
}
}
@@ -885,7 +885,7 @@ function template_preprocess_forum_topic_navigation(&$variables) {
$output = '';
// get previous and next topic
- $sql = "SELECT n.nid, n.title, n.sticky, l.comment_count, l.last_comment_timestamp FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid INNER JOIN {term_node} r ON n.nid = r.nid AND r.tid = %d WHERE n.status = 1 ORDER BY n.sticky DESC, ". _forum_get_topic_order_sql(variable_get('forum_order', 1));
+ $sql = "SELECT n.nid, n.title, n.sticky, l.comment_count, l.last_comment_timestamp FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid INNER JOIN {term_node} r ON n.nid = r.nid AND r.tid = %d WHERE n.status = 1 ORDER BY n.sticky DESC, " . _forum_get_topic_order_sql(variable_get('forum_order', 1));
$result = db_query(db_rewrite_sql($sql), isset($variables['node']->tid) ? $variables['node']->tid : 0);
$stop = $variables['prev'] = $variables['next'] = 0;
@@ -953,5 +953,5 @@ function _forum_get_topic_order($sortby) {
function _forum_get_topic_order_sql($sortby) {
$order = _forum_get_topic_order($sortby);
- return $order['field'] .' '. strtoupper($order['sort']);
+ return $order['field'] . ' ' . strtoupper($order['sort']);
}
diff --git a/modules/help/help.admin.inc b/modules/help/help.admin.inc
index 7b70ce523..701f8fabc 100644
--- a/modules/help/help.admin.inc
+++ b/modules/help/help.admin.inc
@@ -11,8 +11,8 @@
*/
function help_main() {
// Add CSS
- drupal_add_css(drupal_get_path('module', 'help') .'/help.css', 'module', 'all', FALSE);
- $output = '<h2>'. t('Help topics') .'</h2><p>'. t('Help is available on the following items:') .'</p>'. help_links_as_list();
+ drupal_add_css(drupal_get_path('module', 'help') . '/help.css', 'module', 'all', FALSE);
+ $output = '<h2>' . t('Help topics') . '</h2><p>' . t('Help is available on the following items:') . '</p>' . help_links_as_list();
return $output;
}
@@ -22,7 +22,7 @@ function help_main() {
function help_page($name) {
$output = '';
if (module_hook($name, 'help')) {
- $module = drupal_parse_info_file(drupal_get_path('module', $name) .'/'. $name .'.info');
+ $module = drupal_parse_info_file(drupal_get_path('module', $name) . '/' . $name . '.info');
drupal_set_title($module['name']);
$temp = module_invoke($name, 'help', "admin/help#$name", drupal_help_arg());
@@ -63,9 +63,9 @@ function help_links_as_list() {
$output = '<div class="clear-block"><div class="help-items"><ul>';
$i = 0;
foreach ($modules as $module => $name) {
- $output .= '<li>'. l($name, 'admin/help/'. $module) .'</li>';
+ $output .= '<li>' . l($name, 'admin/help/' . $module) . '</li>';
if (($i + 1) % $break == 0 && ($i + 1) != $count) {
- $output .= '</ul></div><div class="help-items'. ($i + 1 == $break * 3 ? ' help-items-last' : '') .'"><ul>';
+ $output .= '</ul></div><div class="help-items' . ($i + 1 == $break * 3 ? ' help-items-last' : '') . '"><ul>';
}
$i++;
}
diff --git a/modules/help/help.module b/modules/help/help.module
index 2daff64b3..0b7787089 100644
--- a/modules/help/help.module
+++ b/modules/help/help.module
@@ -19,7 +19,7 @@ function help_menu() {
);
foreach (module_implements('help', TRUE) as $module) {
- $items['admin/help/'. $module] = array(
+ $items['admin/help/' . $module] = array(
'title' => $module,
'page callback' => 'help_page',
'page arguments' => array(2),
@@ -37,11 +37,11 @@ function help_menu() {
function help_help($path, $arg) {
switch ($path) {
case 'admin/help':
- $output = '<p>'. t('This guide provides context sensitive help on the use and configuration of <a href="@drupal">Drupal</a> and its modules, and is a supplement to the more extensive online <a href="@handbook">Drupal handbook</a>. The online handbook may contain more up-to-date information, is annotated with helpful user-contributed comments, and serves as the definitive reference point for all Drupal documentation.', array('@drupal' => 'http://drupal.org', '@handbook' => 'http://drupal.org/handbook')) .'</p>';
+ $output = '<p>' . t('This guide provides context sensitive help on the use and configuration of <a href="@drupal">Drupal</a> and its modules, and is a supplement to the more extensive online <a href="@handbook">Drupal handbook</a>. The online handbook may contain more up-to-date information, is annotated with helpful user-contributed comments, and serves as the definitive reference point for all Drupal documentation.', array('@drupal' => 'http://drupal.org', '@handbook' => 'http://drupal.org/handbook')) . '</p>';
return $output;
case 'admin/help#help':
- $output = '<p>'. t('The help module provides context sensitive help on the use and configuration of <a href="@drupal">Drupal</a> and its modules, and is a supplement to the more extensive online <a href="@handbook">Drupal handbook</a>. The online handbook may contain more up-to-date information, is annotated with helpful user-contributed comments, and serves as the definitive reference point for all Drupal documentation.', array('@drupal' => 'http://drupal.org', '@handbook' => 'http://drupal.org/handbook')) .'</p>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@help">Help module</a>.', array('@help' => 'http://drupal.org/handbook/modules/help/')) .'</p>';
+ $output = '<p>' . t('The help module provides context sensitive help on the use and configuration of <a href="@drupal">Drupal</a> and its modules, and is a supplement to the more extensive online <a href="@handbook">Drupal handbook</a>. The online handbook may contain more up-to-date information, is annotated with helpful user-contributed comments, and serves as the definitive reference point for all Drupal documentation.', array('@drupal' => 'http://drupal.org', '@handbook' => 'http://drupal.org/handbook')) . '</p>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@help">Help module</a>.', array('@help' => 'http://drupal.org/handbook/modules/help/')) . '</p>';
return $output;
}
}
diff --git a/modules/locale/locale.install b/modules/locale/locale.install
index 278fc3388..3b3fdbab7 100644
--- a/modules/locale/locale.install
+++ b/modules/locale/locale.install
@@ -172,13 +172,13 @@ function locale_update_6004() {
function locale_update_6005() {
foreach (node_get_types() as $type => $content_type) {
// Default to NULL, so we can skip dealing with non-existent settings.
- $setting = variable_get('language_'. $type, NULL);
+ $setting = variable_get('language_' . $type, NULL);
if ($type == 'default' && is_numeric($setting)) {
// language_default was overwritten with the content type setting,
// so reset the default language and save the content type setting.
variable_set('language_content_type_default', $setting);
variable_del('language_default');
- drupal_set_message('The default language setting has been reset to its default value. Check the '. l('language configuration page', 'admin/settings/language') .' to configure it correctly.');
+ drupal_set_message('The default language setting has been reset to its default value. Check the ' . l('language configuration page', 'admin/settings/language') . ' to configure it correctly.');
}
elseif ($type == 'negotiation') {
// language_content_type_negotiation is an integer either if it is
@@ -186,13 +186,13 @@ function locale_update_6005() {
// The language_negotiation setting is not reset, but
// the user is alerted that this setting possibly was overwritten
variable_set('language_content_type_negotiation', $setting);
- drupal_set_message('The language negotiation setting was possibly overwritten by a content type of the same name. Check the '. l('language configuration page', 'admin/settings/language/configure') .' and the '. l('<em>'. $content_type->name ."</em> content type's multilingual support settings", 'admin/build/types/negotiation', array('html' => TRUE)) .' to configure them correctly.');
+ drupal_set_message('The language negotiation setting was possibly overwritten by a content type of the same name. Check the ' . l('language configuration page', 'admin/settings/language/configure') . ' and the ' . l('<em>' . $content_type->name . "</em> content type's multilingual support settings", 'admin/build/types/negotiation', array('html' => TRUE)) . ' to configure them correctly.');
}
elseif (!is_null($setting)) {
// Change the language setting variable for any other content type.
// Do not worry about language_count, it will be updated below.
- variable_set('language_content_type_'. $type, $setting);
- variable_del('language_'. $type);
+ variable_set('language_content_type_' . $type, $setting);
+ variable_del('language_' . $type);
}
}
// Update language count variable that might be overwritten.
diff --git a/modules/locale/locale.module b/modules/locale/locale.module
index f8de01ee1..47c77204b 100644
--- a/modules/locale/locale.module
+++ b/modules/locale/locale.module
@@ -32,44 +32,44 @@ define('LANGUAGE_RTL', 1);
function locale_help($path, $arg) {
switch ($path) {
case 'admin/help#locale':
- $output = '<p>'. t('The locale module allows your Drupal site to be presented in languages other than the default English, a defining feature of multi-lingual websites. The locale module works by examining text as it is about to be displayed: when a translation of the text is available in the language to be displayed, the translation is displayed rather than the original text. When a translation is unavailable, the original text is displayed, and then stored for later review by a translator.') .'</p>';
- $output .= '<p>'. t('Beyond translation of the Drupal interface, the locale module provides a feature set tailored to the needs of a multi-lingual site. Language negotiation allows your site to automatically change language based on the domain or path used for each request. Users may (optionally) select their preferred language on their <em>My account</em> page, and your site can be configured to honor a web browser\'s preferred language settings. Your site content can be created in (and translated to) any enabled language, and each post may have a language-appropriate alias for each of its translations. The locale module works in concert with the <a href="@content-help">content translation module</a> to manage translated content.', array('@content-help' => url('admin/help/translation'))) .'</p>';
- $output .= '<p>'. t('Translations may be provided by:') .'</p>';
- $output .= '<ul><li>'. t("translating the original text via the locale module's integrated web interface, or") .'</li>';
- $output .= '<li>'. t('importing files from a set of existing translations, known as a translation package. A translation package enables the display of a specific version of Drupal in a specific language, and contain files in the Gettext Portable Object (<em>.po</em>) format. Although not all languages are available for every version of Drupal, translation packages for many languages are available for download from the <a href="@translations">Drupal translation page</a>.', array('@translations' => 'http://drupal.org/project/translations')) .'</li></ul>';
- $output .= '<p>'. t('If an existing translation package does not meet your needs, the Gettext Portable Object (<em>.po</em>) files within a package may be modified, or new <em>.po</em> files may be created, using a desktop Gettext editor. The locale module\'s <a href="@import">import</a> feature allows the translated strings from a new or modified <em>.po</em> file to be added to your site. The locale module\'s <a href="@export">export</a> feature generates files from your site\'s translated strings, that can either be shared with others or edited offline by a Gettext translation editor.', array('@import' => url('admin/build/translate/import'), '@export' => url('admin/build/translate/export'))) .'</p>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@locale">Locale module</a>.', array('@locale' => 'http://drupal.org/handbook/modules/locale/')) .'</p>';
+ $output = '<p>' . t('The locale module allows your Drupal site to be presented in languages other than the default English, a defining feature of multi-lingual websites. The locale module works by examining text as it is about to be displayed: when a translation of the text is available in the language to be displayed, the translation is displayed rather than the original text. When a translation is unavailable, the original text is displayed, and then stored for later review by a translator.') . '</p>';
+ $output .= '<p>' . t('Beyond translation of the Drupal interface, the locale module provides a feature set tailored to the needs of a multi-lingual site. Language negotiation allows your site to automatically change language based on the domain or path used for each request. Users may (optionally) select their preferred language on their <em>My account</em> page, and your site can be configured to honor a web browser\'s preferred language settings. Your site content can be created in (and translated to) any enabled language, and each post may have a language-appropriate alias for each of its translations. The locale module works in concert with the <a href="@content-help">content translation module</a> to manage translated content.', array('@content-help' => url('admin/help/translation'))) . '</p>';
+ $output .= '<p>' . t('Translations may be provided by:') . '</p>';
+ $output .= '<ul><li>' . t("translating the original text via the locale module's integrated web interface, or") . '</li>';
+ $output .= '<li>' . t('importing files from a set of existing translations, known as a translation package. A translation package enables the display of a specific version of Drupal in a specific language, and contain files in the Gettext Portable Object (<em>.po</em>) format. Although not all languages are available for every version of Drupal, translation packages for many languages are available for download from the <a href="@translations">Drupal translation page</a>.', array('@translations' => 'http://drupal.org/project/translations')) . '</li></ul>';
+ $output .= '<p>' . t('If an existing translation package does not meet your needs, the Gettext Portable Object (<em>.po</em>) files within a package may be modified, or new <em>.po</em> files may be created, using a desktop Gettext editor. The locale module\'s <a href="@import">import</a> feature allows the translated strings from a new or modified <em>.po</em> file to be added to your site. The locale module\'s <a href="@export">export</a> feature generates files from your site\'s translated strings, that can either be shared with others or edited offline by a Gettext translation editor.', array('@import' => url('admin/build/translate/import'), '@export' => url('admin/build/translate/export'))) . '</p>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@locale">Locale module</a>.', array('@locale' => 'http://drupal.org/handbook/modules/locale/')) . '</p>';
return $output;
case 'admin/settings/language':
- $output = '<p>'. t("This page provides an overview of your site's enabled languages. If multiple languages are available and enabled, the text on your site interface may be translated, registered users may select their preferred language on the <em>My account</em> page, and site authors may indicate a specific language when creating posts. The site's default language is used for anonymous visitors and for users who have not selected a preferred language.") .'</p>';
- $output .= '<p>'. t('For each language available on the site, use the <em>edit</em> link to configure language details, including name, an optional language-specific path or domain, and whether the language is natively presented either left-to-right or right-to-left. These languages also appear in the <em>Language</em> selection when creating a post of a content type with multilingual support.') .'</p>';
- $output .= '<p>'. t('Use the <a href="@add-language">add language page</a> to enable additional languages (and automatically import files from a translation package, if available), the <a href="@search">translate interface page</a> to locate strings for manual translation, or the <a href="@import">import page</a> to add translations from individual <em>.po</em> files. A number of contributed translation packages containing <em>.po</em> files are available on the <a href="@translations">Drupal.org translations page</a>.', array('@add-language' => url('admin/settings/language/add'), '@search' => url('admin/build/translate/search'), '@import' => url('admin/build/translate/import'), '@translations' => 'http://drupal.org/project/translations')) .'</p>';
+ $output = '<p>' . t("This page provides an overview of your site's enabled languages. If multiple languages are available and enabled, the text on your site interface may be translated, registered users may select their preferred language on the <em>My account</em> page, and site authors may indicate a specific language when creating posts. The site's default language is used for anonymous visitors and for users who have not selected a preferred language.") . '</p>';
+ $output .= '<p>' . t('For each language available on the site, use the <em>edit</em> link to configure language details, including name, an optional language-specific path or domain, and whether the language is natively presented either left-to-right or right-to-left. These languages also appear in the <em>Language</em> selection when creating a post of a content type with multilingual support.') . '</p>';
+ $output .= '<p>' . t('Use the <a href="@add-language">add language page</a> to enable additional languages (and automatically import files from a translation package, if available), the <a href="@search">translate interface page</a> to locate strings for manual translation, or the <a href="@import">import page</a> to add translations from individual <em>.po</em> files. A number of contributed translation packages containing <em>.po</em> files are available on the <a href="@translations">Drupal.org translations page</a>.', array('@add-language' => url('admin/settings/language/add'), '@search' => url('admin/build/translate/search'), '@import' => url('admin/build/translate/import'), '@translations' => 'http://drupal.org/project/translations')) . '</p>';
return $output;
case 'admin/settings/language/add':
- return '<p>'. t('Add all languages to be supported by your site. If your desired language is not available in the <em>Language name</em> drop-down, click <em>Custom language</em> and provide a language code and other details manually. When providing a language code manually, be sure to enter a standardized language code, since this code may be used by browsers to determine an appropriate display language.') .'</p>';
+ return '<p>' . t('Add all languages to be supported by your site. If your desired language is not available in the <em>Language name</em> drop-down, click <em>Custom language</em> and provide a language code and other details manually. When providing a language code manually, be sure to enter a standardized language code, since this code may be used by browsers to determine an appropriate display language.') . '</p>';
case 'admin/settings/language/configure':
- $output = '<p>'. t("Language negotiation settings determine the site's presentation language. Available options include:") .'</p>';
- $output .= '<ul><li>'. t('<strong>None.</strong> The default language is used for site presentation, though users may (optionally) select a preferred language on the <em>My Account</em> page. (User language preferences will be used for site e-mails, if available.)') .'</li>';
- $output .= '<li>'. t('<strong>Path prefix only.</strong> The presentation language is determined by examining the path for a language code or other custom string that matches the path prefix (if any) specified for each language. If a suitable prefix is not identified, the default language is used. <em>Example: "example.com/de/contact" sets presentation language to German based on the use of "de" within the path.</em>') .'</li>';
- $output .= '<li>'. t("<strong>Path prefix with language fallback.</strong> The presentation language is determined by examining the path for a language code or other custom string that matches the path prefix (if any) specified for each language. If a suitable prefix is not identified, the display language is determined by the user's language preferences from the <em>My Account</em> page, or by the browser's language settings. If a presentation language cannot be determined, the default language is used.") .'</t>';
- $output .= '<li>'. t('<strong>Domain name only.</strong> The presentation language is determined by examining the domain used to access the site, and comparing it to the language domain (if any) specified for each language. If a match is not identified, the default language is used. <em>Example: "http://de.example.com/contact" sets presentation language to German based on the use of "http://de.example.com" in the domain.</em>') .'</li></ul>';
- $output .= '<p>'. t('The path prefix or domain name for a language may be set by editing the <a href="@languages">available languages</a>. In the absence of an appropriate match, the site is displayed in the <a href="@languages">default language</a>.', array('@languages' => url('admin/settings/language'))) .'</p>';
+ $output = '<p>' . t("Language negotiation settings determine the site's presentation language. Available options include:") . '</p>';
+ $output .= '<ul><li>' . t('<strong>None.</strong> The default language is used for site presentation, though users may (optionally) select a preferred language on the <em>My Account</em> page. (User language preferences will be used for site e-mails, if available.)') . '</li>';
+ $output .= '<li>' . t('<strong>Path prefix only.</strong> The presentation language is determined by examining the path for a language code or other custom string that matches the path prefix (if any) specified for each language. If a suitable prefix is not identified, the default language is used. <em>Example: "example.com/de/contact" sets presentation language to German based on the use of "de" within the path.</em>') . '</li>';
+ $output .= '<li>' . t("<strong>Path prefix with language fallback.</strong> The presentation language is determined by examining the path for a language code or other custom string that matches the path prefix (if any) specified for each language. If a suitable prefix is not identified, the display language is determined by the user's language preferences from the <em>My Account</em> page, or by the browser's language settings. If a presentation language cannot be determined, the default language is used.") . '</t>';
+ $output .= '<li>' . t('<strong>Domain name only.</strong> The presentation language is determined by examining the domain used to access the site, and comparing it to the language domain (if any) specified for each language. If a match is not identified, the default language is used. <em>Example: "http://de.example.com/contact" sets presentation language to German based on the use of "http://de.example.com" in the domain.</em>') . '</li></ul>';
+ $output .= '<p>' . t('The path prefix or domain name for a language may be set by editing the <a href="@languages">available languages</a>. In the absence of an appropriate match, the site is displayed in the <a href="@languages">default language</a>.', array('@languages' => url('admin/settings/language'))) . '</p>';
return $output;
case 'admin/build/translate':
- $output = '<p>'. t('This page provides an overview of available translatable strings. Drupal displays translatable strings in text groups; modules may define additional text groups containing other translatable strings. Because text groups provide a method of grouping related strings, they are often used to focus translation efforts on specific areas of the Drupal interface.') .'</p>';
- $output .= '<p>'. t('Review the <a href="@languages">languages page</a> for more information on adding support for additional languages.', array('@languages' => url('admin/settings/language'))) .'</p>';
+ $output = '<p>' . t('This page provides an overview of available translatable strings. Drupal displays translatable strings in text groups; modules may define additional text groups containing other translatable strings. Because text groups provide a method of grouping related strings, they are often used to focus translation efforts on specific areas of the Drupal interface.') . '</p>';
+ $output .= '<p>' . t('Review the <a href="@languages">languages page</a> for more information on adding support for additional languages.', array('@languages' => url('admin/settings/language'))) . '</p>';
return $output;
case 'admin/build/translate/import':
- $output = '<p>'. t('This page imports the translated strings contained in an individual Gettext Portable Object (<em>.po</em>) file. Normally distributed as part of a translation package (each translation package may contain several <em>.po</em> files), a <em>.po</em> file may need to be imported after off-line editing in a Gettext translation editor. Importing an individual <em>.po</em> file may be a lengthy process.') .'</p>';
- $output .= '<p>'. t('Note that the <em>.po</em> files within a translation package are imported automatically (if available) when new modules or themes are enabled, or as new languages are added. Since this page only allows the import of one <em>.po</em> file at a time, it may be simpler to download and extract a translation package into your Drupal installation directory and <a href="@language-add">add the language</a> (which automatically imports all <em>.po</em> files within the package). Translation packages are available for download on the <a href="@translations">Drupal translation page</a>.', array('@language-add' => url('admin/settings/language/add'), '@translations' => 'http://drupal.org/project/translations')) .'</p>';
+ $output = '<p>' . t('This page imports the translated strings contained in an individual Gettext Portable Object (<em>.po</em>) file. Normally distributed as part of a translation package (each translation package may contain several <em>.po</em> files), a <em>.po</em> file may need to be imported after off-line editing in a Gettext translation editor. Importing an individual <em>.po</em> file may be a lengthy process.') . '</p>';
+ $output .= '<p>' . t('Note that the <em>.po</em> files within a translation package are imported automatically (if available) when new modules or themes are enabled, or as new languages are added. Since this page only allows the import of one <em>.po</em> file at a time, it may be simpler to download and extract a translation package into your Drupal installation directory and <a href="@language-add">add the language</a> (which automatically imports all <em>.po</em> files within the package). Translation packages are available for download on the <a href="@translations">Drupal translation page</a>.', array('@language-add' => url('admin/settings/language/add'), '@translations' => 'http://drupal.org/project/translations')) . '</p>';
return $output;
case 'admin/build/translate/export':
- return '<p>'. t('This page exports the translated strings used by your site. An export file may be in Gettext Portable Object (<em>.po</em>) form, which includes both the original string and the translation (used to share translations with others), or in Gettext Portable Object Template (<em>.pot</em>) form, which includes the original strings only (used to create new translations with a Gettext translation editor).') .'</p>';
+ return '<p>' . t('This page exports the translated strings used by your site. An export file may be in Gettext Portable Object (<em>.po</em>) form, which includes both the original string and the translation (used to share translations with others), or in Gettext Portable Object Template (<em>.pot</em>) form, which includes the original strings only (used to create new translations with a Gettext translation editor).') . '</p>';
case 'admin/build/translate/search':
- return '<p>'. t('This page allows a translator to search for specific translated and untranslated strings, and is used when creating or editing translations. (Note: For translation tasks involving many strings, it may be more convenient to <a href="@export">export</a> strings for off-line editing in a desktop Gettext translation editor.) Searches may be limited to strings found within a specific text group or in a specific language.', array('@export' => url('admin/build/translate/export'))) .'</p>';
+ return '<p>' . t('This page allows a translator to search for specific translated and untranslated strings, and is used when creating or editing translations. (Note: For translation tasks involving many strings, it may be more convenient to <a href="@export">export</a> strings for off-line editing in a desktop Gettext translation editor.) Searches may be limited to strings found within a specific text group or in a specific language.', array('@export' => url('admin/build/translate/export'))) . '</p>';
case 'admin/build/block/configure':
if ($arg[4] == 'locale' && $arg[5] == 0) {
- return '<p>'. t('This block is only shown if <a href="@languages">at least two languages are enabled</a> and <a href="@configuration">language negotiation</a> is set to something other than <em>None</em>.', array('@languages' => url('admin/settings/language'), '@configuration' => url('admin/settings/language/configure'))) .'</p>';
+ return '<p>' . t('This block is only shown if <a href="@languages">at least two languages are enabled</a> and <a href="@configuration">language negotiation</a> is set to something other than <em>None</em>.', array('@languages' => url('admin/settings/language'), '@configuration' => url('admin/settings/language/configure'))) . '</p>';
}
break;
}
@@ -220,7 +220,7 @@ function locale_user($type, $edit, &$user, $category = NULL) {
$names = array();
foreach ($languages as $langcode => $item) {
$name = t($item->name);
- $names[$langcode] = $name . ($item->native != $name ? ' ('. $item->native .')' : '');
+ $names[$langcode] = $name . ($item->native != $name ? ' (' . $item->native . ')' : '');
}
$form['locale'] = array(
'#type' => 'fieldset',
@@ -265,7 +265,7 @@ function locale_form_alter(&$form, $form_state, $form_id) {
$form['workflow']['language_content_type'] = array(
'#type' => 'radios',
'#title' => t('Multilingual support'),
- '#default_value' => variable_get('language_content_type_'. $form['#node_type']->type, 0),
+ '#default_value' => variable_get('language_content_type_' . $form['#node_type']->type, 0),
'#options' => array(t('Disabled'), t('Enabled')),
'#description' => t('Enable multilingual support for this content type. If enabled, a language selection field will be added to the editing form, allowing you to select from one of the <a href="!languages">enabled languages</a>. If disabled, new posts are saved with the default language. Existing content will not be affected by changing this option.', array('!languages' => url('admin/settings/language'))),
);
@@ -275,7 +275,7 @@ function locale_form_alter(&$form, $form_state, $form_id) {
// Language field for nodes
default:
if (isset($form['#id']) && $form['#id'] == 'node-form') {
- if (isset($form['#node']->type) && variable_get('language_content_type_'. $form['#node']->type, 0)) {
+ if (isset($form['#node']->type) && variable_get('language_content_type_' . $form['#node']->type, 0)) {
$form['language'] = array(
'#type' => 'select',
'#title' => t('Language'),
@@ -347,7 +347,7 @@ function locale($string = NULL, $langcode = NULL, $reset = FALSE) {
// perspective that is a really bad idea, so we have no user
// interface for this. Be careful when turning this option off!
if (variable_get('locale_cache_strings', 1) == 1) {
- if ($cache = cache_get('locale:'. $langcode, 'cache')) {
+ if ($cache = cache_get('locale:' . $langcode, 'cache')) {
$locale_t[$langcode] = $cache->data;
}
else {
@@ -358,7 +358,7 @@ function locale($string = NULL, $langcode = NULL, $reset = FALSE) {
while ($data = db_fetch_object($result)) {
$locale_t[$langcode][$data->source] = (empty($data->translation) ? TRUE : $data->translation);
}
- cache_set('locale:'. $langcode, $locale_t[$langcode]);
+ cache_set('locale:' . $langcode, $locale_t[$langcode]);
}
}
}
@@ -417,7 +417,7 @@ function locale_get_plural($count, $langcode = NULL) {
}
if ($locale_formula[$langcode]) {
$n = $count;
- $plurals[$langcode][$count] = @eval('return intval('. $locale_formula[$langcode] .');');
+ $plurals[$langcode][$count] = @eval('return intval(' . $locale_formula[$langcode] . ');');
return $plurals[$langcode][$count];
}
else {
@@ -528,11 +528,11 @@ function locale_update_js_files() {
}
// If necessary, rebuild the translation file for the current language.
- if (!empty($parsed['refresh:'. $language->language])) {
+ if (!empty($parsed['refresh:' . $language->language])) {
// Don't clear the refresh flag on failure, so that another try will
// be performed later.
if (locale_inc_callback('_locale_rebuild_js')) {
- unset($parsed['refresh:'. $language->language]);
+ unset($parsed['refresh:' . $language->language]);
}
// Store any changes after refresh was attempted.
variable_set('javascript_parsed', $parsed);
@@ -545,7 +545,7 @@ function locale_update_js_files() {
// Add the translation JavaScript file to the page.
if ($files && !empty($language->javascript)) {
- drupal_add_js($dir .'/'. $language->language .'_'. $language->javascript .'.js', 'core');
+ drupal_add_js($dir . '/' . $language->language . '_' . $language->javascript . '.js', 'core');
}
}
diff --git a/modules/menu/menu.admin.inc b/modules/menu/menu.admin.inc
index d55d7515b..9d88dd7c7 100644
--- a/modules/menu/menu.admin.inc
+++ b/modules/menu/menu.admin.inc
@@ -13,7 +13,7 @@ function menu_overview_page() {
$result = db_query("SELECT * FROM {menu_custom} ORDER BY title");
$content = array();
while ($menu = db_fetch_array($result)) {
- $menu['href'] = 'admin/build/menu-customize/'. $menu['menu_name'];
+ $menu['href'] = 'admin/build/menu-customize/' . $menu['menu_name'];
$menu['localized_options'] = array();
$content[] = $menu;
}
@@ -66,10 +66,10 @@ function _menu_overview_tree_form($tree) {
$item = $data['link'];
// Don't show callbacks; these have $item['hidden'] < 0.
if ($item && $item['hidden'] >= 0) {
- $mlid = 'mlid:'. $item['mlid'];
+ $mlid = 'mlid:' . $item['mlid'];
$form[$mlid]['#item'] = $item;
$form[$mlid]['#attributes'] = $item['hidden'] ? array('class' => 'menu-disabled') : array('class' => 'menu-enabled');
- $form[$mlid]['title']['#value'] = l($item['title'], $item['href'], $item['localized_options']) . ($item['hidden'] ? ' ('. t('disabled') .')' : '');
+ $form[$mlid]['title']['#value'] = l($item['title'], $item['href'], $item['localized_options']) . ($item['hidden'] ? ' (' . t('disabled') . ')' : '');
$form[$mlid]['hidden'] = array(
'#type' => 'checkbox',
'#default_value' => !$item['hidden'],
@@ -94,14 +94,14 @@ function _menu_overview_tree_form($tree) {
);
// Build a list of operations.
$operations = array();
- $operations['edit'] = l(t('edit'), 'admin/build/menu/item/'. $item['mlid'] .'/edit');
+ $operations['edit'] = l(t('edit'), 'admin/build/menu/item/' . $item['mlid'] . '/edit');
// Only items created by the menu module can be deleted.
if ($item['module'] == 'menu' || $item['updated'] == 1) {
- $operations['delete'] = l(t('delete'), 'admin/build/menu/item/'. $item['mlid'] .'/delete');
+ $operations['delete'] = l(t('delete'), 'admin/build/menu/item/' . $item['mlid'] . '/delete');
}
// Set the reset column.
elseif ($item['module'] == 'system' && $item['customized']) {
- $operations['reset'] = l(t('reset'), 'admin/build/menu/item/'. $item['mlid'] .'/reset');
+ $operations['reset'] = l(t('reset'), 'admin/build/menu/item/' . $item['mlid'] . '/reset');
}
$form[$mlid]['operations'] = array();
@@ -208,7 +208,7 @@ function theme_menu_overview_form($form) {
$row = array_merge($row, $operations);
$row = array_merge(array('data' => $row), $element['#attributes']);
- $row['class'] = !empty($row['class']) ? $row['class'] .' draggable' : 'draggable';
+ $row['class'] = !empty($row['class']) ? $row['class'] . ' draggable' : 'draggable';
$rows[] = $row;
}
}
@@ -247,10 +247,10 @@ function menu_edit_item(&$form_state, $type, $item, $menu) {
$path = $item['link_path'];
if (isset($item['options']['query'])) {
- $path .= '?'. $item['options']['query'];
+ $path .= '?' . $item['options']['query'];
}
if (isset($item['options']['fragment'])) {
- $path .= '#'. $item['options']['fragment'];
+ $path .= '#' . $item['options']['fragment'];
}
if ($item['module'] == 'menu') {
$form['menu']['link_path'] = array(
@@ -303,7 +303,7 @@ function menu_edit_item(&$form_state, $type, $item, $menu) {
// Generate a list of possible parents (not including this item or descendants).
$options = menu_parent_options(menu_get_menus(), $item);
- $default = $item['menu_name'] .':'. $item['plid'];
+ $default = $item['menu_name'] . ':' . $item['plid'];
if (!isset($options[$default])) {
$default = 'navigation:0';
}
@@ -359,7 +359,7 @@ function menu_edit_item_validate($form, &$form_state) {
* Submit function for the delete button on the menu item editing form.
*/
function menu_item_delete_submit($form, &$form_state) {
- $form_state['redirect'] = 'admin/build/menu/item/'. $form_state['values']['menu']['mlid'] .'/delete';
+ $form_state['redirect'] = 'admin/build/menu/item/' . $form_state['values']['menu']['mlid'] . '/delete';
}
/**
@@ -378,7 +378,7 @@ function menu_edit_item_submit($form, &$form_state) {
if (!menu_link_save($item)) {
drupal_set_message(t('There was an error saving the menu link.'), 'error');
}
- $form_state['redirect'] = 'admin/build/menu-customize/'. $item['menu_name'];
+ $form_state['redirect'] = 'admin/build/menu-customize/' . $item['menu_name'];
}
/**
@@ -431,7 +431,7 @@ function menu_edit_menu(&$form_state, $type, $menu = array()) {
* Submit function for the 'Delete' button on the menu editing form.
*/
function menu_custom_delete_submit($form, &$form_state) {
- $form_state['redirect'] = 'admin/build/menu-customize/'. $form_state['values']['menu_name'] .'/delete';
+ $form_state['redirect'] = 'admin/build/menu-customize/' . $form_state['values']['menu_name'] . '/delete';
}
/**
@@ -454,10 +454,10 @@ function menu_delete_menu_confirm(&$form_state, $menu) {
$caption = '';
$num_links = db_result(db_query("SELECT COUNT(*) FROM {menu_links} WHERE menu_name = '%s'", $menu['menu_name']));
if ($num_links) {
- $caption .= '<p>'. format_plural($num_links, '<strong>Warning:</strong> There is currently 1 menu item in %title. It will be deleted (system-defined items will be reset).', '<strong>Warning:</strong> There are currently @count menu items in %title. They will be deleted (system-defined items will be reset).', array('%title' => $menu['title'])) .'</p>';
+ $caption .= '<p>' . format_plural($num_links, '<strong>Warning:</strong> There is currently 1 menu item in %title. It will be deleted (system-defined items will be reset).', '<strong>Warning:</strong> There are currently @count menu items in %title. They will be deleted (system-defined items will be reset).', array('%title' => $menu['title'])) . '</p>';
}
- $caption .= '<p>'. t('This action cannot be undone.') .'</p>';
- return confirm_form($form, t('Are you sure you want to delete the custom menu %title?', array('%title' => $menu['title'])), 'admin/build/menu-customize/'. $menu['menu_name'], $caption, t('Delete'));
+ $caption .= '<p>' . t('This action cannot be undone.') . '</p>';
+ return confirm_form($form, t('Are you sure you want to delete the custom menu %title?', array('%title' => $menu['title'])), 'admin/build/menu-customize/' . $menu['menu_name'], $caption, t('Delete'));
}
/**
@@ -476,7 +476,7 @@ function menu_delete_menu_confirm_submit($form, &$form_state) {
menu_reset_item($item);
}
// Delete all links to the overview page for this menu.
- $result = db_query("SELECT mlid FROM {menu_links} ml WHERE ml.link_path = '%s'", 'admin/build/menu-customize/'. $menu['menu_name']);
+ $result = db_query("SELECT mlid FROM {menu_links} ml WHERE ml.link_path = '%s'", 'admin/build/menu-customize/' . $menu['menu_name']);
while ($m = db_fetch_array($result)) {
menu_link_delete($m['mlid']);
}
@@ -506,7 +506,7 @@ function menu_edit_menu_validate($form, &$form_state) {
}
if ($form['#insert']) {
// We will add 'menu-' to the menu name to help avoid name-space conflicts.
- $item['menu_name'] = 'menu-'. $item['menu_name'];
+ $item['menu_name'] = 'menu-' . $item['menu_name'];
if (db_result(db_query("SELECT menu_name FROM {menu_custom} WHERE menu_name = '%s'", $item['menu_name'])) ||
db_result(db_query_range("SELECT menu_name FROM {menu_links} WHERE menu_name = '%s'", $item['menu_name'], 0, 1))) {
form_set_error('menu_name', t('The menu already exists.'));
@@ -522,10 +522,10 @@ function menu_edit_menu_submit($form, &$form_state) {
$path = 'admin/build/menu-customize/';
if ($form['#insert']) {
// Add 'menu-' to the menu name to help avoid name-space conflicts.
- $menu['menu_name'] = 'menu-'. $menu['menu_name'];
+ $menu['menu_name'] = 'menu-' . $menu['menu_name'];
$link['link_title'] = $menu['title'];
$link['link_path'] = $path . $menu['menu_name'];
- $link['router_path'] = $path .'%';
+ $link['router_path'] = $path . '%';
$link['module'] = 'menu';
$link['plid'] = db_result(db_query("SELECT mlid FROM {menu_links} WHERE link_path = '%s' AND module = '%s'", 'admin/build/menu', 'system'));
menu_link_save($link);
@@ -561,7 +561,7 @@ function menu_item_delete_page($item) {
*/
function menu_item_delete_form(&$form_state, $item) {
$form['#item'] = $item;
- return confirm_form($form, t('Are you sure you want to delete the custom menu item %item?', array('%item' => $item['link_title'])), 'admin/build/menu-customize/'. $item['menu_name']);
+ return confirm_form($form, t('Are you sure you want to delete the custom menu item %item?', array('%item' => $item['link_title'])), 'admin/build/menu-customize/' . $item['menu_name']);
}
/**
@@ -573,7 +573,7 @@ function menu_item_delete_form_submit($form, &$form_state) {
$t_args = array('%title' => $item['link_title']);
drupal_set_message(t('The menu item %title has been deleted.', $t_args));
watchdog('menu', 'Deleted menu item %title.', $t_args, WATCHDOG_NOTICE);
- $form_state['redirect'] = 'admin/build/menu-customize/'. $item['menu_name'];
+ $form_state['redirect'] = 'admin/build/menu-customize/' . $item['menu_name'];
}
/**
@@ -581,7 +581,7 @@ function menu_item_delete_form_submit($form, &$form_state) {
*/
function menu_reset_item_confirm(&$form_state, $item) {
$form['item'] = array('#type' => 'value', '#value' => $item);
- return confirm_form($form, t('Are you sure you want to reset the item %item to its default values?', array('%item' => $item['link_title'])), 'admin/build/menu-customize/'. $item['menu_name'], t('Any customizations will be lost. This action cannot be undone.'), t('Reset'));
+ return confirm_form($form, t('Are you sure you want to reset the item %item to its default values?', array('%item' => $item['link_title'])), 'admin/build/menu-customize/' . $item['menu_name'], t('Any customizations will be lost. This action cannot be undone.'), t('Reset'));
}
/**
@@ -591,7 +591,7 @@ function menu_reset_item_confirm_submit($form, &$form_state) {
$item = $form_state['values']['item'];
$new_item = menu_reset_item($item);
drupal_set_message(t('The menu item was reset to its default settings.'));
- $form_state['redirect'] = 'admin/build/menu-customize/'. $new_item['menu_name'];
+ $form_state['redirect'] = 'admin/build/menu-customize/' . $new_item['menu_name'];
}
/**
diff --git a/modules/menu/menu.module b/modules/menu/menu.module
index c09ad9495..a4fd8584d 100644
--- a/modules/menu/menu.module
+++ b/modules/menu/menu.module
@@ -18,18 +18,18 @@ define('MENU_MAX_MENU_NAME_LENGTH_UI', 27);
function menu_help($path, $arg) {
switch ($path) {
case 'admin/help#menu':
- $output = '<p>'. t("The menu module provides an interface to control and customize Drupal's powerful menu system. Menus are a hierarchical collection of links, or menu items, used to navigate a website, and are positioned and displayed using Drupal's flexible block system. By default, three menus are created during installation: <em>Navigation</em>, <em>Primary links</em>, and <em>Secondary links</em>. The <em>Navigation</em> menu contains most links necessary for working with and navigating your site, and is often displayed in either the left or right sidebar. Most Drupal themes also provide support for <em>Primary links</em> and <em>Secondary links</em>, by displaying them in either the header or footer of each page. By default, <em>Primary links</em> and <em>Secondary links</em> contain no menu items but may be configured to contain custom menu items specific to your site.") .'</p>';
- $output .= '<p>'. t('The <a href="@menu">menus page</a> displays all menus currently available on your site. Select a menu from this list to add or edit a menu item, or to rearrange items within the menu. Create new menus using the <a href="@add-menu">add menu page</a> (the block containing a new menu must also be enabled on the <a href="@blocks">blocks administration page</a>).', array('@menu' => url('admin/build/menu'), '@add-menu' => url('admin/build/menu/add'), '@blocks' => url('admin/build/block'))) .'</p>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@menu">Menu module</a>.', array('@menu' => 'http://drupal.org/handbook/modules/menu/')) .'</p>';
+ $output = '<p>' . t("The menu module provides an interface to control and customize Drupal's powerful menu system. Menus are a hierarchical collection of links, or menu items, used to navigate a website, and are positioned and displayed using Drupal's flexible block system. By default, three menus are created during installation: <em>Navigation</em>, <em>Primary links</em>, and <em>Secondary links</em>. The <em>Navigation</em> menu contains most links necessary for working with and navigating your site, and is often displayed in either the left or right sidebar. Most Drupal themes also provide support for <em>Primary links</em> and <em>Secondary links</em>, by displaying them in either the header or footer of each page. By default, <em>Primary links</em> and <em>Secondary links</em> contain no menu items but may be configured to contain custom menu items specific to your site.") . '</p>';
+ $output .= '<p>' . t('The <a href="@menu">menus page</a> displays all menus currently available on your site. Select a menu from this list to add or edit a menu item, or to rearrange items within the menu. Create new menus using the <a href="@add-menu">add menu page</a> (the block containing a new menu must also be enabled on the <a href="@blocks">blocks administration page</a>).', array('@menu' => url('admin/build/menu'), '@add-menu' => url('admin/build/menu/add'), '@blocks' => url('admin/build/block'))) . '</p>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@menu">Menu module</a>.', array('@menu' => 'http://drupal.org/handbook/modules/menu/')) . '</p>';
return $output;
case 'admin/build/menu':
- return '<p>'. t('Menus are a collection of links (menu items) used to navigate a website. The menus currently available on your site are displayed below. Select a menu from this list to manage its menu items.') .'</p>';
+ return '<p>' . t('Menus are a collection of links (menu items) used to navigate a website. The menus currently available on your site are displayed below. Select a menu from this list to manage its menu items.') . '</p>';
case 'admin/build/menu/add':
- return '<p>'. t('Enter the name for your new menu. Remember to enable the newly created block in the <a href="@blocks">blocks administration page</a>.', array('@blocks' => url('admin/build/block'))) .'</p>';
+ return '<p>' . t('Enter the name for your new menu. Remember to enable the newly created block in the <a href="@blocks">blocks administration page</a>.', array('@blocks' => url('admin/build/block'))) . '</p>';
case 'admin/build/menu-customize/%':
- return '<p>'. t('To rearrange menu items, grab a drag-and-drop handle under the <em>Menu item</em> column and drag the items (or group of items) to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the <em>Save configuration</em> button at the bottom of the page.') .'<p>';
+ return '<p>' . t('To rearrange menu items, grab a drag-and-drop handle under the <em>Menu item</em> column and drag the items (or group of items) to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the <em>Save configuration</em> button at the bottom of the page.') . '<p>';
case 'admin/build/menu/item/add':
- return '<p>'. t('Enter the title and path for your new menu item.') .'</p>';
+ return '<p>' . t('Enter the title and path for your new menu item.') . '</p>';
}
}
@@ -164,7 +164,7 @@ function menu_enable() {
while ($menu = db_fetch_array($result)) {
$link['mlid'] = 0;
$link['link_title'] = $menu['title'];
- $link['link_path'] = 'admin/build/menu-customize/'. $menu['menu_name'];
+ $link['link_path'] = 'admin/build/menu-customize/' . $menu['menu_name'];
if (!db_result(db_query("SELECT mlid FROM {menu_links} WHERE link_path = '%s' AND plid = %d", $link['link_path'], $link['plid']))) {
menu_link_save($link);
}
@@ -216,7 +216,7 @@ function menu_parent_options($menus, $item) {
foreach ($menus as $menu_name => $title) {
$tree = menu_tree_all_data($menu_name, NULL);
- $options[$menu_name .':0'] = '<'. $title .'>';
+ $options[$menu_name . ':0'] = '<' . $title . '>';
_menu_parents_recurse($tree, $menu_name, '--', $options, $item['mlid'], $limit);
}
return $options;
@@ -232,13 +232,13 @@ function _menu_parents_recurse($tree, $menu_name, $indent, &$options, $exclude,
break;
}
if ($data['link']['mlid'] != $exclude && $data['link']['hidden'] >= 0) {
- $title = $indent .' '. truncate_utf8($data['link']['title'], 30, TRUE, FALSE);
+ $title = $indent . ' ' . truncate_utf8($data['link']['title'], 30, TRUE, FALSE);
if ($data['link']['hidden']) {
- $title .= ' ('. t('disabled') .')';
+ $title .= ' (' . t('disabled') . ')';
}
- $options[$menu_name .':'. $data['link']['mlid']] = $title;
+ $options[$menu_name . ':' . $data['link']['mlid']] = $title;
if ($data['below']) {
- _menu_parents_recurse($data['below'], $menu_name, $indent .'--', $options, $exclude, $depth_limit);
+ _menu_parents_recurse($data['below'], $menu_name, $indent . '--', $options, $exclude, $depth_limit);
}
}
}
@@ -351,7 +351,7 @@ function _menu_parent_depth_limit($item) {
* Implementation of hook_form_alter(). Adds menu item fields to the node form.
*/
function menu_form_alter(&$form, $form_state, $form_id) {
- if (isset($form['#node']) && $form['#node']->type .'_node_form' == $form_id) {
+ if (isset($form['#node']) && $form['#node']->type . '_node_form' == $form_id) {
// Note - doing this to make sure the delete checkbox stays in the form.
$form['#cache'] = TRUE;
@@ -391,7 +391,7 @@ function menu_form_alter(&$form, $form_state, $form_id) {
);
// Generate a list of possible parents (not including this item or descendants).
$options = menu_parent_options(menu_get_menus(), $item);
- $default = $item['menu_name'] .':'. $item['plid'];
+ $default = $item['menu_name'] . ':' . $item['plid'];
if (!isset($options[$default])) {
$default = 'primary-links:0';
}
@@ -436,7 +436,7 @@ function menu_get_menus($all = TRUE) {
$system_menus = menu_list_system_menus();
$sql = 'SELECT * FROM {menu_custom}';
if (!$all) {
- $sql .= ' WHERE menu_name NOT IN ('. implode(',', array_fill(0, count($system_menus), "'%s'")) .')';
+ $sql .= ' WHERE menu_name NOT IN (' . implode(',', array_fill(0, count($system_menus), "'%s'")) . ')';
}
$sql .= ' ORDER BY title';
$result = db_query($sql, $system_menus);
diff --git a/modules/node/content_types.inc b/modules/node/content_types.inc
index a436336c4..328f67bb8 100644
--- a/modules/node/content_types.inc
+++ b/modules/node/content_types.inc
@@ -20,16 +20,16 @@ function node_overview_types() {
if (node_hook($type, 'form')) {
$type_url_str = str_replace('_', '-', $type->type);
$row = array(
- l($name, 'admin/content/node-type/'. $type_url_str),
+ l($name, 'admin/content/node-type/' . $type_url_str),
check_plain($type->type),
filter_xss_admin($type->description),
);
// Set the edit column.
- $row[] = array('data' => l(t('edit'), 'admin/content/node-type/'. $type_url_str));
+ $row[] = array('data' => l(t('edit'), 'admin/content/node-type/' . $type_url_str));
// Set the delete column.
if ($type->custom) {
- $row[] = array('data' => l(t('delete'), 'admin/content/node-type/'. $type_url_str .'/delete'));
+ $row[] = array('data' => l(t('delete'), 'admin/content/node-type/' . $type_url_str . '/delete'));
}
else {
$row[] = array('data' => '');
@@ -152,7 +152,7 @@ function node_type_form(&$form_state, $type = NULL) {
);
$form['workflow']['node_options'] = array('#type' => 'checkboxes',
'#title' => t('Default options'),
- '#default_value' => variable_get('node_options_'. $type->type, array('status', 'promote')),
+ '#default_value' => variable_get('node_options_' . $type->type, array('status', 'promote')),
'#options' => array(
'status' => t('Published'),
'promote' => t('Promoted to front page'),
@@ -280,7 +280,7 @@ function node_type_form_submit($form, &$form_state) {
node_type_reset($type);
}
elseif ($op == t('Delete content type')) {
- $form_state['redirect'] = 'admin/content/node-type/'. str_replace('_', '-', $type->old_type) .'/delete';
+ $form_state['redirect'] = 'admin/content/node-type/' . str_replace('_', '-', $type->old_type) . '/delete';
return;
}
@@ -300,8 +300,8 @@ function node_type_form_submit($form, &$form_state) {
// Save or reset persistent variable values.
foreach ($variables as $key => $value) {
- $variable_new = $key .'_'. $type->type;
- $variable_old = $key .'_'. $type->old_type;
+ $variable_new = $key . '_' . $type->type;
+ $variable_old = $key . '_' . $type->old_type;
if ($op == t('Reset to defaults')) {
variable_del($variable_old);
@@ -385,10 +385,10 @@ function node_type_delete_confirm(&$form_state, $type) {
$num_nodes = db_result(db_query("SELECT COUNT(*) FROM {node} WHERE type = '%s'", $type->type));
if ($num_nodes) {
- $caption .= '<p>'. format_plural($num_nodes, '<strong>Warning:</strong> there is currently 1 %type post on your site. It may not be able to be displayed or edited correctly, once you have removed this content type.', '<strong>Warning:</strong> there are currently @count %type posts on your site. They may not be able to be displayed or edited correctly, once you have removed this content type.', array('%type' => $type->name)) .'</p>';
+ $caption .= '<p>' . format_plural($num_nodes, '<strong>Warning:</strong> there is currently 1 %type post on your site. It may not be able to be displayed or edited correctly, once you have removed this content type.', '<strong>Warning:</strong> there are currently @count %type posts on your site. They may not be able to be displayed or edited correctly, once you have removed this content type.', array('%type' => $type->name)) . '</p>';
}
- $caption .= '<p>'. t('This action cannot be undone.') .'</p>';
+ $caption .= '<p>' . t('This action cannot be undone.') . '</p>';
return confirm_form($form, $message, 'admin/build/types', $caption, t('Delete'));
}
diff --git a/modules/node/node.admin.inc b/modules/node/node.admin.inc
index 0b1252d74..81160b1d6 100644
--- a/modules/node/node.admin.inc
+++ b/modules/node/node.admin.inc
@@ -14,8 +14,8 @@ function node_configure() {
// in the {node_access} table, or if there are modules that
// implement hook_node_grants().
if (db_result(db_query('SELECT COUNT(*) FROM {node_access}')) != 1 || count(module_implements('node_grants')) > 0) {
- $status = '<p>'. t('If the site is experiencing problems with permissions to content, you may have to rebuild the permissions cache. Possible causes for permission problems are disabling modules or configuration changes to permissions. Rebuilding will remove all privileges to posts, and replace them with permissions based on the current modules and settings.') .'</p>';
- $status .= '<p>'. t('Rebuilding may take some time if there is a lot of content or complex permission settings. After rebuilding has completed posts will automatically use the new permissions.') .'</p>';
+ $status = '<p>' . t('If the site is experiencing problems with permissions to content, you may have to rebuild the permissions cache. Possible causes for permission problems are disabling modules or configuration changes to permissions. Rebuilding will remove all privileges to posts, and replace them with permissions based on the current modules and settings.') . '</p>';
+ $status .= '<p>' . t('Rebuilding may take some time if there is a lot of content or complex permission settings. After rebuilding has completed posts will automatically use the new permissions.') . '</p>';
$form['access'] = array(
'#type' => 'fieldset',
@@ -48,7 +48,7 @@ function node_configure() {
1800 => t('1800 characters'),
2000 => t('2000 characters'),
),
- '#description' => t("The maximum number of characters used in the trimmed version of a post. Drupal will use this setting to determine at which offset long posts should be trimmed. The trimmed version of a post is typically used as a teaser when displaying the post on the main page, in XML feeds, etc. To disable teasers, set to 'Unlimited'. Note that this setting will only affect new or updated content and will not affect existing teasers.")
+ '#description' => t("The maximum number of characters used in the trimmed version of a post. Drupal will use this setting to determine at which offset long posts should be trimmed. The trimmed version of a post is typically used as a teaser when displaying the post on the main page, in XML feeds, etc. To disable teasers, set to 'Unlimited' . Note that this setting will only affect new or updated content and will not affect existing teasers.")
);
$form['node_preview'] = array(
@@ -186,7 +186,7 @@ function node_build_filter_query() {
case 'status':
// Note: no exploitable hole as $key/$value have already been checked when submitted
list($key, $value) = explode('-', $value, 2);
- $where[] = 'n.'. $key .' = %d';
+ $where[] = 'n.' . $key . ' = %d';
break;
case 'category':
$table = "tn$index";
@@ -202,7 +202,7 @@ function node_build_filter_query() {
}
$args[] = $value;
}
- $where = count($where) ? 'WHERE '. implode(' AND ', $where) : '';
+ $where = count($where) ? 'WHERE ' . implode(' AND ', $where) : '';
return array('where' => $where, 'join' => $join, 'args' => $args);
}
@@ -288,17 +288,17 @@ function theme_node_filters($form) {
$output .= '<ul class="clear-block">';
if (!empty($form['current'])) {
foreach (element_children($form['current']) as $key) {
- $output .= '<li>'. drupal_render($form['current'][$key]) .'</li>';
+ $output .= '<li>' . drupal_render($form['current'][$key]) . '</li>';
}
}
- $output .= '<li><dl class="multiselect">'. (!empty($form['current']) ? '<dt><em>'. t('and') .'</em> '. t('where') .'</dt>' : '') .'<dd class="a">';
+ $output .= '<li><dl class="multiselect">' . (!empty($form['current']) ? '<dt><em>' . t('and') . '</em> ' . t('where') . '</dt>' : '') . '<dd class="a">';
foreach (element_children($form['filter']) as $key) {
$output .= drupal_render($form['filter'][$key]);
}
$output .= '</dd>';
- $output .= '<dt>'. t('is') .'</dt><dd class="b">';
+ $output .= '<dt>' . t('is') . '</dt><dd class="b">';
foreach (element_children($form['status']) as $key) {
$output .= drupal_render($form['status'][$key]);
@@ -306,7 +306,7 @@ function theme_node_filters($form) {
$output .= '</dd>';
$output .= '</dl>';
- $output .= '<div class="container-inline" id="node-admin-buttons">'. drupal_render($form['buttons']) .'</div>';
+ $output .= '<div class="container-inline" id="node-admin-buttons">' . drupal_render($form['buttons']) . '</div>';
$output .= '</li></ul>';
return $output;
@@ -370,7 +370,7 @@ function node_mass_update($nodes, $updates) {
'error_message' => t('The update has encountered an error.'),
// The operations do not live in the .module file, so we need to
// tell the batch engine which file to load before calling them.
- 'file' => drupal_get_path('module', 'node') .'/node.admin.inc',
+ 'file' => drupal_get_path('module', 'node') . '/node.admin.inc',
);
batch_set($batch);
}
@@ -412,7 +412,7 @@ function _node_mass_update_batch_process($nodes, $updates, &$context) {
$node = _node_mass_update_helper($nid, $updates);
// Store result for post-processing in the finished callback.
- $context['results'][] = l($node->title, 'node/'. $node->nid);
+ $context['results'][] = l($node->title, 'node/' . $node->nid);
// Update our progress information.
$context['sandbox']['progress']++;
@@ -462,7 +462,7 @@ function node_admin_nodes() {
$filter = node_build_filter_query();
- $result = pager_query(db_rewrite_sql('SELECT n.*, u.name FROM {node} n '. $filter['join'] .' INNER JOIN {users} u ON n.uid = u.uid '. $filter['where'] .' ORDER BY n.changed DESC'), 50, 0, NULL, $filter['args']);
+ $result = pager_query(db_rewrite_sql('SELECT n.*, u.name FROM {node} n ' . $filter['join'] . ' INNER JOIN {users} u ON n.uid = u.uid ' . $filter['where'] . ' ORDER BY n.changed DESC'), 50, 0, NULL, $filter['args']);
// Enable language column if locale is enabled or if we have any node with language
$count = db_result(db_query("SELECT COUNT(*) FROM {node} n WHERE language != ''"));
@@ -495,14 +495,14 @@ function node_admin_nodes() {
while ($node = db_fetch_object($result)) {
$nodes[$node->nid] = '';
$options = empty($node->language) ? array() : array('language' => $languages[$node->language]);
- $form['title'][$node->nid] = array('#value' => l($node->title, 'node/'. $node->nid, $options) .' '. theme('mark', node_mark($node->nid, $node->changed)));
+ $form['title'][$node->nid] = array('#value' => l($node->title, 'node/' . $node->nid, $options) . ' ' . theme('mark', node_mark($node->nid, $node->changed)));
$form['name'][$node->nid] = array('#value' => check_plain(node_get_types('name', $node)));
$form['username'][$node->nid] = array('#value' => theme('username', $node));
$form['status'][$node->nid] = array('#value' => ($node->status ? t('published') : t('not published')));
if ($multilanguage) {
$form['language'][$node->nid] = array('#value' => empty($node->language) ? t('Language neutral') : t($languages[$node->language]->name));
}
- $form['operations'][$node->nid] = array('#value' => l(t('edit'), 'node/'. $node->nid .'/edit', array('query' => $destination)));
+ $form['operations'][$node->nid] = array('#value' => l(t('edit'), 'node/' . $node->nid . '/edit', array('query' => $destination)));
}
$form['nodes'] = array('#type' => 'checkboxes', '#options' => $nodes);
$form['pager'] = array('#value' => theme('pager', NULL, 50, 0));
@@ -611,7 +611,7 @@ function node_multiple_delete_confirm(&$form_state, $nodes) {
'#type' => 'hidden',
'#value' => $nid,
'#prefix' => '<li>',
- '#suffix' => check_plain($title) ."</li>\n",
+ '#suffix' => check_plain($title) . "</li>\n",
);
}
$form['operation'] = array('#type' => 'hidden', '#value' => 'delete');
diff --git a/modules/node/node.module b/modules/node/node.module
index fea24b56a..f46f2d050 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -36,28 +36,28 @@ function node_help($path, $arg) {
switch ($path) {
case 'admin/help#node':
- $output = '<p>'. t('The node module manages content on your site, and stores all posts (regardless of type) as a "node". In addition to basic publishing settings, including whether the post has been published, promoted to the site front page, or should remain present (or sticky) at the top of lists, the node module also records basic information about the author of a post. Optional revision control over edits is available. For additional functionality, the node module is often extended by other modules.') .'</p>';
- $output .= '<p>'. t('Though each post on your site is a node, each post is also of a particular <a href="@content-type">content type</a>. <a href="@content-type">Content types</a> are used to define the characteristics of a post, including the title and description of the fields displayed on its add and edit pages. Each content type may have different default settings for <em>Publishing options</em> and other workflow controls. By default, the two content types in a standard Drupal installation are <em>Page</em> and <em>Story</em>. Use the <a href="@content-type">content types page</a> to add new or edit existing content types. Additional content types also become available as you enable additional core, contributed and custom modules.', array('@content-type' => url('admin/build/types'))) .'</p>';
- $output .= '<p>'. t('The administrative <a href="@content">content page</a> allows you to review and manage your site content. The <a href="@post-settings">post settings page</a> sets certain options for the display of posts. The node module makes a number of permissions available for each content type, which may be set by role on the <a href="@permissions">permissions page</a>.', array('@content' => url('admin/content/node'), '@post-settings' => url('admin/content/node-settings'), '@permissions' => url('admin/user/permissions'))) .'</p>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@node">Node module</a>.', array('@node' => 'http://drupal.org/handbook/modules/node/')) .'</p>';
+ $output = '<p>' . t('The node module manages content on your site, and stores all posts (regardless of type) as a "node" . In addition to basic publishing settings, including whether the post has been published, promoted to the site front page, or should remain present (or sticky) at the top of lists, the node module also records basic information about the author of a post. Optional revision control over edits is available. For additional functionality, the node module is often extended by other modules.') . '</p>';
+ $output .= '<p>' . t('Though each post on your site is a node, each post is also of a particular <a href="@content-type">content type</a>. <a href="@content-type">Content types</a> are used to define the characteristics of a post, including the title and description of the fields displayed on its add and edit pages. Each content type may have different default settings for <em>Publishing options</em> and other workflow controls. By default, the two content types in a standard Drupal installation are <em>Page</em> and <em>Story</em>. Use the <a href="@content-type">content types page</a> to add new or edit existing content types. Additional content types also become available as you enable additional core, contributed and custom modules.', array('@content-type' => url('admin/build/types'))) . '</p>';
+ $output .= '<p>' . t('The administrative <a href="@content">content page</a> allows you to review and manage your site content. The <a href="@post-settings">post settings page</a> sets certain options for the display of posts. The node module makes a number of permissions available for each content type, which may be set by role on the <a href="@permissions">permissions page</a>.', array('@content' => url('admin/content/node'), '@post-settings' => url('admin/content/node-settings'), '@permissions' => url('admin/user/permissions'))) . '</p>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@node">Node module</a>.', array('@node' => 'http://drupal.org/handbook/modules/node/')) . '</p>';
return $output;
case 'admin/content/node':
return ' '; // Return a non-null value so that the 'more help' link is shown.
case 'admin/build/types':
- return '<p>'. t('Below is a list of all the content types on your site. All posts that exist on your site are instances of one of these content types.') .'</p>';
+ return '<p>' . t('Below is a list of all the content types on your site. All posts that exist on your site are instances of one of these content types.') . '</p>';
case 'admin/build/types/add':
- return '<p>'. t('To create a new content type, enter the human-readable name, the machine-readable name, and all other relevant fields that are on this page. Once created, users of your site will be able to create posts that are instances of this content type.') .'</p>';
+ return '<p>' . t('To create a new content type, enter the human-readable name, the machine-readable name, and all other relevant fields that are on this page. Once created, users of your site will be able to create posts that are instances of this content type.') . '</p>';
case 'node/%/revisions':
- return '<p>'. t('The revisions let you track differences between multiple versions of a post.') .'</p>';
+ return '<p>' . t('The revisions let you track differences between multiple versions of a post.') . '</p>';
case 'node/%/edit':
$node = node_load($arg[1]);
$type = node_get_types('type', $node->type);
- return (!empty($type->help) ? '<p>'. filter_xss_admin($type->help) .'</p>' : '');
+ return (!empty($type->help) ? '<p>' . filter_xss_admin($type->help) . '</p>' : '');
}
if ($arg[0] == 'node' && $arg[1] == 'add' && $arg[2]) {
$type = node_get_types('type', str_replace('-', '_', $arg[2]));
- return (!empty($type->help) ? '<p>'. filter_xss_admin($type->help) .'</p>' : '');
+ return (!empty($type->help) ? '<p>' . filter_xss_admin($type->help) . '</p>' : '');
}
}
@@ -135,7 +135,7 @@ function node_title_list($result, $title = NULL) {
$items = array();
$num_rows = FALSE;
while ($node = db_fetch_object($result)) {
- $items[] = l($node->title, 'node/'. $node->nid, !empty($node->comment_count) ? array('title' => format_plural($node->comment_count, '1 comment', '@count comments')) : array());
+ $items[] = l($node->title, 'node/' . $node->nid, !empty($node->comment_count) ? array('title' => format_plural($node->comment_count, '1 comment', '@count comments')) : array());
$num_rows = TRUE;
}
@@ -219,11 +219,11 @@ function node_teaser_js(&$form, &$form_state) {
// Glue the teaser to the body.
if (trim($form_state['values']['teaser_js'])) {
// Space the teaser from the body
- $body = trim($form_state['values']['teaser_js']) ."\r\n<!--break-->\r\n". trim($form_state['values']['body']);
+ $body = trim($form_state['values']['teaser_js']) . "\r\n<!--break-->\r\n" . trim($form_state['values']['body']);
}
else {
// Empty teaser, no spaces.
- $body = '<!--break-->'. $form_state['values']['body'];
+ $body = '<!--break-->' . $form_state['values']['body'];
}
// Pass updated body value on to preview/submit form processing.
form_set_value($form['body'], $body, $form_state);
@@ -649,7 +649,7 @@ function node_invoke(&$node, $hook, $a2 = NULL, $a3 = NULL, $a4 = NULL) {
if ($module == 'node') {
$module = 'node_content'; // Avoid function name collisions.
}
- $function = $module .'_'. $hook;
+ $function = $module . '_' . $hook;
return ($function($node, $a2, $a3, $a4));
}
}
@@ -669,7 +669,7 @@ function node_invoke(&$node, $hook, $a2 = NULL, $a3 = NULL, $a4 = NULL) {
function node_invoke_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
$return = array();
foreach (module_implements('nodeapi') as $name) {
- $function = $name .'_nodeapi';
+ $function = $name . '_nodeapi';
$result = $function($node, $op, $a3, $a4);
if (isset($result) && is_array($result)) {
$return = array_merge($return, $result);
@@ -716,7 +716,7 @@ function node_load($param = array(), $revision = NULL, $reset = NULL) {
elseif (is_array($param)) {
// Turn the conditions into a query.
foreach ($param as $key => $value) {
- $cond[] = 'n.'. db_escape_string($key) ." = '%s'";
+ $cond[] = 'n.' . db_escape_string($key) . " = '%s'";
$arguments[] = $value;
}
$cond = implode(' AND ', $cond);
@@ -743,10 +743,10 @@ function node_load($param = array(), $revision = NULL, $reset = NULL) {
// No db_rewrite_sql is applied so as to get complete indexing for search.
if ($revision) {
array_unshift($arguments, $revision);
- $node = db_fetch_object(db_query('SELECT '. $fields .' FROM {node} n INNER JOIN {users} u ON u.uid = n.uid INNER JOIN {node_revisions} r ON r.nid = n.nid AND r.vid = %d WHERE '. $cond, $arguments));
+ $node = db_fetch_object(db_query('SELECT ' . $fields . ' FROM {node} n INNER JOIN {users} u ON u.uid = n.uid INNER JOIN {node_revisions} r ON r.nid = n.nid AND r.vid = %d WHERE ' . $cond, $arguments));
}
else {
- $node = db_fetch_object(db_query('SELECT '. $fields .' FROM {node} n INNER JOIN {users} u ON u.uid = n.uid INNER JOIN {node_revisions} r ON r.vid = n.vid WHERE '. $cond, $arguments));
+ $node = db_fetch_object(db_query('SELECT ' . $fields . ' FROM {node} n INNER JOIN {users} u ON u.uid = n.uid INNER JOIN {node_revisions} r ON r.vid = n.vid WHERE ' . $cond, $arguments));
}
if ($node && $node->nid) {
@@ -1113,7 +1113,7 @@ function node_show($node, $cid, $message = FALSE) {
* @ingroup themeable
*/
function theme_node_log_message($log) {
- return '<div class="log"><div class="title">'. t('Log') .':</div>'. $log .'</div>';
+ return '<div class="log"><div class="title">' . t('Log') . ':</div>' . $log . '</div>';
}
/**
@@ -1164,7 +1164,7 @@ function node_search($op = 'search', $keys = NULL) {
);
$form['content_ranking']['#theme'] = 'node_search_admin';
$form['content_ranking']['info'] = array(
- '#value' => '<em>'. t('The following numbers control which properties the content search should favor when ordering the results. Higher numbers mean more influence, zero means the property is ignored. Changing these numbers does not require the search index to be rebuilt. Changes take effect immediately.') .'</em>'
+ '#value' => '<em>' . t('The following numbers control which properties the content search should favor when ordering the results. Higher numbers mean more influence, zero means the property is ignored. Changing these numbers does not require the search index to be rebuilt. Changes take effect immediately.') . '</em>'
);
$ranking = array('node_rank_relevance' => t('Keyword relevance'),
@@ -1200,7 +1200,7 @@ function node_search($op = 'search', $keys = NULL) {
$types[] = "n.type = '%s'";
$arguments1[] = $t;
}
- $conditions1 .= ' AND ('. implode(' OR ', $types) .')';
+ $conditions1 .= ' AND (' . implode(' OR ', $types) . ')';
$keys = search_query_insert($keys, 'type');
}
@@ -1210,7 +1210,7 @@ function node_search($op = 'search', $keys = NULL) {
$categories[] = "tn.tid = %d";
$arguments1[] = $c;
}
- $conditions1 .= ' AND ('. implode(' OR ', $categories) .')';
+ $conditions1 .= ' AND (' . implode(' OR ', $categories) . ')';
$join1 .= ' INNER JOIN {term_node} tn ON n.vid = tn.vid';
$keys = search_query_insert($keys, 'category');
}
@@ -1259,10 +1259,10 @@ function node_search($op = 'search', $keys = NULL) {
$join2 .= ' LEFT JOIN {node_counter} nc ON nc.nid = i.sid';
$total += $weight;
}
- $select2 = (count($ranking) ? implode(' + ', $ranking) : 'i.relevance') .' AS score';
+ $select2 = (count($ranking) ? implode(' + ', $ranking) : 'i.relevance') . ' AS score';
// Do search
- $find = do_search($keys, 'node', 'INNER JOIN {node} n ON n.nid = i.sid '. $join1 .' INNER JOIN {users} u ON n.uid = u.uid', $conditions1 . (empty($where1) ? '' : ' AND '. $where1), $arguments1, $select2, $join2, $arguments2);
+ $find = do_search($keys, 'node', 'INNER JOIN {node} n ON n.nid = i.sid ' . $join1 . ' INNER JOIN {users} u ON n.uid = u.uid', $conditions1 . (empty($where1) ? '' : ' AND ' . $where1), $arguments1, $select2, $join2, $arguments2);
// Load results
$results = array();
@@ -1280,7 +1280,7 @@ function node_search($op = 'search', $keys = NULL) {
$extra = node_invoke_nodeapi($node, 'search result');
$results[] = array(
- 'link' => url('node/'. $item->sid, array('absolute' => TRUE)),
+ 'link' => url('node/' . $item->sid, array('absolute' => TRUE)),
'type' => check_plain(node_get_types('name', $node)),
'title' => $node->title,
'user' => theme('username', $node),
@@ -1473,7 +1473,7 @@ function node_menu() {
);
foreach (node_get_types('types', NULL, TRUE) as $type) {
$type_url_str = str_replace('_', '-', $type->type);
- $items['node/add/'. $type_url_str] = array(
+ $items['node/add/' . $type_url_str] = array(
'title' => drupal_ucfirst($type->name),
'title callback' => 'check_plain',
'page callback' => 'node_add',
@@ -1483,18 +1483,18 @@ function node_menu() {
'description' => $type->description,
'file' => 'node.pages.inc',
);
- $items['admin/content/node-type/'. $type_url_str] = array(
+ $items['admin/content/node-type/' . $type_url_str] = array(
'title' => $type->name,
'page callback' => 'drupal_get_form',
'page arguments' => array('node_type_form', $type),
'file' => 'content_types.inc',
'type' => MENU_CALLBACK,
);
- $items['admin/content/node-type/'. $type_url_str .'/edit'] = array(
+ $items['admin/content/node-type/' . $type_url_str . '/edit'] = array(
'title' => 'Edit',
'type' => MENU_DEFAULT_LOCAL_TASK,
);
- $items['admin/content/node-type/'. $type_url_str .'/delete'] = array(
+ $items['admin/content/node-type/' . $type_url_str . '/delete'] = array(
'title' => 'Delete',
'page arguments' => array('node_type_delete_confirm', $type),
'file' => 'content_types.inc',
@@ -1583,7 +1583,7 @@ function node_page_title($node) {
* Implementation of hook_init().
*/
function node_init() {
- drupal_add_css(drupal_get_path('module', 'node') .'/node.css');
+ drupal_add_css(drupal_get_path('module', 'node') . '/node.css');
}
function node_last_changed($nid) {
@@ -1671,7 +1671,7 @@ function node_feed($nids = FALSE, $channel = array()) {
// Allow modules to add additional item fields and/or modify $item
$extra = node_invoke_nodeapi($item, 'rss item');
- $extra = array_merge($extra, array(array('key' => 'pubDate', 'value' => format_date($item->created, 'custom', 'r')), array('key' => 'dc:creator', 'value' => $item->name), array('key' => 'guid', 'value' => $item->nid .' at '. $base_url, 'attributes' => array('isPermaLink' => 'false'))));
+ $extra = array_merge($extra, array(array('key' => 'pubDate', 'value' => format_date($item->created, 'custom', 'r')), array('key' => 'dc:creator', 'value' => $item->name), array('key' => 'guid', 'value' => $item->nid . ' at ' . $base_url, 'attributes' => array('isPermaLink' => 'false'))));
foreach ($extra as $element) {
if (isset($element['namespace'])) {
$namespaces = array_merge($namespaces, $element['namespace']);
@@ -1686,7 +1686,7 @@ function node_feed($nids = FALSE, $channel = array()) {
case 'teaser':
$item_text = $item->teaser;
if (!empty($item->readmore)) {
- $item_text .= '<p>'. l(t('read more'), 'node/'. $item->nid, array('absolute' => TRUE, 'attributes' => array('target' => '_blank'))) .'</p>';
+ $item_text .= '<p>' . l(t('read more'), 'node/' . $item->nid, array('absolute' => TRUE, 'attributes' => array('target' => '_blank'))) . '</p>';
}
break;
case 'title':
@@ -1707,7 +1707,7 @@ function node_feed($nids = FALSE, $channel = array()) {
$channel = array_merge($channel_defaults, $channel);
$output = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
- $output .= "<rss version=\"". $channel["version"] ."\" xml:base=\"". $base_url ."\" ". drupal_attributes($namespaces) .">\n";
+ $output .= "<rss version=\"" . $channel["version"] . "\" xml:base=\"" . $base_url . "\" " . drupal_attributes($namespaces) . ">\n";
$output .= format_rss_channel($channel['title'], $channel['link'], $channel['description'], $items, $channel['language']);
$output .= "</rss>\n";
@@ -1730,21 +1730,21 @@ function node_page_default() {
if ($num_rows) {
$feed_url = url('rss.xml', array('absolute' => TRUE));
- drupal_add_feed($feed_url, variable_get('site_name', 'Drupal') .' '. t('RSS'));
+ drupal_add_feed($feed_url, variable_get('site_name', 'Drupal') . ' ' . t('RSS'));
$output .= theme('pager', NULL, variable_get('default_nodes_main', 10));
}
else {
- $default_message = '<h1 class="title">'. t('Welcome to your new Drupal website!') .'</h1>';
- $default_message .= '<p>'. t('Please follow these steps to set up and start using your website:') .'</p>';
+ $default_message = '<h1 class="title">' . t('Welcome to your new Drupal website!') . '</h1>';
+ $default_message .= '<p>' . t('Please follow these steps to set up and start using your website:') . '</p>';
$default_message .= '<ol>';
- $default_message .= '<li>'. t('<strong>Configure your website</strong> Once logged in, visit the <a href="@admin">administration section</a>, where you can <a href="@config">customize and configure</a> all aspects of your website.', array('@admin' => url('admin'), '@config' => url('admin/settings'))) .'</li>';
- $default_message .= '<li>'. t('<strong>Enable additional functionality</strong> Next, visit the <a href="@modules">module list</a> and enable features which suit your specific needs. You can find additional modules in the <a href="@download_modules">Drupal modules download section</a>.', array('@modules' => url('admin/build/modules'), '@download_modules' => 'http://drupal.org/project/modules')) .'</li>';
- $default_message .= '<li>'. t('<strong>Customize your website design</strong> To change the "look and feel" of your website, visit the <a href="@themes">themes section</a>. You may choose from one of the included themes or download additional themes from the <a href="@download_themes">Drupal themes download section</a>.', array('@themes' => url('admin/build/themes'), '@download_themes' => 'http://drupal.org/project/themes')) .'</li>';
- $default_message .= '<li>'. t('<strong>Start posting content</strong> Finally, you can <a href="@content">create content</a> for your website. This message will disappear once you have promoted a post to the front page.', array('@content' => url('node/add'))) .'</li>';
+ $default_message .= '<li>' . t('<strong>Configure your website</strong> Once logged in, visit the <a href="@admin">administration section</a>, where you can <a href="@config">customize and configure</a> all aspects of your website.', array('@admin' => url('admin'), '@config' => url('admin/settings'))) . '</li>';
+ $default_message .= '<li>' . t('<strong>Enable additional functionality</strong> Next, visit the <a href="@modules">module list</a> and enable features which suit your specific needs. You can find additional modules in the <a href="@download_modules">Drupal modules download section</a>.', array('@modules' => url('admin/build/modules'), '@download_modules' => 'http://drupal.org/project/modules')) . '</li>';
+ $default_message .= '<li>' . t('<strong>Customize your website design</strong> To change the "look and feel" of your website, visit the <a href="@themes">themes section</a>. You may choose from one of the included themes or download additional themes from the <a href="@download_themes">Drupal themes download section</a>.', array('@themes' => url('admin/build/themes'), '@download_themes' => 'http://drupal.org/project/themes')) . '</li>';
+ $default_message .= '<li>' . t('<strong>Start posting content</strong> Finally, you can <a href="@content">create content</a> for your website. This message will disappear once you have promoted a post to the front page.', array('@content' => url('node/add'))) . '</li>';
$default_message .= '</ol>';
- $default_message .= '<p>'. t('For more information, please refer to the <a href="@help">help section</a>, or the <a href="@handbook">online Drupal handbooks</a>. You may also post at the <a href="@forum">Drupal forum</a>, or view the wide range of <a href="@support">other support options</a> available.', array('@help' => url('admin/help'), '@handbook' => 'http://drupal.org/handbooks', '@forum' => 'http://drupal.org/forum', '@support' => 'http://drupal.org/support')) .'</p>';
+ $default_message .= '<p>' . t('For more information, please refer to the <a href="@help">help section</a>, or the <a href="@handbook">online Drupal handbooks</a>. You may also post at the <a href="@forum">Drupal forum</a>, or view the wide range of <a href="@support">other support options</a> available.', array('@help' => url('admin/help'), '@handbook' => 'http://drupal.org/handbooks', '@forum' => 'http://drupal.org/forum', '@support' => 'http://drupal.org/support')) . '</p>';
- $output = '<div id="first-time">'. $default_message .'</div>';
+ $output = '<div id="first-time">' . $default_message . '</div>';
}
drupal_set_title('');
@@ -1793,7 +1793,7 @@ function _node_index_node($node) {
$node = node_build_content($node, FALSE, FALSE);
$node->body = drupal_render($node->content);
- $text = '<h1>'. check_plain($node->title) .'</h1>'. $node->body;
+ $text = '<h1>' . check_plain($node->title) . '</h1>' . $node->body;
// Fetch extra data normally not visible
$extra = node_invoke_nodeapi($node, 'update index');
@@ -1895,17 +1895,17 @@ function node_search_validate($form, &$form_state) {
$keys = search_query_insert($keys, 'category', implode(',', $form_state['values']['category']));
}
if ($form_state['values']['or'] != '') {
- if (preg_match_all('/ ("[^"]+"|[^" ]+)/i', ' '. $form_state['values']['or'], $matches)) {
- $keys .= ' '. implode(' OR ', $matches[1]);
+ if (preg_match_all('/ ("[^"]+"|[^" ]+)/i', ' ' . $form_state['values']['or'], $matches)) {
+ $keys .= ' ' . implode(' OR ', $matches[1]);
}
}
if ($form_state['values']['negative'] != '') {
- if (preg_match_all('/ ("[^"]+"|[^" ]+)/i', ' '. $form_state['values']['negative'], $matches)) {
- $keys .= ' -'. implode(' -', $matches[1]);
+ if (preg_match_all('/ ("[^"]+"|[^" ]+)/i', ' ' . $form_state['values']['negative'], $matches)) {
+ $keys .= ' -' . implode(' -', $matches[1]);
}
}
if ($form_state['values']['phrase'] != '') {
- $keys .= ' "'. str_replace('"', ' ', $form_state['values']['phrase']) .'"';
+ $keys .= ' "' . str_replace('"', ' ', $form_state['values']['phrase']) . '"';
}
if (!empty($keys)) {
form_set_value($form['basic']['inline']['processed_keys'], trim($keys), $form_state);
@@ -2014,7 +2014,7 @@ function node_access($op, $node, $account = NULL) {
$grants_sql = '';
if (count($grants)) {
- $grants_sql = 'AND ('. implode(' OR ', $grants) .')';
+ $grants_sql = 'AND (' . implode(' OR ', $grants) . ')';
}
$sql = "SELECT COUNT(*) FROM {node_access} WHERE (nid = 0 OR nid = %d) $grants_sql AND grant_$op >= 1";
@@ -2047,7 +2047,7 @@ function _node_access_join_sql($node_alias = 'n', $node_access_alias = 'na') {
return '';
}
- return 'INNER JOIN {node_access} '. $node_access_alias .' ON '. $node_access_alias .'.nid = '. $node_alias .'.nid';
+ return 'INNER JOIN {node_access} ' . $node_access_alias . ' ON ' . $node_access_alias . '.nid = ' . $node_alias . '.nid';
}
/**
@@ -2078,7 +2078,7 @@ function _node_access_where_sql($op = 'view', $node_access_alias = 'na', $accoun
$grants_sql = '';
if (count($grants)) {
- $grants_sql = 'AND ('. implode(' OR ', $grants) .')';
+ $grants_sql = 'AND (' . implode(' OR ', $grants) . ')';
}
$sql = "$node_access_alias.grant_$op >= 1 $grants_sql";
@@ -2126,7 +2126,7 @@ function node_access_view_all_nodes() {
$grants_sql = '';
if (count($grants)) {
- $grants_sql = 'AND ('. implode(' OR ', $grants) .')';
+ $grants_sql = 'AND (' . implode(' OR ', $grants) . ')';
}
$sql = "SELECT COUNT(*) FROM {node_access} WHERE nid = 0 $grants_sql AND grant_view >= 1";
@@ -2385,17 +2385,17 @@ function node_content_access($op, $node, $account) {
$type = is_string($node) ? $node : (is_array($node) ? $node['type'] : $node->type);
if ($op == 'create') {
- return user_access('create '. $type .' content', $account);
+ return user_access('create ' . $type . ' content', $account);
}
if ($op == 'update') {
- if (user_access('edit any '. $type .' content', $account) || (user_access('edit own '. $type .' content', $account) && ($account->uid == $node->uid))) {
+ if (user_access('edit any ' . $type . ' content', $account) || (user_access('edit own ' . $type . ' content', $account) && ($account->uid == $node->uid))) {
return TRUE;
}
}
if ($op == 'delete') {
- if (user_access('delete any '. $type .' content', $account) || (user_access('delete own '. $type .' content', $account) && ($account->uid == $node->uid))) {
+ if (user_access('delete any ' . $type . ' content', $account) || (user_access('delete own ' . $type . ' content', $account) && ($account->uid == $node->uid))) {
return TRUE;
}
}
@@ -2437,7 +2437,7 @@ function node_forms() {
$forms = array();
if ($types = node_get_types()) {
foreach (array_keys($types) as $type) {
- $forms[$type .'_node_form']['callback'] = 'node_form';
+ $forms[$type . '_node_form']['callback'] = 'node_form';
}
}
return $forms;
@@ -2705,7 +2705,7 @@ function node_unpublish_by_keyword_action_form($context) {
$form['keywords'] = array(
'#title' => t('Keywords'),
'#type' => 'textarea',
- '#description' => t('The post 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 post 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/node/node.pages.inc b/modules/node/node.pages.inc
index dc3e529cb..0f94a4ac2 100644
--- a/modules/node/node.pages.inc
+++ b/modules/node/node.pages.inc
@@ -12,7 +12,7 @@
*/
function node_page_edit($node) {
drupal_set_title($node->title);
- return drupal_get_form($node->type .'_node_form', $node);
+ return drupal_get_form($node->type . '_node_form', $node);
}
function node_add_page() {
@@ -32,8 +32,8 @@ function theme_node_add_list($content) {
if ($content) {
$output = '<dl class="node-type-list">';
foreach ($content as $item) {
- $output .= '<dt>'. l($item['title'], $item['href'], $item['options']) .'</dt>';
- $output .= '<dd>'. filter_xss_admin($item['description']) .'</dd>';
+ $output .= '<dt>' . l($item['title'], $item['href'], $item['options']) . '</dt>';
+ $output .= '<dd>' . filter_xss_admin($item['description']) . '</dd>';
}
$output .= '</dl>';
}
@@ -55,7 +55,7 @@ function node_add($type) {
$node = array('uid' => $user->uid, 'name' => (isset($user->name) ? $user->name : ''), 'type' => $type, 'language' => '');
drupal_set_title(t('Create @name', array('@name' => $types[$type]->name)));
- $output = drupal_get_form($type .'_node_form', $node);
+ $output = drupal_get_form($type . '_node_form', $node);
}
return $output;
@@ -67,7 +67,7 @@ function node_form_validate($form, &$form_state) {
function node_object_prepare(&$node) {
// Set up default values, if required.
- $node_options = variable_get('node_options_'. $node->type, array('status', 'promote'));
+ $node_options = variable_get('node_options_' . $node->type, array('status', 'promote'));
// If this is a new node, fill in the default values.
if (!isset($node->nid)) {
foreach (array('status', 'promote', 'sticky') as $key) {
@@ -249,7 +249,7 @@ function node_form(&$form_state, $node) {
);
}
$form['#validate'][] = 'node_form_validate';
- $form['#theme'] = array($node->type .'_node_form', 'node_form');
+ $form['#theme'] = array($node->type . '_node_form', 'node_form');
return $form;
}
@@ -306,7 +306,7 @@ function node_form_delete_submit($form, &$form_state) {
unset($_REQUEST['destination']);
}
$node = $form['#node'];
- $form_state['redirect'] = array('node/'. $node->nid .'/delete', $destination);
+ $form_state['redirect'] = array('node/' . $node->nid . '/delete', $destination);
}
@@ -431,9 +431,9 @@ function theme_node_preview($node) {
if ($preview_trimmed_version) {
drupal_set_message(t('The trimmed version of your post shows what your post looks like when promoted to the main page or when exported for syndication.<span class="no-js"> You can insert the delimiter "&lt;!--break--&gt;" (without the quotes) to fine-tune where your post gets split.</span>'));
- $output .= '<h3>'. t('Preview trimmed version') .'</h3>';
+ $output .= '<h3>' . t('Preview trimmed version') . '</h3>';
$output .= node_view(clone $node, 1, FALSE, 0);
- $output .= '<h3>'. t('Preview full version') .'</h3>';
+ $output .= '<h3>' . t('Preview full version') . '</h3>';
$output .= node_view($node, 0, FALSE, 0);
}
else {
@@ -450,7 +450,7 @@ function node_form_submit($form, &$form_state) {
$node = node_form_submit_build_node($form, $form_state);
$insert = empty($node->nid);
node_save($node);
- $node_link = l(t('view'), 'node/'. $node->nid);
+ $node_link = l(t('view'), 'node/' . $node->nid);
$watchdog_args = array('@type' => $node->type, '%title' => $node->title);
$t_args = array('@type' => node_get_types('name', $node), '%title' => $node->title);
@@ -465,7 +465,7 @@ function node_form_submit($form, &$form_state) {
if ($node->nid) {
unset($form_state['rebuild']);
$form_state['nid'] = $node->nid;
- $form_state['redirect'] = 'node/'. $node->nid;
+ $form_state['redirect'] = 'node/' . $node->nid;
}
else {
// In the unlikely case something went wrong on save, the node will be
@@ -499,7 +499,7 @@ function node_delete_confirm(&$form_state, $node) {
return confirm_form($form,
t('Are you sure you want to delete %title?', array('%title' => $node->title)),
- isset($_GET['destination']) ? $_GET['destination'] : 'node/'. $node->nid,
+ isset($_GET['destination']) ? $_GET['destination'] : 'node/' . $node->nid,
t('This action cannot be undone.'),
t('Delete'),
t('Cancel')
@@ -542,13 +542,13 @@ function node_revision_overview($node) {
if ($revision->current_vid > 0) {
$row[] = array('data' => t('!date by !username', array('!date' => l(format_date($revision->timestamp, 'small'), "node/$node->nid"), '!username' => theme('username', $revision)))
- . (($revision->log != '') ? '<p class="revision-log">'. filter_xss($revision->log) .'</p>' : ''),
+ . (($revision->log != '') ? '<p class="revision-log">' . filter_xss($revision->log) . '</p>' : ''),
'class' => 'revision-current');
$operations[] = array('data' => theme('placeholder', t('current revision')), 'class' => 'revision-current', 'colspan' => 2);
}
else {
$row[] = t('!date by !username', array('!date' => l(format_date($revision->timestamp, 'small'), "node/$node->nid/revisions/$revision->vid/view"), '!username' => theme('username', $revision)))
- . (($revision->log != '') ? '<p class="revision-log">'. filter_xss($revision->log) .'</p>' : '');
+ . (($revision->log != '') ? '<p class="revision-log">' . filter_xss($revision->log) . '</p>' : '');
if ($revert_permission) {
$operations[] = l(t('revert'), "node/$node->nid/revisions/$revision->vid/revert");
}
@@ -567,7 +567,7 @@ function node_revision_overview($node) {
*/
function node_revision_revert_confirm($form_state, $node_revision) {
$form['#node_revision'] = $node_revision;
- return confirm_form($form, t('Are you sure you want to revert to the revision from %revision-date?', array('%revision-date' => format_date($node_revision->revision_timestamp))), 'node/'. $node_revision->nid .'/revisions', '', t('Revert'), t('Cancel'));
+ return confirm_form($form, t('Are you sure you want to revert to the revision from %revision-date?', array('%revision-date' => format_date($node_revision->revision_timestamp))), 'node/' . $node_revision->nid . '/revisions', '', t('Revert'), t('Cancel'));
}
function node_revision_revert_confirm_submit($form, &$form_state) {
@@ -582,12 +582,12 @@ function node_revision_revert_confirm_submit($form, &$form_state) {
watchdog('content', '@type: reverted %title revision %revision.', array('@type' => $node_revision->type, '%title' => $node_revision->title, '%revision' => $node_revision->vid));
drupal_set_message(t('@type %title has been reverted back to the revision from %revision-date.', array('@type' => node_get_types('name', $node_revision), '%title' => $node_revision->title, '%revision-date' => format_date($node_revision->revision_timestamp))));
- $form_state['redirect'] = 'node/'. $node_revision->nid .'/revisions';
+ $form_state['redirect'] = 'node/' . $node_revision->nid . '/revisions';
}
function node_revision_delete_confirm($form_state, $node_revision) {
$form['#node_revision'] = $node_revision;
- return confirm_form($form, t('Are you sure you want to delete the revision from %revision-date?', array('%revision-date' => format_date($node_revision->revision_timestamp))), 'node/'. $node_revision->nid .'/revisions', t('This action cannot be undone.'), t('Delete'), t('Cancel'));
+ return confirm_form($form, t('Are you sure you want to delete the revision from %revision-date?', array('%revision-date' => format_date($node_revision->revision_timestamp))), 'node/' . $node_revision->nid . '/revisions', t('This action cannot be undone.'), t('Delete'), t('Cancel'));
}
function node_revision_delete_confirm_submit($form, &$form_state) {
@@ -596,7 +596,7 @@ function node_revision_delete_confirm_submit($form, &$form_state) {
node_invoke_nodeapi($node_revision, 'delete revision');
watchdog('content', '@type: deleted %title revision %revision.', array('@type' => $node_revision->type, '%title' => $node_revision->title, '%revision' => $node_revision->vid));
drupal_set_message(t('Revision from %revision-date of @type %title has been deleted.', array('%revision-date' => format_date($node_revision->revision_timestamp), '@type' => node_get_types('name', $node_revision), '%title' => $node_revision->title)));
- $form_state['redirect'] = 'node/'. $node_revision->nid;
+ $form_state['redirect'] = 'node/' . $node_revision->nid;
if (db_result(db_query('SELECT COUNT(vid) FROM {node_revisions} WHERE nid = %d', $node_revision->nid)) > 1) {
$form_state['redirect'] .= '/revisions';
}
diff --git a/modules/openid/openid.inc b/modules/openid/openid.inc
index db979b67e..c39cd8e40 100644
--- a/modules/openid/openid.inc
+++ b/modules/openid/openid.inc
@@ -7,10 +7,10 @@
*/
// Diffie-Hellman Key Exchange Default Value.
-define('OPENID_DH_DEFAULT_MOD', '155172898181473697471232257763715539915724801'.
- '966915404479707795314057629378541917580651227423698188993727816152646631'.
- '438561595825688188889951272158842675419950341258706556549803580104870537'.
- '681476726513255747040765857479291291572334510643245094715007229621094194'.
+define('OPENID_DH_DEFAULT_MOD', '155172898181473697471232257763715539915724801' .
+ '966915404479707795314057629378541917580651227423698188993727816152646631' .
+ '438561595825688188889951272158842675419950341258706556549803580104870537' .
+ '681476726513255747040765857479291291572334510643245094715007229621094194' .
'349783925984760375594985848253359305585439638443');
// Constants for Diffie-Hellman key exchange computations.
@@ -29,11 +29,11 @@ define('OPENID_NS_1_0', 'http://openid.net/signon/1.0');
function openid_redirect_http($url, $message) {
$query = array();
foreach ($message as $key => $val) {
- $query[] = $key .'='. urlencode($val);
+ $query[] = $key . '=' . urlencode($val);
}
$sep = (strpos($url, '?') === FALSE) ? '?' : '&';
- header('Location: '. $url . $sep . implode('&', $query), TRUE, 302);
+ header('Location: ' . $url . $sep . implode('&', $query), TRUE, 302);
exit;
}
@@ -41,7 +41,7 @@ function openid_redirect_http($url, $message) {
* Creates a js auto-submit redirect for (for the 2.x protocol)
*/
function openid_redirect($url, $message) {
- $output = '<html><head><title>'. t('OpenID redirect') ."</title></head>\n<body>";
+ $output = '<html><head><title>' . t('OpenID redirect') . "</title></head>\n<body>";
$output .= drupal_get_form('openid_redirect_form', $url, $message);
$output .= '<script type="text/javascript">document.getElementById("openid-redirect-form").submit();</script>';
$output .= "</body></html>\n";
@@ -109,7 +109,7 @@ function _openid_normalize_url($url) {
$normalized_url = $url;
if (stristr($url, '://') === FALSE) {
- $normalized_url = 'http://'. $url;
+ $normalized_url = 'http://' . $url;
}
if (substr_count($normalized_url, '/') < 3) {
@@ -148,7 +148,7 @@ function _openid_encode_message($message) {
if ($encoded_message != '') {
$encoded_message .= '&';
}
- $encoded_message .= rawurlencode(trim($parts[0])) .'='. rawurlencode(trim($parts[1]));
+ $encoded_message .= rawurlencode(trim($parts[0])) . '=' . rawurlencode(trim($parts[1]));
}
}
@@ -191,7 +191,7 @@ function _openid_nonce() {
*/
function _openid_link_href($rel, $html) {
$rel = preg_quote($rel);
- preg_match('|<link\s+rel=["\'](.*)'. $rel .'(.*)["\'](.*)/?>|iUs', $html, $matches);
+ preg_match('|<link\s+rel=["\'](.*)' . $rel . '(.*)["\'](.*)/?>|iUs', $html, $matches);
if (isset($matches[3])) {
preg_match('|href=["\']([^"]+)["\']|iU', $matches[3], $href);
return trim($href[1]);
@@ -203,7 +203,7 @@ function _openid_link_href($rel, $html) {
* Pull the http-equiv attribute out of an html meta element
*/
function _openid_meta_httpequiv($equiv, $html) {
- preg_match('|<meta\s+http-equiv=["\']'. $equiv .'["\'](.*)/?>|iUs', $html, $matches);
+ preg_match('|<meta\s+http-equiv=["\']' . $equiv . '["\'](.*)/?>|iUs', $html, $matches);
if (isset($matches[1])) {
preg_match('|content=["\']([^"]+)["\']|iUs', $matches[1], $content);
if (isset($content[1])) {
@@ -226,8 +226,8 @@ function _openid_signature($association, $message_array, $keys_to_sign) {
$sign_data = array();
foreach ($keys_to_sign as $key) {
- if (isset($message_array['openid.'. $key])) {
- $sign_data[$key] = $message_array['openid.'. $key];
+ if (isset($message_array['openid.' . $key])) {
+ $sign_data[$key] = $message_array['openid.' . $key];
}
}
@@ -356,7 +356,7 @@ function _openid_dh_rand($stop) {
}
do {
- $bytes = "\x00". _openid_get_bytes($nbytes);
+ $bytes = "\x00" . _openid_get_bytes($nbytes);
$n = _openid_dh_binary_to_long($bytes);
// Keep looping if this value is in the low duplicated range.
} while (bccomp($n, $duplicate) < 0);
diff --git a/modules/openid/openid.module b/modules/openid/openid.module
index 3e456f2b9..80f8ca655 100644
--- a/modules/openid/openid.module
+++ b/modules/openid/openid.module
@@ -43,17 +43,17 @@ function openid_help($path, $arg) {
switch ($path) {
case 'user/%/openid':
- $output = '<p>'. t('This site supports <a href="@openid-net">OpenID</a>, a secure way to log into many websites using a single username and password. OpenID can reduce the necessity of managing many usernames and passwords for many websites.', array('@openid-net' => url('http://openid.net'))) .'</p>';
- $output .= '<p>'. t('To use OpenID you must first establish an identity on a public or private OpenID server. If you do not have an OpenID and would like one, look into one of the <a href="@openid-providers">free public providers</a>. You can find out more about OpenID at <a href="@openid-net">this website</a>.', array('@openid-providers' => url('http://openid.net/wiki/index.php/OpenIDServers'), '@openid-net' => url('http://openid.net'))) .'</p>';
- $output .= '<p>'. t('If you already have an OpenID, enter the URL to your OpenID server below (e.g. myusername.openidprovider.com). Next time you login, you will be able to use this URL instead of a regular username and password. You can have multiple OpenID servers if you like; just keep adding them here.') .'</p>';
+ $output = '<p>' . t('This site supports <a href="@openid-net">OpenID</a>, a secure way to log into many websites using a single username and password. OpenID can reduce the necessity of managing many usernames and passwords for many websites.', array('@openid-net' => url('http://openid.net'))) . '</p>';
+ $output .= '<p>' . t('To use OpenID you must first establish an identity on a public or private OpenID server. If you do not have an OpenID and would like one, look into one of the <a href="@openid-providers">free public providers</a>. You can find out more about OpenID at <a href="@openid-net">this website</a>.', array('@openid-providers' => url('http://openid.net/wiki/index.php/OpenIDServers'), '@openid-net' => url('http://openid.net'))) . '</p>';
+ $output .= '<p>' . t('If you already have an OpenID, enter the URL to your OpenID server below (e.g. myusername.openidprovider.com). Next time you login, you will be able to use this URL instead of a regular username and password. You can have multiple OpenID servers if you like; just keep adding them here.') . '</p>';
return $output;
case 'admin/help#openid':
- $output = '<p>'. t('OpenID is a secure method for logging into many websites with a single username and password. It does not require special software, and it does not share passwords with any site to which it is associated; including your site.') .'</p>';
- $output .= '<p>'. t('Users can create accounts using their OpenID, assign one or more OpenIDs to an existing account, and log in using an OpenID. This lowers the barrier to registration, which is good for the site, and offers convenience and security to the users. OpenID is not a trust system, so email verification is still necessary. The benefit stems from the fact that users can have a single password that they can use on many websites. This means they can easily update their single password from a centralized location, rather than having to change dozens of passwords individually.') .'</p>';
- $output .= '<p>'. t('The basic concept is as follows: A user has an account on an OpenID server. This account provides them with a unique URL (such as myusername.openidprovider.com). When the user comes to your site, they are presented with the option of entering this URL. Your site then communicates with the OpenID server, asking it to verify the identity of the user. If the user is logged into their OpenID server, the server communicates back to your site, verifying the user. If they are not logged in, the OpenID server will ask the user for their password. At no point does your site record, or need to record the user\'s password.') .'</p>';
- $output .= '<p>'. t('More information on OpenID is available at <a href="@openid-net">OpenID.net</a>.', array('@openid-net' => url('http://openid.net'))) .'</p>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@handbook">OpenID module</a>.', array('@handbook' => 'http://drupal.org/handbook/modules/openid')) .'</p>';
+ $output = '<p>' . t('OpenID is a secure method for logging into many websites with a single username and password. It does not require special software, and it does not share passwords with any site to which it is associated; including your site.') . '</p>';
+ $output .= '<p>' . t('Users can create accounts using their OpenID, assign one or more OpenIDs to an existing account, and log in using an OpenID. This lowers the barrier to registration, which is good for the site, and offers convenience and security to the users. OpenID is not a trust system, so email verification is still necessary. The benefit stems from the fact that users can have a single password that they can use on many websites. This means they can easily update their single password from a centralized location, rather than having to change dozens of passwords individually.') . '</p>';
+ $output .= '<p>' . t('The basic concept is as follows: A user has an account on an OpenID server. This account provides them with a unique URL (such as myusername.openidprovider.com). When the user comes to your site, they are presented with the option of entering this URL. Your site then communicates with the OpenID server, asking it to verify the identity of the user. If the user is logged into their OpenID server, the server communicates back to your site, verifying the user. If they are not logged in, the OpenID server will ask the user for their password. At no point does your site record, or need to record the user\'s password.') . '</p>';
+ $output .= '<p>' . t('More information on OpenID is available at <a href="@openid-net">OpenID.net</a>.', array('@openid-net' => url('http://openid.net'))) . '</p>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@handbook">OpenID module</a>.', array('@handbook' => 'http://drupal.org/handbook/modules/openid')) . '</p>';
return $output;
}
}
@@ -76,8 +76,8 @@ function openid_user($op, &$edit, &$account, $category = NULL) {
*/
function openid_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'user_login_block' || $form_id == 'user_login') {
- drupal_add_css(drupal_get_path('module', 'openid') .'/openid.css', 'module');
- drupal_add_js(drupal_get_path('module', 'openid') .'/openid.js');
+ drupal_add_css(drupal_get_path('module', 'openid') . '/openid.css', 'module');
+ drupal_add_js(drupal_get_path('module', 'openid') . '/openid.js');
if (!empty($form_state['post']['openid_identifier'])) {
$form['name']['#required'] = FALSE;
$form['pass']['#required'] = FALSE;
@@ -190,7 +190,7 @@ function openid_begin($claimed_id, $return_to = '', $form_values = array()) {
$identity = $claimed_id;
}
- if (isset($services[0]['types']) && is_array($services[0]['types']) && in_array(OPENID_NS_2_0 .'/server', $services[0]['types'])) {
+ if (isset($services[0]['types']) && is_array($services[0]['types']) && in_array(OPENID_NS_2_0 . '/server', $services[0]['types'])) {
$identity = 'http://specs.openid.net/auth/2.0/identifier_select';
}
$authn_request = openid_authentication_request($claimed_id, $identity, $return_to, $assoc_handle, $services[0]['version']);
@@ -267,7 +267,7 @@ function openid_discovery($claimed_id) {
$xrds_url = $claimed_id;
if (_openid_is_xri($claimed_id)) {
- $xrds_url = 'http://xri.net/'. $claimed_id;
+ $xrds_url = 'http://xri.net/' . $claimed_id;
}
$url = @parse_url($xrds_url);
if ($url['scheme'] == 'http' || $url['scheme'] == 'https') {
diff --git a/modules/openid/openid.pages.inc b/modules/openid/openid.pages.inc
index 981a6d11b..57f2687f2 100644
--- a/modules/openid/openid.pages.inc
+++ b/modules/openid/openid.pages.inc
@@ -29,7 +29,7 @@ function openid_authentication_page() {
*/
function openid_user_identities($account) {
drupal_set_title(check_plain($account->name));
- drupal_add_css(drupal_get_path('module', 'openid') .'/openid.css', 'module');
+ drupal_add_css(drupal_get_path('module', 'openid') . '/openid.css', 'module');
// Check to see if we got a response
$result = openid_complete();
@@ -44,7 +44,7 @@ function openid_user_identities($account) {
$result = db_query("SELECT * FROM {authmap} WHERE module='openid' AND uid=%d", $account->uid);
while ($identity = db_fetch_object($result)) {
- $rows[] = array($identity->authname, l(t('Delete'), 'user/'. $account->uid .'/openid/delete/'. $identity->aid));
+ $rows[] = array($identity->authname, l(t('Delete'), 'user/' . $account->uid . '/openid/delete/' . $identity->aid));
}
$output = theme('table', $header, $rows);
@@ -74,7 +74,7 @@ function openid_user_add_validate($form, &$form_state) {
form_set_error('openid_identifier', t('That OpenID is already in use on this site.'));
}
else {
- $return_to = url('user/'. arg(1) .'/openid', array('absolute' => TRUE));
+ $return_to = url('user/' . arg(1) . '/openid', array('absolute' => TRUE));
openid_begin($form_state['values']['openid_identifier'], $return_to);
}
}
@@ -87,5 +87,5 @@ function openid_user_delete($account, $aid = 0) {
if (db_affected_rows()) {
drupal_set_message(t('OpenID deleted.'));
}
- drupal_goto('user/'. $account->uid .'/openid');
+ drupal_goto('user/' . $account->uid . '/openid');
}
diff --git a/modules/openid/xrds.inc b/modules/openid/xrds.inc
index 955876881..cd862cdec 100644
--- a/modules/openid/xrds.inc
+++ b/modules/openid/xrds.inc
@@ -36,8 +36,8 @@ function _xrds_element_end(&$parser, $name) {
$name = _xrds_strip_namespace($name);
if ($name == 'SERVICE') {
- if (in_array(OPENID_NS_2_0 .'/signon', $xrds_current_service['types']) ||
- in_array(OPENID_NS_2_0 .'/server', $xrds_current_service['types'])) {
+ if (in_array(OPENID_NS_2_0 . '/signon', $xrds_current_service['types']) ||
+ in_array(OPENID_NS_2_0 . '/server', $xrds_current_service['types'])) {
$xrds_current_service['version'] = 2;
}
elseif (in_array(OPENID_NS_1_1, $xrds_current_service['types']) ||
diff --git a/modules/path/path.admin.inc b/modules/path/path.admin.inc
index e5966b3da..eab81760b 100644
--- a/modules/path/path.admin.inc
+++ b/modules/path/path.admin.inc
@@ -220,7 +220,7 @@ function path_admin_filter_form(&$form_state, $keys = '') {
* Process filter form submission when the Filter button is pressed.
*/
function path_admin_filter_form_submit_filter($form, &$form_state) {
- $form_state['redirect'] = 'admin/build/path/list/'. trim($form_state['values']['filter']);
+ $form_state['redirect'] = 'admin/build/path/list/' . trim($form_state['values']['filter']);
}
/**
diff --git a/modules/path/path.module b/modules/path/path.module
index d1ef1b83d..ac66faedd 100644
--- a/modules/path/path.module
+++ b/modules/path/path.module
@@ -12,20 +12,20 @@
function path_help($path, $arg) {
switch ($path) {
case 'admin/help#path':
- $output = '<p>'. t('The path module allows you to specify aliases for Drupal URLs. Such aliases improve readability of URLs for your users and may help internet search engines to index your content more effectively. More than one alias may be created for a given page.') .'</p>';
- $output .= '<p>'. t('Some examples of URL aliases are:') .'</p>';
- $output .= '<ul><li>'. t('%alias for the path %path', array('%alias' => 'login', '%path' => 'user/login')) .'</li>';
- $output .= '<li>'. t('%alias for the path %path', array('%alias' => 'store', '%path' => 'image/tid/16')) .'</li>';
- $output .= '<li>'. t('%alias for the path %path', array('%alias' => 'store/products/whirlygigs', '%path' => 'taxonomy/term/7+19+20+21')) .'</li>';
- $output .= '<li>'. t('%alias for the path %path', array('%alias' => 'contact', '%path' => 'node/3')) .'</li></ul>';
- $output .= '<p>'. t('The path module enables appropriately permissioned users to specify an optional alias in all node input and editing forms, and provides an interface to view and edit all URL aliases. The two permissions related to URL aliasing are <em>administer url aliases</em> and <em>create url aliases</em>. ') .'</p>';
- $output .= '<p>'. t('This module also provides user-defined mass URL aliasing capabilities, which is useful if you wish to uniformly use URLs different from the default. For example, you may want to have your URLs presented in a different language. Access to the Drupal source code on the web server is required to set up mass URL aliasing. ') .'</p>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@path">Path module</a>.', array('@path' => 'http://drupal.org/handbook/modules/path/')) .'</p>';
+ $output = '<p>' . t('The path module allows you to specify aliases for Drupal URLs. Such aliases improve readability of URLs for your users and may help internet search engines to index your content more effectively. More than one alias may be created for a given page.') . '</p>';
+ $output .= '<p>' . t('Some examples of URL aliases are:') . '</p>';
+ $output .= '<ul><li>' . t('%alias for the path %path', array('%alias' => 'login', '%path' => 'user/login')) . '</li>';
+ $output .= '<li>' . t('%alias for the path %path', array('%alias' => 'store', '%path' => 'image/tid/16')) . '</li>';
+ $output .= '<li>' . t('%alias for the path %path', array('%alias' => 'store/products/whirlygigs', '%path' => 'taxonomy/term/7+19+20+21')) . '</li>';
+ $output .= '<li>' . t('%alias for the path %path', array('%alias' => 'contact', '%path' => 'node/3')) . '</li></ul>';
+ $output .= '<p>' . t('The path module enables appropriately permissioned users to specify an optional alias in all node input and editing forms, and provides an interface to view and edit all URL aliases. The two permissions related to URL aliasing are <em>administer url aliases</em> and <em>create url aliases</em>. ') . '</p>';
+ $output .= '<p>' . t('This module also provides user-defined mass URL aliasing capabilities, which is useful if you wish to uniformly use URLs different from the default. For example, you may want to have your URLs presented in a different language. Access to the Drupal source code on the web server is required to set up mass URL aliasing. ') . '</p>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@path">Path module</a>.', array('@path' => 'http://drupal.org/handbook/modules/path/')) . '</p>';
return $output;
case 'admin/build/path':
- return '<p>'. t("Drupal provides complete control over URLs through aliasing, which is often used to make URLs more readable or easy to remember. For example, the alias 'about' may be mapped onto the post at the system path 'node/1', creating a more meaningful URL. Each system path can have multiple aliases.") .'</p>';
+ return '<p>' . t("Drupal provides complete control over URLs through aliasing, which is often used to make URLs more readable or easy to remember. For example, the alias 'about' may be mapped onto the post at the system path 'node/1', creating a more meaningful URL. Each system path can have multiple aliases.") . '</p>';
case 'admin/build/path/add':
- return '<p>'. t('Enter the path you wish to create the alias for, followed by the name of the new alias.') .'</p>';
+ return '<p>' . t('Enter the path you wish to create the alias for, followed by the name of the new alias.') . '</p>';
}
}
@@ -139,7 +139,7 @@ function path_nodeapi(&$node, $op, $arg) {
break;
case 'load':
- $path = 'node/'. $node->nid;
+ $path = 'node/' . $node->nid;
$alias = drupal_get_path_alias($path, $language);
if ($path != $alias) {
$node->path = $alias;
@@ -150,16 +150,16 @@ function path_nodeapi(&$node, $op, $arg) {
// Don't try to insert if path is NULL. We may have already set
// the alias ahead of time.
if (isset($node->path)) {
- path_set_alias('node/'. $node->nid, $node->path, NULL, $language);
+ path_set_alias('node/' . $node->nid, $node->path, NULL, $language);
}
break;
case 'update':
- path_set_alias('node/'. $node->nid, isset($node->path) ? $node->path : NULL, isset($node->pid) ? $node->pid : NULL, $language);
+ path_set_alias('node/' . $node->nid, isset($node->path) ? $node->path : NULL, isset($node->pid) ? $node->pid : NULL, $language);
break;
case 'delete':
- $path = 'node/'. $node->nid;
+ $path = 'node/' . $node->nid;
if (drupal_get_path_alias($path) != $path) {
path_set_alias($path);
}
@@ -172,7 +172,7 @@ function path_nodeapi(&$node, $op, $arg) {
* Implementation of hook_form_alter().
*/
function path_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) {
$path = isset($form['#node']->path) ? $form['#node']->path : NULL;
$form['path'] = array(
'#type' => 'fieldset',
diff --git a/modules/php/php.install b/modules/php/php.install
index d5ee4d8bd..04c11eef4 100644
--- a/modules/php/php.install
+++ b/modules/php/php.install
@@ -17,7 +17,7 @@ function php_install() {
// Enable the PHP evaluator filter.
db_query("INSERT INTO {filters} (format, module, delta, weight) VALUES (%d, 'php', 0, 0)", $format);
- drupal_set_message(t('A !php-code input format has been created.', array('!php-code' => l('PHP code', 'admin/settings/filters/'. $format))));
+ drupal_set_message(t('A !php-code input format has been created.', array('!php-code' => l('PHP code', 'admin/settings/filters/' . $format))));
}
}
diff --git a/modules/php/php.module b/modules/php/php.module
index c3f1d8ff3..222e1cf40 100644
--- a/modules/php/php.module
+++ b/modules/php/php.module
@@ -13,10 +13,10 @@
function php_help($path, $arg) {
switch ($path) {
case 'admin/help#php':
- $output = '<p>'. t('The PHP filter adds the ability to include PHP code in posts. PHP is a general-purpose scripting language widely-used for web development; the content management system used by this website has been developed using PHP.') .'</p>';
- $output .= '<p>'. t('Through the PHP filter, users with the proper permission may include custom PHP code within a page of the site. While this is a powerful and flexible feature if used by a trusted user with PHP experience, it is a significant and dangerous security risk in the hands of a malicious user. Even a trusted user may accidentally compromise the site by entering malformed or incorrect PHP code. Only the most trusted users should be granted permission to use the PHP filter, and all PHP code added through the PHP filter should be carefully examined before use.') .'</p>';
- $output .= '<p>'. t('<a href="@drupal">Drupal.org</a> offers <a href="@php-snippets">some example PHP snippets</a>, or you can create your own with some PHP experience and knowledge of the Drupal system.', array('@drupal' => url('http://drupal.org'), '@php-snippets' => url('http://drupal.org/handbook/customization/php-snippets'))) .'</p>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@php">PHP module</a>.', array('@php' => 'http://drupal.org/handbook/modules/php/')) .'</p>';
+ $output = '<p>' . t('The PHP filter adds the ability to include PHP code in posts. PHP is a general-purpose scripting language widely-used for web development; the content management system used by this website has been developed using PHP.') . '</p>';
+ $output .= '<p>' . t('Through the PHP filter, users with the proper permission may include custom PHP code within a page of the site. While this is a powerful and flexible feature if used by a trusted user with PHP experience, it is a significant and dangerous security risk in the hands of a malicious user. Even a trusted user may accidentally compromise the site by entering malformed or incorrect PHP code. Only the most trusted users should be granted permission to use the PHP filter, and all PHP code added through the PHP filter should be carefully examined before use.') . '</p>';
+ $output .= '<p>' . t('<a href="@drupal">Drupal.org</a> offers <a href="@php-snippets">some example PHP snippets</a>, or you can create your own with some PHP experience and knowledge of the Drupal system.', array('@drupal' => url('http://drupal.org'), '@php-snippets' => url('http://drupal.org/handbook/customization/php-snippets'))) . '</p>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@php">PHP module</a>.', array('@php' => 'http://drupal.org/handbook/modules/php/')) . '</p>';
return $output;
}
}
@@ -31,24 +31,24 @@ function php_filter_tips($delta, $format, $long = false) {
case 0:
return t('You may post PHP code. You should include &lt;?php ?&gt; tags.');
case 1:
- $output = '<h4>'. t('Using custom PHP code') .'</h4>';
- $output .= '<p>'. t('Custom PHP code may be embedded in some types of site content, including posts and blocks. While embedding PHP code inside a post or block is a powerful and flexible feature when used by a trusted user with PHP experience, it is a significant and dangerous security risk when used improperly. Even a small mistake when posting PHP code may accidentally compromise your site.') .'</p>';
- $output .= '<p>'. t('If you are unfamiliar with PHP, SQL, or Drupal, avoid using custom PHP code within posts. Experimenting with PHP may corrupt your database, render your site inoperable, or significantly compromise security.') .'</p>';
- $output .= '<p>'. t('Notes:') .'</p>';
- $output .= '<ul><li>'. t('Remember to double-check each line for syntax and logic errors <strong>before</strong> saving.') .'</li>';
- $output .= '<li>'. t('Statements must be correctly terminated with semicolons.') .'</li>';
- $output .= '<li>'. t('Global variables used within your PHP code retain their values after your script executes.') .'</li>';
- $output .= '<li>'. t('<code>register_globals</code> is <strong>turned off</strong>. If you need to use forms, understand and use the functions in <a href="@formapi">the Drupal Form API</a>.', array('@formapi' => url('http://api.drupal.org/api/group/form_api/7'))) .'</li>';
- $output .= '<li>'. t('Use a <code>print</code> or <code>return</code> statement in your code to output content.') .'</li>';
- $output .= '<li>'. t('Develop and test your PHP code using a separate test script and sample database before deploying on a production site.') .'</li>';
- $output .= '<li>'. t('Consider including your custom PHP code within a site-specific module or <code>template.php</code> file rather than embedding it directly into a post or block.') .'</li>';
- $output .= '<li>'. t('Be aware that the ability to embed PHP code within content is provided by the PHP Filter module. If this module is disabled or deleted, then blocks and posts with embedded PHP may display, rather than execute, the PHP code.') .'</li></ul>';
- $output .= '<p>'. t('A basic example: <em>Creating a "Welcome" block that greets visitors with a simple message.</em>') .'</p>';
- $output .= '<ul><li>'. t('<p>Add a custom block to your site, named "Welcome". With its input format set to "PHP code" (or another format supporting PHP input), add the following in the Block body:</p>
+ $output = '<h4>' . t('Using custom PHP code') . '</h4>';
+ $output .= '<p>' . t('Custom PHP code may be embedded in some types of site content, including posts and blocks. While embedding PHP code inside a post or block is a powerful and flexible feature when used by a trusted user with PHP experience, it is a significant and dangerous security risk when used improperly. Even a small mistake when posting PHP code may accidentally compromise your site.') . '</p>';
+ $output .= '<p>' . t('If you are unfamiliar with PHP, SQL, or Drupal, avoid using custom PHP code within posts. Experimenting with PHP may corrupt your database, render your site inoperable, or significantly compromise security.') . '</p>';
+ $output .= '<p>' . t('Notes:') . '</p>';
+ $output .= '<ul><li>' . t('Remember to double-check each line for syntax and logic errors <strong>before</strong> saving.') . '</li>';
+ $output .= '<li>' . t('Statements must be correctly terminated with semicolons.') . '</li>';
+ $output .= '<li>' . t('Global variables used within your PHP code retain their values after your script executes.') . '</li>';
+ $output .= '<li>' . t('<code>register_globals</code> is <strong>turned off</strong>. If you need to use forms, understand and use the functions in <a href="@formapi">the Drupal Form API</a>.', array('@formapi' => url('http://api.drupal.org/api/group/form_api/7'))) . '</li>';
+ $output .= '<li>' . t('Use a <code>print</code> or <code>return</code> statement in your code to output content.') . '</li>';
+ $output .= '<li>' . t('Develop and test your PHP code using a separate test script and sample database before deploying on a production site.') . '</li>';
+ $output .= '<li>' . t('Consider including your custom PHP code within a site-specific module or <code>template.php</code> file rather than embedding it directly into a post or block.') . '</li>';
+ $output .= '<li>' . t('Be aware that the ability to embed PHP code within content is provided by the PHP Filter module. If this module is disabled or deleted, then blocks and posts with embedded PHP may display, rather than execute, the PHP code.') . '</li></ul>';
+ $output .= '<p>' . t('A basic example: <em>Creating a "Welcome" block that greets visitors with a simple message.</em>') . '</p>';
+ $output .= '<ul><li>' . t('<p>Add a custom block to your site, named "Welcome" . With its input format set to "PHP code" (or another format supporting PHP input), add the following in the Block body:</p>
<pre>
print t(\'Welcome visitor! Thank you for visiting.\');
-</pre>') .'</li>';
- $output .= '<li>'. t('<p>To display the name of a registered user, use this instead:</p>
+</pre>') . '</li>';
+ $output .= '<li>' . t('<p>To display the name of a registered user, use this instead:</p>
<pre>
global $user;
if ($user->uid) {
@@ -57,8 +57,8 @@ if ($user->uid) {
else {
print t(\'Welcome visitor! Thank you for visiting.\');
}
-</pre>') .'</li></ul>';
- $output .= '<p>'. t('<a href="@drupal">Drupal.org</a> offers <a href="@php-snippets">some example PHP snippets</a>, or you can create your own with some PHP experience and knowledge of the Drupal system.', array('@drupal' => url('http://drupal.org'), '@php-snippets' => url('http://drupal.org/handbook/customization/php-snippets'))) .'</p>';
+</pre>') . '</li></ul>';
+ $output .= '<p>' . t('<a href="@drupal">Drupal.org</a> offers <a href="@php-snippets">some example PHP snippets</a>, or you can create your own with some PHP experience and knowledge of the Drupal system.', array('@drupal' => url('http://drupal.org'), '@php-snippets' => url('http://drupal.org/handbook/customization/php-snippets'))) . '</p>';
return $output;
}
}
diff --git a/modules/poll/poll.module b/modules/poll/poll.module
index 615e0fd9f..c43fc61dd 100644
--- a/modules/poll/poll.module
+++ b/modules/poll/poll.module
@@ -13,9 +13,9 @@
function poll_help($path, $arg) {
switch ($path) {
case 'admin/help#poll':
- $output = '<p>'. t('The poll module can be used to create simple polls for site users. A poll is a simple, multiple choice questionnaire which displays the cumulative results of the answers to the poll. Having polls on the site is a good way to receive feedback from community members.') .'</p>';
- $output .= '<p>'. t('When creating a poll, enter the question being posed, as well as the potential choices (and beginning vote counts for each choice). The status and duration (length of time the poll remains active for new votes) can also be specified. Use the <a href="@poll">poll</a> menu item to view all current polls. To vote in or view the results of a specific poll, click on the poll itself.', array('@poll' => url('poll'))) .'</p>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@poll">Poll module</a>.', array('@poll' => 'http://drupal.org/handbook/modules/poll/')) .'</p>';
+ $output = '<p>' . t('The poll module can be used to create simple polls for site users. A poll is a simple, multiple choice questionnaire which displays the cumulative results of the answers to the poll. Having polls on the site is a good way to receive feedback from community members.') . '</p>';
+ $output .= '<p>' . t('When creating a poll, enter the question being posed, as well as the potential choices (and beginning vote counts for each choice). The status and duration (length of time the poll remains active for new votes) can also be specified. Use the <a href="@poll">poll</a> menu item to view all current polls. To vote in or view the results of a specific poll, click on the poll itself.', array('@poll' => url('poll'))) . '</p>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@poll">Poll module</a>.', array('@poll' => 'http://drupal.org/handbook/modules/poll/')) . '</p>';
return $output;
}
}
@@ -24,7 +24,7 @@ function poll_help($path, $arg) {
* Implementation of hook_init().
*/
function poll_init() {
- drupal_add_css(drupal_get_path('module', 'poll') .'/poll.css');
+ drupal_add_css(drupal_get_path('module', 'poll') . '/poll.css');
}
/**
@@ -164,7 +164,7 @@ function poll_block($op = 'list', $delta = '') {
* Closes polls that have exceeded their allowed runtime.
*/
function poll_cron() {
- $result = db_query('SELECT p.nid FROM {poll} p INNER JOIN {node} n ON p.nid = n.nid WHERE (n.created + p.runtime) < '. time() .' AND p.active = 1 AND p.runtime != 0');
+ $result = db_query('SELECT p.nid FROM {poll} p INNER JOIN {node} n ON p.nid = n.nid WHERE (n.created + p.runtime) < ' . time() . ' AND p.active = 1 AND p.runtime != 0');
while ($poll = db_fetch_object($result)) {
db_query("UPDATE {poll} SET active = 0 WHERE nid = %d", $poll->nid);
}
@@ -359,7 +359,7 @@ function poll_choice_js() {
// Render the new output.
$choice_form = $form['choice_wrapper']['choice'];
unset($choice_form['#prefix'], $choice_form['#suffix']); // Prevent duplicate wrappers.
- $choice_form[$delta]['#attributes']['class'] = empty($choice_form[$delta]['#attributes']['class']) ? 'ahah-new-content' : $choice_form[$delta]['#attributes']['class'] .' ahah-new-content';
+ $choice_form[$delta]['#attributes']['class'] = empty($choice_form[$delta]['#attributes']['class']) ? 'ahah-new-content' : $choice_form[$delta]['#attributes']['class'] . ' ahah-new-content';
$choice_form[$delta]['chvotes']['#value'] = 0;
$output = theme('status_messages') . drupal_render($choice_form);
@@ -517,7 +517,7 @@ function poll_view($node, $teaser = FALSE, $page = FALSE, $block = FALSE) {
$links = module_invoke_all('link', 'node', $node, 1);
$links[] = array('title' => t('Older polls'), 'href' => 'poll', 'attributes' => array('title' => t('View the list of polls on this site.')));
if ($node->allowvotes && $block) {
- $links[] = array('title' => t('Results'), 'href' => 'node/'. $node->nid .'/results', 'attributes' => array('title' => t('View the current poll results.')));
+ $links[] = array('title' => t('Results'), 'href' => 'node/' . $node->nid . '/results', 'attributes' => array('title' => t('View the current poll results.')));
}
$node->links = $links;
@@ -546,7 +546,7 @@ function poll_teaser($node) {
if (is_array($node->choice)) {
foreach ($node->choice as $k => $choice) {
if ($choice['chtext'] != '') {
- $teaser .= '* '. check_plain($choice['chtext']) ."\n";
+ $teaser .= '* ' . check_plain($choice['chtext']) . "\n";
}
}
}
@@ -676,7 +676,7 @@ function poll_view_results(&$node, $teaser, $page, $block) {
*/
function theme_poll_choices($form) {
// Change the button title to reflect the behavior when using JavaScript.
- drupal_add_js('if (Drupal.jsEnabled) { $(document).ready(function() { $("#edit-poll-more").val("'. t('Add another choice') .'"); }); }', 'inline');
+ drupal_add_js('if (Drupal.jsEnabled) { $(document).ready(function() { $("#edit-poll-more").val("' . t('Add another choice') . '"); }); }', 'inline');
$rows = array();
$headers = array(
diff --git a/modules/poll/poll.pages.inc b/modules/poll/poll.pages.inc
index 597073578..c5895f902 100644
--- a/modules/poll/poll.pages.inc
+++ b/modules/poll/poll.pages.inc
@@ -17,7 +17,7 @@ function poll_page() {
$result = pager_query($sql, 15, 0, $count_sql);
$output = '<ul>';
while ($node = db_fetch_object($result)) {
- $output .= '<li>'. l($node->title, "node/$node->nid") .' - '. format_plural($node->votes, '1 vote', '@count votes') .' - '. ($node->active ? t('open') : t('closed')) .'</li>';
+ $output .= '<li>' . l($node->title, "node/$node->nid") . ' - ' . format_plural($node->votes, '1 vote', '@count votes') . ' - ' . ($node->active ? t('open') : t('closed')) . '</li>';
}
$output .= '</ul>';
$output .= theme("pager", NULL, 15);
@@ -34,7 +34,7 @@ function poll_votes($node) {
$header[] = array('data' => t('Visitor'), 'field' => 'u.name');
$header[] = array('data' => t('Vote'), 'field' => 'pv.chorder');
- $result = pager_query("SELECT pv.chorder, pv.uid, pv.hostname, u.name FROM {poll_votes} pv LEFT JOIN {users} u ON pv.uid = u.uid WHERE pv.nid = %d". tablesort_sql($header), 20, 0, NULL, $node->nid);
+ $result = pager_query("SELECT pv.chorder, pv.uid, pv.hostname, u.name FROM {poll_votes} pv LEFT JOIN {users} u ON pv.uid = u.uid WHERE pv.nid = %d" . tablesort_sql($header), 20, 0, NULL, $node->nid);
$rows = array();
while ($vote = db_fetch_object($result)) {
$rows[] = array(
diff --git a/modules/profile/profile.admin.inc b/modules/profile/profile.admin.inc
index 490b48e91..dd355c47b 100644
--- a/modules/profile/profile.admin.inc
+++ b/modules/profile/profile.admin.inc
@@ -52,10 +52,10 @@ function profile_admin_overview() {
}
$form['#tree'] = TRUE;
- $addnewfields = '<h2>'. t('Add new field') .'</h2>';
+ $addnewfields = '<h2>' . t('Add new field') . '</h2>';
$addnewfields .= '<ul>';
foreach (_profile_field_types() as $key => $value) {
- $addnewfields .= '<li>'. l($value, "admin/user/profile/add/$key") .'</li>';
+ $addnewfields .= '<li>' . l($value, "admin/user/profile/add/$key") . '</li>';
}
$addnewfields .= '</ul>';
$form['addnewfields'] = array('#value' => $addnewfields);
@@ -91,10 +91,10 @@ function profile_admin_overview_submit($form, &$form_state) {
* @see profile_admin_overview()
*/
function theme_profile_admin_overview($form) {
- drupal_add_css(drupal_get_path('module', 'profile') .'/profile.css');
+ drupal_add_css(drupal_get_path('module', 'profile') . '/profile.css');
// Add javascript if there's more than one field.
if (isset($form['submit'])) {
- drupal_add_js(drupal_get_path('module', 'profile') .'/profile.js');
+ drupal_add_js(drupal_get_path('module', 'profile') . '/profile.js');
}
$rows = array();
@@ -110,21 +110,21 @@ function theme_profile_admin_overview($form) {
// Category classes are given numeric IDs because there's no guarantee
// class names won't contain invalid characters.
$categories[$category] = $category_number;
- $category_field['#attributes']['class'] = 'profile-category profile-category-'. $category_number;
+ $category_field['#attributes']['class'] = 'profile-category profile-category-' . $category_number;
$rows[] = array(array('data' => $category, 'colspan' => 7, 'class' => 'category'));
- $rows[] = array('data' => array(array('data' => '<em>'. t('No fields in this category. If this category remains empty when saved, it will be removed.') .'</em>', 'colspan' => 7)), 'class' => 'category-'. $category_number .'-message category-message category-populated');
+ $rows[] = array('data' => array(array('data' => '<em>' . t('No fields in this category. If this category remains empty when saved, it will be removed.') . '</em>', 'colspan' => 7)), 'class' => 'category-' . $category_number . '-message category-message category-populated');
// Make it dragable only if there is more than one field
if (isset($form['submit'])) {
- drupal_add_tabledrag('profile-fields', 'order', 'sibling', 'profile-weight', 'profile-weight-'. $category_number);
- drupal_add_tabledrag('profile-fields', 'match', 'sibling', 'profile-category', 'profile-category-'. $category_number);
+ drupal_add_tabledrag('profile-fields', 'order', 'sibling', 'profile-weight', 'profile-weight-' . $category_number);
+ drupal_add_tabledrag('profile-fields', 'match', 'sibling', 'profile-category', 'profile-category-' . $category_number);
}
$category_number++;
}
// Add special drag and drop classes that group fields together.
- $field['weight']['#attributes']['class'] = 'profile-weight profile-weight-'. $categories[$category];
- $field['category']['#attributes']['class'] = 'profile-category profile-category-'. $categories[$category];
+ $field['weight']['#attributes']['class'] = 'profile-weight profile-weight-' . $categories[$category];
+ $field['category']['#attributes']['class'] = 'profile-category profile-category-' . $categories[$category];
// Add the row
$row = array();
@@ -251,14 +251,14 @@ Unless you know what you are doing, it is highly recommended that you prefix the
$form['fields']['page'] = array('#type' => 'textfield',
'#title' => t('Page title'),
'#default_value' => $edit['page'],
- '#description' => t('To enable browsing this field by value, enter a title for the resulting page. The word <code>%value</code> will be substituted with the corresponding value. An example page title is "People whose favorite color is %value". This is only applicable for a public field.'),
+ '#description' => t('To enable browsing this field by value, enter a title for the resulting page. The word <code>%value</code> will be substituted with the corresponding value. An example page title is "People whose favorite color is %value" . This is only applicable for a public field.'),
);
}
else if ($type == 'checkbox') {
$form['fields']['page'] = array('#type' => 'textfield',
'#title' => t('Page title'),
'#default_value' => $edit['page'],
- '#description' => t('To enable browsing this field by value, enter a title for the resulting page. An example page title is "People who are employed". This is only applicable for a public field.'),
+ '#description' => t('To enable browsing this field by value, enter a title for the resulting page. An example page title is "People who are employed" . This is only applicable for a public field.'),
);
}
$form['fields']['weight'] = array('#type' => 'weight',
@@ -313,10 +313,10 @@ function profile_field_form_validate($form, &$form_state) {
$query_suffix = ' AND fid != %d';
}
- if (db_result(db_query("SELECT fid FROM {profile_fields} WHERE title = '%s' AND category = '%s'". $query_suffix, $args1))) {
+ if (db_result(db_query("SELECT fid FROM {profile_fields} WHERE title = '%s' AND category = '%s'" . $query_suffix, $args1))) {
form_set_error('title', t('The specified title is already in use.'));
}
- if (db_result(db_query("SELECT fid FROM {profile_fields} WHERE name = '%s'". $query_suffix, $args2))) {
+ if (db_result(db_query("SELECT fid FROM {profile_fields} WHERE name = '%s'" . $query_suffix, $args2))) {
form_set_error('name', t('The specified name is already in use.'));
}
if ($form_state['values']['visibility'] == PROFILE_HIDDEN) {
@@ -371,7 +371,7 @@ function profile_field_delete(&$form_state, $fid) {
return confirm_form($form,
t('Are you sure you want to delete the field %field?', array('%field' => $field->title)), 'admin/user/profile',
- t('This action cannot be undone. If users have entered values into this field in their profile, these entries will also be deleted. If you want to keep the user-entered data, instead of deleting the field you may wish to <a href="@edit-field">edit this field</a> and change it to a hidden profile field so that it may only be accessed by administrators.', array('@edit-field' => url('admin/user/profile/edit/'. $fid))),
+ t('This action cannot be undone. If users have entered values into this field in their profile, these entries will also be deleted. If you want to keep the user-entered data, instead of deleting the field you may wish to <a href="@edit-field">edit this field</a> and change it to a hidden profile field so that it may only be accessed by administrators.', array('@edit-field' => url('admin/user/profile/edit/' . $fid))),
t('Delete'), t('Cancel'));
}
diff --git a/modules/profile/profile.module b/modules/profile/profile.module
index 6031afbb0..feecd0a79 100644
--- a/modules/profile/profile.module
+++ b/modules/profile/profile.module
@@ -32,19 +32,19 @@ define('PROFILE_HIDDEN', 4);
function profile_help($path, $arg) {
switch ($path) {
case 'admin/help#profile':
- $output = '<p>'. t('The profile module allows custom fields (such as country, full name, or age) to be defined and displayed in the <em>My Account</em> section. This permits users of a site to share more information about themselves, and can help community-based sites organize users around specific information.') .'</p>';
- $output .= '<p>'. t('The following types of fields can be added to a user profile:') .'</p>';
- $output .= '<ul><li>'. t('single-line textfield') .'</li>';
- $output .= '<li>'. t('multi-line textfield') .'</li>';
- $output .= '<li>'. t('checkbox') .'</li>';
- $output .= '<li>'. t('list selection') .'</li>';
- $output .= '<li>'. t('freeform list') .'</li>';
- $output .= '<li>'. t('URL') .'</li>';
- $output .= '<li>'. t('date') .'</li></ul>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@profile">Profile module</a>.', array('@profile' => 'http://drupal.org/handbook/modules/profile/')) .'</p>';
+ $output = '<p>' . t('The profile module allows custom fields (such as country, full name, or age) to be defined and displayed in the <em>My Account</em> section. This permits users of a site to share more information about themselves, and can help community-based sites organize users around specific information.') . '</p>';
+ $output .= '<p>' . t('The following types of fields can be added to a user profile:') . '</p>';
+ $output .= '<ul><li>' . t('single-line textfield') . '</li>';
+ $output .= '<li>' . t('multi-line textfield') . '</li>';
+ $output .= '<li>' . t('checkbox') . '</li>';
+ $output .= '<li>' . t('list selection') . '</li>';
+ $output .= '<li>' . t('freeform list') . '</li>';
+ $output .= '<li>' . t('URL') . '</li>';
+ $output .= '<li>' . t('date') . '</li></ul>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@profile">Profile module</a>.', array('@profile' => 'http://drupal.org/handbook/modules/profile/')) . '</p>';
return $output;
case 'admin/user/profile':
- return '<p>'. t("This page displays a list of the existing custom profile fields to be displayed on a user's <em>My Account</em> page. To provide structure, similar or related fields may be placed inside a category. To add a new category (or edit an existing one), edit a profile field and provide a new category name. To change the category of a field or the order of fields within a category, grab a drag-and-drop handle under the Title column and drag the field to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the <em>Save configuration</em> button at the bottom of the page.") .'</p>';
+ return '<p>' . t("This page displays a list of the existing custom profile fields to be displayed on a user's <em>My Account</em> page. To provide structure, similar or related fields may be placed inside a category. To add a new category (or edit an existing one), edit a profile field and provide a new category name. To change the category of a field or the order of fields within a category, grab a drag-and-drop handle under the Title column and drag the field to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the <em>Save configuration</em> button at the bottom of the page.") . '</p>';
}
}
@@ -183,7 +183,7 @@ function profile_block($op = 'list', $delta = '', $edit = array()) {
}
if (isset($use_fields['user_profile']) && $use_fields['user_profile']) {
- $output .= '<div>'. l(t('View full user profile'), 'user/'. $account->uid) .'</div>';
+ $output .= '<div>' . l(t('View full user profile'), 'user/' . $account->uid) . '</div>';
}
}
@@ -258,11 +258,11 @@ function profile_view_field($user, $field) {
return check_markup($value);
case 'textfield':
case 'selection':
- return $browse ? l($value, 'profile/'. $field->name .'/'. $value) : check_plain($value);
+ return $browse ? l($value, 'profile/' . $field->name . '/' . $value) : check_plain($value);
case 'checkbox':
- return $browse ? l($field->title, 'profile/'. $field->name) : check_plain($field->title);
+ return $browse ? l($field->title, 'profile/' . $field->name) : check_plain($field->title);
case 'url':
- return '<a href="'. check_url($value) .'">'. check_plain($value) .'</a>';
+ return '<a href="' . check_url($value) . '">' . check_plain($value) . '</a>';
case 'date':
$format = substr(variable_get('date_format_short', 'm/d/Y - H:i'), 0, 5);
// Note: Avoid PHP's date() because it does not handle dates before
@@ -283,7 +283,7 @@ function profile_view_field($user, $field) {
$fields = array();
foreach ($values as $value) {
if ($value = trim($value)) {
- $fields[] = $browse ? l($value, 'profile/'. $field->name .'/'. $value) : check_plain($value);
+ $fields[] = $browse ? l($value, 'profile/' . $field->name . '/' . $value) : check_plain($value);
}
}
return implode(', ', $fields);
@@ -321,7 +321,7 @@ function profile_view_profile(&$user) {
'#title' => $title,
'#value' => $value,
'#weight' => $field->weight,
- '#attributes' => array('class' => 'profile-'. $field->name),
+ '#attributes' => array('class' => 'profile-' . $field->name),
);
}
}
@@ -331,11 +331,11 @@ function _profile_form_explanation($field) {
$output = $field->explanation;
if ($field->type == 'list') {
- $output .= ' '. t('Put each item on a separate line or separate them by commas. No HTML allowed.');
+ $output .= ' ' . t('Put each item on a separate line or separate them by commas. No HTML allowed.');
}
if ($field->visibility == PROFILE_PRIVATE) {
- $output .= ' '. t('The content of this field is kept private and will not be shown publicly.');
+ $output .= ' ' . t('The content of this field is kept private and will not be shown publicly.');
}
return $output;
@@ -361,7 +361,7 @@ function profile_form_profile($edit, $user, $category, $register = FALSE) {
'#required' => $field->required,
);
if ($field->autocomplete) {
- $fields[$category][$field->name]['#autocomplete_path'] = "profile/autocomplete/". $field->fid;
+ $fields[$category][$field->name]['#autocomplete_path'] = "profile/autocomplete/" . $field->fid;
}
break;
case 'textarea':
@@ -534,7 +534,7 @@ function template_preprocess_profile_wrapper(&$variables) {
if ($field = arg(1)) {
$variables['current_field'] = $field;
// Supply an alternate template suggestion based on the browsable field.
- $variables['template_files'][] = 'profile-wrapper-'. $field;
+ $variables['template_files'][] = 'profile-wrapper-' . $field;
}
}
diff --git a/modules/search/search.admin.inc b/modules/search/search.admin.inc
index 6e57c653e..97631eb7b 100644
--- a/modules/search/search.admin.inc
+++ b/modules/search/search.admin.inc
@@ -45,8 +45,8 @@ function search_admin_settings() {
}
}
$count = format_plural($remaining, 'There is 1 item left to index.', 'There are @count items left to index.');
- $percentage = ((int)min(100, 100 * ($total - $remaining) / max(1, $total))) .'%';
- $status = '<p><strong>'. t('%percentage of the site has been indexed.', array('%percentage' => $percentage)) .' '. $count .'</strong></p>';
+ $percentage = ((int)min(100, 100 * ($total - $remaining) / max(1, $total))) . '%';
+ $status = '<p><strong>' . t('%percentage of the site has been indexed.', array('%percentage' => $percentage)) . ' ' . $count . '</strong></p>';
$form['status'] = array('#type' => 'fieldset', '#title' => t('Indexing status'));
$form['status']['status'] = array('#value' => $status);
$form['status']['wipe'] = array('#type' => 'submit', '#value' => t('Re-index site'));
diff --git a/modules/search/search.module b/modules/search/search.module
index 052b1de63..76d5d98c6 100644
--- a/modules/search/search.module
+++ b/modules/search/search.module
@@ -20,32 +20,32 @@
* No Number, Other
*/
define('PREG_CLASS_SEARCH_EXCLUDE',
-'\x{0}-\x{2f}\x{3a}-\x{40}\x{5b}-\x{60}\x{7b}-\x{bf}\x{d7}\x{f7}\x{2b0}-'.
-'\x{385}\x{387}\x{3f6}\x{482}-\x{489}\x{559}-\x{55f}\x{589}-\x{5c7}\x{5f3}-'.
-'\x{61f}\x{640}\x{64b}-\x{65e}\x{66a}-\x{66d}\x{670}\x{6d4}\x{6d6}-\x{6ed}'.
-'\x{6fd}\x{6fe}\x{700}-\x{70f}\x{711}\x{730}-\x{74a}\x{7a6}-\x{7b0}\x{901}-'.
-'\x{903}\x{93c}\x{93e}-\x{94d}\x{951}-\x{954}\x{962}-\x{965}\x{970}\x{981}-'.
-'\x{983}\x{9bc}\x{9be}-\x{9cd}\x{9d7}\x{9e2}\x{9e3}\x{9f2}-\x{a03}\x{a3c}-'.
-'\x{a4d}\x{a70}\x{a71}\x{a81}-\x{a83}\x{abc}\x{abe}-\x{acd}\x{ae2}\x{ae3}'.
-'\x{af1}-\x{b03}\x{b3c}\x{b3e}-\x{b57}\x{b70}\x{b82}\x{bbe}-\x{bd7}\x{bf0}-'.
-'\x{c03}\x{c3e}-\x{c56}\x{c82}\x{c83}\x{cbc}\x{cbe}-\x{cd6}\x{d02}\x{d03}'.
-'\x{d3e}-\x{d57}\x{d82}\x{d83}\x{dca}-\x{df4}\x{e31}\x{e34}-\x{e3f}\x{e46}-'.
-'\x{e4f}\x{e5a}\x{e5b}\x{eb1}\x{eb4}-\x{ebc}\x{ec6}-\x{ecd}\x{f01}-\x{f1f}'.
-'\x{f2a}-\x{f3f}\x{f71}-\x{f87}\x{f90}-\x{fd1}\x{102c}-\x{1039}\x{104a}-'.
-'\x{104f}\x{1056}-\x{1059}\x{10fb}\x{10fc}\x{135f}-\x{137c}\x{1390}-\x{1399}'.
-'\x{166d}\x{166e}\x{1680}\x{169b}\x{169c}\x{16eb}-\x{16f0}\x{1712}-\x{1714}'.
-'\x{1732}-\x{1736}\x{1752}\x{1753}\x{1772}\x{1773}\x{17b4}-\x{17db}\x{17dd}'.
-'\x{17f0}-\x{180e}\x{1843}\x{18a9}\x{1920}-\x{1945}\x{19b0}-\x{19c0}\x{19c8}'.
-'\x{19c9}\x{19de}-\x{19ff}\x{1a17}-\x{1a1f}\x{1d2c}-\x{1d61}\x{1d78}\x{1d9b}-'.
-'\x{1dc3}\x{1fbd}\x{1fbf}-\x{1fc1}\x{1fcd}-\x{1fcf}\x{1fdd}-\x{1fdf}\x{1fed}-'.
-'\x{1fef}\x{1ffd}-\x{2070}\x{2074}-\x{207e}\x{2080}-\x{2101}\x{2103}-\x{2106}'.
-'\x{2108}\x{2109}\x{2114}\x{2116}-\x{2118}\x{211e}-\x{2123}\x{2125}\x{2127}'.
-'\x{2129}\x{212e}\x{2132}\x{213a}\x{213b}\x{2140}-\x{2144}\x{214a}-\x{2b13}'.
-'\x{2ce5}-\x{2cff}\x{2d6f}\x{2e00}-\x{3005}\x{3007}-\x{303b}\x{303d}-\x{303f}'.
-'\x{3099}-\x{309e}\x{30a0}\x{30fb}-\x{30fe}\x{3190}-\x{319f}\x{31c0}-\x{31cf}'.
-'\x{3200}-\x{33ff}\x{4dc0}-\x{4dff}\x{a015}\x{a490}-\x{a716}\x{a802}\x{a806}'.
-'\x{a80b}\x{a823}-\x{a82b}\x{d800}-\x{f8ff}\x{fb1e}\x{fb29}\x{fd3e}\x{fd3f}'.
-'\x{fdfc}-\x{fe6b}\x{feff}-\x{ff0f}\x{ff1a}-\x{ff20}\x{ff3b}-\x{ff40}\x{ff5b}-'.
+'\x{0}-\x{2f}\x{3a}-\x{40}\x{5b}-\x{60}\x{7b}-\x{bf}\x{d7}\x{f7}\x{2b0}-' .
+'\x{385}\x{387}\x{3f6}\x{482}-\x{489}\x{559}-\x{55f}\x{589}-\x{5c7}\x{5f3}-' .
+'\x{61f}\x{640}\x{64b}-\x{65e}\x{66a}-\x{66d}\x{670}\x{6d4}\x{6d6}-\x{6ed}' .
+'\x{6fd}\x{6fe}\x{700}-\x{70f}\x{711}\x{730}-\x{74a}\x{7a6}-\x{7b0}\x{901}-' .
+'\x{903}\x{93c}\x{93e}-\x{94d}\x{951}-\x{954}\x{962}-\x{965}\x{970}\x{981}-' .
+'\x{983}\x{9bc}\x{9be}-\x{9cd}\x{9d7}\x{9e2}\x{9e3}\x{9f2}-\x{a03}\x{a3c}-' .
+'\x{a4d}\x{a70}\x{a71}\x{a81}-\x{a83}\x{abc}\x{abe}-\x{acd}\x{ae2}\x{ae3}' .
+'\x{af1}-\x{b03}\x{b3c}\x{b3e}-\x{b57}\x{b70}\x{b82}\x{bbe}-\x{bd7}\x{bf0}-' .
+'\x{c03}\x{c3e}-\x{c56}\x{c82}\x{c83}\x{cbc}\x{cbe}-\x{cd6}\x{d02}\x{d03}' .
+'\x{d3e}-\x{d57}\x{d82}\x{d83}\x{dca}-\x{df4}\x{e31}\x{e34}-\x{e3f}\x{e46}-' .
+'\x{e4f}\x{e5a}\x{e5b}\x{eb1}\x{eb4}-\x{ebc}\x{ec6}-\x{ecd}\x{f01}-\x{f1f}' .
+'\x{f2a}-\x{f3f}\x{f71}-\x{f87}\x{f90}-\x{fd1}\x{102c}-\x{1039}\x{104a}-' .
+'\x{104f}\x{1056}-\x{1059}\x{10fb}\x{10fc}\x{135f}-\x{137c}\x{1390}-\x{1399}' .
+'\x{166d}\x{166e}\x{1680}\x{169b}\x{169c}\x{16eb}-\x{16f0}\x{1712}-\x{1714}' .
+'\x{1732}-\x{1736}\x{1752}\x{1753}\x{1772}\x{1773}\x{17b4}-\x{17db}\x{17dd}' .
+'\x{17f0}-\x{180e}\x{1843}\x{18a9}\x{1920}-\x{1945}\x{19b0}-\x{19c0}\x{19c8}' .
+'\x{19c9}\x{19de}-\x{19ff}\x{1a17}-\x{1a1f}\x{1d2c}-\x{1d61}\x{1d78}\x{1d9b}-' .
+'\x{1dc3}\x{1fbd}\x{1fbf}-\x{1fc1}\x{1fcd}-\x{1fcf}\x{1fdd}-\x{1fdf}\x{1fed}-' .
+'\x{1fef}\x{1ffd}-\x{2070}\x{2074}-\x{207e}\x{2080}-\x{2101}\x{2103}-\x{2106}' .
+'\x{2108}\x{2109}\x{2114}\x{2116}-\x{2118}\x{211e}-\x{2123}\x{2125}\x{2127}' .
+'\x{2129}\x{212e}\x{2132}\x{213a}\x{213b}\x{2140}-\x{2144}\x{214a}-\x{2b13}' .
+'\x{2ce5}-\x{2cff}\x{2d6f}\x{2e00}-\x{3005}\x{3007}-\x{303b}\x{303d}-\x{303f}' .
+'\x{3099}-\x{309e}\x{30a0}\x{30fb}-\x{30fe}\x{3190}-\x{319f}\x{31c0}-\x{31cf}' .
+'\x{3200}-\x{33ff}\x{4dc0}-\x{4dff}\x{a015}\x{a490}-\x{a716}\x{a802}\x{a806}' .
+'\x{a80b}\x{a823}-\x{a82b}\x{d800}-\x{f8ff}\x{fb1e}\x{fb29}\x{fd3e}\x{fd3f}' .
+'\x{fdfc}-\x{fe6b}\x{feff}-\x{ff0f}\x{ff1a}-\x{ff20}\x{ff3b}-\x{ff40}\x{ff5b}-' .
'\x{ff65}\x{ff70}\x{ff9e}\x{ff9f}\x{ffe0}-\x{fffd}');
/**
@@ -87,7 +87,7 @@ define('PREG_CLASS_PUNCTUATION',
* (Chinese, Japanese, Korean).
* Contains kana and BMP ideographs.
*/
-define('PREG_CLASS_CJK', '\x{3041}-\x{30ff}\x{31f0}-\x{31ff}\x{3400}-\x{4db5}'.
+define('PREG_CLASS_CJK', '\x{3041}-\x{30ff}\x{31f0}-\x{31ff}\x{3400}-\x{4db5}' .
'\x{4e00}-\x{9fbb}\x{f900}-\x{fad9}');
/**
@@ -96,12 +96,12 @@ define('PREG_CLASS_CJK', '\x{3041}-\x{30ff}\x{31f0}-\x{31ff}\x{3400}-\x{4db5}'.
function search_help($path, $arg) {
switch ($path) {
case 'admin/help#search':
- $output = '<p>'. t('The search module adds the ability to search for content by keywords. Search is often the only practical way to find content on a large site, and is useful for finding both users and posts.') .'</p>';
- $output .= '<p>'. t('To provide keyword searching, the search engine maintains an index of words found in your site\'s content. To build and maintain this index, a correctly configured <a href="@cron">cron maintenance task</a> is required. Indexing behavior can be adjusted using the <a href="@searchsettings">search settings page</a>; for example, the <em>Number of items to index per cron run</em> sets the maximum number of items indexed in each pass of a <a href="@cron">cron maintenance task</a>. If necessary, reduce this number to prevent timeouts and memory errors when indexing.', array('@cron' => url('admin/reports/status'), '@searchsettings' => url('admin/settings/search'))) .'</p>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@search">Search module</a>.', array('@search' => 'http://drupal.org/handbook/modules/search/')) .'</p>';
+ $output = '<p>' . t('The search module adds the ability to search for content by keywords. Search is often the only practical way to find content on a large site, and is useful for finding both users and posts.') . '</p>';
+ $output .= '<p>' . t('To provide keyword searching, the search engine maintains an index of words found in your site\'s content. To build and maintain this index, a correctly configured <a href="@cron">cron maintenance task</a> is required. Indexing behavior can be adjusted using the <a href="@searchsettings">search settings page</a>; for example, the <em>Number of items to index per cron run</em> sets the maximum number of items indexed in each pass of a <a href="@cron">cron maintenance task</a>. If necessary, reduce this number to prevent timeouts and memory errors when indexing.', array('@cron' => url('admin/reports/status'), '@searchsettings' => url('admin/settings/search'))) . '</p>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@search">Search module</a>.', array('@search' => 'http://drupal.org/handbook/modules/search/')) . '</p>';
return $output;
case 'admin/settings/search':
- return '<p>'. t('The search engine maintains an index of words found in your site\'s content. To build and maintain this index, a correctly configured <a href="@cron">cron maintenance task</a> is required. Indexing behavior can be adjusted using the settings below.', array('@cron' => url('admin/reports/status'))) .'</p>';
+ return '<p>' . t('The search engine maintains an index of words found in your site\'s content. To build and maintain this index, a correctly configured <a href="@cron">cron maintenance task</a> is required. Indexing behavior can be adjusted using the settings below.', array('@cron' => url('admin/reports/status'))) . '</p>';
case 'search#noresults':
return t('<ul>
<li>Check if your spelling is correct.</li>
@@ -203,7 +203,7 @@ function search_menu() {
);
foreach (module_implements('search') as $name) {
- $items['search/'. $name .'/%menu_tail'] = array(
+ $items['search/' . $name . '/%menu_tail'] = array(
'title callback' => 'module_invoke',
'title arguments' => array($name, 'search', 'name', TRUE),
'page callback' => 'search_view',
@@ -317,7 +317,7 @@ function search_simplify($text) {
// Simple CJK handling
if (variable_get('overlap_cjk', TRUE)) {
- $text = preg_replace_callback('/['. PREG_CLASS_CJK .']+/u', 'search_expand_cjk', $text);
+ $text = preg_replace_callback('/[' . PREG_CLASS_CJK . ']+/u', 'search_expand_cjk', $text);
}
// To improve searching for numerical data such as dates, IP addresses
@@ -326,7 +326,7 @@ function search_simplify($text) {
// This also means that searching for e.g. '20/03/1984' also returns
// results with '20-03-1984' in them.
// Readable regexp: ([number]+)[punctuation]+(?=[number])
- $text = preg_replace('/(['. PREG_CLASS_NUMBERS .']+)['. PREG_CLASS_PUNCTUATION .']+(?=['. PREG_CLASS_NUMBERS .'])/u', '\1', $text);
+ $text = preg_replace('/([' . PREG_CLASS_NUMBERS . ']+)[' . PREG_CLASS_PUNCTUATION . ']+(?=[' . PREG_CLASS_NUMBERS . '])/u', '\1', $text);
// The dot, underscore and dash are simply removed. This allows meaningful
// search behavior with acronyms and URLs.
@@ -334,7 +334,7 @@ function search_simplify($text) {
// With the exception of the rules above, we consider all punctuation,
// marks, spacers, etc, to be a word boundary.
- $text = preg_replace('/['. PREG_CLASS_SEARCH_EXCLUDE .']+/u', ' ', $text);
+ $text = preg_replace('/[' . PREG_CLASS_SEARCH_EXCLUDE . ']+/u', ' ', $text);
return $text;
}
@@ -349,7 +349,7 @@ function search_expand_cjk($matches) {
$l = drupal_strlen($str);
// Passthrough short words
if ($l <= $min) {
- return ' '. $str .' ';
+ return ' ' . $str . ' ';
}
$tokens = ' ';
// FIFO queue of characters
@@ -361,7 +361,7 @@ function search_expand_cjk($matches) {
$str = substr($str, strlen($current));
$chars[] = $current;
if ($i >= $min - 1) {
- $tokens .= implode('', $chars) .' ';
+ $tokens .= implode('', $chars) . ' ';
array_shift($chars);
}
}
@@ -425,7 +425,7 @@ function search_index($sid, $type, $text) {
// Link matching
global $base_url;
- $node_regexp = '@href=[\'"]?(?:'. preg_quote($base_url, '@') .'/|'. preg_quote(base_path(), '@') .')(?:\?q=)?/?((?![a-z]+:)[^\'">]+)[\'">]@i';
+ $node_regexp = '@href=[\'"]?(?:' . preg_quote($base_url, '@') . '/|' . preg_quote(base_path(), '@') . ')(?:\?q=)?/?((?![a-z]+:)[^\'">]+)[\'">]@i';
// Multipliers for scores of words inside certain HTML tags.
// Note: 'a' must be included for link ranking to work.
@@ -445,7 +445,7 @@ function search_index($sid, $type, $text) {
// Strip off all ignored tags to speed up processing, but insert space before/after
// them to keep word boundaries.
$text = str_replace(array('<', '>'), array(' <', '> '), $text);
- $text = strip_tags($text, '<'. implode('><', array_keys($tags)) .'>');
+ $text = strip_tags($text, '<' . implode('><', array_keys($tags)) . '>');
// Split HTML tags from plain text.
$split = preg_split('/\s*<([^>]+?)>\s*/', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
@@ -528,7 +528,7 @@ function search_index($sid, $type, $text) {
$words = search_index_split($value);
foreach ($words as $word) {
// Add word to accumulator
- $accum .= $word .' ';
+ $accum .= $word . ' ';
$num = is_numeric($word);
// Check wordlength
if ($num || drupal_strlen($word) >= $minimum_word_size) {
@@ -639,7 +639,7 @@ function search_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
while ($link = db_fetch_object($result)) {
$output[] = $link->caption;
}
- return '<a>('. implode(', ', $output) .')</a>';
+ return '<a>(' . implode(', ', $output) . ')</a>';
// Reindex the node when it is updated. The node is automatically indexed
// when it is added, simply by being added to the node table.
case 'update':
@@ -668,7 +668,7 @@ function search_comment($a1, $op) {
* Extract a module-specific search option from a search query. e.g. 'type:book'
*/
function search_query_extract($keys, $option) {
- if (preg_match('/(^| )'. $option .':([^ ]*)( |$)/i', $keys, $matches)) {
+ if (preg_match('/(^| )' . $option . ':([^ ]*)( |$)/i', $keys, $matches)) {
return $matches[2];
}
}
@@ -679,10 +679,10 @@ function search_query_extract($keys, $option) {
*/
function search_query_insert($keys, $option, $value = '') {
if (search_query_extract($keys, $option)) {
- $keys = trim(preg_replace('/(^| )'. $option .':[^ ]*/i', '', $keys));
+ $keys = trim(preg_replace('/(^| )' . $option . ':[^ ]*/i', '', $keys));
}
if ($value != '') {
- $keys .= ' '. $option .':'. $value;
+ $keys .= ' ' . $option . ':' . $value;
}
return $keys;
}
@@ -711,7 +711,7 @@ function search_parse_query($text) {
$keys = array('positive' => array(), 'negative' => array());
// Tokenize query string
- preg_match_all('/ (-?)("[^"]+"|[^" ]+)/i', ' '. $text, $matches, PREG_SET_ORDER);
+ preg_match_all('/ (-?)("[^"]+"|[^" ]+)/i', ' ' . $text, $matches, PREG_SET_ORDER);
if (count($matches) < 1) {
return NULL;
@@ -795,7 +795,7 @@ function search_parse_query($text) {
}
}
if (count($queryor)) {
- $query[] = '('. implode(' OR ', $queryor) .')';
+ $query[] = '(' . implode(' OR ', $queryor) . ')';
// A group of OR keywords only needs to match once
$matches += ($any > 0);
}
@@ -857,7 +857,7 @@ function _search_parse_query(&$word, &$scores, $not = FALSE) {
}
}
// Return matching snippet and number of added words
- return array("d.data ". ($not ? 'NOT ' : '') ."LIKE '%% %s %%'", $num_new_scores, $num_valid_words);
+ return array("d.data " . ($not ? 'NOT ' : '') . "LIKE '%% %s %%'", $num_new_scores, $num_valid_words);
}
/**
@@ -946,7 +946,7 @@ function do_search($keywords, $type, $join1 = '', $where1 = '1', $arguments1 = a
if (!$normalize) {
return array();
}
- $columns2 = str_replace('i.relevance', '('. (1.0 / $normalize) .' * SUM(i.score * t.count))', $columns2);
+ $columns2 = str_replace('i.relevance', '(' . (1.0 / $normalize) . ' * SUM(i.score * t.count))', $columns2);
// Build query to retrieve results.
$select = "SELECT i.type, i.sid, $columns2 FROM {search_index} i $join $join2 WHERE $conditions GROUP BY i.type, i.sid HAVING COUNT(*) >= %d";
@@ -1023,10 +1023,10 @@ function search_get_keys() {
function search_form(&$form_state, $action = '', $keys = '', $type = NULL, $prompt = NULL) {
// Add CSS
- drupal_add_css(drupal_get_path('module', 'search') .'/search.css', 'module', 'all', FALSE);
+ drupal_add_css(drupal_get_path('module', 'search') . '/search.css', 'module', 'all', FALSE);
if (!$action) {
- $action = url('search/'. $type);
+ $action = url('search/' . $type);
}
if (is_null($prompt)) {
$prompt = t('Enter your keywords');
@@ -1081,7 +1081,7 @@ function search_box(&$form_state, $form_id) {
*/
function search_box_form_submit($form, &$form_state) {
$form_id = $form['form_id']['#value'];
- $form_state['redirect'] = 'search/node/'. trim($form_state['values'][$form_id]);
+ $form_state['redirect'] = 'search/node/' . trim($form_state['values'][$form_id]);
}
/**
@@ -1173,14 +1173,14 @@ function search_data($keys = NULL, $type = 'node') {
*/
function search_excerpt($keys, $text) {
// We highlight around non-indexable or CJK characters.
- $boundary = '(?:(?<=['. PREG_CLASS_SEARCH_EXCLUDE . PREG_CLASS_CJK .'])|(?=['. PREG_CLASS_SEARCH_EXCLUDE . PREG_CLASS_CJK .']))';
+ $boundary = '(?:(?<=[' . PREG_CLASS_SEARCH_EXCLUDE . PREG_CLASS_CJK . '])|(?=[' . PREG_CLASS_SEARCH_EXCLUDE . PREG_CLASS_CJK . ']))';
// Extract positive keywords and phrases
- preg_match_all('/ ("([^"]+)"|(?!OR)([^" ]+))/', ' '. $keys, $matches);
+ preg_match_all('/ ("([^"]+)"|(?!OR)([^" ]+))/', ' ' . $keys, $matches);
$keys = array_merge($matches[2], $matches[3]);
// Prepare text
- $text = ' '. strip_tags(str_replace(array('<', '>'), array(' <', '> '), $text)) .' ';
+ $text = ' ' . strip_tags(str_replace(array('<', '>'), array(' <', '> '), $text)) . ' ';
array_walk($keys, '_search_excerpt_replace');
$workkeys = $keys;
@@ -1208,7 +1208,7 @@ function search_excerpt($keys, $text) {
}
// Locate a keyword (position $p), then locate a space in front (position
// $q) and behind it (position $s)
- if (preg_match('/'. $boundary . $key . $boundary .'/iu', $text, $match, PREG_OFFSET_CAPTURE, $included[$key])) {
+ if (preg_match('/' . $boundary . $key . $boundary . '/iu', $text, $match, PREG_OFFSET_CAPTURE, $included[$key])) {
$p = $match[0][1];
if (($q = strpos($text, ' ', max(0, $p - 60))) !== FALSE) {
$end = substr($text, $p, 80);
@@ -1233,7 +1233,7 @@ function search_excerpt($keys, $text) {
// If we didn't find anything, return the beginning.
if (count($ranges) == 0) {
- return truncate_utf8($text, 256) .' ...';
+ return truncate_utf8($text, 256) . ' ...';
}
// Sort the text ranges by starting position.
@@ -1263,10 +1263,10 @@ function search_excerpt($keys, $text) {
foreach ($newranges as $from => $to) {
$out[] = substr($text, $from, $to - $from);
}
- $text = (isset($newranges[0]) ? '' : '... ') . implode(' ... ', $out) .' ...';
+ $text = (isset($newranges[0]) ? '' : '... ') . implode(' ... ', $out) . ' ...';
// Highlight keywords. Must be done at once to prevent conflicts ('strong' and '<strong>').
- $text = preg_replace('/'. $boundary .'('. implode('|', $keys) .')'. $boundary .'/iu', '<strong>\0</strong>', $text);
+ $text = preg_replace('/' . $boundary . '(' . implode('|', $keys) . ')' . $boundary . '/iu', '<strong>\0</strong>', $text);
return $text;
}
diff --git a/modules/search/search.pages.inc b/modules/search/search.pages.inc
index db1773fa7..d4ef2bd40 100644
--- a/modules/search/search.pages.inc
+++ b/modules/search/search.pages.inc
@@ -26,7 +26,7 @@ function search_view($type = 'node') {
$results = '';
if (trim($keys)) {
// Log the search keys:
- watchdog('search', '%keys (@type).', array('%keys' => $keys, '@type' => module_invoke($type, 'search', 'name')), WATCHDOG_NOTICE, l(t('results'), 'search/'. $type .'/'. $keys));
+ watchdog('search', '%keys (@type).', array('%keys' => $keys, '@type' => module_invoke($type, 'search', 'name')), WATCHDOG_NOTICE, l(t('results'), 'search/' . $type . '/' . $keys));
// Collect the search results:
$results = search_data($keys, $type);
@@ -65,7 +65,7 @@ function template_preprocess_search_results(&$variables) {
}
$variables['pager'] = theme('pager', NULL, 10, 0);
// Provide alternate search results template.
- $variables['template_files'][] = 'search-results-'. $variables['type'];
+ $variables['template_files'][] = 'search-results-' . $variables['type'];
}
/**
@@ -101,7 +101,7 @@ function template_preprocess_search_result(&$variables) {
$variables['info_split'] = $info;
$variables['info'] = implode(' - ', $info);
// Provide alternate search result template.
- $variables['template_files'][] = 'search-result-'. $variables['type'];
+ $variables['template_files'][] = 'search-result-' . $variables['type'];
}
/**
@@ -125,6 +125,6 @@ function search_form_submit($form, &$form_state) {
}
$type = $form_state['values']['module'] ? $form_state['values']['module'] : 'node';
- $form_state['redirect'] = 'search/'. $type .'/'. $keys;
+ $form_state['redirect'] = 'search/' . $type . '/' . $keys;
return;
}
diff --git a/modules/statistics/statistics.admin.inc b/modules/statistics/statistics.admin.inc
index e41403c59..9aad6f668 100644
--- a/modules/statistics/statistics.admin.inc
+++ b/modules/statistics/statistics.admin.inc
@@ -17,7 +17,7 @@ function statistics_recent_hits() {
array('data' => t('Operations'))
);
- $sql = 'SELECT a.aid, a.path, a.title, a.uid, u.name, a.timestamp FROM {accesslog} a LEFT JOIN {users} u ON u.uid = a.uid'. tablesort_sql($header);
+ $sql = 'SELECT a.aid, a.path, a.title, a.uid, u.name, a.timestamp FROM {accesslog} a LEFT JOIN {users} u ON u.uid = a.uid' . tablesort_sql($header);
$result = pager_query($sql, 30);
$rows = array();
@@ -82,7 +82,7 @@ function statistics_top_visitors() {
array('data' => t('Operations'))
);
- $sql = "SELECT COUNT(a.uid) AS hits, a.uid, u.name, a.hostname, SUM(a.timer) AS total, ac.aid FROM {accesslog} a LEFT JOIN {access} ac ON ac.type = 'host' AND LOWER(a.hostname) LIKE (ac.mask) LEFT JOIN {users} u ON a.uid = u.uid GROUP BY a.hostname, a.uid, u.name, ac.aid". tablesort_sql($header);
+ $sql = "SELECT COUNT(a.uid) AS hits, a.uid, u.name, a.hostname, SUM(a.timer) AS total, ac.aid FROM {accesslog} a LEFT JOIN {access} ac ON ac.type = 'host' AND LOWER(a.hostname) LIKE (ac.mask) LEFT JOIN {users} u ON a.uid = u.uid GROUP BY a.hostname, a.uid, u.name, ac.aid" . tablesort_sql($header);
$sql_cnt = "SELECT COUNT(DISTINCT(CONCAT(uid, hostname))) FROM {accesslog}";
$result = pager_query($sql, 30, 0, $sql_cnt);
diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module
index 58a3ad47c..3f43406b3 100644
--- a/modules/statistics/statistics.module
+++ b/modules/statistics/statistics.module
@@ -12,28 +12,28 @@
function statistics_help($path, $arg) {
switch ($path) {
case 'admin/help#statistics':
- $output = '<p>'. t('The statistics module keeps track of numerous site usage statistics, including the number of times, and from where, each of your posts is viewed. These statistics are useful in determining how users are interacting with each other and with your site, and are required for the display of some Drupal blocks.') .'</p>';
- $output .= '<p>'. t('The statistics module provides:') .'</p>';
- $output .= '<ul><li>'. t('a counter for each post on your site that increments each time the post is viewed. (Enable <em>Count content views</em> on the <a href="@accesslog">access log settings page</a>, and determine if the post access counters should be visible to any user roles on the <a href="@permissions">permissions page</a>.)', array('@accesslog' => url('admin/reports/settings'), '@permissions' => url('admin/user/permissions'))) .'</li>';
- $output .= '<li>'. t('a <a href="@recent-hits">recent hits</a> log that displays information about the latest activity on your site, including the URL and title of the page accessed, the user name (if available) and IP address of the accessing party.', array('@recent-hits' => url('admin/reports/hits'))) .'</li>';
- $output .= '<li>'. t('a <a href="@top-referrers">top referrers</a> log that displays the referring parties for your site visits (where your visitors came from).', array('@top-referrers' => url('admin/reports/referrers'))) .'</li>';
- $output .= '<li>'. t('a <a href="@top-pages">top pages</a> log that displays site content in descending order by number of views.', array('@top-pages' => url('admin/reports/pages'))) .'</li>';
- $output .= '<li>'. t('a <a href="@top-visitors">top visitors</a> log that displays the most active users on your site.', array('@top-visitors' => url('admin/reports/visitors'))) .'</li>';
- $output .= '<li>'. t('a <em>Popular content</em> block that displays the day\'s most viewed content, the all-time most viewed content, and the last content viewed. (Enable the <em>Popular content</em> block on the <a href="@blocks">blocks administration page</a>.)', array('@blocks' => url('admin/build/block'))) .'</li></ul>';
- $output .= '<p>'. t('Configuring the statistics module') .'</p>';
- $output .= '<ul><li>'. t('When the <em>Enable access log</em> setting on the <a href="@accesslog">access log settings page</a> is enabled, data about every page accessed (including the remote host\'s IP address, referrer, node accessed, and user name) is stored in the access log. The access log must be enabled for the <a href="@recent-hits">recent hits</a>, <a href="@top-referrers">top referrers</a>, <a href="@top-pages">top pages</a>, and <a href="@top-visitors">top visitors</a> log pages to function. Enabling the access log adds one additional database call per page displayed by Drupal.', array('@accesslog' => url('admin/reports/settings'), '@recent-hits' => url('admin/reports/hits'), '@top-referrers' => url('admin/reports/referrers'), '@top-pages' => url('admin/reports/pages'), '@top-visitors' => url('admin/reports/visitors'))) .'</li>';
- $output .= '<li>'. t('The <em>Discard access logs older than</em> setting on the <a href="@accesslog">access log settings page</a> specifies the length of time entries are retained in the access log before they are deleted. Automatic access log entry deletion requires a correctly configured <a href="@cron">cron maintenance task</a>.', array('@accesslog' => url('admin/reports/settings'), '@cron' => url('admin/reports/status'))) .'</li>';
- $output .= '<li>'. t('The <em>Count content views</em> setting on the <a href="@accesslog">access log settings page</a> enables a counter for each post on your site that increments each time the post is viewed. This option must be enabled to provide post-specific access counts. Enabling this option adds one additional database call per each post displayed by Drupal.', array('@accesslog' => url('admin/reports/settings'))) .'</li></ul>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@statistics">Statistics module</a>.', array('@statistics' => 'http://drupal.org/handbook/modules/statistics/')) .'</p>';
+ $output = '<p>' . t('The statistics module keeps track of numerous site usage statistics, including the number of times, and from where, each of your posts is viewed. These statistics are useful in determining how users are interacting with each other and with your site, and are required for the display of some Drupal blocks.') . '</p>';
+ $output .= '<p>' . t('The statistics module provides:') . '</p>';
+ $output .= '<ul><li>' . t('a counter for each post on your site that increments each time the post is viewed. (Enable <em>Count content views</em> on the <a href="@accesslog">access log settings page</a>, and determine if the post access counters should be visible to any user roles on the <a href="@permissions">permissions page</a>.)', array('@accesslog' => url('admin/reports/settings'), '@permissions' => url('admin/user/permissions'))) . '</li>';
+ $output .= '<li>' . t('a <a href="@recent-hits">recent hits</a> log that displays information about the latest activity on your site, including the URL and title of the page accessed, the user name (if available) and IP address of the accessing party.', array('@recent-hits' => url('admin/reports/hits'))) . '</li>';
+ $output .= '<li>' . t('a <a href="@top-referrers">top referrers</a> log that displays the referring parties for your site visits (where your visitors came from).', array('@top-referrers' => url('admin/reports/referrers'))) . '</li>';
+ $output .= '<li>' . t('a <a href="@top-pages">top pages</a> log that displays site content in descending order by number of views.', array('@top-pages' => url('admin/reports/pages'))) . '</li>';
+ $output .= '<li>' . t('a <a href="@top-visitors">top visitors</a> log that displays the most active users on your site.', array('@top-visitors' => url('admin/reports/visitors'))) . '</li>';
+ $output .= '<li>' . t('a <em>Popular content</em> block that displays the day\'s most viewed content, the all-time most viewed content, and the last content viewed. (Enable the <em>Popular content</em> block on the <a href="@blocks">blocks administration page</a>.)', array('@blocks' => url('admin/build/block'))) . '</li></ul>';
+ $output .= '<p>' . t('Configuring the statistics module') . '</p>';
+ $output .= '<ul><li>' . t('When the <em>Enable access log</em> setting on the <a href="@accesslog">access log settings page</a> is enabled, data about every page accessed (including the remote host\'s IP address, referrer, node accessed, and user name) is stored in the access log. The access log must be enabled for the <a href="@recent-hits">recent hits</a>, <a href="@top-referrers">top referrers</a>, <a href="@top-pages">top pages</a>, and <a href="@top-visitors">top visitors</a> log pages to function. Enabling the access log adds one additional database call per page displayed by Drupal.', array('@accesslog' => url('admin/reports/settings'), '@recent-hits' => url('admin/reports/hits'), '@top-referrers' => url('admin/reports/referrers'), '@top-pages' => url('admin/reports/pages'), '@top-visitors' => url('admin/reports/visitors'))) . '</li>';
+ $output .= '<li>' . t('The <em>Discard access logs older than</em> setting on the <a href="@accesslog">access log settings page</a> specifies the length of time entries are retained in the access log before they are deleted. Automatic access log entry deletion requires a correctly configured <a href="@cron">cron maintenance task</a>.', array('@accesslog' => url('admin/reports/settings'), '@cron' => url('admin/reports/status'))) . '</li>';
+ $output .= '<li>' . t('The <em>Count content views</em> setting on the <a href="@accesslog">access log settings page</a> enables a counter for each post on your site that increments each time the post is viewed. This option must be enabled to provide post-specific access counts. Enabling this option adds one additional database call per each post displayed by Drupal.', array('@accesslog' => url('admin/reports/settings'))) . '</li></ul>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@statistics">Statistics module</a>.', array('@statistics' => 'http://drupal.org/handbook/modules/statistics/')) . '</p>';
return $output;
case 'admin/reports/settings':
- return '<p>'. t('Settings for the statistical information that Drupal will keep about the site. See <a href="@statistics">site statistics</a> for the actual information.', array('@statistics' => url('admin/reports/hits'))) .'</p>';
+ return '<p>' . t('Settings for the statistical information that Drupal will keep about the site. See <a href="@statistics">site statistics</a> for the actual information.', array('@statistics' => url('admin/reports/hits'))) . '</p>';
case 'admin/reports/hits':
- return '<p>'. t("This page displays the site's most recent hits.") .'</p>';
+ return '<p>' . t("This page displays the site's most recent hits.") . '</p>';
case 'admin/reports/referrers':
- return '<p>'. t('This page displays all external referrers, or external references to your website.') .'</p>';
+ return '<p>' . t('This page displays all external referrers, or external references to your website.') . '</p>';
case 'admin/reports/visitors':
- return '<p>'. t("When you ban a visitor, you prevent the visitor's IP address from accessing your site. Unlike blocking a user, banning a visitor works even for anonymous users. This is most commonly used to block resource-intensive bots or web crawlers.") .'</p>';
+ return '<p>' . t("When you ban a visitor, you prevent the visitor's IP address from accessing your site. Unlike blocking a user, banning a visitor works even for anonymous users. This is most commonly used to block resource-intensive bots or web crawlers.") . '</p>';
}
}
@@ -210,7 +210,7 @@ function statistics_cron() {
*/
function statistics_title_list($dbfield, $dbrows) {
if (in_array($dbfield, array('totalcount', 'daycount', 'timestamp'))) {
- return db_query_range(db_rewrite_sql("SELECT n.nid, n.title, u.uid, u.name FROM {node} n INNER JOIN {node_counter} s ON n.nid = s.nid INNER JOIN {users} u ON n.uid = u.uid WHERE s.". $dbfield ." != 0 AND n.status = 1 ORDER BY s.". $dbfield ." DESC"), 0, $dbrows);
+ return db_query_range(db_rewrite_sql("SELECT n.nid, n.title, u.uid, u.name FROM {node} n INNER JOIN {node_counter} s ON n.nid = s.nid INNER JOIN {users} u ON n.uid = u.uid WHERE s." . $dbfield . " != 0 AND n.status = 1 ORDER BY s." . $dbfield . " DESC"), 0, $dbrows);
}
return FALSE;
}
diff --git a/modules/statistics/statistics.pages.inc b/modules/statistics/statistics.pages.inc
index 84dca6d29..69286b515 100644
--- a/modules/statistics/statistics.pages.inc
+++ b/modules/statistics/statistics.pages.inc
@@ -15,7 +15,7 @@ function statistics_node_tracker() {
array('data' => t('User'), 'field' => 'u.name'),
array('data' => t('Operations')));
- $result = pager_query('SELECT a.aid, a.timestamp, a.url, a.uid, u.name FROM {accesslog} a LEFT JOIN {users} u ON a.uid = u.uid WHERE a.path LIKE \'node/%d%%\''. tablesort_sql($header), 30, 0, NULL, $node->nid);
+ $result = pager_query('SELECT a.aid, a.timestamp, a.url, a.uid, u.name FROM {accesslog} a LEFT JOIN {users} u ON a.uid = u.uid WHERE a.path LIKE \'node/%d%%\'' . tablesort_sql($header), 30, 0, NULL, $node->nid);
$rows = array();
while ($log = db_fetch_object($result)) {
$rows[] = array(
@@ -47,7 +47,7 @@ function statistics_user_tracker() {
array('data' => t('Page'), 'field' => 'path'),
array('data' => t('Operations')));
- $result = pager_query('SELECT aid, timestamp, path, title FROM {accesslog} WHERE uid = %d'. tablesort_sql($header), 30, 0, NULL, $account->uid);
+ $result = pager_query('SELECT aid, timestamp, path, title FROM {accesslog} WHERE uid = %d' . tablesort_sql($header), 30, 0, NULL, $account->uid);
$rows = array();
while ($log = db_fetch_object($result)) {
$rows[] = array(
diff --git a/modules/syslog/syslog.module b/modules/syslog/syslog.module
index b9810ea91..66df76f0f 100644
--- a/modules/syslog/syslog.module
+++ b/modules/syslog/syslog.module
@@ -19,9 +19,9 @@ else {
function syslog_help($path, $arg) {
switch ($path) {
case 'admin/help#syslog':
- $output = '<p>'. t("The syslog module enables Drupal to send messages to the operating system's logging facility.") .'</p>';
- $output .= '<p>'. t('Syslog is an operating system administrative logging tool, and provides valuable information for use in system management and security auditing. Most suited to medium and large sites, syslog provides filtering tools that allow messages to be routed by type and severity. On UNIX/Linux systems, the file /etc/syslog.conf defines this routing configuration; on Microsoft Windows, all messages are sent to the Event Log. For more information on syslog facilities, severity levels, and how to set up a syslog.conf file, see <a href="@syslog_conf">UNIX/Linux syslog.conf</a> and PHP\'s <a href="@php_openlog">openlog</a> and <a href="@php_syslog">syslog</a> functions.', array('@syslog_conf' => url('http://www.rt.com/man/syslog.5.html'), '@php_openlog' => url('http://www.php.net/manual/en/function.openlog.php'), '@php_syslog' => url('http://www.php.net/manual/en/function.syslog.php'))) .'</p>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@syslog">Syslog module</a>.', array('@syslog' => 'http://drupal.org/handbook/modules/syslog')) .'</p>';
+ $output = '<p>' . t("The syslog module enables Drupal to send messages to the operating system's logging facility.") . '</p>';
+ $output .= '<p>' . t('Syslog is an operating system administrative logging tool, and provides valuable information for use in system management and security auditing. Most suited to medium and large sites, syslog provides filtering tools that allow messages to be routed by type and severity. On UNIX/Linux systems, the file /etc/syslog.conf defines this routing configuration; on Microsoft Windows, all messages are sent to the Event Log. For more information on syslog facilities, severity levels, and how to set up a syslog.conf file, see <a href="@syslog_conf">UNIX/Linux syslog.conf</a> and PHP\'s <a href="@php_openlog">openlog</a> and <a href="@php_syslog">syslog</a> functions.', array('@syslog_conf' => url('http://www.rt.com/man/syslog.5.html'), '@php_openlog' => url('http://www.php.net/manual/en/function.openlog.php'), '@php_syslog' => url('http://www.php.net/manual/en/function.syslog.php'))) . '</p>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@syslog">Syslog module</a>.', array('@syslog' => 'http://drupal.org/handbook/modules/syslog')) . '</p>';
return $output;
}
}
@@ -97,14 +97,14 @@ function theme_syslog_format($entry) {
global $base_url;
$message = $base_url;
- $message .= '|'. $entry['timestamp'];
- $message .= '|'. $entry['type'];
- $message .= '|'. $entry['ip'];
- $message .= '|'. $entry['request_uri'];
- $message .= '|'. $entry['referer'];
- $message .= '|'. $entry['user']->uid;
- $message .= '|'. strip_tags($entry['link']);
- $message .= '|'. strip_tags(is_null($entry['variables']) ? $entry['message'] : strtr($entry['message'], $entry['variables']));
+ $message .= '|' . $entry['timestamp'];
+ $message .= '|' . $entry['type'];
+ $message .= '|' . $entry['ip'];
+ $message .= '|' . $entry['request_uri'];
+ $message .= '|' . $entry['referer'];
+ $message .= '|' . $entry['user']->uid;
+ $message .= '|' . strip_tags($entry['link']);
+ $message .= '|' . strip_tags(is_null($entry['variables']) ? $entry['message'] : strtr($entry['message'], $entry['variables']));
return $message;
}
diff --git a/modules/system/block.tpl.php b/modules/system/block.tpl.php
index 30f95b458..8ca0f2ba4 100644
--- a/modules/system/block.tpl.php
+++ b/modules/system/block.tpl.php
@@ -26,7 +26,7 @@
* @see template_preprocess_block()
*/
?>
-<div id="block-<?php print $block->module .'-'. $block->delta; ?>" class="block block-<?php print $block->module ?>">
+<div id="block-<?php print $block->module . '-' . $block->delta; ?>" class="block block-<?php print $block->module ?>">
<?php if ($block->subject): ?>
<h2><?php print $block->subject ?></h2>
<?php endif;?>
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index c144c15d6..8c9d0aa0e 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -47,7 +47,7 @@ function system_main_admin_page($arg = NULL) {
$block['content'] .= theme('admin_block_content', system_admin_menu_block($item));
// Prepare for sorting as in function _menu_tree_check_access().
// The weight is offset so it is always positive, with a uniform 5-digits.
- $blocks[(50000 + $item['weight']) .' '. $item['title'] .' '. $item['mlid']] = $block;
+ $blocks[(50000 + $item['weight']) . ' ' . $item['title'] . ' ' . $item['mlid']] = $block;
}
}
if ($blocks) {
@@ -143,7 +143,7 @@ function system_admin_theme_settings() {
uasort($themes, 'system_sort_modules_by_info_name');
- $options[0] = '<'. t('System default') .'>';
+ $options[0] = '<' . t('System default') . '>';
foreach ($themes as $theme) {
$options[$theme->name] = $theme->info['name'];
}
@@ -204,7 +204,7 @@ function system_themes_form() {
$options[$theme->name] = '';
if (!empty($theme->status) || $theme->name == variable_get('admin_theme', '0')) {
- $form[$theme->name]['operations'] = array('#value' => l(t('configure'), 'admin/build/themes/settings/'. $theme->name) );
+ $form[$theme->name]['operations'] = array('#value' => l(t('configure'), 'admin/build/themes/settings/' . $theme->name) );
}
else {
// Dummy element for drupal_render. Cleaner than adding a check in the theme function.
@@ -319,7 +319,7 @@ function system_theme_settings(&$form_state, $key = '') {
// Default settings are defined in theme_get_settings() in includes/theme.inc
if ($key) {
$settings = theme_get_settings($key);
- $var = str_replace('/', '_', 'theme_'. $key .'_settings');
+ $var = str_replace('/', '_', 'theme_' . $key . '_settings');
$themes = system_theme_data();
$features = $themes[$key]->info['features'];
}
@@ -333,7 +333,7 @@ function system_theme_settings(&$form_state, $key = '') {
// Check for a new uploaded logo, and use that instead.
if ($file = file_save_upload('logo_upload', array('file_validate_is_image' => array()))) {
$parts = pathinfo($file->filename);
- $filename = ($key) ? str_replace('/', '_', $key) .'_logo.'. $parts['extension'] : 'logo.'. $parts['extension'];
+ $filename = ($key) ? str_replace('/', '_', $key) . '_logo.' . $parts['extension'] : 'logo.' . $parts['extension'];
// The image was saved using file_save_upload() and was added to the
// files table as a temporary file. We'll make a copy and let the garbage
@@ -348,7 +348,7 @@ function system_theme_settings(&$form_state, $key = '') {
// Check for a new uploaded favicon, and use that instead.
if ($file = file_save_upload('favicon_upload')) {
$parts = pathinfo($file->filename);
- $filename = ($key) ? str_replace('/', '_', $key) .'_favicon.'. $parts['extension'] : 'favicon.'. $parts['extension'];
+ $filename = ($key) ? str_replace('/', '_', $key) . '_favicon.' . $parts['extension'] : 'favicon.' . $parts['extension'];
// The image was saved using file_save_upload() and was added to the
// files table as a temporary file. We'll make a copy and let the garbage
@@ -391,10 +391,10 @@ function system_theme_settings(&$form_state, $key = '') {
);
foreach ($toggles as $name => $title) {
if ((!$key) || in_array($name, $features)) {
- $form['theme_settings']['toggle_'. $name] = array('#type' => 'checkbox', '#title' => $title, '#default_value' => $settings['toggle_'. $name]);
+ $form['theme_settings']['toggle_' . $name] = array('#type' => 'checkbox', '#title' => $title, '#default_value' => $settings['toggle_' . $name]);
// Disable checkboxes for features not supported in the current configuration.
- if (isset($disabled['toggle_'. $name])) {
- $form['theme_settings']['toggle_'. $name]['#disabled'] = TRUE;
+ if (isset($disabled['toggle_' . $name])) {
+ $form['theme_settings']['toggle_' . $name]['#disabled'] = TRUE;
}
}
}
@@ -485,18 +485,18 @@ function system_theme_settings(&$form_state, $key = '') {
if ($key) {
// Include the theme's theme-settings.php file
- $filename = './'. str_replace("/$key.info", '', $themes[$key]->filename) .'/theme-settings.php';
+ $filename = './' . str_replace("/$key.info", '', $themes[$key]->filename) . '/theme-settings.php';
if (!file_exists($filename) and !empty($themes[$key]->info['base theme'])) {
// If the theme doesn't have a theme-settings.php file, use the base theme's.
$base = $themes[$key]->info['base theme'];
- $filename = './'. str_replace("/$base.info", '', $themes[$base]->filename) .'/theme-settings.php';
+ $filename = './' . str_replace("/$base.info", '', $themes[$base]->filename) . '/theme-settings.php';
}
if (file_exists($filename)) {
require_once $filename;
}
// Call engine-specific settings.
- $function = $themes[$key]->prefix .'_engine_settings';
+ $function = $themes[$key]->prefix . '_engine_settings';
if (function_exists($function)) {
$group = $function($settings);
if (!empty($group)) {
@@ -505,9 +505,9 @@ function system_theme_settings(&$form_state, $key = '') {
}
}
// Call theme-specific settings.
- $function = $key .'_settings';
+ $function = $key . '_settings';
if (!function_exists($function)) {
- $function = $themes[$key]->prefix .'_settings';
+ $function = $themes[$key]->prefix . '_settings';
}
if (function_exists($function)) {
$group = $function($settings);
@@ -1049,7 +1049,7 @@ function system_modules_uninstall_confirm_form($storage) {
// Construct the hidden form elements and list items.
foreach (array_filter($storage['uninstall']) as $module => $value) {
- $info = drupal_parse_info_file(dirname(drupal_get_filename('module', $module)) .'/'. $module .'.info');
+ $info = drupal_parse_info_file(dirname(drupal_get_filename('module', $module)) . '/' . $module . '.info');
$uninstall[] = $info['name'];
$form['uninstall'][$module] = array('#type' => 'hidden',
'#value' => 1,
@@ -1060,7 +1060,7 @@ function system_modules_uninstall_confirm_form($storage) {
if (isset($uninstall)) {
$form['#confirmed'] = TRUE;
$form['uninstall']['#tree'] = TRUE;
- $form['modules'] = array('#value' => '<p>'. t('The following modules will be completely uninstalled from your site, and <em>all data from these modules will be lost</em>!') .'</p>'. theme('item_list', $uninstall));
+ $form['modules'] = array('#value' => '<p>' . t('The following modules will be completely uninstalled from your site, and <em>all data from these modules will be lost</em>!') . '</p>' . theme('item_list', $uninstall));
$form = confirm_form(
$form,
t('Confirm uninstall'),
@@ -1328,16 +1328,16 @@ function system_logging_overview() {
*/
function system_performance_settings() {
- $description = '<p>'. t("The normal cache mode is suitable for most sites and does not cause any side effects. The aggressive cache mode causes Drupal to skip the loading (boot) and unloading (exit) of enabled modules when serving a cached page. This results in an additional performance boost but can cause unwanted side effects.") .'</p>';
+ $description = '<p>' . t("The normal cache mode is suitable for most sites and does not cause any side effects. The aggressive cache mode causes Drupal to skip the loading (boot) and unloading (exit) of enabled modules when serving a cached page. This results in an additional performance boost but can cause unwanted side effects.") . '</p>';
$problem_modules = array_unique(array_merge(module_implements('boot'), module_implements('exit')));
sort($problem_modules);
if (count($problem_modules) > 0) {
- $description .= '<p>'. t('<strong class="error">The following enabled modules are incompatible with aggressive mode caching and will not function properly: %modules</strong>', array('%modules' => implode(', ', $problem_modules))) .'.</p>';
+ $description .= '<p>' . t('<strong class="error">The following enabled modules are incompatible with aggressive mode caching and will not function properly: %modules</strong>', array('%modules' => implode(', ', $problem_modules))) . '.</p>';
}
else {
- $description .= '<p>'. t('<strong class="ok">Currently, all enabled modules are compatible with the aggressive caching policy.</strong> Please note, if you use aggressive caching and enable new modules, you will need to check this page again to ensure compatibility.') .'</p>';
+ $description .= '<p>' . t('<strong class="ok">Currently, all enabled modules are compatible with the aggressive caching policy.</strong> Please note, if you use aggressive caching and enable new modules, you will need to check this page again to ensure compatibility.') . '</p>';
}
$form['page_cache'] = array(
'#type' => 'fieldset',
@@ -1354,7 +1354,7 @@ function system_performance_settings() {
);
$period = drupal_map_assoc(array(0, 60, 180, 300, 600, 900, 1800, 2700, 3600, 10800, 21600, 32400, 43200, 86400), 'format_interval');
- $period[0] = '<'. t('none') .'>';
+ $period[0] = '<' . t('none') . '>';
$form['page_cache']['cache_lifetime'] = array(
'#type' => 'select',
'#title' => t('Minimum cache lifetime'),
@@ -1388,7 +1388,7 @@ function system_performance_settings() {
$form['bandwidth_optimizations'] = array(
'#type' => 'fieldset',
'#title' => t('Bandwidth optimizations'),
- '#description' => '<p>'. t('Drupal can automatically optimize external resources like CSS and JavaScript, which can reduce both the size and number of requests made to your website. CSS files can be aggregated and compressed into a single file, while JavaScript files are aggregated (but not compressed). These optional optimizations may reduce server load, bandwidth requirements, and page loading times.') .'</p><p>'. t('These options are disabled if you have not set up your files directory, or if your download method is set to private.') .'</p>'
+ '#description' => '<p>' . t('Drupal can automatically optimize external resources like CSS and JavaScript, which can reduce both the size and number of requests made to your website. CSS files can be aggregated and compressed into a single file, while JavaScript files are aggregated (but not compressed). These optional optimizations may reduce server load, bandwidth requirements, and page loading times.') . '</p><p>' . t('These options are disabled if you have not set up your files directory, or if your download method is set to private.') . '</p>'
);
$directory = file_directory_path();
@@ -1534,7 +1534,7 @@ function system_rss_feeds_settings() {
* @see system_date_time_settings_submit()
*/
function system_date_time_settings() {
- drupal_add_js(drupal_get_path('module', 'system') .'/system.js', 'module');
+ drupal_add_js(drupal_get_path('module', 'system') . '/system.js', 'module');
drupal_add_js(array('dateTime' => array('lookup' => url('admin/settings/date-time/lookup'))), 'setting');
// Date settings:
@@ -1742,16 +1742,16 @@ function system_clean_url_settings() {
if (!variable_get('clean_url', 0)) {
if (strpos(request_uri(), '?q=') !== FALSE) {
- drupal_add_js(drupal_get_path('module', 'system') .'/system.js', 'module');
+ drupal_add_js(drupal_get_path('module', 'system') . '/system.js', 'module');
- $form['clean_url']['#description'] .= ' <span>'. t('Before enabling clean URLs, you must perform a test to determine if your server is properly configured. If you are able to see this page again after clicking the "Run the clean URL test" link, the test has succeeded and the radio buttons above will be available. If instead you are directed to a "Page not found" error, you will need to change the configuration of your server. The <a href="@handbook">handbook page on Clean URLs</a> has additional troubleshooting information.', array('@handbook' => 'http://drupal.org/node/15365')) .'</span>';
+ $form['clean_url']['#description'] .= ' <span>' . t('Before enabling clean URLs, you must perform a test to determine if your server is properly configured. If you are able to see this page again after clicking the "Run the clean URL test" link, the test has succeeded and the radio buttons above will be available. If instead you are directed to a "Page not found" error, you will need to change the configuration of your server. The <a href="@handbook">handbook page on Clean URLs</a> has additional troubleshooting information.', array('@handbook' => 'http://drupal.org/node/15365')) . '</span>';
$form['clean_url']['#disabled'] = TRUE;
$form['clean_url']['#prefix'] = '<div id="clean-url">';
- $form['clean_url']['#suffix'] = '<p>'. t('<a href="@clean_url">Run the clean url test</a>.', array('@clean_url' => base_path() .'admin/settings/clean-urls')) .'</p></div>';
+ $form['clean_url']['#suffix'] = '<p>' . t('<a href="@clean_url">Run the clean url test</a>.', array('@clean_url' => base_path() . 'admin/settings/clean-urls')) . '</p></div>';
}
else {
- $form['clean_url']['#description'] .= ' <div class="ok">'. t('Your server has been successfully tested to support this feature.') .'</div>';
+ $form['clean_url']['#description'] .= ' <div class="ok">' . t('Your server has been successfully tested to support this feature.') . '</div>';
}
}
@@ -1839,7 +1839,7 @@ function system_sql() {
$data[$entry->Variable_name] = $entry->Value;
}
- $output = '<h2>'. t('Command counters') .'</h2>';
+ $output = '<h2>' . t('Command counters') . '</h2>';
$output .= _system_sql($data, array(
'Com_select' => t('The number of <code>SELECT</code>-statements.'),
'Com_insert' => t('The number of <code>INSERT</code>-statements.'),
@@ -1849,7 +1849,7 @@ function system_sql() {
'Com_unlock_tables' => t('The number of table unlocks.')
));
- $output .= '<h2>'. t('Query performance') .'</h2>';
+ $output .= '<h2>' . t('Query performance') . '</h2>';
$output .= _system_sql($data, array(
'Select_full_join' => t('The number of joins without an index; should be zero.'),
'Select_range_check' => t('The number of joins without keys that check for key usage after each row; should be zero.'),
@@ -1858,8 +1858,8 @@ function system_sql() {
'Table_locks_waited' => t('The number of times the server had to wait for a lock.')
));
- $output .= '<h2>'. t('Query cache information') .'</h2>';
- $output .= '<p>'. t('The MySQL query cache can improve performance of your site by storing the result of queries. Then, if an identical query is received later, the MySQL server retrieves the result from the query cache rather than parsing and executing the statement again.') .'</p>';
+ $output .= '<h2>' . t('Query cache information') . '</h2>';
+ $output .= '<p>' . t('The MySQL query cache can improve performance of your site by storing the result of queries. Then, if an identical query is received later, the MySQL server retrieves the result from the query cache rather than parsing and executing the statement again.') . '</p>';
$output .= _system_sql($data, array(
'Qcache_queries_in_cache' => t('The number of queries in the query cache.'),
'Qcache_hits' => t('The number of times MySQL found previous results in the cache.'),
@@ -1932,15 +1932,15 @@ function theme_admin_block_content($content) {
if (system_admin_compact_mode()) {
$output = '<ul class="menu">';
foreach ($content as $item) {
- $output .= '<li class="leaf">'. l($item['title'], $item['href'], $item['localized_options']) .'</li>';
+ $output .= '<li class="leaf">' . l($item['title'], $item['href'], $item['localized_options']) . '</li>';
}
$output .= '</ul>';
}
else {
$output = '<dl class="admin-list">';
foreach ($content as $item) {
- $output .= '<dt>'. l($item['title'], $item['href'], $item['localized_options']) .'</dt>';
- $output .= '<dd>'. $item['description'] .'</dd>';
+ $output .= '<dt>' . l($item['title'], $item['href'], $item['localized_options']) . '</dt>';
+ $output .= '<dd>' . $item['description'] . '</dd>';
}
$output .= '</dl>';
}
@@ -1978,7 +1978,7 @@ function theme_admin_page($blocks) {
$output .= theme('system_compact_link');
foreach ($container as $id => $data) {
- $output .= '<div class="'. $id .' clear-block">';
+ $output .= '<div class="' . $id . ' clear-block">';
$output .= $data;
$output .= '</div>';
}
@@ -2024,7 +2024,7 @@ function theme_system_admin_by_module($menu_items) {
$output = '<div class="admin clear-block">';
foreach ($container as $id => $data) {
- $output .= '<div class="'. $id .' clear-block">';
+ $output .= '<div class="' . $id . ' clear-block">';
$output .= $data;
$output .= '</div>';
}
@@ -2053,15 +2053,15 @@ function theme_status_report(&$requirements) {
REQUIREMENT_WARNING => 'warning',
REQUIREMENT_ERROR => 'error',
);
- $class = $classes[isset($requirement['severity']) ? (int)$requirement['severity'] : 0] .' '. $class;
+ $class = $classes[isset($requirement['severity']) ? (int)$requirement['severity'] : 0] . ' ' . $class;
// Output table row(s)
if (!empty($requirement['description'])) {
- $output .= '<tr class="'. $class .' merge-down"><th>'. $requirement['title'] .'</th><td>'. $requirement['value'] .'</td></tr>';
- $output .= '<tr class="'. $class .' merge-up"><td colspan="2">'. $requirement['description'] .'</td></tr>';
+ $output .= '<tr class="' . $class . ' merge-down"><th>' . $requirement['title'] . '</th><td>' . $requirement['value'] . '</td></tr>';
+ $output .= '<tr class="' . $class . ' merge-up"><td colspan="2">' . $requirement['description'] . '</td></tr>';
}
else {
- $output .= '<tr class="'. $class .'"><th>'. $requirement['title'] .'</th><td>'. $requirement['value'] .'</td></tr>';
+ $output .= '<tr class="' . $class . '"><th>' . $requirement['title'] . '</th><td>' . $requirement['value'] . '</td></tr>';
}
}
}
@@ -2112,7 +2112,7 @@ function theme_system_modules($form) {
if (isset($form['status']['#incompatible_modules_core'][$key])) {
unset($form['status'][$key]);
$status = theme('image', 'misc/watchdog-error.png', t('incompatible'), t('Incompatible with this version of Drupal core'));
- $description .= '<div class="incompatible">'. t('This version is incompatible with the !core_version version of Drupal core.', array('!core_version' => VERSION)) .'</div>';
+ $description .= '<div class="incompatible">' . t('This version is incompatible with the !core_version version of Drupal core.', array('!core_version' => VERSION)) . '</div>';
}
elseif (isset($form['status']['#incompatible_modules_php'][$key])) {
unset($form['status'][$key]);
@@ -2121,7 +2121,7 @@ function theme_system_modules($form) {
if (substr_count($php_required, '.') < 2) {
$php_required .= '.*';
}
- $description .= '<div class="incompatible">'. t('This module requires PHP version @php_required and is incompatible with PHP version !php_version.', array('@php_required' => $php_required, '!php_version' => phpversion())) .'</div>';
+ $description .= '<div class="incompatible">' . t('This module requires PHP version @php_required and is incompatible with PHP version !php_version.', array('@php_required' => $php_required, '!php_version' => phpversion())) . '</div>';
}
else {
$status = drupal_render($form['status'][$key]);
@@ -2133,10 +2133,10 @@ function theme_system_modules($form) {
// Add labels only when there is also a checkbox.
if (isset($form['status'][$key])) {
- $row[] = '<strong><label for="'. $form['status'][$key]['#id'] .'">'. drupal_render($form['name'][$key]) .'</label></strong>';
+ $row[] = '<strong><label for="' . $form['status'][$key]['#id'] . '">' . drupal_render($form['name'][$key]) . '</label></strong>';
}
else {
- $row[] = '<strong>'. drupal_render($form['name'][$key]) .'</strong>';
+ $row[] = '<strong>' . drupal_render($form['name'][$key]) . '</strong>';
}
$row[] = drupal_render($form['version'][$key]);
@@ -2182,7 +2182,7 @@ function theme_system_modules_uninstall($form) {
foreach (element_children($form['modules']) as $module) {
$rows[] = array(
array('data' => drupal_render($form['uninstall'][$module]), 'align' => 'center'),
- '<strong>'. drupal_render($form['modules'][$module]['name']) .'</strong>',
+ '<strong>' . drupal_render($form['modules'][$module]['name']) . '</strong>',
array('data' => drupal_render($form['modules'][$module]['description']), 'class' => 'description'),
);
}
@@ -2242,7 +2242,7 @@ function theme_system_themes_form($form) {
if (isset($form['status']['#incompatible_themes_core'][$key])) {
unset($form['status'][$key]);
$status = theme('image', 'misc/watchdog-error.png', t('incompatible'), t('Incompatible with this version of Drupal core'));
- $description .= '<div class="incompatible">'. t('This version is incompatible with the !core_version version of Drupal core.', array('!core_version' => VERSION)) .'</div>';
+ $description .= '<div class="incompatible">' . t('This version is incompatible with the !core_version version of Drupal core.', array('!core_version' => VERSION)) . '</div>';
}
elseif (isset($form['status']['#incompatible_themes_php'][$key])) {
unset($form['status'][$key]);
@@ -2251,14 +2251,14 @@ function theme_system_themes_form($form) {
if (substr_count($php_required, '.') < 2) {
$php_required .= '.*';
}
- $description .= '<div class="incompatible">'. t('This theme requires PHP version @php_required and is incompatible with PHP version !php_version.', array('@php_required' => $php_required, '!php_version' => phpversion())) .'</div>';
+ $description .= '<div class="incompatible">' . t('This theme requires PHP version @php_required and is incompatible with PHP version !php_version.', array('@php_required' => $php_required, '!php_version' => phpversion())) . '</div>';
}
else {
$status = drupal_render($form['status'][$key]);
}
// Style theme info
- $theme = '<div class="theme-info"><h2>'. $info['name'] .'</h2><div class="description">'. $description .'</div></div>';
+ $theme = '<div class="theme-info"><h2>' . $info['name'] . '</h2><div class="description">' . $description . '</div></div>';
// Build rows
$row = array();
diff --git a/modules/system/system.install b/modules/system/system.install
index b4dcd1fd1..db804064e 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -81,13 +81,13 @@ function system_requirements($phase) {
if (!empty($description)) {
if ($php_ini_path = get_cfg_var('cfg_file_path')) {
- $description .= ' '. $t('Increase the memory limit by editing the memory_limit parameter in the file %configuration-file and then restart your web server (or contact your system administrator or hosting provider for assistance).', array('%configuration-file' => $php_ini_path));
+ $description .= ' ' . $t('Increase the memory limit by editing the memory_limit parameter in the file %configuration-file and then restart your web server (or contact your system administrator or hosting provider for assistance).', array('%configuration-file' => $php_ini_path));
}
else {
- $description .= ' '. $t('Contact your system administrator or hosting provider for assistance with increasing your PHP memory limit.');
+ $description .= ' ' . $t('Contact your system administrator or hosting provider for assistance with increasing your PHP memory limit.');
}
- $requirements['php_memory_limit']['description'] = $description .' '. $t('See the <a href="@url">Drupal requirements</a> for more information.', array('@url' => 'http://drupal.org/requirements'));
+ $requirements['php_memory_limit']['description'] = $description . ' ' . $t('See the <a href="@url">Drupal requirements</a> for more information.', array('@url' => 'http://drupal.org/requirements'));
$requirements['php_memory_limit']['severity'] = REQUIREMENT_WARNING;
}
}
@@ -101,7 +101,7 @@ function system_requirements($phase) {
// Test settings.php file writability
if ($phase == 'runtime') {
$conf_dir = drupal_verify_install_file(conf_path(), FILE_NOT_WRITABLE, 'dir');
- $conf_file = drupal_verify_install_file(conf_path() .'/settings.php', FILE_EXIST|FILE_READABLE|FILE_NOT_WRITABLE);
+ $conf_file = drupal_verify_install_file(conf_path() . '/settings.php', FILE_EXIST|FILE_READABLE|FILE_NOT_WRITABLE);
if (!$conf_dir || !$conf_file) {
$requirements['settings.php'] = array(
'value' => $t('Not protected'),
@@ -112,7 +112,7 @@ function system_requirements($phase) {
$requirements['settings.php']['description'] .= $t('The directory %file is not protected from modifications and poses a security risk. You must change the directory\'s permissions to be non-writable. ', array('%file' => conf_path()));
}
if (!$conf_file) {
- $requirements['settings.php']['description'] .= $t('The file %file is not protected from modifications and poses a security risk. You must change the file\'s permissions to be non-writable.', array('%file' => conf_path() .'/settings.php'));
+ $requirements['settings.php']['description'] .= $t('The file %file is not protected from modifications and poses a security risk. You must change the file\'s permissions to be non-writable.', array('%file' => conf_path() . '/settings.php'));
}
}
else {
@@ -160,18 +160,18 @@ function system_requirements($phase) {
// Set summary and description based on values determined above.
if ($never_run) {
$summary = $t('Never run');
- $description = $t('Cron has not run.') .' '. $help;
+ $description = $t('Cron has not run.') . ' ' . $help;
}
else {
$summary = $t('Last run !time ago', array('!time' => format_interval(time() - $cron_last)));
$description = '';
if ($severity != REQUIREMENT_OK) {
- $description = $t('Cron has not run recently.') .' '. $help;
+ $description = $t('Cron has not run recently.') . ' ' . $help;
}
}
- $description .= ' '. $t('You can <a href="@cron">run cron manually</a>.', array('@cron' => url('admin/reports/status/run-cron')));
- $description .= '<br />'. $t('To run cron from outside the site, go to <a href="!cron">!cron</a>', array('!cron' => url('cron.php', array('absolute' => true, 'query' => 'cron_key='. variable_get('cron_key', 'drupal')))));
+ $description .= ' ' . $t('You can <a href="@cron">run cron manually</a>.', array('@cron' => url('admin/reports/status/run-cron')));
+ $description .= '<br />' . $t('To run cron from outside the site, go to <a href="!cron">!cron</a>', array('!cron' => url('cron.php', array('absolute' => true, 'query' => 'cron_key=' . variable_get('cron_key', 'drupal')))));
$requirements['cron'] = array(
'title' => $t('Cron maintenance tasks'),
@@ -205,12 +205,12 @@ function system_requirements($phase) {
}
// The files directory requirement check is done only during install and runtime.
if ($phase == 'runtime') {
- $description = $error .' '. $t('You may need to set the correct directory at the <a href="@admin-file-system">file system settings page</a> or change the current directory\'s permissions so that it is writable.', array('@admin-file-system' => url('admin/settings/file-system')));
+ $description = $error . ' ' . $t('You may need to set the correct directory at the <a href="@admin-file-system">file system settings page</a> or change the current directory\'s permissions so that it is writable.', array('@admin-file-system' => url('admin/settings/file-system')));
}
elseif ($phase == 'install') {
// For the installer UI, we need different wording. 'value' will
// be treated as version, so provide none there.
- $description = $error .' '. $t('An automated attempt to create this directory failed, possibly due to a permissions problem. To proceed with the installation, either create the directory and modify its permissions manually, or ensure that the installer has the permissions to create it automatically. For more information, please see INSTALL.txt or the <a href="@handbook_url">on-line handbook</a>.', array('@handbook_url' => 'http://drupal.org/server-permissions'));
+ $description = $error . ' ' . $t('An automated attempt to create this directory failed, possibly due to a permissions problem. To proceed with the installation, either create the directory and modify its permissions manually, or ensure that the installer has the permissions to create it automatically. For more information, please see INSTALL.txt or the <a href="@handbook_url">on-line handbook</a>.', array('@handbook_url' => 'http://drupal.org/server-permissions'));
$requirements['file system']['value'] = '';
}
if (!empty($description)) {
@@ -243,7 +243,7 @@ function system_requirements($phase) {
if (max($updates) > $default) {
$requirements['update']['severity'] = REQUIREMENT_ERROR;
$requirements['update']['value'] = $t('Out of date');
- $requirements['update']['description'] = $t('Some modules have database schema updates to install. You should run the <a href="@update">database update script</a> immediately.', array('@update' => base_path() .'update.php'));
+ $requirements['update']['description'] = $t('Some modules have database schema updates to install. You should run the <a href="@update">database update script</a> immediately.', array('@update' => base_path() . 'update.php'));
break;
}
}
@@ -1130,7 +1130,7 @@ function system_schema() {
'default' => '',
),
'owner' => array(
- 'description' => t("A theme's 'parent'. Can be either a theme or an engine."),
+ 'description' => t("A theme's 'parent' . Can be either a theme or an engine."),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
@@ -1397,9 +1397,9 @@ function system_update_6006() {
*/
function system_update_6007() {
$ret = array();
- $ret[] = update_sql("UPDATE {watchdog} SET severity = ". WATCHDOG_NOTICE ." WHERE severity = 0");
- $ret[] = update_sql("UPDATE {watchdog} SET severity = ". WATCHDOG_WARNING ." WHERE severity = 1");
- $ret[] = update_sql("UPDATE {watchdog} SET severity = ". WATCHDOG_ERROR ." WHERE severity = 2");
+ $ret[] = update_sql("UPDATE {watchdog} SET severity = " . WATCHDOG_NOTICE . " WHERE severity = 0");
+ $ret[] = update_sql("UPDATE {watchdog} SET severity = " . WATCHDOG_WARNING . " WHERE severity = 1");
+ $ret[] = update_sql("UPDATE {watchdog} SET severity = " . WATCHDOG_ERROR . " WHERE severity = 2");
return $ret;
}
@@ -1592,15 +1592,15 @@ function system_update_6017() {
);
foreach ($var_names as $old => $new) {
foreach (array('_subject', '_body') as $suffix) {
- $old_name = 'user_mail_'. $old . $suffix;
- $new_name = 'user_mail_'. $new . $suffix;
+ $old_name = 'user_mail_' . $old . $suffix;
+ $new_name = 'user_mail_' . $new . $suffix;
if ($old_val = variable_get($old_name, FALSE)) {
variable_set($new_name, $old_val);
variable_del($old_name);
$ret[] = array('success' => TRUE, 'query' => "variable_set($new_name)");
$ret[] = array('success' => TRUE, 'query' => "variable_del($old_name)");
if ($old_name == 'user_mail_approval_body') {
- drupal_set_message('Saving an old value of the welcome message body for users that are pending administrator approval. However, you should consider modifying this text, since Drupal can now be configured to automatically notify users and send them their login information when their accounts are approved. See the <a href="'. url('admin/user/settings') .'">User settings</a> page for details.');
+ drupal_set_message('Saving an old value of the welcome message body for users that are pending administrator approval. However, you should consider modifying this text, since Drupal can now be configured to automatically notify users and send them their login information when their accounts are approved. See the <a href="' . url('admin/user/settings') . '">User settings</a> page for details.');
}
}
}
@@ -1627,7 +1627,7 @@ function system_update_6018() {
while ($format = db_fetch_object($result)) {
$weight = db_result(db_query("SELECT MAX(weight) FROM {filters} WHERE format = %d", $format->format));
db_query("INSERT INTO {filters} (format, module, delta, weight) VALUES (%d, '%s', %d, %d)", $format->format, 'filter', 3, max(10, $weight + 1));
- $ret[] = array('success' => TRUE, 'query' => "HTML corrector filter added to the '". $format->name ."' input format.");
+ $ret[] = array('success' => TRUE, 'query' => "HTML corrector filter added to the '" . $format->name . "' input format.");
}
return $ret;
@@ -1732,16 +1732,16 @@ function system_update_6019() {
// Remove default => 0, set auto increment.
$new_uid = 1 + db_result(db_query('SELECT MAX(uid) FROM {users}'));
- $ret[] = update_sql('UPDATE {users} SET uid = '. $new_uid .' WHERE uid = 0');
+ $ret[] = update_sql('UPDATE {users} SET uid = ' . $new_uid . ' WHERE uid = 0');
db_drop_primary_key($ret, 'users');
db_change_field($ret, 'users', 'uid', 'uid', array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), array('primary key' => array('uid')));
- $ret[] = update_sql('UPDATE {users} SET uid = 0 WHERE uid = '. $new_uid);
+ $ret[] = update_sql('UPDATE {users} SET uid = 0 WHERE uid = ' . $new_uid);
// Special field names.
$map = array('node_revisions' => 'vid');
// Make sure these tables have proper auto_increment fields.
foreach (array('boxes', 'files', 'node', 'node_revisions') as $table) {
- $field = isset($map[$table]) ? $map[$table] : $table[0] .'id';
+ $field = isset($map[$table]) ? $map[$table] : $table[0] . 'id';
db_drop_primary_key($ret, $table);
db_change_field($ret, $table, $field, $field, array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), array('primary key' => array($field)));
}
@@ -1930,7 +1930,7 @@ function system_update_6021() {
$_SESSION['menu_item_map'][$item['mid']] = array('mlid' => $item['mlid'], 'menu_name' => $item['menu_name']);
}
elseif (!isset($_SESSION['menu_menu_map'][$item['mid']])) {
- $item['menu_name'] = 'menu-'. preg_replace('/[^a-zA-Z0-9]/', '-', strtolower($item['title']));
+ $item['menu_name'] = 'menu-' . preg_replace('/[^a-zA-Z0-9]/', '-', strtolower($item['title']));
$item['menu_name'] = substr($item['menu_name'], 0, 20);
$original_menu_name = $item['menu_name'];
$i = 0;
@@ -1957,7 +1957,7 @@ function system_update_6021() {
if (!empty($_SESSION['menu_bogus_menus'])) {
// Remove entries in bogus menus. This is secure because we deleted
// every non-alpanumeric character from the menu name.
- $ret[] = update_sql("DELETE FROM {menu_links} WHERE menu_name IN ('". implode("', '", $_SESSION['menu_bogus_menus']) ."')");
+ $ret[] = update_sql("DELETE FROM {menu_links} WHERE menu_name IN ('" . implode("', '", $_SESSION['menu_bogus_menus']) . "')");
}
$menu_primary_menu = variable_get('menu_primary_menu', 0);
@@ -1983,7 +1983,7 @@ function system_update_6021() {
// Change the existing menu name to 'primary-links'.
$replace = array('%new_name' => 'primary-links', '%desc' => $menus['primary-links']['description'], '%old_name' => $_SESSION['menu_menu_map'][$updated_primary_links_menu]);
$ret[] = update_sql(strtr("UPDATE {menu_custom} SET menu_name = '%new_name', description = '%desc' WHERE menu_name = '%old_name'", $replace));
- $ret[] = update_sql("UPDATE {menu_links} SET menu_name = 'primary-links' WHERE menu_name = '". $_SESSION['menu_menu_map'][$updated_primary_links_menu] ."'");
+ $ret[] = update_sql("UPDATE {menu_links} SET menu_name = 'primary-links' WHERE menu_name = '" . $_SESSION['menu_menu_map'][$updated_primary_links_menu] . "'");
$_SESSION['menu_menu_map'][$updated_primary_links_menu] = 'primary-links';
}
@@ -2007,7 +2007,7 @@ function system_update_6021() {
// Change the existing menu name to 'secondary-links'.
$replace = array('%new_name' => 'secondary-links', '%desc' => $menus['secondary-links']['description'], '%old_name' => $_SESSION['menu_menu_map'][$updated_secondary_links_menu]);
$ret[] = update_sql(strtr("UPDATE {menu_custom} SET menu_name = '%new_name', description = '%desc' WHERE menu_name = '%old_name'", $replace));
- $ret[] = update_sql("UPDATE {menu_links} SET menu_name = 'secondary-links' WHERE menu_name = '". $_SESSION['menu_menu_map'][$updated_secondary_links_menu] ."'");
+ $ret[] = update_sql("UPDATE {menu_links} SET menu_name = 'secondary-links' WHERE menu_name = '" . $_SESSION['menu_menu_map'][$updated_secondary_links_menu] . "'");
$_SESSION['menu_menu_map'][$updated_secondary_links_menu] = 'secondary-links';
}
@@ -2032,10 +2032,10 @@ function system_update_6021() {
foreach ($_SESSION['menu_menu_map'] as $mid => $menu_name) {
// This is again secure because we deleted every non-alpanumeric
// character from the menu name.
- $ret[] = update_sql("UPDATE {blocks} SET delta = '". $menu_name ."' WHERE module = 'menu' AND delta = '". $mid ."'");
- $ret[] = update_sql("UPDATE {blocks_roles} SET delta = '". $menu_name ."' WHERE module = 'menu' AND delta = '". $mid ."'");
+ $ret[] = update_sql("UPDATE {blocks} SET delta = '" . $menu_name . "' WHERE module = 'menu' AND delta = '" . $mid . "'");
+ $ret[] = update_sql("UPDATE {blocks_roles} SET delta = '" . $menu_name . "' WHERE module = 'menu' AND delta = '" . $mid . "'");
}
- $ret[] = array('success' => TRUE, 'query' => 'Relocated '. $_SESSION['system_update_6021'] .' existing items to the new menu system.');
+ $ret[] = array('success' => TRUE, 'query' => 'Relocated ' . $_SESSION['system_update_6021'] . ' existing items to the new menu system.');
$ret[] = update_sql("DROP TABLE {menu}");
unset($_SESSION['system_update_6021'], $_SESSION['system_update_6021_max'], $_SESSION['menu_menu_map'], $_SESSION['menu_item_map'], $_SESSION['menu_bogus_menus']);
// Create the menu overview links - also calls menu_rebuild(). If menu is
@@ -2134,7 +2134,7 @@ function system_update_6026() {
$ret = array();
// Notify user that new update module exists.
- drupal_set_message('Drupal can check periodically for important bug fixes and security releases using the new update status module. This module can be turned on from the <a href="'. url('admin/build/modules') .'">modules administration page</a>. For more information please read the <a href="http://drupal.org/handbook/modules/update">Update status handbook page</a>.');
+ drupal_set_message('Drupal can check periodically for important bug fixes and security releases using the new update status module. This module can be turned on from the <a href="' . url('admin/build/modules') . '">modules administration page</a>. For more information please read the <a href="http://drupal.org/handbook/modules/update">Update status handbook page</a>.');
return $ret;
}
@@ -2394,7 +2394,7 @@ function system_update_6038() {
if (db_table_exists('profile_fields')) {
$ret[] = update_sql("UPDATE {profile_fields} SET category = 'Account settings' WHERE LOWER(category) = 'account'");
if ($affectedrows = db_affected_rows()) {
- drupal_set_message('There were '. $affectedrows .' profile fields that used a reserved category name. They have been assigned to the category "Account settings".');
+ drupal_set_message('There were ' . $affectedrows . ' profile fields that used a reserved category name. They have been assigned to the category "Account settings".');
}
}
return $ret;
@@ -2438,7 +2438,7 @@ function system_update_6041() {
$vid = intval(variable_get('forum_nav_vocabulary', ''));
if (db_table_exists('vocabulary') && $vid) {
$ret[] = update_sql("UPDATE {vocabulary} SET required = 0 WHERE vid = " . $vid);
- $ret[] = update_sql("UPDATE {system} SET weight = ". $weight ." WHERE name = 'forum'");
+ $ret[] = update_sql("UPDATE {system} SET weight = " . $weight . " WHERE name = 'forum'");
}
return $ret;
}
@@ -2448,10 +2448,10 @@ function system_update_6041() {
*/
function system_update_6042() {
foreach (list_themes() as $theme) {
- $stylesheet = variable_get('color_'. $theme->name .'_stylesheet', NULL);
+ $stylesheet = variable_get('color_' . $theme->name . '_stylesheet', NULL);
if (!empty($stylesheet)) {
- variable_set('color_'. $theme->name .'_stylesheets', array($stylesheet));
- variable_del('color_'. $theme->name .'_stylesheet');
+ variable_set('color_' . $theme->name . '_stylesheets', array($stylesheet));
+ variable_del('color_' . $theme->name . '_stylesheet');
}
}
return array();
@@ -2616,7 +2616,7 @@ function system_update_6045() {
// Notify user that delete permissions may have been changed. This was in
// effect since system_update_6039(), but there was no user notice.
- drupal_set_message('Drupal now has separate edit and delete permissions. Previously, users who were able to edit content were automatically allowed to delete it. For added security, delete permissions for individual core content types have been <strong>removed</strong> from all roles on your site (only roles with the "administer nodes" permission can now delete these types of content). If you would like to reenable any individual delete permissions, you can do this at the <a href="'. url('admin/user/permissions', array('fragment' => 'module-node')) .'">permissions page</a>.');
+ drupal_set_message('Drupal now has separate edit and delete permissions. Previously, users who were able to edit content were automatically allowed to delete it. For added security, delete permissions for individual core content types have been <strong>removed</strong> from all roles on your site (only roles with the "administer nodes" permission can now delete these types of content). If you would like to reenable any individual delete permissions, you can do this at the <a href="' . url('admin/user/permissions', array('fragment' => 'module-node')) . '">permissions page</a>.');
return $ret;
}
@@ -2737,7 +2737,7 @@ function system_update_7003() {
}
else {
$invalid_host = check_plain($blocked->mask);
- $ret[] = array('success' => TRUE, 'query' => 'The host '. $invalid_host .' is no longer blocked because it is not a valid IP address.');
+ $ret[] = array('success' => TRUE, 'query' => 'The host ' . $invalid_host . ' is no longer blocked because it is not a valid IP address.');
}
}
if (isset($invalid_host)) {
@@ -2791,8 +2791,8 @@ function system_update_7004(&$sandbox) {
foreach ($renamed_deltas as $module => $deltas) {
foreach ($deltas as $old_delta => $new_delta) {
// Only do the update if the old block actually exists.
- if (db_result(db_query("SELECT COUNT(*) FROM {". $table ."} WHERE module = '%s' AND delta = '%s'", $module, $old_delta))) {
- $ret[] = update_sql("UPDATE {". $table ."} SET delta = '". $new_delta ."' WHERE module = '". $module ."' AND delta = '". $old_delta ."'");
+ if (db_result(db_query("SELECT COUNT(*) FROM {" . $table . "} WHERE module = '%s' AND delta = '%s'", $module, $old_delta))) {
+ $ret[] = update_sql("UPDATE {" . $table . "} SET delta = '" . $new_delta . "' WHERE module = '" . $module . "' AND delta = '" . $old_delta . "'");
}
}
}
diff --git a/modules/system/system.module b/modules/system/system.module
index c864d8082..432881ef9 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -49,60 +49,60 @@ function system_help($path, $arg) {
switch ($path) {
case 'admin/help#system':
- $output = '<p>'. t('The system module is at the foundation of your Drupal website, and provides basic but extensible functionality for use by other modules and themes. Some integral elements of Drupal are contained in and managed by the system module, including caching, enabling or disabling of modules and themes, preparing and displaying the administrative page, and configuring fundamental site settings. A number of key system maintenance operations are also part of the system module.') .'</p>';
- $output .= '<p>'. t('The system module provides:') .'</p>';
- $output .= '<ul><li>'. t('support for enabling and disabling <a href="@modules">modules</a>. Drupal comes packaged with a number of core modules; each module provides a discrete set of features and may be enabled depending on the needs of your site. A wide array of additional modules contributed by members of the Drupal community are available for download at the <a href="@drupal-modules">Drupal.org module page</a>.', array('@modules' => url('admin/build/modules'), '@drupal-modules' => 'http://drupal.org/project/modules')) .'</li>';
- $output .= '<li>'. t('support for enabling and disabling <a href="@themes">themes</a>, which determine the design and presentation of your site. Drupal comes packaged with several core themes and additional contributed themes are available at the <a href="@drupal-themes">Drupal.org theme page</a>.', array('@themes' => url('admin/build/themes'), '@drupal-themes' => 'http://drupal.org/project/themes')) .'</li>';
- $output .= '<li>'. t('a robust <a href="@cache-settings">caching system</a> that allows the efficient re-use of previously-constructed web pages and web page components. Drupal stores the pages requested by anonymous users in a compressed format; depending on your site configuration and the amount of your web traffic tied to anonymous visitors, Drupal\'s caching system may significantly increase the speed of your site.', array('@cache-settings' => url('admin/settings/performance'))) .'</li>';
- $output .= '<li>'. t('a set of routine administrative operations that rely on a correctly-configured <a href="@cron">cron maintenance task</a> to run automatically. A number of other modules, including the feed aggregator, and search also rely on <a href="@cron">cron maintenance tasks</a>. For more information, see the online handbook entry for <a href="@handbook">configuring cron jobs</a>.', array('@cron' => url('admin/reports/status'), '@handbook' => 'http://drupal.org/cron')) .'</li>';
- $output .= '<li>'. t('basic configuration options for your site, including <a href="@date-settings">date and time settings</a>, <a href="@file-system">file system settings</a>, <a href="@clean-url">clean URL support</a>, <a href="@site-info">site name and other information</a>, and a <a href="@site-maintenance">site maintenance</a> function for taking your site temporarily off-line.', array('@date-settings' => url('admin/settings/date-time'), '@file-system' => url('admin/settings/file-system'), '@clean-url' => url('admin/settings/clean-urls'), '@site-info' => url('admin/settings/site-information'), '@site-maintenance' => url('admin/settings/site-maintenance'))) .'</li></ul>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@system">System module</a>.', array('@system' => 'http://drupal.org/handbook/modules/system/')) .'</p>';
+ $output = '<p>' . t('The system module is at the foundation of your Drupal website, and provides basic but extensible functionality for use by other modules and themes. Some integral elements of Drupal are contained in and managed by the system module, including caching, enabling or disabling of modules and themes, preparing and displaying the administrative page, and configuring fundamental site settings. A number of key system maintenance operations are also part of the system module.') . '</p>';
+ $output .= '<p>' . t('The system module provides:') . '</p>';
+ $output .= '<ul><li>' . t('support for enabling and disabling <a href="@modules">modules</a>. Drupal comes packaged with a number of core modules; each module provides a discrete set of features and may be enabled depending on the needs of your site. A wide array of additional modules contributed by members of the Drupal community are available for download at the <a href="@drupal-modules">Drupal.org module page</a>.', array('@modules' => url('admin/build/modules'), '@drupal-modules' => 'http://drupal.org/project/modules')) . '</li>';
+ $output .= '<li>' . t('support for enabling and disabling <a href="@themes">themes</a>, which determine the design and presentation of your site. Drupal comes packaged with several core themes and additional contributed themes are available at the <a href="@drupal-themes">Drupal.org theme page</a>.', array('@themes' => url('admin/build/themes'), '@drupal-themes' => 'http://drupal.org/project/themes')) . '</li>';
+ $output .= '<li>' . t('a robust <a href="@cache-settings">caching system</a> that allows the efficient re-use of previously-constructed web pages and web page components. Drupal stores the pages requested by anonymous users in a compressed format; depending on your site configuration and the amount of your web traffic tied to anonymous visitors, Drupal\'s caching system may significantly increase the speed of your site.', array('@cache-settings' => url('admin/settings/performance'))) . '</li>';
+ $output .= '<li>' . t('a set of routine administrative operations that rely on a correctly-configured <a href="@cron">cron maintenance task</a> to run automatically. A number of other modules, including the feed aggregator, and search also rely on <a href="@cron">cron maintenance tasks</a>. For more information, see the online handbook entry for <a href="@handbook">configuring cron jobs</a>.', array('@cron' => url('admin/reports/status'), '@handbook' => 'http://drupal.org/cron')) . '</li>';
+ $output .= '<li>' . t('basic configuration options for your site, including <a href="@date-settings">date and time settings</a>, <a href="@file-system">file system settings</a>, <a href="@clean-url">clean URL support</a>, <a href="@site-info">site name and other information</a>, and a <a href="@site-maintenance">site maintenance</a> function for taking your site temporarily off-line.', array('@date-settings' => url('admin/settings/date-time'), '@file-system' => url('admin/settings/file-system'), '@clean-url' => url('admin/settings/clean-urls'), '@site-info' => url('admin/settings/site-information'), '@site-maintenance' => url('admin/settings/site-maintenance'))) . '</li></ul>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@system">System module</a>.', array('@system' => 'http://drupal.org/handbook/modules/system/')) . '</p>';
return $output;
case 'admin':
- return '<p>'. t('Welcome to the administration section. Here you may control how your site functions.') .'</p>';
+ return '<p>' . t('Welcome to the administration section. Here you may control how your site functions.') . '</p>';
case 'admin/by-module':
- return '<p>'. t('This page shows you all available administration tasks for each module.') .'</p>';
+ return '<p>' . t('This page shows you all available administration tasks for each module.') . '</p>';
case 'admin/build/themes':
- $output = '<p>'. t('Select which themes are available to your users and specify the default theme. To configure site-wide display settings, click the "configure" task above. Alternatively, to override these settings in a specific theme, click the "configure" link for that theme. Note that different themes may have different regions available for displaying content; for consistency in presentation, you may wish to enable only one theme.') .'</p>';
- $output .= '<p>'. t('To change the appearance of your site, a number of <a href="@themes">contributed themes</a> are available.', array('@themes' => 'http://drupal.org/project/themes')) .'</p>';
+ $output = '<p>' . t('Select which themes are available to your users and specify the default theme. To configure site-wide display settings, click the "configure" task above. Alternatively, to override these settings in a specific theme, click the "configure" link for that theme. Note that different themes may have different regions available for displaying content; for consistency in presentation, you may wish to enable only one theme.') . '</p>';
+ $output .= '<p>' . t('To change the appearance of your site, a number of <a href="@themes">contributed themes</a> are available.', array('@themes' => 'http://drupal.org/project/themes')) . '</p>';
return $output;
- case 'admin/build/themes/settings/'. $arg[4]:
+ case 'admin/build/themes/settings/' . $arg[4]:
$reference = explode('.', $arg[4], 2);
$theme = array_pop($reference);
- return '<p>'. t('These options control the display settings for the <code>%template</code> theme. When your site is displayed using this theme, these settings will be used. By clicking "Reset to defaults," you can choose to use the <a href="@global">global settings</a> for this theme.', array('%template' => $theme, '@global' => url('admin/build/themes/settings'))) .'</p>';
+ return '<p>' . t('These options control the display settings for the <code>%template</code> theme. When your site is displayed using this theme, these settings will be used. By clicking "Reset to defaults," you can choose to use the <a href="@global">global settings</a> for this theme.', array('%template' => $theme, '@global' => url('admin/build/themes/settings'))) . '</p>';
case 'admin/build/themes/settings':
- return '<p>'. t('These options control the default display settings for your entire site, across all themes. Unless they have been overridden by a specific theme, these settings will be used.') .'</p>';
+ return '<p>' . t('These options control the default display settings for your entire site, across all themes. Unless they have been overridden by a specific theme, these settings will be used.') . '</p>';
case 'admin/build/modules':
- $output = '<p>'. t('Modules are plugins that extend Drupal\'s core functionality. Enable modules by selecting the <em>Enabled</em> checkboxes below and clicking the <em>Save configuration</em> button. Once a module is enabled, new <a href="@permissions">permissions</a> may be available. To reduce server load, modules with their <em>Throttle</em> checkbox selected are temporarily disabled when your site becomes extremely busy. (Note that the <em>Throttle</em> checkbox is only available if the Throttle module is enabled.)', array('@permissions' => url('admin/user/permissions')));
+ $output = '<p>' . t('Modules are plugins that extend Drupal\'s core functionality. Enable modules by selecting the <em>Enabled</em> checkboxes below and clicking the <em>Save configuration</em> button. Once a module is enabled, new <a href="@permissions">permissions</a> may be available. To reduce server load, modules with their <em>Throttle</em> checkbox selected are temporarily disabled when your site becomes extremely busy. (Note that the <em>Throttle</em> checkbox is only available if the Throttle module is enabled.)', array('@permissions' => url('admin/user/permissions')));
if (module_exists('throttle')) {
- $output .= ' '. t('The auto-throttle functionality must be enabled on the <a href="@throttle">throttle configuration page</a> after having enabled the throttle module.', array('@throttle' => url('admin/settings/throttle')));
+ $output .= ' ' . t('The auto-throttle functionality must be enabled on the <a href="@throttle">throttle configuration page</a> after having enabled the throttle module.', array('@throttle' => url('admin/settings/throttle')));
}
$output .= '</p>';
- $output .= '<p>'. t('It is important that <a href="@update-php">update.php</a> is run every time a module is updated to a newer version.', array('@update-php' => $base_url .'/update.php')) .'</p>';
- $output .= '<p>'. t('You can find all administration tasks belonging to a particular module on the <a href="@by-module">administration by module page</a>.', array('@by-module' => url('admin/by-module'))) .'</p>';
- $output .= '<p>'. t('To extend the functionality of your site, a number of <a href="@modules">contributed modules</a> are available.', array('@modules' => 'http://drupal.org/project/modules')) .'</p>';
+ $output .= '<p>' . t('It is important that <a href="@update-php">update.php</a> is run every time a module is updated to a newer version.', array('@update-php' => $base_url . '/update.php')) . '</p>';
+ $output .= '<p>' . t('You can find all administration tasks belonging to a particular module on the <a href="@by-module">administration by module page</a>.', array('@by-module' => url('admin/by-module'))) . '</p>';
+ $output .= '<p>' . t('To extend the functionality of your site, a number of <a href="@modules">contributed modules</a> are available.', array('@modules' => 'http://drupal.org/project/modules')) . '</p>';
return $output;
case 'admin/build/modules/uninstall':
- return '<p>'. t('The uninstall process removes all data related to a module. To uninstall a module, you must first disable it. Not all modules support this feature.') .'</p>';
+ return '<p>' . t('The uninstall process removes all data related to a module. To uninstall a module, you must first disable it. Not all modules support this feature.') . '</p>';
case 'admin/build/block/configure':
if ($arg[4] == 'system' && $arg[5] == 0) {
- return '<p>'. t('The <em>Powered by Drupal</em> block is an optional link to the home page of the Drupal project. While there is absolutely no requirement that sites feature this link, it may be used to show support for Drupal.') .'</p>';
+ return '<p>' . t('The <em>Powered by Drupal</em> block is an optional link to the home page of the Drupal project. While there is absolutely no requirement that sites feature this link, it may be used to show support for Drupal.') . '</p>';
}
break;
case 'admin/settings/actions':
case 'admin/settings/actions/manage':
- $output = '<p>'. t('Actions are individual tasks that the system can do, such as unpublishing a piece of content or banning a user. Modules, such as the trigger module, can fire these actions when certain system events happen; for example, when a new post is added or when a user logs in. Modules may also provide additional actions.') .'</p>';
- $output .= '<p>'. t('There are two types of actions: simple and advanced. Simple actions do not require any additional configuration, and are listed here automatically. Advanced actions can do more than simple actions; for example, send an e-mail to a specified address, or check for certain words within a piece of content. These actions need to be created and configured first before they may be used. To create an advanced action, select the action from the drop-down below and click the <em>Create</em> button.') .'</p>';
+ $output = '<p>' . t('Actions are individual tasks that the system can do, such as unpublishing a piece of content or banning a user. Modules, such as the trigger module, can fire these actions when certain system events happen; for example, when a new post is added or when a user logs in. Modules may also provide additional actions.') . '</p>';
+ $output .= '<p>' . t('There are two types of actions: simple and advanced. Simple actions do not require any additional configuration, and are listed here automatically. Advanced actions can do more than simple actions; for example, send an e-mail to a specified address, or check for certain words within a piece of content. These actions need to be created and configured first before they may be used. To create an advanced action, select the action from the drop-down below and click the <em>Create</em> button.') . '</p>';
if (module_exists('trigger')) {
- $output .= '<p>'. t('You may proceed to the <a href="@url">Triggers</a> page to assign these actions to system events.', array('@url' => url('admin/build/trigger'))) .'</p>';
+ $output .= '<p>' . t('You may proceed to the <a href="@url">Triggers</a> page to assign these actions to system events.', array('@url' => url('admin/build/trigger'))) . '</p>';
}
return $output;
case 'admin/settings/actions/configure':
return t('An advanced action offers additional configuration options which may be filled out below. Changing the <em>Description</em> field is recommended, in order to better identify the precise action taking place. This description will be displayed in modules such as the trigger module when assigning actions to system events, so it is best if it is as descriptive as possible (for example, "Send e-mail to Moderation Team" rather than simply "Send e-mail").');
case 'admin/settings/ip-blocking':
- return '<p>'. t('IP addresses listed here are blocked from your site before any modules are loaded. You may add IP addresses to the list, or delete existing entries.') .'</p>';
+ return '<p>' . t('IP addresses listed here are blocked from your site before any modules are loaded. You may add IP addresses to the list, or delete existing entries.') . '</p>';
case 'admin/reports/status':
- return '<p>'. t("Here you can find a short overview of your site's parameters as well as any problems detected with your installation. It may be useful to copy and paste this information into support requests filed on drupal.org's support forums and project issue queues.") .'</p>';
+ return '<p>' . t("Here you can find a short overview of your site's parameters as well as any problems detected with your installation. It may be useful to copy and paste this information into support requests filed on drupal.org's support forums and project issue queues.") . '</p>';
}
}
@@ -420,7 +420,7 @@ function system_menu() {
);
foreach (list_themes() as $theme) {
- $items['admin/build/themes/settings/'. $theme->name] = array(
+ $items['admin/build/themes/settings/' . $theme->name] = array(
'title' => $theme->info['name'],
'page arguments' => array('system_theme_settings', $theme->name),
'type' => MENU_LOCAL_TASK,
@@ -684,13 +684,13 @@ function system_init() {
if (arg(0) == 'admin' || (variable_get('node_admin_theme', '0') && arg(0) == 'node' && (arg(1) == 'add' || arg(2) == 'edit'))) {
global $custom_theme;
$custom_theme = variable_get('admin_theme', '0');
- drupal_add_css(drupal_get_path('module', 'system') .'/admin.css', 'module');
+ drupal_add_css(drupal_get_path('module', 'system') . '/admin.css', 'module');
}
// Add the CSS for this 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') . '/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');
}
/**
@@ -758,7 +758,7 @@ function system_block($op = 'list', $delta = '', $edit = NULL) {
variable_set('drupal_badge_size', $edit['size']);
break;
case 'view':
- $image_path = 'misc/'. variable_get('drupal_badge_color', 'powered-blue') .'-'. variable_get('drupal_badge_size', '80x15') .'.png';
+ $image_path = 'misc/' . variable_get('drupal_badge_color', 'powered-blue') . '-' . variable_get('drupal_badge_size', '80x15') . '.png';
$block['subject'] = NULL; // Don't display a title
$block['content'] = theme('system_powered_by', $image_path);
return $block;
@@ -793,7 +793,7 @@ function system_admin_menu_block($item) {
}
// Prepare for sorting as in function _menu_tree_check_access().
// The weight is offset so it is always positive, with a uniform 5-digits.
- $content[(50000 + $item['weight']) .' '. $item['title'] .' '. $item['mlid']] = $item;
+ $content[(50000 + $item['weight']) . ' ' . $item['title'] . ' ' . $item['mlid']] = $item;
}
ksort($content);
return $content;
@@ -863,7 +863,7 @@ function system_theme_select_form($description = '', $default_value = '', $weigh
$screenshot = $screenshot ? theme('image', $screenshot, t('Screenshot for %theme theme', array('%theme' => $info->name)), '', array('class' => 'screenshot'), FALSE) : t('no screenshot');
$form['themes'][$info->key]['screenshot'] = array('#value' => $screenshot);
- $form['themes'][$info->key]['description'] = array('#type' => 'item', '#title' => $info->name, '#value' => dirname($info->filename) . ($info->name == variable_get('theme_default', 'garland') ? '<br /> <em>'. t('(site default theme)') .'</em>' : ''));
+ $form['themes'][$info->key]['description'] = array('#type' => 'item', '#title' => $info->name, '#value' => dirname($info->filename) . ($info->name == variable_get('theme_default', 'garland') ? '<br /> <em>' . t('(site default theme)') . '</em>' : ''));
$options[$info->key] = '';
}
@@ -1005,7 +1005,7 @@ function _system_theme_data() {
$sub_themes[] = $key;
}
if (empty($themes[$key]->info['engine'])) {
- $filename = dirname($themes[$key]->filename) .'/'. $themes[$key]->name .'.theme';
+ $filename = dirname($themes[$key]->filename) . '/' . $themes[$key]->name . '.theme';
if (file_exists($filename)) {
$themes[$key]->owner = $filename;
$themes[$key]->prefix = $key;
@@ -1024,7 +1024,7 @@ function _system_theme_data() {
$pathed_stylesheets = array();
foreach ($themes[$key]->info['stylesheets'] as $media => $stylesheets) {
foreach ($stylesheets as $stylesheet) {
- $pathed_stylesheets[$media][$stylesheet] = dirname($themes[$key]->filename) .'/'. $stylesheet;
+ $pathed_stylesheets[$media][$stylesheet] = dirname($themes[$key]->filename) . '/' . $stylesheet;
}
}
$themes[$key]->info['stylesheets'] = $pathed_stylesheets;
@@ -1032,12 +1032,12 @@ function _system_theme_data() {
// Give the scripts proper path information.
$scripts = array();
foreach ($themes[$key]->info['scripts'] as $script) {
- $scripts[$script] = dirname($themes[$key]->filename) .'/'. $script;
+ $scripts[$script] = dirname($themes[$key]->filename) . '/' . $script;
}
$themes[$key]->info['scripts'] = $scripts;
// Give the screenshot proper path information.
if (!empty($themes[$key]->info['screenshot'])) {
- $themes[$key]->info['screenshot'] = dirname($themes[$key]->filename) .'/'. $themes[$key]->info['screenshot'];
+ $themes[$key]->info['screenshot'] = dirname($themes[$key]->filename) . '/' . $themes[$key]->info['screenshot'];
}
}
@@ -1237,8 +1237,8 @@ function _system_sort_requirements($a, $b) {
*/
function system_node_type($op, $info) {
if ($op == 'update' && !empty($info->old_type) && $info->type != $info->old_type) {
- $old = 'toggle_node_info_'. $info->old_type;
- $new = 'toggle_node_info_'. $info->type;
+ $old = 'toggle_node_info_' . $info->old_type;
+ $new = 'toggle_node_info_' . $info->type;
$theme_settings = variable_get('theme_settings', array());
if (isset($theme_settings[$old])) {
@@ -1359,7 +1359,7 @@ function system_get_module_admin_tasks($module) {
$admin_task_count = 0;
// Check for permissions.
if (module_hook($module, 'perm') && $admin_access) {
- $admin_tasks[-1] = l(t('Configure permissions'), 'admin/user/permissions', array('fragment' => 'module-'. $module));
+ $admin_tasks[-1] = l(t('Configure permissions'), 'admin/user/permissions', array('fragment' => 'module-' . $module));
}
// Check for menu items that are admin links.
@@ -1474,7 +1474,7 @@ function system_actions_manage() {
foreach ($actions_map as $key => $array) {
if ($array['configurable']) {
- $options[$key] = $array['description'] .'...';
+ $options[$key] = $array['description'] . '...';
}
else {
$unconfigurable[] = $array;
@@ -1504,7 +1504,7 @@ function system_actions_manage() {
if (!empty($pager)) {
$row[] = array(array('data' => $pager, 'colspan' => '3'));
}
- $output .= '<h3>'. t('Actions available to Drupal:') .'</h3>';
+ $output .= '<h3>' . t('Actions available to Drupal:') . '</h3>';
$output .= theme('table', $header, $row);
}
@@ -1552,7 +1552,7 @@ function system_actions_manage_form($form_state, $options = array()) {
*/
function system_actions_manage_form_submit($form, &$form_state) {
if ($form_state['values']['action']) {
- $form_state['redirect'] = 'admin/settings/actions/configure/'. $form_state['values']['action'];
+ $form_state['redirect'] = 'admin/settings/actions/configure/' . $form_state['values']['action'];
}
}
@@ -1612,7 +1612,7 @@ function system_actions_configure($form_state, $action = NULL) {
'#description' => t('A unique description for this advanced action. This description will be displayed in the interface of modules that integrate with actions, such as Trigger module.'),
'#weight' => -10
);
- $action_form = $function .'_form';
+ $action_form = $function . '_form';
$form = array_merge($form, $action_form($edit));
$form['actions_type'] = array(
'#type' => 'value',
@@ -1646,7 +1646,7 @@ function system_actions_configure($form_state, $action = NULL) {
* Validate system_actions_configure form submissions.
*/
function system_actions_configure_validate($form, $form_state) {
- $function = actions_function_lookup($form_state['values']['actions_action']) .'_validate';
+ $function = actions_function_lookup($form_state['values']['actions_action']) . '_validate';
// Hand off validation to the action.
if (function_exists($function)) {
$function($form, $form_state);
@@ -1658,7 +1658,7 @@ function system_actions_configure_validate($form, $form_state) {
*/
function system_actions_configure_submit($form, &$form_state) {
$function = actions_function_lookup($form_state['values']['actions_action']);
- $submit_function = $function .'_submit';
+ $submit_function = $function . '_submit';
// Action will return keyed array of values to store.
$params = $submit_function($form, $form_state);
@@ -1893,7 +1893,7 @@ function system_mail($key, &$message, $params) {
$node = $params['node'];
$variables += array(
'%uid' => $node->uid,
- '%node_url' => url('node/'. $node->nid, array('absolute' => TRUE)),
+ '%node_url' => url('node/' . $node->nid, array('absolute' => TRUE)),
'%node_type' => node_get_types('name', $node),
'%title' => $node->title,
'%teaser' => $node->teaser,
@@ -1967,7 +1967,7 @@ function system_message_action(&$object, $context = array()) {
if (isset($node) && is_object($node)) {
$variables = array_merge($variables, array(
'%uid' => $node->uid,
- '%node_url' => url('node/'. $node->nid, array('absolute' => TRUE)),
+ '%node_url' => url('node/' . $node->nid, array('absolute' => TRUE)),
'%node_type' => check_plain(node_get_types('name', $node)),
'%title' => filter_xss($node->title),
'%teaser' => filter_xss($node->teaser),
@@ -2022,7 +2022,7 @@ function _system_zonelist() {
$zones = array();
foreach ($zonelist as $offset) {
$zone = $offset * 3600;
- $zones[$zone] = format_date($timestamp, 'custom', variable_get('date_format_long', 'l, F j, Y - H:i') .' O', $zone);
+ $zones[$zone] = format_date($timestamp, 'custom', variable_get('date_format_long', 'l, F j, Y - H:i') . ' O', $zone);
}
return $zones;
}
diff --git a/modules/taxonomy/taxonomy.admin.inc b/modules/taxonomy/taxonomy.admin.inc
index 90ff0168d..52c0aa938 100644
--- a/modules/taxonomy/taxonomy.admin.inc
+++ b/modules/taxonomy/taxonomy.admin.inc
@@ -210,11 +210,11 @@ function taxonomy_form_vocabulary_submit($form, &$form_state) {
switch (taxonomy_save_vocabulary($form_state['values'])) {
case SAVED_NEW:
drupal_set_message(t('Created new vocabulary %name.', array('%name' => $form_state['values']['name'])));
- watchdog('taxonomy', 'Created new vocabulary %name.', array('%name' => $form_state['values']['name']), WATCHDOG_NOTICE, l(t('edit'), 'admin/content/taxonomy/edit/vocabulary/'. $form_state['values']['vid']));
+ watchdog('taxonomy', 'Created new vocabulary %name.', array('%name' => $form_state['values']['name']), WATCHDOG_NOTICE, l(t('edit'), 'admin/content/taxonomy/edit/vocabulary/' . $form_state['values']['vid']));
break;
case SAVED_UPDATED:
drupal_set_message(t('Updated vocabulary %name.', array('%name' => $form_state['values']['name'])));
- watchdog('taxonomy', 'Updated vocabulary %name.', array('%name' => $form_state['values']['name']), WATCHDOG_NOTICE, l(t('edit'), 'admin/content/taxonomy/edit/vocabulary/'. $form_state['values']['vid']));
+ watchdog('taxonomy', 'Updated vocabulary %name.', array('%name' => $form_state['values']['name']), WATCHDOG_NOTICE, l(t('edit'), 'admin/content/taxonomy/edit/vocabulary/' . $form_state['values']['vid']));
break;
}
@@ -288,7 +288,7 @@ function taxonomy_overview_terms(&$form_state, $vocabulary) {
$results = pager_query(db_rewrite_sql('SELECT t.*, h.parent FROM {term_data} t INNER JOIN {term_hierarchy} h ON t.tid = h.tid WHERE t.vid = %d ORDER BY weight, name', 't', 'tid'), $page_increment, 0, NULL, $vocabulary->vid);
$total_entries = db_query(db_rewrite_sql('SELECT count(*) FROM {term_data} t INNER JOIN {term_hierarchy} h ON t.tid = h.tid WHERE t.vid = %d'), $page_increment, 0, NULL, $vocabulary->vid);
while ($term = db_fetch_object($results)) {
- $key = 'tid:'. $term->tid .':0';
+ $key = 'tid:' . $term->tid . ':0';
$current_page[$key] = $term;
$page_entries++;
}
@@ -342,7 +342,7 @@ function taxonomy_overview_terms(&$form_state, $vocabulary) {
// Finally, if we've gotten down this far, we're rendering a term on this page.
$page_entries++;
$term_deltas[$term->tid] = isset($term_deltas[$term->tid]) ? $term_deltas[$term->tid] + 1 : 0;
- $key = 'tid:'. $term->tid .':'. $term_deltas[$term->tid];
+ $key = 'tid:' . $term->tid . ':' . $term_deltas[$term->tid];
// Keep track of the first term displayed on this page.
if ($page_entries == 1) {
@@ -426,7 +426,7 @@ function taxonomy_overview_terms(&$form_state, $vocabulary) {
);
$form['destination'] = array(
'#type' => 'hidden',
- '#value' => $_GET['q'] . (isset($_GET['page']) ? '?page='. $_GET['page'] : '')
+ '#value' => $_GET['q'] . (isset($_GET['page']) ? '?page=' . $_GET['page'] : '')
);
}
@@ -554,9 +554,9 @@ function theme_taxonomy_overview_terms($form) {
if ($form['#parent_fields']) {
drupal_add_tabledrag('taxonomy', 'match', 'parent', 'term-parent', 'term-parent', 'term-id', FALSE);
drupal_add_tabledrag('taxonomy', 'depth', 'group', 'term-depth', NULL, NULL, FALSE);
- drupal_add_js(drupal_get_path('module', 'taxonomy') .'/taxonomy.js');
+ drupal_add_js(drupal_get_path('module', 'taxonomy') . '/taxonomy.js');
drupal_add_js(array('taxonomy' => array('backPeddle' => $back_peddle, 'forwardPeddle' => $forward_peddle)), 'setting');
- drupal_add_css(drupal_get_path('module', 'taxonomy') .'/taxonomy.css');
+ drupal_add_css(drupal_get_path('module', 'taxonomy') . '/taxonomy.css');
}
$errors = form_get_errors() != FALSE ? form_get_errors() : array();
@@ -699,8 +699,8 @@ function taxonomy_form_term(&$form_state, $vocabulary, $edit = array()) {
}
$exclude[] = $edit['tid'];
- $form['advanced']['parent'] = _taxonomy_term_select(t('Parents'), 'parent', $parent, $vocabulary->vid, t('Parent terms') .'.', 1, '<'. t('root') .'>', $exclude);
- $form['advanced']['relations'] = _taxonomy_term_select(t('Related terms'), 'relations', array_keys(taxonomy_get_related($edit['tid'])), $vocabulary->vid, NULL, 1, '<'. t('none') .'>', array($edit['tid']));
+ $form['advanced']['parent'] = _taxonomy_term_select(t('Parents'), 'parent', $parent, $vocabulary->vid, t('Parent terms') . '.', 1, '<' . t('root') . '>', $exclude);
+ $form['advanced']['relations'] = _taxonomy_term_select(t('Related terms'), 'relations', array_keys(taxonomy_get_related($edit['tid'])), $vocabulary->vid, NULL, 1, '<' . t('none') . '>', array($edit['tid']));
}
$form['advanced']['synonyms'] = array(
'#type' => 'textarea',
@@ -773,11 +773,11 @@ function taxonomy_form_term_submit($form, &$form_state) {
switch (taxonomy_save_term($form_state['values'])) {
case SAVED_NEW:
drupal_set_message(t('Created new term %term.', array('%term' => $form_state['values']['name'])));
- watchdog('taxonomy', 'Created new term %term.', array('%term' => $form_state['values']['name']), WATCHDOG_NOTICE, l(t('edit'), 'admin/content/taxonomy/edit/term/'. $form_state['values']['tid']));
+ watchdog('taxonomy', 'Created new term %term.', array('%term' => $form_state['values']['name']), WATCHDOG_NOTICE, l(t('edit'), 'admin/content/taxonomy/edit/term/' . $form_state['values']['tid']));
break;
case SAVED_UPDATED:
drupal_set_message(t('Updated term %term.', array('%term' => $form_state['values']['name'])));
- watchdog('taxonomy', 'Updated term %term.', array('%term' => $form_state['values']['name']), WATCHDOG_NOTICE, l(t('edit'), 'admin/content/taxonomy/edit/term/'. $form_state['values']['tid']));
+ watchdog('taxonomy', 'Updated term %term.', array('%term' => $form_state['values']['name']), WATCHDOG_NOTICE, l(t('edit'), 'admin/content/taxonomy/edit/term/' . $form_state['values']['tid']));
break;
}
@@ -823,8 +823,8 @@ function taxonomy_term_confirm_parents(&$form_state, $vocabulary) {
);
}
$question = t('Set multiple term parents?');
- $description = '<p>'. t("Adding multiple parents to a term will cause the %vocabulary vocabulary to look for multiple parents on every term. Because multiple parents are not supported when using the drag and drop outline interface, drag and drop will be disabled if you enable this option. If you choose to have multiple parents, you will only be able to set parents by using the term edit form.", array('%vocabulary' => $vocabulary->name)) .'</p>';
- $description .= '<p>'. t("You may re-enable the drag and drop interface at any time by reducing multiple parents to a single parent for the terms in this vocabulary.") .'</p>';
+ $description = '<p>' . t("Adding multiple parents to a term will cause the %vocabulary vocabulary to look for multiple parents on every term. Because multiple parents are not supported when using the drag and drop outline interface, drag and drop will be disabled if you enable this option. If you choose to have multiple parents, you will only be able to set parents by using the term edit form.", array('%vocabulary' => $vocabulary->name)) . '</p>';
+ $description .= '<p>' . t("You may re-enable the drag and drop interface at any time by reducing multiple parents to a single parent for the terms in this vocabulary.") . '</p>';
return confirm_form($form, $question, drupal_get_destination(), $description, t('Set multiple parents'));
}
@@ -916,7 +916,7 @@ function taxonomy_vocabulary_confirm_reset_alphabetical(&$form_state, $vid) {
return confirm_form($form,
t('Are you sure you want to reset the vocabulary %title to alphabetical order?',
array('%title' => $vocabulary->name)),
- 'admin/content/taxonomy/'. $vid,
+ 'admin/content/taxonomy/' . $vid,
t('Resetting a vocabulary will discard all custom ordering and sort items alphabetically.'),
t('Reset to alphabetical'),
t('Cancel'));
@@ -931,5 +931,5 @@ function taxonomy_vocabulary_confirm_reset_alphabetical_submit($form, &$form_sta
db_query('UPDATE {term_data} t SET weight = 0 WHERE vid = %d', $form_state['values']['vid']);
drupal_set_message(t('Reset vocabulary %name to alphabetical order.', array('%name' => $form_state['values']['name'])));
watchdog('taxonomy', 'Reset vocabulary %name to alphabetical order.', array('%name' => $form_state['values']['name']), WATCHDOG_NOTICE);
- $form_state['redirect'] = 'admin/content/taxonomy/'. $form_state['values']['vid'];
+ $form_state['redirect'] = 'admin/content/taxonomy/' . $form_state['values']['vid'];
}
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index c1bc41c34..5fc6dfb10 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -60,7 +60,7 @@ function taxonomy_link($type, $node = NULL) {
// other terms which are objects. So we have to check if a $term
// is an object or not.
if (is_object($term)) {
- $links['taxonomy_term_'. $term->tid] = array(
+ $links['taxonomy_term_' . $term->tid] = array(
'title' => $term->name,
'href' => taxonomy_term_path($term),
'attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description))
@@ -72,7 +72,7 @@ function taxonomy_link($type, $node = NULL) {
foreach ($term as $free_typed) {
$typed_terms = drupal_explode_tags($free_typed);
foreach ($typed_terms as $typed_term) {
- $links['taxonomy_preview_term_'. $typed_term] = array(
+ $links['taxonomy_preview_term_' . $typed_term] = array(
'title' => $typed_term,
);
}
@@ -104,7 +104,7 @@ function taxonomy_term_path($term) {
if ($vocabulary->module != 'taxonomy' && $path = module_invoke($vocabulary->module, 'term_path', $term)) {
return $path;
}
- return 'taxonomy/term/'. $term->tid;
+ return 'taxonomy/term/' . $term->tid;
}
/**
@@ -488,7 +488,7 @@ function taxonomy_get_vocabularies($type = NULL) {
* and provide scalable alternatives.
*/
function taxonomy_form_alter(&$form, $form_state, $form_id) {
- if (isset($form['type']) && isset($form['#node']) && (!variable_get('taxonomy_override_selector', FALSE)) && $form['type']['#value'] .'_node_form' == $form_id) {
+ if (isset($form['type']) && isset($form['#node']) && (!variable_get('taxonomy_override_selector', FALSE)) && $form['type']['#value'] . '_node_form' == $form_id) {
$node = $form['#node'];
if (!isset($node->taxonomy)) {
@@ -525,7 +525,7 @@ function taxonomy_form_alter(&$form, $form_state, $form_id) {
'#description' => $help,
'#required' => $vocabulary->required,
'#default_value' => $typed_string,
- '#autocomplete_path' => 'taxonomy/autocomplete/'. $vocabulary->vid,
+ '#autocomplete_path' => 'taxonomy/autocomplete/' . $vocabulary->vid,
'#weight' => $vocabulary->weight,
'#maxlength' => 255,
);
@@ -1091,20 +1091,20 @@ function taxonomy_select_nodes($tids = array(), $operator = 'or', $depth = 0, $p
if ($operator == 'or') {
$args = call_user_func_array('array_merge', $descendant_tids);
$placeholders = db_placeholders($args, 'int');
- $sql = 'SELECT DISTINCT(n.nid), n.sticky, n.title, n.created FROM {node} n INNER JOIN {term_node} tn ON n.vid = tn.vid WHERE tn.tid IN ('. $placeholders .') AND n.status = 1 ORDER BY '. $order;
- $sql_count = 'SELECT COUNT(DISTINCT(n.nid)) FROM {node} n INNER JOIN {term_node} tn ON n.vid = tn.vid WHERE tn.tid IN ('. $placeholders .') AND n.status = 1';
+ $sql = 'SELECT DISTINCT(n.nid), n.sticky, n.title, n.created FROM {node} n INNER JOIN {term_node} tn ON n.vid = tn.vid WHERE tn.tid IN (' . $placeholders . ') AND n.status = 1 ORDER BY ' . $order;
+ $sql_count = 'SELECT COUNT(DISTINCT(n.nid)) FROM {node} n INNER JOIN {term_node} tn ON n.vid = tn.vid WHERE tn.tid IN (' . $placeholders . ') AND n.status = 1';
}
else {
$joins = '';
$wheres = '';
$args = array();
foreach ($descendant_tids as $index => $tids) {
- $joins .= ' INNER JOIN {term_node} tn'. $index .' ON n.vid = tn'. $index .'.vid';
- $wheres .= ' AND tn'. $index .'.tid IN ('. db_placeholders($tids, 'int') .')';
+ $joins .= ' INNER JOIN {term_node} tn' . $index . ' ON n.vid = tn' . $index . '.vid';
+ $wheres .= ' AND tn' . $index . '.tid IN (' . db_placeholders($tids, 'int') . ')';
$args = array_merge($args, $tids);
}
- $sql = 'SELECT DISTINCT(n.nid), n.sticky, n.title, n.created FROM {node} n '. $joins .' WHERE n.status = 1 '. $wheres .' ORDER BY '. $order;
- $sql_count = 'SELECT COUNT(DISTINCT(n.nid)) FROM {node} n '. $joins .' WHERE n.status = 1 '. $wheres;
+ $sql = 'SELECT DISTINCT(n.nid), n.sticky, n.title, n.created FROM {node} n ' . $joins . ' WHERE n.status = 1 ' . $wheres . ' ORDER BY ' . $order;
+ $sql_count = 'SELECT COUNT(DISTINCT(n.nid)) FROM {node} n ' . $joins . ' WHERE n.status = 1 ' . $wheres;
}
$sql = db_rewrite_sql($sql);
$sql_count = db_rewrite_sql($sql_count);
@@ -1134,7 +1134,7 @@ function taxonomy_render_nodes($result) {
$output .= theme('pager', NULL, variable_get('default_nodes_main', 10), 0);
}
else {
- $output .= '<p>'. t('There are currently no posts in this category.') .'</p>';
+ $output .= '<p>' . t('There are currently no posts in this category.') . '</p>';
}
return $output;
}
@@ -1189,7 +1189,7 @@ function taxonomy_node_update_index(&$node) {
$output[] = $term->name;
}
if (count($output)) {
- return '<strong>('. implode(', ', $output) .')</strong>';
+ return '<strong>(' . implode(', ', $output) . ')</strong>';
}
}
@@ -1226,7 +1226,7 @@ function taxonomy_rss_item($node) {
foreach ($node->taxonomy as $term) {
$output[] = array('key' => 'category',
'value' => check_plain($term->name),
- 'attributes' => array('domain' => url('taxonomy/term/'. $term->tid, array('absolute' => TRUE))));
+ 'attributes' => array('domain' => url('taxonomy/term/' . $term->tid, array('absolute' => TRUE))));
}
return $output;
}
@@ -1237,34 +1237,34 @@ function taxonomy_rss_item($node) {
function taxonomy_help($path, $arg) {
switch ($path) {
case 'admin/help#taxonomy':
- $output = '<p>'. t('The taxonomy module allows you to categorize content using various systems of classification. Free-tagging vocabularies are created by users on the fly when they submit posts (as commonly found in blogs and social bookmarking applications). Controlled vocabularies allow for administrator-defined short lists of terms as well as complex hierarchies with multiple relationships between different terms. These methods can be applied to different content types and combined together to create a powerful and flexible method of classifying and presenting your content.') .'</p>';
- $output .= '<p>'. t('For example, when creating a recipe site, you might want to classify posts by both the type of meal and preparation time. A vocabulary for each allows you to categorize using each criteria independently instead of creating a tag for every possible combination.') .'</p>';
- $output .= '<p>'. t('Type of Meal: <em>Appetizer, Main Course, Salad, Dessert</em>') .'</p>';
- $output .= '<p>'. t('Preparation Time: <em>0-30mins, 30-60mins, 1-2 hrs, 2hrs+</em>') .'</p>';
- $output .= '<p>'. t("Each taxonomy term (often called a 'category' or 'tag' in other systems) automatically provides lists of posts and a corresponding RSS feed. These taxonomy/term URLs can be manipulated to generate AND and OR lists of posts classified with terms. In our recipe site example, it then becomes easy to create pages displaying 'Main courses', '30 minute recipes', or '30 minute main courses and appetizers' by using terms on their own or in combination with others. There are a significant number of contributed modules which you to alter and extend the behavior of the core module for both display and organization of terms.") .'</p>';
- $output .= '<p>'. t("Terms can also be organized in parent/child relationships from the admin interface. An example would be a vocabulary grouping countries under their parent geo-political regions. The taxonomy module also enables advanced implementations of hierarchy, for example placing Turkey in both the 'Middle East' and 'Europe'.") .'</p>';
- $output .= '<p>'. t('The taxonomy module supports the use of both synonyms and related terms, but does not directly use this functionality. However, optional contributed or custom modules may make full use of these advanced features.') .'</p>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@taxonomy">Taxonomy module</a>.', array('@taxonomy' => 'http://drupal.org/handbook/modules/taxonomy/')) .'</p>';
+ $output = '<p>' . t('The taxonomy module allows you to categorize content using various systems of classification. Free-tagging vocabularies are created by users on the fly when they submit posts (as commonly found in blogs and social bookmarking applications). Controlled vocabularies allow for administrator-defined short lists of terms as well as complex hierarchies with multiple relationships between different terms. These methods can be applied to different content types and combined together to create a powerful and flexible method of classifying and presenting your content.') . '</p>';
+ $output .= '<p>' . t('For example, when creating a recipe site, you might want to classify posts by both the type of meal and preparation time. A vocabulary for each allows you to categorize using each criteria independently instead of creating a tag for every possible combination.') . '</p>';
+ $output .= '<p>' . t('Type of Meal: <em>Appetizer, Main Course, Salad, Dessert</em>') . '</p>';
+ $output .= '<p>' . t('Preparation Time: <em>0-30mins, 30-60mins, 1-2 hrs, 2hrs+</em>') . '</p>';
+ $output .= '<p>' . t("Each taxonomy term (often called a 'category' or 'tag' in other systems) automatically provides lists of posts and a corresponding RSS feed. These taxonomy/term URLs can be manipulated to generate AND and OR lists of posts classified with terms. In our recipe site example, it then becomes easy to create pages displaying 'Main courses', '30 minute recipes', or '30 minute main courses and appetizers' by using terms on their own or in combination with others. There are a significant number of contributed modules which you to alter and extend the behavior of the core module for both display and organization of terms.") . '</p>';
+ $output .= '<p>' . t("Terms can also be organized in parent/child relationships from the admin interface. An example would be a vocabulary grouping countries under their parent geo-political regions. The taxonomy module also enables advanced implementations of hierarchy, for example placing Turkey in both the 'Middle East' and 'Europe'.") . '</p>';
+ $output .= '<p>' . t('The taxonomy module supports the use of both synonyms and related terms, but does not directly use this functionality. However, optional contributed or custom modules may make full use of these advanced features.') . '</p>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@taxonomy">Taxonomy module</a>.', array('@taxonomy' => 'http://drupal.org/handbook/modules/taxonomy/')) . '</p>';
return $output;
case 'admin/content/taxonomy':
- $output = '<p>'. t("The taxonomy module allows you to categorize your content using both tags and administrator defined terms. It is a flexible tool for classifying content with many advanced features. To begin, create a 'Vocabulary' to hold one set of terms or tags. You can create one free-tagging vocabulary for everything, or separate controlled vocabularies to define the various properties of your content, for example 'Countries' or 'Colors'.") .'</p>';
- $output .= '<p>'. t('Use the list below to configure and review the vocabularies defined on your site, or to list and manage the terms (tags) they contain. A vocabulary may (optionally) be tied to specific content types as shown in the <em>Type</em> column and, if so, will be displayed when creating or editing posts of that type. Multiple vocabularies tied to the same content type will be displayed in the order shown below. To change the order of a vocabulary, grab a drag-and-drop handle under the <em>Name</em> column and drag it to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the <em>Save</em> button at the bottom of the page.') .'</p>';
+ $output = '<p>' . t("The taxonomy module allows you to categorize your content using both tags and administrator defined terms. It is a flexible tool for classifying content with many advanced features. To begin, create a 'Vocabulary' to hold one set of terms or tags. You can create one free-tagging vocabulary for everything, or separate controlled vocabularies to define the various properties of your content, for example 'Countries' or 'Colors'.") . '</p>';
+ $output .= '<p>' . t('Use the list below to configure and review the vocabularies defined on your site, or to list and manage the terms (tags) they contain. A vocabulary may (optionally) be tied to specific content types as shown in the <em>Type</em> column and, if so, will be displayed when creating or editing posts of that type. Multiple vocabularies tied to the same content type will be displayed in the order shown below. To change the order of a vocabulary, grab a drag-and-drop handle under the <em>Name</em> column and drag it to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the <em>Save</em> button at the bottom of the page.') . '</p>';
return $output;
case 'admin/content/taxonomy/%':
$vocabulary = taxonomy_vocabulary_load($arg[3]);
if ($vocabulary->tags) {
- return '<p>'. t('%capital_name is a free-tagging vocabulary. To change the name or description of a term, click the <em>edit</em> link next to the term.', array('%capital_name' => drupal_ucfirst($vocabulary->name))) .'</p>';
+ return '<p>' . t('%capital_name is a free-tagging vocabulary. To change the name or description of a term, click the <em>edit</em> link next to the term.', array('%capital_name' => drupal_ucfirst($vocabulary->name))) . '</p>';
}
switch ($vocabulary->hierarchy) {
case 0:
- return '<p>'. t('%capital_name is a flat vocabulary. You may organize the terms in the %name vocabulary by using the handles on the left side of the table. To change the name or description of a term, click the <em>edit</em> link next to the term.', array('%capital_name' => drupal_ucfirst($vocabulary->name), '%name' => $vocabulary->name)) .'</p>';
+ return '<p>' . t('%capital_name is a flat vocabulary. You may organize the terms in the %name vocabulary by using the handles on the left side of the table. To change the name or description of a term, click the <em>edit</em> link next to the term.', array('%capital_name' => drupal_ucfirst($vocabulary->name), '%name' => $vocabulary->name)) . '</p>';
case 1:
- return '<p>'. t('%capital_name is a single hierarchy vocabulary. You may organize the terms in the %name vocabulary by using the handles on the left side of the table. To change the name or description of a term, click the <em>edit</em> link next to the term.', array('%capital_name' => drupal_ucfirst($vocabulary->name), '%name' => $vocabulary->name)) .'</p>';
+ return '<p>' . t('%capital_name is a single hierarchy vocabulary. You may organize the terms in the %name vocabulary by using the handles on the left side of the table. To change the name or description of a term, click the <em>edit</em> link next to the term.', array('%capital_name' => drupal_ucfirst($vocabulary->name), '%name' => $vocabulary->name)) . '</p>';
case 2:
- return '<p>'. t('%capital_name is a multiple hierarchy vocabulary. To change the name or description of a term, click the <em>edit</em> link next to the term. Drag and drop of multiple hierarchies is not supported, but you can re-enable drag and drop support by editing each term to include only a single parent.', array('%capital_name' => drupal_ucfirst($vocabulary->name))) .'</p>';
+ return '<p>' . t('%capital_name is a multiple hierarchy vocabulary. To change the name or description of a term, click the <em>edit</em> link next to the term. Drag and drop of multiple hierarchies is not supported, but you can re-enable drag and drop support by editing each term to include only a single parent.', array('%capital_name' => drupal_ucfirst($vocabulary->name))) . '</p>';
}
case 'admin/content/taxonomy/add/vocabulary':
- return '<p>'. t('Define how your vocabulary will be presented to administrators and users, and which content types to categorize with it. Tags allows users to create terms when submitting posts by typing a comma separated list. Otherwise terms are chosen from a select list and can only be created by users with the "administer taxonomy" permission.') .'</p>';
+ return '<p>' . t('Define how your vocabulary will be presented to administrators and users, and which content types to categorize with it. Tags allows users to create terms when submitting posts by typing a comma separated list. Otherwise terms are chosen from a select list and can only be created by users with the "administer taxonomy" permission.') . '</p>';
}
}
@@ -1286,7 +1286,7 @@ function taxonomy_implode_tags($tags, $vid = NULL) {
// Commas and quotes in tag names are special cases, so encode 'em.
if (strpos($tag->name, ',') !== FALSE || strpos($tag->name, '"') !== FALSE) {
- $tag->name = '"'. str_replace('"', '""', $tag->name) .'"';
+ $tag->name = '"' . str_replace('"', '""', $tag->name) . '"';
}
$typed_tags[] = $tag->name;
diff --git a/modules/taxonomy/taxonomy.pages.inc b/modules/taxonomy/taxonomy.pages.inc
index b3e088c6a..d0557dc59 100644
--- a/modules/taxonomy/taxonomy.pages.inc
+++ b/modules/taxonomy/taxonomy.pages.inc
@@ -16,7 +16,7 @@ function taxonomy_term_page($str_tids = '', $depth = 0, $op = 'page') {
}
if ($terms['tids']) {
- $result = db_query(db_rewrite_sql('SELECT t.tid, t.name FROM {term_data} t WHERE t.tid IN ('. db_placeholders($terms['tids']) .')', 't', 'tid'), $terms['tids']);
+ $result = db_query(db_rewrite_sql('SELECT t.tid, t.name FROM {term_data} t WHERE t.tid IN (' . db_placeholders($terms['tids']) . ')', 't', 'tid'), $terms['tids']);
$tids = array(); // we rebuild the $tids-array so it only contains terms the user has access to.
$names = array();
while ($term = db_fetch_object($result)) {
@@ -35,20 +35,20 @@ function taxonomy_term_page($str_tids = '', $depth = 0, $op = 'page') {
$breadcrumb = array();
while ($parents = taxonomy_get_parents($current->tid)) {
$current = array_shift($parents);
- $breadcrumb[] = l($current->name, 'taxonomy/term/'. $current->tid);
+ $breadcrumb[] = l($current->name, 'taxonomy/term/' . $current->tid);
}
$breadcrumb[] = l(t('Home'), NULL);
$breadcrumb = array_reverse($breadcrumb);
drupal_set_breadcrumb($breadcrumb);
$output = theme('taxonomy_term_page', $tids, taxonomy_select_nodes($tids, $terms['operator'], $depth, TRUE));
- drupal_add_feed(url('taxonomy/term/'. $str_tids .'/'. $depth .'/feed'), 'RSS - '. $title);
+ drupal_add_feed(url('taxonomy/term/' . $str_tids . '/' . $depth . '/feed'), 'RSS - ' . $title);
return $output;
break;
case 'feed':
- $channel['link'] = url('taxonomy/term/'. $str_tids .'/'. $depth, array('absolute' => TRUE));
- $channel['title'] = variable_get('site_name', 'Drupal') .' - '. $title;
+ $channel['link'] = url('taxonomy/term/' . $str_tids . '/' . $depth, array('absolute' => TRUE));
+ $channel['title'] = variable_get('site_name', 'Drupal') . ' - ' . $title;
// Only display the description if we have a single term, to avoid clutter and confusion.
if (count($tids) == 1) {
$term = taxonomy_get_term($tids[0]);
@@ -86,7 +86,7 @@ function taxonomy_term_page($str_tids = '', $depth = 0, $op = 'page') {
* @ingroup themeable
*/
function theme_taxonomy_term_page($tids, $result) {
- drupal_add_css(drupal_get_path('module', 'taxonomy') .'/taxonomy.css');
+ drupal_add_css(drupal_get_path('module', 'taxonomy') . '/taxonomy.css');
$output = '';
@@ -121,13 +121,13 @@ function taxonomy_autocomplete($vid, $string = '') {
if ($last_string != '') {
$result = db_query_range(db_rewrite_sql("SELECT t.tid, t.name FROM {term_data} t WHERE t.vid = %d AND LOWER(t.name) LIKE LOWER('%%%s%%')", 't', 'tid'), $vid, $last_string, 0, 10);
- $prefix = count($array) ? implode(', ', $array) .', ' : '';
+ $prefix = count($array) ? implode(', ', $array) . ', ' : '';
while ($tag = db_fetch_object($result)) {
$n = $tag->name;
// Commas and quotes in terms are special cases, so encode 'em.
if (strpos($tag->name, ',') !== FALSE || strpos($tag->name, '"') !== FALSE) {
- $n = '"'. str_replace('"', '""', $tag->name) .'"';
+ $n = '"' . str_replace('"', '""', $tag->name) . '"';
}
$matches[$prefix . $n] = check_plain($tag->name);
}
diff --git a/modules/throttle/throttle.module b/modules/throttle/throttle.module
index 43d090361..17f6bbb27 100644
--- a/modules/throttle/throttle.module
+++ b/modules/throttle/throttle.module
@@ -101,7 +101,7 @@ function throttle_exit() {
if ($throttle) {
variable_set('throttle_level', 0);
// Note: unorthodox format_plural() usage due to Gettext plural limitations.
- $message = format_plural($users, '1 user', '@count users') .', ';
+ $message = format_plural($users, '1 user', '@count users') . ', ';
$message .= format_plural($guests, '1 guest accessing site; throttle disabled', '@count guests accessing site; throttle disabled');
}
}
@@ -118,11 +118,11 @@ function throttle_exit() {
function throttle_help($path, $arg) {
switch ($path) {
case 'admin/help#throttle':
- $output = '<p>'. t('The throttle module provides a congestion control mechanism that automatically adjusts to a surge in incoming traffic. If your site is referenced by a popular website, or experiences a "Denial of Service" (DoS) attack, your webserver might become overwhelmed. The throttle mechanism is utilized by modules to temporarily disable CPU-intensive functionality, increasing performance. For instance, via the throttle module, modules may choose to disable resource-intensive blocks or the code within the site theme may temporarily disable user pictures in posts.') .'</p>';
- $output .= '<p>'. t('The congestion control throttle can be automatically enabled when the number of anonymous or authenticated users currently visiting the site exceeds a specified threshold.') .'</p>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@throttle">Throttle module</a>.', array('@throttle' => 'http://drupal.org/handbook/modules/throttle/')) .'</p>';
+ $output = '<p>' . t('The throttle module provides a congestion control mechanism that automatically adjusts to a surge in incoming traffic. If your site is referenced by a popular website, or experiences a "Denial of Service" (DoS) attack, your webserver might become overwhelmed. The throttle mechanism is utilized by modules to temporarily disable CPU-intensive functionality, increasing performance. For instance, via the throttle module, modules may choose to disable resource-intensive blocks or the code within the site theme may temporarily disable user pictures in posts.') . '</p>';
+ $output .= '<p>' . t('The congestion control throttle can be automatically enabled when the number of anonymous or authenticated users currently visiting the site exceeds a specified threshold.') . '</p>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@throttle">Throttle module</a>.', array('@throttle' => 'http://drupal.org/handbook/modules/throttle/')) . '</p>';
return $output;
case 'admin/settings/throttle':
- return '<p>'. t('The throttle module provides a congestion control mechanism that automatically adjusts to a surge in incoming traffic. If your site is referenced by a popular website, or experiences a "Denial of Service" (DoS) attack, your webserver might become overwhelmed. The throttle mechanism is utilized by modules to temporarily disable CPU-intensive functionality, increasing performance.') .'</p>';
+ return '<p>' . t('The throttle module provides a congestion control mechanism that automatically adjusts to a surge in incoming traffic. If your site is referenced by a popular website, or experiences a "Denial of Service" (DoS) attack, your webserver might become overwhelmed. The throttle mechanism is utilized by modules to temporarily disable CPU-intensive functionality, increasing performance.') . '</p>';
}
}
diff --git a/modules/tracker/tracker.module b/modules/tracker/tracker.module
index c3e4cd1a3..489160f96 100644
--- a/modules/tracker/tracker.module
+++ b/modules/tracker/tracker.module
@@ -12,9 +12,9 @@
function tracker_help($path, $arg) {
switch ($path) {
case 'admin/help#tracker':
- $output = '<p>'. t('The tracker module displays the most recently added or updated content on your site, and provides user-level tracking to follow the contributions of particular authors.') .'</p>';
- $output .= '<p>'. t("The <em>Recent posts</em> page is available via a link in the navigation menu block and displays new and recently-updated content (including the content type, the title, the author's name, number of comments, and time of last update) in reverse chronological order. Posts are marked updated when changes occur in the text, or when new comments are added. To use the tracker module to follow a specific user's contributions, select the <em>Track</em> tab from the user's profile page.") .'</p>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@tracker">Tracker module</a>.', array('@tracker' => 'http://drupal.org/handbook/modules/tracker/')) .'</p>';
+ $output = '<p>' . t('The tracker module displays the most recently added or updated content on your site, and provides user-level tracking to follow the contributions of particular authors.') . '</p>';
+ $output .= '<p>' . t("The <em>Recent posts</em> page is available via a link in the navigation menu block and displays new and recently-updated content (including the content type, the title, the author's name, number of comments, and time of last update) in reverse chronological order. Posts are marked updated when changes occur in the text, or when new comments are added. To use the tracker module to follow a specific user's contributions, select the <em>Track</em> tab from the user's profile page.") . '</p>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@tracker">Tracker module</a>.', array('@tracker' => 'http://drupal.org/handbook/modules/tracker/')) . '</p>';
return $output;
}
}
diff --git a/modules/tracker/tracker.pages.inc b/modules/tracker/tracker.pages.inc
index c82fed67f..8b596497e 100644
--- a/modules/tracker/tracker.pages.inc
+++ b/modules/tracker/tracker.pages.inc
@@ -12,7 +12,7 @@
*/
function tracker_page($account = NULL, $set_title = FALSE) {
// Add CSS
- drupal_add_css(drupal_get_path('module', 'tracker') .'/tracker.css', 'module', 'all', FALSE);
+ drupal_add_css(drupal_get_path('module', 'tracker') . '/tracker.css', 'module', 'all', FALSE);
if ($account) {
if ($set_title) {
@@ -51,7 +51,7 @@ function tracker_page($account = NULL, $set_title = FALSE) {
$rows[] = array(
check_plain(node_get_types('name', $node->type)),
- l($node->title, "node/$node->nid") .' '. theme('mark', node_mark($node->nid, $node->changed)),
+ l($node->title, "node/$node->nid") . ' ' . theme('mark', node_mark($node->nid, $node->changed)),
theme('username', $node),
array('class' => 'replies', 'data' => $comments),
t('!time ago', array('!time' => format_interval(time() - $node->last_updated)))
diff --git a/modules/translation/translation.module b/modules/translation/translation.module
index e532f6844..946744018 100644
--- a/modules/translation/translation.module
+++ b/modules/translation/translation.module
@@ -31,21 +31,21 @@ define('TRANSLATION_ENABLED', 2);
function translation_help($path, $arg) {
switch ($path) {
case 'admin/help#translation':
- $output = '<p>'. t('The content translation module allows content to be translated into different languages. Working with the <a href="@locale">locale module</a> (which manages enabled languages and provides translation for the site interface), the content translation module is key to creating and maintaining translated site content.', array('@locale' => url('admin/help/locale'))) .'</p>';
- $output .= '<p>'. t('Configuring content translation and translation-enabled content types:') .'</p>';
- $output .= '<ul><li>'. t('Assign the <em>translate content</em> permission to the appropriate user roles at the <a href="@permissions">Permissions configuration page</a>.', array('@permissions' => url('admin/user/permissions'))) .'</li>';
- $output .= '<li>'. t('Add and enable desired languages at the <a href="@languages">Languages configuration page</a>.', array('@languages' => url('admin/settings/language'))) .'</li>';
- $output .= '<li>'. t('Determine which <a href="@content-types">content types</a> should support translation features. To enable translation support for a content type, edit the type and at the <em>Multilingual support</em> drop down, select <em>Enabled, with translation</em>. (<em>Multilingual support</em> is located within <em>Workflow settings</em>.) Be sure to save each content type after enabling multilingual support.', array('@content-types' => url('admin/build/types'))) .'</li></ul>';
- $output .= '<p>'. t('Working with translation-enabled content types:') .'</p>';
- $output .= '<ul><li>'. t('Use the <em>Language</em> drop down to select the appropriate language when creating or editing posts.') .'</li>';
- $output .= '<li>'. t('Provide new or edit current translations for existing posts via the <em>Translation</em> tab. Only visible while viewing a post as a user with the <em>translate content</em> permission, this tab allows translations to be added or edited using a specialized editing form that also displays the content being translated.') .'</li>';
- $output .= '<li>'. t('Update translations as needed, so that they accurately reflect changes in the content of the original post. The translation status flag provides a simple method for tracking outdated translations. After editing a post, for example, select the <em>Flag translations as outdated</em> check box to mark all of its translations as outdated and in need of revision. Individual translations may be marked for revision by selecting the <em>This translation needs to be updated</em> check box on the translation editing form.') .'</li>';
- $output .= '<li>'. t('The <a href="@content-node">Content management administration page</a> displays the language of each post, and also allows filtering by language or translation status.', array('@content-node' => url('admin/content/node'))) .'</li></ul>';
- $output .= '<p>'. t('Use the <a href="@blocks">language switcher block</a> provided by locale module to allow users to select a language. If available, both the site interface and site content are presented in the language selected.', array('@blocks' => url('admin/build/block'))) .'</p>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@translation">Translation module</a>.', array('@translation' => 'http://drupal.org/handbook/modules/translation/')) .'</p>';
+ $output = '<p>' . t('The content translation module allows content to be translated into different languages. Working with the <a href="@locale">locale module</a> (which manages enabled languages and provides translation for the site interface), the content translation module is key to creating and maintaining translated site content.', array('@locale' => url('admin/help/locale'))) . '</p>';
+ $output .= '<p>' . t('Configuring content translation and translation-enabled content types:') . '</p>';
+ $output .= '<ul><li>' . t('Assign the <em>translate content</em> permission to the appropriate user roles at the <a href="@permissions">Permissions configuration page</a>.', array('@permissions' => url('admin/user/permissions'))) . '</li>';
+ $output .= '<li>' . t('Add and enable desired languages at the <a href="@languages">Languages configuration page</a>.', array('@languages' => url('admin/settings/language'))) . '</li>';
+ $output .= '<li>' . t('Determine which <a href="@content-types">content types</a> should support translation features. To enable translation support for a content type, edit the type and at the <em>Multilingual support</em> drop down, select <em>Enabled, with translation</em>. (<em>Multilingual support</em> is located within <em>Workflow settings</em>.) Be sure to save each content type after enabling multilingual support.', array('@content-types' => url('admin/build/types'))) . '</li></ul>';
+ $output .= '<p>' . t('Working with translation-enabled content types:') . '</p>';
+ $output .= '<ul><li>' . t('Use the <em>Language</em> drop down to select the appropriate language when creating or editing posts.') . '</li>';
+ $output .= '<li>' . t('Provide new or edit current translations for existing posts via the <em>Translation</em> tab. Only visible while viewing a post as a user with the <em>translate content</em> permission, this tab allows translations to be added or edited using a specialized editing form that also displays the content being translated.') . '</li>';
+ $output .= '<li>' . t('Update translations as needed, so that they accurately reflect changes in the content of the original post. The translation status flag provides a simple method for tracking outdated translations. After editing a post, for example, select the <em>Flag translations as outdated</em> check box to mark all of its translations as outdated and in need of revision. Individual translations may be marked for revision by selecting the <em>This translation needs to be updated</em> check box on the translation editing form.') . '</li>';
+ $output .= '<li>' . t('The <a href="@content-node">Content management administration page</a> displays the language of each post, and also allows filtering by language or translation status.', array('@content-node' => url('admin/content/node'))) . '</li></ul>';
+ $output .= '<p>' . t('Use the <a href="@blocks">language switcher block</a> provided by locale module to allow users to select a language. If available, both the site interface and site content are presented in the language selected.', array('@blocks' => url('admin/build/block'))) . '</p>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@translation">Translation module</a>.', array('@translation' => 'http://drupal.org/handbook/modules/translation/')) . '</p>';
return $output;
case 'node/%/translate':
- $output = '<p>'. t('Translations of a piece of content are managed with translation sets. Each translation set has one source post and any number of translations in any of the <a href="!languages">enabled languages</a>. All translations are tracked to be up to date or outdated based on whether the source post was modified significantly.', array('!languages' => url('admin/settings/language'))) .'</p>';
+ $output = '<p>' . t('Translations of a piece of content are managed with translation sets. Each translation set has one source post and any number of translations in any of the <a href="!languages">enabled languages</a>. All translations are tracked to be up to date or outdated based on whether the source post was modified significantly.', array('!languages' => url('admin/settings/language'))) . '</p>';
return $output;
}
}
@@ -296,7 +296,7 @@ function translation_node_get_translations($tnid) {
* Boolean value.
*/
function translation_supported_type($type) {
- return variable_get('language_content_type_'. $type, 0) == TRANSLATION_ENABLED;
+ return variable_get('language_content_type_' . $type, 0) == TRANSLATION_ENABLED;
}
/**
@@ -314,7 +314,7 @@ function translation_path_get_translations($path) {
// Check for a node related path, and for its translations.
if ((preg_match("!^node/([0-9]+)(/.+|)$!", $path, $matches)) && ($node = node_load((int)$matches[1])) && !empty($node->tnid)) {
foreach (translation_node_get_translations($node->tnid) as $language => $translation_node) {
- $paths[$language] = 'node/'. $translation_node->nid . $matches[2];
+ $paths[$language] = 'node/' . $translation_node->nid . $matches[2];
}
}
return $paths;
diff --git a/modules/translation/translation.pages.inc b/modules/translation/translation.pages.inc
index d82d3da89..3bbedcfaf 100644
--- a/modules/translation/translation.pages.inc
+++ b/modules/translation/translation.pages.inc
@@ -33,21 +33,21 @@ function translation_node_overview($node) {
// Existing translation in the translation set: display status.
// We load the full node to check whether the user can edit it.
$translation_node = node_load($translations[$language->language]->nid);
- $title = l($translation_node->title, 'node/'. $translation_node->nid);
+ $title = l($translation_node->title, 'node/' . $translation_node->nid);
if (node_access('update', $translation_node)) {
$options[] = l(t('edit'), "node/$translation_node->nid/edit");
}
$status = $translation_node->status ? t('Published') : t('Not published');
- $status .= $translation_node->translate ? ' - <span class="marker">'. t('outdated') .'</span>' : '';
+ $status .= $translation_node->translate ? ' - <span class="marker">' . t('outdated') . '</span>' : '';
if ($translation_node->nid == $tnid) {
- $language_name = '<strong>'. $language_name .'</strong> (source)';
+ $language_name = '<strong>' . $language_name . '</strong> (source)';
}
}
else {
// No such translation in the set yet: help user to create it.
$title = t('n/a');
if (node_access('create', $node)) {
- $options[] = l(t('add translation'), 'node/add/'. str_replace('_', '-', $node->type), array('query' => "translation=$node->nid&language=$language->language"));
+ $options[] = l(t('add translation'), 'node/add/' . str_replace('_', '-', $node->type), array('query' => "translation=$node->nid&language=$language->language"));
}
$status = t('Not translated');
}
diff --git a/modules/trigger/trigger.admin.inc b/modules/trigger/trigger.admin.inc
index 217bfd5c3..798afb7fe 100644
--- a/modules/trigger/trigger.admin.inc
+++ b/modules/trigger/trigger.admin.inc
@@ -29,7 +29,7 @@ function trigger_assign($type = NULL) {
foreach ($hooks as $module => $hook) {
if (isset($hook[$type])) {
foreach ($hook[$type] as $op => $description) {
- $form_id = 'trigger_'. $type .'_'. $op .'_assign_form';
+ $form_id = 'trigger_' . $type . '_' . $op . '_assign_form';
$output .= drupal_get_form($form_id, $type, $op, $description['runs when']);
}
}
@@ -68,7 +68,7 @@ function trigger_unassign($form_state, $hook = NULL, $op = NULL, $aid = NULL) {
$action = actions_function_lookup($aid);
$actions = actions_get_all_actions();
- $destination = 'admin/build/trigger/'. ($hook == 'nodeapi' ? 'node' : $hook);
+ $destination = 'admin/build/trigger/' . ($hook == 'nodeapi' ? 'node' : $hook);
return confirm_form($form,
t('Are you sure you want to unassign the action %title?', array('%title' => $actions[$action]['description'])),
@@ -87,7 +87,7 @@ function trigger_unassign_submit($form, &$form_state) {
watchdog('actions', 'Action %action has been unassigned.', array('%action' => check_plain($actions[$aid]['description'])));
drupal_set_message(t('Action %action has been unassigned.', array('%action' => $actions[$aid]['description'])));
$hook = $form_values['hook'] == 'nodeapi' ? 'node' : $form_values['hook'];
- $form_state['redirect'] = 'admin/build/trigger/'. $hook;
+ $form_state['redirect'] = 'admin/build/trigger/' . $hook;
}
else {
drupal_goto('admin/build/trigger');
@@ -151,7 +151,7 @@ function trigger_assign_form($form_state, $hook, $op, $description) {
foreach ($actions as $aid => $description) {
$form[$op]['assigned']['#value'][$aid] = array(
'description' => $description,
- 'link' => l(t('unassign'), "admin/build/trigger/unassign/$hook/$op/". md5($aid))
+ 'link' => l(t('unassign'), "admin/build/trigger/unassign/$hook/$op/" . md5($aid))
);
}
diff --git a/modules/trigger/trigger.module b/modules/trigger/trigger.module
index 61544246e..4db55dd96 100644
--- a/modules/trigger/trigger.module
+++ b/modules/trigger/trigger.module
@@ -11,22 +11,22 @@
* Implementation of hook_help().
*/
function trigger_help($path, $arg) {
- $explanation = '<p>'. t('Triggers are system events, such as when new content is added or when a user logs in. Trigger module combines these triggers with actions (functional tasks), such as unpublishing content or e-mailing an administrator. The <a href="@url">Actions settings page</a> contains a list of existing actions and provides the ability to create and configure additional actions.', array('@url' => url('admin/settings/actions'))) .'</p>';
+ $explanation = '<p>' . t('Triggers are system events, such as when new content is added or when a user logs in. Trigger module combines these triggers with actions (functional tasks), such as unpublishing content or e-mailing an administrator. The <a href="@url">Actions settings page</a> contains a list of existing actions and provides the ability to create and configure additional actions.', array('@url' => url('admin/settings/actions'))) . '</p>';
switch ($path) {
case 'admin/build/trigger/comment':
- return $explanation .'<p>'. t('Below you can assign actions to run when certain comment-related triggers happen. For example, you could promote a post to the front page when a comment is added.') .'</p>';
+ return $explanation . '<p>' . t('Below you can assign actions to run when certain comment-related triggers happen. For example, you could promote a post to the front page when a comment is added.') . '</p>';
case 'admin/build/trigger/node':
- return $explanation .'<p>'. t('Below you can assign actions to run when certain content-related triggers happen. For example, you could send an e-mail to an administrator when a post is created or updated.') .'</p>';
+ return $explanation . '<p>' . t('Below you can assign actions to run when certain content-related triggers happen. For example, you could send an e-mail to an administrator when a post is created or updated.') . '</p>';
case 'admin/build/trigger/cron':
- return $explanation .'<p>'. t('Below you can assign actions to run during each pass of a <a href="@cron">cron maintenance task</a>.', array('@cron' => url('admin/reports/status'))) .'</p>';
+ return $explanation . '<p>' . t('Below you can assign actions to run during each pass of a <a href="@cron">cron maintenance task</a>.', array('@cron' => url('admin/reports/status'))) . '</p>';
case 'admin/build/trigger/taxonomy':
- return $explanation .'<p>'. t('Below you can assign actions to run when certain taxonomy-related triggers happen. For example, you could send an e-mail to an administrator when a term is deleted.') .'</p>';
+ return $explanation . '<p>' . t('Below you can assign actions to run when certain taxonomy-related triggers happen. For example, you could send an e-mail to an administrator when a term is deleted.') . '</p>';
case 'admin/build/trigger/user':
- return $explanation .'<p>'. t("Below you can assign actions to run when certain user-related triggers happen. For example, you could send an e-mail to an administrator when a user account is deleted.") .'</p>';
+ return $explanation . '<p>' . t("Below you can assign actions to run when certain user-related triggers happen. For example, you could send an e-mail to an administrator when a user account is deleted.") . '</p>';
case 'admin/help#trigger':
- $output = '<p>'. t('The Trigger module provides the ability to trigger <a href="@actions">actions</a> upon system events, such as when new content is added or when a user logs in.', array('@actions' => url('admin/settings/actions'))) .'</p>';
- $output .= '<p>'. t('The combination of actions and triggers can perform many useful tasks, such as e-mailing an administrator if a user account is deleted, or automatically unpublishing comments that contain certain words. By default, there are five "contexts" of events (Comments, Content, Cron, Taxonomy, and Users), but more may be added by additional modules.') .'</p>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@trigger">Trigger module</a>.', array('@trigger' => 'http://drupal.org/handbook/modules/trigger/')) .'</p>';
+ $output = '<p>' . t('The Trigger module provides the ability to trigger <a href="@actions">actions</a> upon system events, such as when new content is added or when a user logs in.', array('@actions' => url('admin/settings/actions'))) . '</p>';
+ $output .= '<p>' . t('The combination of actions and triggers can perform many useful tasks, such as e-mailing an administrator if a user account is deleted, or automatically unpublishing comments that contain certain words. By default, there are five "contexts" of events (Comments, Content, Cron, Taxonomy, and Users), but more may be added by additional modules.') . '</p>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@trigger">Trigger module</a>.', array('@trigger' => 'http://drupal.org/handbook/modules/trigger/')) . '</p>';
return $output;
}
}
@@ -167,7 +167,7 @@ function trigger_forms() {
foreach ($hooks as $module => $info) {
foreach ($hooks[$module] as $hook => $ops) {
foreach ($ops as $op => $description) {
- $forms['trigger_'. $hook .'_'. $op .'_assign_form'] = array('callback' => 'trigger_assign_form');
+ $forms['trigger_' . $hook . '_' . $op . '_assign_form'] = array('callback' => 'trigger_assign_form');
}
}
}
diff --git a/modules/update/update.compare.inc b/modules/update/update.compare.inc
index a0cf66c3f..826f36a65 100644
--- a/modules/update/update.compare.inc
+++ b/modules/update/update.compare.inc
@@ -69,7 +69,7 @@ function _update_process_info_list(&$projects, $list, $project_type) {
// which is left alone by tar and correctly set to the time the .info file
// was unpacked.
if (!isset($file->info['_info_file_ctime'])) {
- $info_filename = dirname($file->filename) .'/'. $file->name .'.info';
+ $info_filename = dirname($file->filename) . '/' . $file->name . '.info';
$file->info['_info_file_ctime'] = filectime($info_filename);
}
diff --git a/modules/update/update.fetch.inc b/modules/update/update.fetch.inc
index 3edda9cd1..17cf06f48 100644
--- a/modules/update/update.fetch.inc
+++ b/modules/update/update.fetch.inc
@@ -85,7 +85,7 @@ function _update_build_fetch_url($project, $site_key = '') {
}
$name = $project['name'];
$url = $project['info']['project status url'];
- $url .= '/'. $name .'/'. DRUPAL_CORE_COMPATIBILITY;
+ $url .= '/' . $name . '/' . DRUPAL_CORE_COMPATIBILITY;
if (!empty($site_key)) {
$url .= (strpos($url, '?') === TRUE) ? '&' : '?';
$url .= 'site_key=';
@@ -112,7 +112,7 @@ function _update_cron_notify() {
$status = update_requirements('runtime');
$params = array();
foreach (array('core', 'contrib') as $report_type) {
- $type = 'update_'. $report_type;
+ $type = 'update_' . $report_type;
if (isset($status[$type]['severity'])
&& $status[$type]['severity'] == REQUIREMENT_ERROR) {
$params[$report_type] = $status[$type]['reason'];
diff --git a/modules/update/update.module b/modules/update/update.module
index 855f73704..92a8ca586 100644
--- a/modules/update/update.module
+++ b/modules/update/update.module
@@ -58,15 +58,15 @@ define('UPDATE_UNKNOWN', -2);
function update_help($path, $arg) {
switch ($path) {
case 'admin/reports/updates':
- $output = '<p>'. t('Here you can find information about available updates for your installed modules and themes. Note that each module or theme is part of a "project", which may or may not have the same name, and might include multiple modules or themes within it.') .'</p>';
- $output .= '<p>'. t('To extend the functionality or to change the look of your site, a number of contributed <a href="@modules">modules</a> and <a href="@themes">themes</a> are available.', array('@modules' => 'http://drupal.org/project/modules', '@themes' => 'http://drupal.org/project/themes')) .'</p>';
+ $output = '<p>' . t('Here you can find information about available updates for your installed modules and themes. Note that each module or theme is part of a "project", which may or may not have the same name, and might include multiple modules or themes within it.') . '</p>';
+ $output .= '<p>' . t('To extend the functionality or to change the look of your site, a number of contributed <a href="@modules">modules</a> and <a href="@themes">themes</a> are available.', array('@modules' => 'http://drupal.org/project/modules', '@themes' => 'http://drupal.org/project/themes')) . '</p>';
return $output;
case 'admin/build/themes':
case 'admin/build/modules':
include_once './includes/install.inc';
$status = update_requirements('runtime');
foreach (array('core', 'contrib') as $report_type) {
- $type = 'update_'. $report_type;
+ $type = 'update_' . $report_type;
if (isset($status[$type]['severity'])) {
if ($status[$type]['severity'] == REQUIREMENT_ERROR) {
drupal_set_message($status[$type]['description'], 'error');
@@ -76,7 +76,7 @@ function update_help($path, $arg) {
}
}
}
- return '<p>'. t('See the <a href="@available_updates">available updates</a> page for information on installed modules and themes with new versions released.', array('@available_updates' => url('admin/reports/updates'))) .'</p>';
+ return '<p>' . t('See the <a href="@available_updates">available updates</a> page for information on installed modules and themes with new versions released.', array('@available_updates' => url('admin/reports/updates'))) . '</p>';
case 'admin/reports/updates/settings':
case 'admin/reports/status':
@@ -84,10 +84,10 @@ function update_help($path, $arg) {
break;
case 'admin/help#update':
- $output = '<p>'. t("The Update status module periodically checks for new versions of your site's software (including contributed modules and themes), and alerts you to available updates.") .'</p>';
- $output .= '<p>'. t('The <a href="@update-report">report of available updates</a> will alert you when new releases are available for download. You may configure options for update checking frequency and notifications at the <a href="@update-settings">Update status module settings page</a>.', array('@update-report' => url('admin/reports/updates'), '@update-settings' => url('admin/reports/updates/settings'))) .'</p>';
- $output .= '<p>'. t('Please note that in order to provide this information, anonymous usage statistics are sent to drupal.org. If desired, you may disable the Update status module from the <a href="@modules">module administration page</a>.', array('@modules' => url('admin/build/modules'))) .'</p>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@update">Update status module</a>.', array('@update' => 'http://drupal.org/handbook/modules/update')) .'</p>';
+ $output = '<p>' . t("The Update status module periodically checks for new versions of your site's software (including contributed modules and themes), and alerts you to available updates.") . '</p>';
+ $output .= '<p>' . t('The <a href="@update-report">report of available updates</a> will alert you when new releases are available for download. You may configure options for update checking frequency and notifications at the <a href="@update-settings">Update status module settings page</a>.', array('@update-report' => url('admin/reports/updates'), '@update-settings' => url('admin/reports/updates/settings'))) . '</p>';
+ $output .= '<p>' . t('Please note that in order to provide this information, anonymous usage statistics are sent to drupal.org. If desired, you may disable the Update status module from the <a href="@modules">module administration page</a>.', array('@modules' => url('admin/build/modules'))) . '</p>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@update">Update status module</a>.', array('@update' => 'http://drupal.org/handbook/modules/update')) . '</p>';
return $output;
default:
@@ -98,7 +98,7 @@ function update_help($path, $arg) {
include_once './includes/install.inc';
$status = update_requirements('runtime');
foreach (array('core', 'contrib') as $report_type) {
- $type = 'update_'. $report_type;
+ $type = 'update_' . $report_type;
if (isset($status[$type])
&& isset($status[$type]['reason'])
&& $status[$type]['reason'] === UPDATE_NOT_SECURE) {
@@ -274,7 +274,7 @@ function _update_requirement_check($project, $type) {
$requirement_label = t('Up to date');
}
if ($status != UPDATE_CURRENT && $type == 'core' && isset($project['recommended'])) {
- $requirement_label .= ' '. t('(version @version available)', array('@version' => $project['recommended']));
+ $requirement_label .= ' ' . t('(version @version available)', array('@version' => $project['recommended']));
}
$requirement['value'] = l($requirement_label, 'admin/reports/updates');
return $requirement;
@@ -416,7 +416,7 @@ function update_mail($key, &$message, $params) {
foreach ($params as $msg_type => $msg_reason) {
$message['body'][] = _update_message_text($msg_type, $msg_reason, FALSE, $language);
}
- $message['body'][] = t('See the available updates page for more information:', array(), $langcode) ."\n". url('admin/reports/updates', array('absolute' => TRUE, 'language' => $language));
+ $message['body'][] = t('See the available updates page for more information:', array(), $langcode) . "\n" . url('admin/reports/updates', array('absolute' => TRUE, 'language' => $language));
}
/**
@@ -491,7 +491,7 @@ function _update_message_text($msg_type, $msg_reason, $report_link = FALSE, $lan
}
if ($report_link) {
- $text .= ' '. t('See the <a href="@available_updates">available updates</a> page for more information.', array('@available_updates' => url('admin/reports/updates', array('language' => $language))), $langcode);
+ $text .= ' ' . t('See the <a href="@available_updates">available updates</a> page for more information.', array('@available_updates' => url('admin/reports/updates', array('language' => $language))), $langcode);
}
return $text;
diff --git a/modules/update/update.report.inc b/modules/update/update.report.inc
index 77e9c2c68..6bc2ff1cd 100644
--- a/modules/update/update.report.inc
+++ b/modules/update/update.report.inc
@@ -27,12 +27,12 @@ function update_status() {
*/
function theme_update_report($data) {
$last = variable_get('update_last_check', 0);
- $output = '<div class="update checked">'. ($last ? t('Last checked: @time ago', array('@time' => format_interval(time() - $last))) : t('Last checked: never'));
- $output .= ' <span class="check-manually">('. l(t('Check manually'), 'admin/reports/updates/check') .')</span>';
+ $output = '<div class="update checked">' . ($last ? t('Last checked: @time ago', array('@time' => format_interval(time() - $last))) : t('Last checked: never'));
+ $output .= ' <span class="check-manually">(' . l(t('Check manually'), 'admin/reports/updates/check') . ')</span>';
$output .= "</div>\n";
if (!is_array($data)) {
- $output .= '<p>'. $data .'</p>';
+ $output .= '<p>' . $data . '</p>';
return $output;
}
@@ -67,25 +67,25 @@ function theme_update_report($data) {
$row = '<div class="version-status">';
switch ($project['status']) {
case UPDATE_NOT_SECURE:
- $row .= '<span class="security-error">'. t('Security update required!') .'</span>';
+ $row .= '<span class="security-error">' . t('Security update required!') . '</span>';
break;
case UPDATE_REVOKED:
- $row .= '<span class="revoked">'. t('Revoked!') .'</span>';
+ $row .= '<span class="revoked">' . t('Revoked!') . '</span>';
break;
case UPDATE_NOT_SUPPORTED:
- $row .= '<span class="not-supported">'. t('Not supported!') .'</span>';
+ $row .= '<span class="not-supported">' . t('Not supported!') . '</span>';
break;
case UPDATE_NOT_CURRENT:
- $row .= '<span class="not-current">'. t('Update available') .'</span>';
+ $row .= '<span class="not-current">' . t('Update available') . '</span>';
break;
case UPDATE_CURRENT:
- $row .= '<span class="current">'. t('Up to date') .'</span>';
+ $row .= '<span class="current">' . t('Up to date') . '</span>';
break;
default:
$row .= check_plain($project['reason']);
break;
}
- $row .= '<span class="icon">'. $icon .'</span>';
+ $row .= '<span class="icon">' . $icon . '</span>';
$row .= "</div>\n";
$row .= '<div class="project">';
@@ -100,9 +100,9 @@ function theme_update_report($data) {
else {
$row .= check_plain($project['name']);
}
- $row .= ' '. check_plain($project['existing_version']);
+ $row .= ' ' . check_plain($project['existing_version']);
if ($project['install_type'] == 'dev' && !empty($project['datestamp'])) {
- $row .= ' <span class="version-date">('. format_date($project['datestamp'], 'custom', 'Y-M-d') .')</span>';
+ $row .= ' <span class="version-date">(' . format_date($project['datestamp'], 'custom', 'Y-M-d') . ')</span>';
}
$row .= "</div>\n";
@@ -140,7 +140,7 @@ function theme_update_report($data) {
// Now, print any security updates.
if (!empty($project['security updates'])) {
foreach ($project['security updates'] as $security_update) {
- $row .= theme('update_version', $security_update, t('Security update:'), 'version-security'. $security_class);
+ $row .= theme('update_version', $security_update, t('Security update:'), 'version-security' . $security_class);
}
}
}
@@ -166,10 +166,10 @@ function theme_update_report($data) {
$row .= "<div class=\"info\">\n";
if (!empty($project['extra'])) {
- $row .= '<div class="extra">'."\n";
+ $row .= '<div class="extra">' . "\n";
foreach ($project['extra'] as $key => $value) {
- $row .= '<div class="'. $value['class'] .'">';
- $row .= check_plain($value['label']) .': ';
+ $row .= '<div class="' . $value['class'] . '">';
+ $row .= check_plain($value['label']) . ': ';
$row .= theme('placeholder', $value['data']);
$row .= "</div>\n";
}
@@ -201,11 +201,11 @@ function theme_update_report($data) {
);
foreach ($project_types as $type_name => $type_label) {
if (!empty($rows[$type_name])) {
- $output .= "\n<h3>". $type_label ."</h3>\n";
+ $output .= "\n<h3>" . $type_label . "</h3>\n";
$output .= theme('table', $header, $rows[$type_name], array('class' => 'update'));
}
}
- drupal_add_css(drupal_get_path('module', 'update') .'/update.css');
+ drupal_add_css(drupal_get_path('module', 'update') . '/update.css');
return $output;
}
@@ -216,12 +216,12 @@ function theme_update_report($data) {
*/
function theme_update_version($version, $tag, $class) {
$output = '';
- $output .= '<table class="version '. $class .'">';
+ $output .= '<table class="version ' . $class . '">';
$output .= '<tr>';
- $output .= '<td class="version-title">'. $tag ."</td>\n";
+ $output .= '<td class="version-title">' . $tag . "</td>\n";
$output .= '<td class="version-details">';
$output .= l($version['version'], $version['release_link']);
- $output .= ' <span class="version-date">('. format_date($version['date'], 'custom', 'Y-M-d') .')</span>';
+ $output .= ' <span class="version-date">(' . format_date($version['date'], 'custom', 'Y-M-d') . ')</span>';
$output .= "</td>\n";
$output .= '<td class="version-links">';
$links = array();
diff --git a/modules/upload/upload.admin.inc b/modules/upload/upload.admin.inc
index d9371909a..ae0cee19f 100644
--- a/modules/upload/upload.admin.inc
+++ b/modules/upload/upload.admin.inc
@@ -14,7 +14,7 @@ function upload_admin_settings_validate($form, &$form_state) {
$default_uploadsize = $form_state['values']['upload_uploadsize_default'];
$default_usersize = $form_state['values']['upload_usersize_default'];
- $exceed_max_msg = t('Your PHP settings limit the maximum file size per upload to %size.', array('%size' => format_size(file_upload_max_size()))) .'<br/>';
+ $exceed_max_msg = t('Your PHP settings limit the maximum file size per upload to %size.', array('%size' => format_size(file_upload_max_size()))) . '<br/>';
$more_info = t("Depending on your server environment, these settings may be changed in the system-wide php.ini file, a php.ini file in your Drupal root directory, in your Drupal site's settings.php file, or in the .htaccess file in your Drupal root directory.");
if (!is_numeric($default_uploadsize) || ($default_uploadsize <= 0)) {
@@ -32,21 +32,21 @@ function upload_admin_settings_validate($form, &$form_state) {
}
foreach ($form_state['values']['roles'] as $rid => $role) {
- $uploadsize = $form_state['values']['upload_uploadsize_'. $rid];
- $usersize = $form_state['values']['upload_usersize_'. $rid];
+ $uploadsize = $form_state['values']['upload_uploadsize_' . $rid];
+ $usersize = $form_state['values']['upload_usersize_' . $rid];
if (!is_numeric($uploadsize) || ($uploadsize <= 0)) {
- form_set_error('upload_uploadsize_'. $rid, t('The %role file size limit must be a number and greater than zero.', array('%role' => $role)));
+ form_set_error('upload_uploadsize_' . $rid, t('The %role file size limit must be a number and greater than zero.', array('%role' => $role)));
}
if (!is_numeric($usersize) || ($usersize <= 0)) {
- form_set_error('upload_usersize_'. $rid, t('The %role file size limit must be a number and greater than zero.', array('%role' => $role)));
+ form_set_error('upload_usersize_' . $rid, t('The %role file size limit must be a number and greater than zero.', array('%role' => $role)));
}
if ($uploadsize * 1024 * 1024 > file_upload_max_size()) {
- form_set_error('upload_uploadsize_'. $rid, $exceed_max_msg . $more_info);
+ form_set_error('upload_uploadsize_' . $rid, $exceed_max_msg . $more_info);
$more_info = '';
}
if ($uploadsize > $usersize) {
- form_set_error('upload_uploadsize_'. $rid, t('The %role maximum file size per upload is greater than the total file size allowed per user', array('%role' => $role)));
+ form_set_error('upload_uploadsize_' . $rid, t('The %role maximum file size per upload is greater than the total file size allowed per user', array('%role' => $role)));
}
}
}
@@ -71,7 +71,7 @@ function upload_admin_settings() {
'#size' => 15,
'#maxlength' => 10,
'#description' => t('The maximum allowed image size (e.g. 640x480). Set to 0 for no restriction. If an <a href="!image-toolkit-link">image toolkit</a> is installed, files exceeding this value will be scaled down to fit.', array('!image-toolkit-link' => url('admin/settings/image-toolkit'))),
- '#field_suffix' => '<kbd>'. t('WIDTHxHEIGHT') .'</kbd>'
+ '#field_suffix' => '<kbd>' . t('WIDTHxHEIGHT') . '</kbd>'
);
$form['settings_general']['upload_list_default'] = array(
'#type' => 'select',
@@ -107,38 +107,38 @@ function upload_admin_settings() {
'#field_suffix' => t('MB'),
);
- $form['settings_general']['upload_max_size'] = array('#value' => '<p>'. t('Your PHP settings limit the maximum file size per upload to %size.', array('%size' => format_size(file_upload_max_size()))) .'</p>');
+ $form['settings_general']['upload_max_size'] = array('#value' => '<p>' . t('Your PHP settings limit the maximum file size per upload to %size.', array('%size' => format_size(file_upload_max_size()))) . '</p>');
$roles = user_roles(FALSE, 'upload files');
$form['roles'] = array('#type' => 'value', '#value' => $roles);
foreach ($roles as $rid => $role) {
- $form['settings_role_'. $rid] = array(
+ $form['settings_role_' . $rid] = array(
'#type' => 'fieldset',
'#title' => t('Settings for @role', array('@role' => $role)),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
- $form['settings_role_'. $rid]['upload_extensions_'. $rid] = array(
+ $form['settings_role_' . $rid]['upload_extensions_' . $rid] = array(
'#type' => 'textfield',
'#title' => t('Permitted file extensions'),
- '#default_value' => variable_get('upload_extensions_'. $rid, $upload_extensions_default),
+ '#default_value' => variable_get('upload_extensions_' . $rid, $upload_extensions_default),
'#maxlength' => 255,
'#description' => t('Extensions that users in this role can upload. Separate extensions with a space and do not include the leading dot.'),
);
- $form['settings_role_'. $rid]['upload_uploadsize_'. $rid] = array(
+ $form['settings_role_' . $rid]['upload_uploadsize_' . $rid] = array(
'#type' => 'textfield',
'#title' => t('Maximum file size per upload'),
- '#default_value' => variable_get('upload_uploadsize_'. $rid, $upload_uploadsize_default),
+ '#default_value' => variable_get('upload_uploadsize_' . $rid, $upload_uploadsize_default),
'#size' => 5,
'#maxlength' => 5,
'#description' => t('The maximum size of a file a user can upload. If an image is uploaded and a maximum resolution is set, the size will be checked after the file has been resized.'),
'#field_suffix' => t('MB'),
);
- $form['settings_role_'. $rid]['upload_usersize_'. $rid] = array(
+ $form['settings_role_' . $rid]['upload_usersize_' . $rid] = array(
'#type' => 'textfield',
'#title' => t('Total file size per user'),
- '#default_value' => variable_get('upload_usersize_'. $rid, $upload_usersize_default),
+ '#default_value' => variable_get('upload_usersize_' . $rid, $upload_usersize_default),
'#size' => 5,
'#maxlength' => 5,
'#description' => t('The maximum size of all files a user can have on the site.'),
diff --git a/modules/upload/upload.module b/modules/upload/upload.module
index 117333793..d300a13d3 100644
--- a/modules/upload/upload.module
+++ b/modules/upload/upload.module
@@ -13,12 +13,12 @@
function upload_help($path, $arg) {
switch ($path) {
case 'admin/help#upload':
- $output = '<p>'. t('The upload module allows users to upload files to the site. The ability to upload files is important for members of a community who want to share work. It is also useful to administrators who want to keep uploaded files connected to posts.') .'</p>';
- $output .= '<p>'. t('Users with the upload files permission can upload attachments to posts. Uploads may be enabled for specific content types on the content types settings page. Each user role can be customized to limit or control the file size of uploads, or the maximum dimension of image files.') .'</p>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@upload">Upload module</a>.', array('@upload' => 'http://drupal.org/handbook/modules/upload/')) .'</p>';
+ $output = '<p>' . t('The upload module allows users to upload files to the site. The ability to upload files is important for members of a community who want to share work. It is also useful to administrators who want to keep uploaded files connected to posts.') . '</p>';
+ $output .= '<p>' . t('Users with the upload files permission can upload attachments to posts. Uploads may be enabled for specific content types on the content types settings page. Each user role can be customized to limit or control the file size of uploads, or the maximum dimension of image files.') . '</p>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@upload">Upload module</a>.', array('@upload' => 'http://drupal.org/handbook/modules/upload/')) . '</p>';
return $output;
case 'admin/settings/upload':
- return '<p>'. t('Users with the <a href="@permissions">upload files permission</a> can upload attachments. Users with the <a href="@permissions">view uploaded files permission</a> can view uploaded attachments. You can choose which post types can take attachments on the <a href="@types">content types settings</a> page.', array('@permissions' => url('admin/user/permissions'), '@types' => url('admin/settings/types'))) .'</p>';
+ return '<p>' . t('Users with the <a href="@permissions">upload files permission</a> can upload attachments. Users with the <a href="@permissions">view uploaded files permission</a> can view uploaded attachments. You can choose which post types can take attachments on the <a href="@types">content types settings</a> page.', array('@permissions' => url('admin/user/permissions'), '@types' => url('admin/settings/types'))) . '</p>';
}
}
@@ -155,8 +155,8 @@ function upload_file_download($file) {
$result = db_query("SELECT f.* FROM {files} f INNER JOIN {upload} u ON f.fid = u.fid WHERE filepath = '%s'", $file);
if ($file = db_fetch_object($result)) {
return array(
- 'Content-Type: '. $file->filemime,
- 'Content-Length: '. $file->filesize,
+ 'Content-Type: ' . $file->filemime,
+ 'Content-Length: ' . $file->filesize,
);
}
}
@@ -213,14 +213,14 @@ function upload_form_alter(&$form, $form_state, $form_id) {
$form['workflow']['upload'] = array(
'#type' => 'radios',
'#title' => t('Attachments'),
- '#default_value' => variable_get('upload_'. $form['#node_type']->type, 1),
+ '#default_value' => variable_get('upload_' . $form['#node_type']->type, 1),
'#options' => array(t('Disabled'), t('Enabled')),
);
}
if (isset($form['type']) && isset($form['#node'])) {
$node = $form['#node'];
- if ($form['type']['#value'] .'_node_form' == $form_id && variable_get("upload_$node->type", TRUE)) {
+ if ($form['type']['#value'] . '_node_form' == $form_id && variable_get("upload_$node->type", TRUE)) {
// Attachments fieldset
$form['attachments'] = array(
'#type' => 'fieldset',
@@ -248,10 +248,10 @@ function upload_form_alter(&$form, $form_state, $form_id) {
if (!file_check_directory($path, FILE_CREATE_DIRECTORY) || !file_check_directory($temp, FILE_CREATE_DIRECTORY)) {
$form['attachments']['#description'] = t('File attachments are disabled. The file directories have not been properly configured.');
if (user_access('administer site configuration')) {
- $form['attachments']['#description'] .= ' '. t('Please visit the <a href="@admin-file-system">file system configuration page</a>.', array('@admin-file-system' => url('admin/settings/file-system')));
+ $form['attachments']['#description'] .= ' ' . t('Please visit the <a href="@admin-file-system">file system configuration page</a>.', array('@admin-file-system' => url('admin/settings/file-system')));
}
else {
- $form['attachments']['#description'] .= ' '. t('Please contact the site administrator.');
+ $form['attachments']['#description'] .= ' ' . t('Please contact the site administrator.');
}
}
else {
@@ -483,7 +483,7 @@ function _upload_form($node) {
foreach ($node->files as $key => $file) {
$file = (object)$file;
$description = file_create_url($file->filepath);
- $description = "<small>". check_plain($description) ."</small>";
+ $description = "<small>" . check_plain($description) . "</small>";
$form['files'][$key]['description'] = array('#type' => 'textfield', '#default_value' => !empty($file->description) ? $file->description : $file->filename, '#maxlength' => 256, '#description' => $description );
$form['files'][$key]['size'] = array('#value' => format_size($file->filesize));
$form['files'][$key]['remove'] = array('#type' => 'checkbox', '#default_value' => !empty($file->remove));
@@ -580,7 +580,7 @@ function upload_load($node) {
*/
function upload_js() {
// Load the form from the Form API cache.
- $cache = cache_get('form_'. $_POST['form_build_id'], 'cache_form');
+ $cache = cache_get('form_' . $_POST['form_build_id'], 'cache_form');
// We only do the upload.module part of the node validation process.
$node = (object)$_POST;
@@ -616,7 +616,7 @@ function upload_js() {
// Add the new element to the stored form state and resave.
$cache->data['attachments']['wrapper'] = array_merge($cache->data['attachments']['wrapper'], $form);
- cache_set('form_'. $_POST['form_build_id'], $cache->data, 'cache_form', $cache->expire);
+ cache_set('form_' . $_POST['form_build_id'], $cache->data, 'cache_form', $cache->expire);
// Render the form for output.
$form += array(
diff --git a/modules/user/user.admin.inc b/modules/user/user.admin.inc
index 8174878a4..3884698f7 100644
--- a/modules/user/user.admin.inc
+++ b/modules/user/user.admin.inc
@@ -139,9 +139,9 @@ function user_admin_account() {
t('Operations')
);
- $sql = 'SELECT DISTINCT u.uid, u.name, u.status, u.created, u.access FROM {users} u LEFT JOIN {users_roles} ur ON u.uid = ur.uid '. $filter['join'] .' WHERE u.uid != 0 '. $filter['where'];
+ $sql = 'SELECT DISTINCT u.uid, u.name, u.status, u.created, u.access FROM {users} u LEFT JOIN {users_roles} ur ON u.uid = ur.uid ' . $filter['join'] . ' WHERE u.uid != 0 ' . $filter['where'];
$sql .= tablesort_sql($header);
- $query_count = 'SELECT COUNT(DISTINCT u.uid) FROM {users} u LEFT JOIN {users_roles} ur ON u.uid = ur.uid '. $filter['join'] .' WHERE u.uid != 0 '. $filter['where'];
+ $query_count = 'SELECT COUNT(DISTINCT u.uid) FROM {users} u LEFT JOIN {users_roles} ur ON u.uid = ur.uid ' . $filter['join'] . ' WHERE u.uid != 0 ' . $filter['where'];
$result = pager_query($sql, 50, 0, $query_count, $filter['args']);
$form['options'] = array(
@@ -243,14 +243,14 @@ function user_admin_settings() {
);
// These email tokens are shared for all settings, so just define
// the list once to help ensure they stay in sync.
- $email_token_help = t('Available variables are:') .' !username, !site, !password, !uri, !uri_brief, !mailto, !date, !login_uri, !edit_uri, !login_url.';
+ $email_token_help = t('Available variables are:') . ' !username, !site, !password, !uri, !uri_brief, !mailto, !date, !login_uri, !edit_uri, !login_url.';
$form['email']['admin_created'] = array(
'#type' => 'fieldset',
'#title' => t('Welcome, new user created by administrator'),
'#collapsible' => TRUE,
'#collapsed' => (variable_get('user_register', 1) != 0),
- '#description' => t('Customize welcome e-mail messages sent to new member accounts created by an administrator.') .' '. $email_token_help,
+ '#description' => t('Customize welcome e-mail messages sent to new member accounts created by an administrator.') . ' ' . $email_token_help,
);
$form['email']['admin_created']['user_mail_register_admin_created_subject'] = array(
'#type' => 'textfield',
@@ -270,7 +270,7 @@ function user_admin_settings() {
'#title' => t('Welcome, no approval required'),
'#collapsible' => TRUE,
'#collapsed' => (variable_get('user_register', 1) != 1),
- '#description' => t('Customize welcome e-mail messages sent to new members upon registering, when no administrator approval is required.') .' '. $email_token_help
+ '#description' => t('Customize welcome e-mail messages sent to new members upon registering, when no administrator approval is required.') . ' ' . $email_token_help
);
$form['email']['no_approval_required']['user_mail_register_no_approval_required_subject'] = array(
'#type' => 'textfield',
@@ -290,7 +290,7 @@ function user_admin_settings() {
'#title' => t('Welcome, awaiting administrator approval'),
'#collapsible' => TRUE,
'#collapsed' => (variable_get('user_register', 1) != 2),
- '#description' => t('Customize welcome e-mail messages sent to new members upon registering, when administrative approval is required.') .' '. $email_token_help,
+ '#description' => t('Customize welcome e-mail messages sent to new members upon registering, when administrative approval is required.') . ' ' . $email_token_help,
);
$form['email']['pending_approval']['user_mail_register_pending_approval_subject'] = array(
'#type' => 'textfield',
@@ -310,7 +310,7 @@ function user_admin_settings() {
'#title' => t('Password recovery email'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
- '#description' => t('Customize e-mail messages sent to users who request a new password.') .' '. $email_token_help,
+ '#description' => t('Customize e-mail messages sent to users who request a new password.') . ' ' . $email_token_help,
);
$form['email']['password_reset']['user_mail_password_reset_subject'] = array(
'#type' => 'textfield',
@@ -330,7 +330,7 @@ function user_admin_settings() {
'#title' => t('Account activation email'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
- '#description' => t('Enable and customize e-mail messages sent to users upon account activation (when an administrator activates an account of a user who has already registered, on a site where administrative approval is required).') .' '. $email_token_help,
+ '#description' => t('Enable and customize e-mail messages sent to users upon account activation (when an administrator activates an account of a user who has already registered, on a site where administrative approval is required).') . ' ' . $email_token_help,
);
$form['email']['activated']['user_mail_status_activated_notify'] = array(
'#type' => 'checkbox',
@@ -355,7 +355,7 @@ function user_admin_settings() {
'#title' => t('Account blocked email'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
- '#description' => t('Enable and customize e-mail messages sent to users when their accounts are blocked.') .' '. $email_token_help,
+ '#description' => t('Enable and customize e-mail messages sent to users when their accounts are blocked.') . ' ' . $email_token_help,
);
$form['email']['blocked']['user_mail_status_blocked_notify'] = array(
'#type' => 'checkbox',
@@ -380,7 +380,7 @@ function user_admin_settings() {
'#title' => t('Account deleted email'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
- '#description' => t('Enable and customize e-mail messages sent to users when their accounts are deleted.') .' '. $email_token_help,
+ '#description' => t('Enable and customize e-mail messages sent to users when their accounts are deleted.') . ' ' . $email_token_help,
);
$form['email']['deleted']['user_mail_status_deleted_notify'] = array(
'#type' => 'checkbox',
@@ -431,7 +431,7 @@ function user_admin_settings() {
'#prefix' => '<div class="user-admin-picture-radios">',
'#suffix' => '</div>',
);
- drupal_add_js(drupal_get_path('module', 'user') .'/user.js');
+ drupal_add_js(drupal_get_path('module', 'user') . '/user.js');
// If JS is enabled, and the radio is defaulting to off, hide all
// the settings on page load via .css using the js-hide class so
// that there's no flicker.
@@ -440,7 +440,7 @@ function user_admin_settings() {
$css_class .= ' js-hide';
}
$form['pictures']['settings'] = array(
- '#prefix' => '<div class="'. $css_class .'">',
+ '#prefix' => '<div class="' . $css_class . '">',
'#suffix' => '</div>',
);
$form['pictures']['settings']['user_picture_path'] = array(
@@ -449,7 +449,7 @@ function user_admin_settings() {
'#default_value' => variable_get('user_picture_path', 'pictures'),
'#size' => 30,
'#maxlength' => 255,
- '#description' => t('Subdirectory in the directory %dir where pictures will be stored.', array('%dir' => file_directory_path() .'/')),
+ '#description' => t('Subdirectory in the directory %dir where pictures will be stored.', array('%dir' => file_directory_path() . '/')),
);
$form['pictures']['settings']['user_picture_default'] = array(
'#type' => 'textfield',
@@ -505,7 +505,7 @@ function user_admin_perm($form_state, $rid = NULL) {
// always search for "$perm," to make sure we do not confuse
// permissions that are substrings of each other.
while ($role = db_fetch_object($result)) {
- $role_permissions[$role->rid] = $role->perm .',';
+ $role_permissions[$role->rid] = $role->perm . ',';
}
// Retrieve role names for columns.
@@ -537,7 +537,7 @@ function user_admin_perm($form_state, $rid = NULL) {
);
foreach ($role_names as $rid => $name) {
// Builds arrays for checked boxes for each role
- if (strpos($role_permissions[$rid], $perm .',') !== FALSE) {
+ if (strpos($role_permissions[$rid], $perm . ',') !== FALSE) {
$status[$rid][] = $perm;
}
}
@@ -589,7 +589,7 @@ function theme_user_admin_perm($form) {
$row = array();
// Module name
if (is_numeric($key)) {
- $row[] = array('data' => t('@module module', array('@module' => drupal_render($form['permission'][$key]))), 'class' => 'module', 'id' => 'module-'. $form['permission'][$key]['#value'], 'colspan' => count($form['role_names']) + 1);
+ $row[] = array('data' => t('@module module', array('@module' => drupal_render($form['permission'][$key]))), 'class' => 'module', 'id' => 'module-' . $form['permission'][$key]['#value'], 'colspan' => count($form['role_names']) + 1);
}
else {
// Permission row.
@@ -599,7 +599,7 @@ function theme_user_admin_perm($form) {
);
foreach (element_children($form['checkboxes']) as $rid) {
if (is_array($form['checkboxes'][$rid])) {
- $row[] = array('data' => drupal_render($form['checkboxes'][$rid][$key]), 'class' => 'checkbox', 'title' => $roles[$rid] .' : '. t($key));
+ $row[] = array('data' => drupal_render($form['checkboxes'][$rid][$key]), 'class' => 'checkbox', 'title' => $roles[$rid] . ' : ' . t($key));
}
}
}
@@ -764,9 +764,9 @@ function theme_user_admin_account($form) {
function theme_user_admin_new_role($form) {
$header = array(t('Name'), array('data' => t('Operations'), 'colspan' => 2));
foreach (user_roles() as $rid => $name) {
- $edit_permissions = l(t('edit permissions'), 'admin/user/permissions/'. $rid);
+ $edit_permissions = l(t('edit permissions'), 'admin/user/permissions/' . $rid);
if (!in_array($rid, array(DRUPAL_ANONYMOUS_RID, DRUPAL_AUTHENTICATED_RID))) {
- $rows[] = array($name, l(t('edit role'), 'admin/user/roles/edit/'. $rid), $edit_permissions);
+ $rows[] = array($name, l(t('edit role'), 'admin/user/roles/edit/' . $rid), $edit_permissions);
}
else {
$rows[] = array($name, t('locked'), $edit_permissions);
@@ -802,17 +802,17 @@ function theme_user_filters($form) {
$output = '<ul class="clear-block">';
if (!empty($form['current'])) {
foreach (element_children($form['current']) as $key) {
- $output .= '<li>'. drupal_render($form['current'][$key]) .'</li>';
+ $output .= '<li>' . drupal_render($form['current'][$key]) . '</li>';
}
}
- $output .= '<li><dl class="multiselect">'. (!empty($form['current']) ? '<dt><em>'. t('and') .'</em> '. t('where') .'</dt>' : '') .'<dd class="a">';
+ $output .= '<li><dl class="multiselect">' . (!empty($form['current']) ? '<dt><em>' . t('and') . '</em> ' . t('where') . '</dt>' : '') . '<dd class="a">';
foreach (element_children($form['filter']) as $key) {
$output .= drupal_render($form['filter'][$key]);
}
$output .= '</dd>';
- $output .= '<dt>'. t('is') .'</dt><dd class="b">';
+ $output .= '<dt>' . t('is') . '</dt><dd class="b">';
foreach (element_children($form['status']) as $key) {
$output .= drupal_render($form['status'][$key]);
@@ -820,7 +820,7 @@ function theme_user_filters($form) {
$output .= '</dd>';
$output .= '</dl>';
- $output .= '<div class="container-inline" id="user-admin-buttons">'. drupal_render($form['buttons']) .'</div>';
+ $output .= '<div class="container-inline" id="user-admin-buttons">' . drupal_render($form['buttons']) . '</div>';
$output .= '</li></ul>';
return $output;
diff --git a/modules/user/user.install b/modules/user/user.install
index 5f63f05ea..c2c6f2830 100644
--- a/modules/user/user.install
+++ b/modules/user/user.install
@@ -295,7 +295,7 @@ function user_update_7000(&$sandbox) {
$new_hash = user_hash_password($account['pass'], $hash_count_log2);
if ($new_hash) {
// Indicate an updated password.
- $new_hash = 'U'. $new_hash;
+ $new_hash = 'U' . $new_hash;
db_query("UPDATE {users} SET pass = '%s' WHERE uid = %d", $new_hash, $account['uid']);
}
}
@@ -303,7 +303,7 @@ function user_update_7000(&$sandbox) {
$sandbox['user_from'] += $count;
if (!$has_rows) {
$ret['#finished'] = 1;
- $ret[] = array('success' => TRUE, 'query' => "UPDATE {users} SET pass = 'U'. user_hash_password(pass) WHERE uid > 0");
+ $ret[] = array('success' => TRUE, 'query' => "UPDATE {users} SET pass = 'U' . user_hash_password(pass) WHERE uid > 0");
}
}
return $ret;
diff --git a/modules/user/user.module b/modules/user/user.module
index 4b6c65ae2..9314ccd32 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -17,7 +17,7 @@ define('EMAIL_MAX_LENGTH', 64);
*/
function user_module_invoke($type, &$array, &$user, $category = NULL) {
foreach (module_list() as $module) {
- $function = $module .'_user';
+ $function = $module . '_user';
if (function_exists($function)) {
$function($type, $array, $user, $category);
}
@@ -164,7 +164,7 @@ function user_load($array = array()) {
$params[] = $value;
}
}
- $result = db_query('SELECT * FROM {users} u WHERE '. implode(' AND ', $query), $params);
+ $result = db_query('SELECT * FROM {users} u WHERE ' . implode(' AND ', $query), $params);
if ($user = db_fetch_object($result)) {
$user = drupal_unpack($user);
@@ -354,14 +354,14 @@ function user_validate_name($name) {
if (substr($name, -1) == ' ') return t('The username cannot end with a space.');
if (strpos($name, ' ') !== FALSE) return t('The username cannot contain multiple spaces in a row.');
if (ereg("[^\x80-\xF7 [:alnum:]@_.-]", $name)) return t('The username contains an illegal character.');
- if (preg_match('/[\x{80}-\x{A0}'. // Non-printable ISO-8859-1 + NBSP
- '\x{AD}'. // Soft-hyphen
- '\x{2000}-\x{200F}'. // Various space characters
- '\x{2028}-\x{202F}'. // Bidirectional text overrides
- '\x{205F}-\x{206F}'. // Various text hinting characters
- '\x{FEFF}'. // Byte order mark
- '\x{FF01}-\x{FF60}'. // Full-width latin
- '\x{FFF9}-\x{FFFD}'. // Replacement characters
+ if (preg_match('/[\x{80}-\x{A0}' . // Non-printable ISO-8859-1 + NBSP
+ '\x{AD}' . // Soft-hyphen
+ '\x{2000}-\x{200F}' . // Various space characters
+ '\x{2028}-\x{202F}' . // Bidirectional text overrides
+ '\x{205F}-\x{206F}' . // Various text hinting characters
+ '\x{FEFF}' . // Byte order mark
+ '\x{FF01}-\x{FF60}' . // Full-width latin
+ '\x{FFF9}-\x{FFFD}' . // Replacement characters
'\x{0}]/u', // NULL byte
$name)) {
return t('The username contains an illegal character.');
@@ -394,7 +394,7 @@ function user_validate_picture(&$form, &$form_state) {
// files table as a temporary file. We'll make a copy and let the garbage
// collector delete the original upload.
$info = image_get_info($file->filepath);
- $destination = variable_get('user_picture_path', 'pictures') .'/picture-'. $form['#uid'] .'.'. $info['extension'];
+ $destination = variable_get('user_picture_path', 'pictures') . '/picture-' . $form['#uid'] . '.' . $info['extension'];
if (file_copy($file, $destination, FILE_EXISTS_REPLACE)) {
$form_state['values']['picture'] = $file->filepath;
}
@@ -470,7 +470,7 @@ function user_access($string, $account = NULL, $reset = FALSE) {
// To reduce the number of SQL queries, we cache the user's permissions
// in a static variable.
if (!isset($perm[$account->uid])) {
- $result = db_query("SELECT p.perm FROM {role} r INNER JOIN {permission} p ON p.rid = r.rid WHERE r.rid IN (". db_placeholders($account->roles) .")", array_keys($account->roles));
+ $result = db_query("SELECT p.perm FROM {role} r INNER JOIN {permission} p ON p.rid = r.rid WHERE r.rid IN (" . db_placeholders($account->roles) . ")", array_keys($account->roles));
$perms = array();
while ($row = db_fetch_object($result)) {
@@ -511,9 +511,9 @@ function user_perm() {
* Ensure that user pictures (avatars) are always downloadable.
*/
function user_file_download($file) {
- if (strpos($file, variable_get('user_picture_path', 'pictures') .'/picture-') === 0) {
+ if (strpos($file, variable_get('user_picture_path', 'pictures') . '/picture-') === 0) {
$info = image_get_info(file_create_path($file));
- return array('Content-type: '. $info['mime_type']);
+ return array('Content-type: ' . $info['mime_type']);
}
}
@@ -535,13 +535,13 @@ function user_search($op = 'search', $keys = NULL, $skip_access_check = FALSE) {
// Administrators can also search in the otherwise private email field.
$result = pager_query("SELECT name, uid, mail FROM {users} WHERE LOWER(name) LIKE LOWER('%%%s%%') OR LOWER(mail) LIKE LOWER('%%%s%%')", 15, 0, NULL, $keys, $keys);
while ($account = db_fetch_object($result)) {
- $find[] = array('title' => $account->name .' ('. $account->mail .')', 'link' => url('user/'. $account->uid, array('absolute' => TRUE)));
+ $find[] = array('title' => $account->name . ' (' . $account->mail . ')', 'link' => url('user/' . $account->uid, array('absolute' => TRUE)));
}
}
else {
$result = pager_query("SELECT name, uid FROM {users} WHERE LOWER(name) LIKE LOWER('%%%s%%')", 15, 0, NULL, $keys);
while ($account = db_fetch_object($result)) {
- $find[] = array('title' => $account->name, 'link' => url('user/'. $account->uid, array('absolute' => TRUE)));
+ $find[] = array('title' => $account->name, 'link' => url('user/' . $account->uid, array('absolute' => TRUE)));
}
}
return $find;
@@ -1011,7 +1011,7 @@ function user_menu() {
foreach ($categories as $key => $category) {
// 'account' is already handled by the MENU_DEFAULT_LOCAL_TASK.
if ($category['name'] != 'account') {
- $items['user/%user_category/edit/'. $category['name']] = array(
+ $items['user/%user_category/edit/' . $category['name']] = array(
'title callback' => 'check_plain',
'title arguments' => array($category['title']),
'page callback' => 'user_edit',
@@ -1031,7 +1031,7 @@ function user_menu() {
}
function user_init() {
- drupal_add_css(drupal_get_path('module', 'user') .'/user.css', 'module');
+ drupal_add_css(drupal_get_path('module', 'user') . '/user.css', 'module');
}
function user_current_load($arg) {
@@ -1153,7 +1153,7 @@ function user_login(&$form_state) {
// If we are already logged on, go to the user page instead.
if ($user->uid) {
- drupal_goto('user/'. $user->uid);
+ drupal_goto('user/' . $user->uid);
}
// Display login form:
@@ -1296,7 +1296,7 @@ function user_authenticate_finalize(&$edit) {
function user_login_submit($form, &$form_state) {
global $user;
if ($user->uid) {
- $form_state['redirect'] = 'user/'. $user->uid;
+ $form_state['redirect'] = 'user/' . $user->uid;
return;
}
}
@@ -1327,13 +1327,13 @@ function user_external_login_register($name, $module) {
}
user_set_authmaps($account, array("authname_$module" => $name));
$user = $account;
- watchdog('user', 'New external user: %name using module %module.', array('%name' => $name, '%module' => $module), WATCHDOG_NOTICE, l(t('edit'), 'user/'. $user->uid .'/edit'));
+ watchdog('user', 'New external user: %name using module %module.', array('%name' => $name, '%module' => $module), WATCHDOG_NOTICE, l(t('edit'), 'user/' . $user->uid . '/edit'));
}
}
function user_pass_reset_url($account) {
$timestamp = time();
- return url("user/reset/$account->uid/$timestamp/". user_pass_rehash($account->pass, $timestamp, $account->login), array('absolute' => TRUE));
+ return url("user/reset/$account->uid/$timestamp/" . user_pass_rehash($account->pass, $timestamp, $account->login), array('absolute' => TRUE));
}
function user_pass_rehash($password, $timestamp, $login) {
@@ -1441,7 +1441,7 @@ function user_edit_form(&$form_state, $uid, $edit, $register = FALSE) {
else {
$form['picture']['picture_delete'] = array('#type' => 'hidden');
}
- $form['picture']['picture_upload'] = array('#type' => 'file', '#title' => t('Upload picture'), '#size' => 48, '#description' => t('Your virtual face or picture. Maximum dimensions are %dimensions and the maximum size is %size kB.', array('%dimensions' => variable_get('user_picture_dimensions', '85x85'), '%size' => variable_get('user_picture_file_size', '30'))) .' '. variable_get('user_picture_guidelines', ''));
+ $form['picture']['picture_upload'] = array('#type' => 'file', '#title' => t('Upload picture'), '#size' => 48, '#description' => t('Your virtual face or picture. Maximum dimensions are %dimensions and the maximum size is %size kB.', array('%dimensions' => variable_get('user_picture_dimensions', '85x85'), '%size' => variable_get('user_picture_file_size', '30'))) . ' ' . variable_get('user_picture_guidelines', ''));
$form['#validate'][] = 'user_validate_picture';
}
$form['#uid'] = $uid;
@@ -1497,7 +1497,7 @@ function user_delete($edit, $uid) {
db_query('DELETE FROM {users} WHERE uid = %d', $uid);
db_query('DELETE FROM {users_roles} WHERE uid = %d', $uid);
db_query('DELETE FROM {authmap} WHERE uid = %d', $uid);
- $variables = array('%name' => $account->name, '%email' => '<'. $account->mail .'>');
+ $variables = array('%name' => $account->name, '%email' => '<' . $account->mail . '>');
watchdog('user', 'Deleted user: %name %email.', $variables, WATCHDOG_NOTICE);
module_invoke_all('user', 'delete', $edit, $account);
}
@@ -1526,8 +1526,8 @@ function user_build_content(&$account) {
function user_mail($key, &$message, $params) {
$language = $message['language'];
$variables = user_mail_tokens($params['account'], $language);
- $message['subject'] .= _user_mail_text($key .'_subject', $language, $variables);
- $message['body'][] = _user_mail_text($key .'_body', $language, $variables);
+ $message['subject'] .= _user_mail_text($key . '_subject', $language, $variables);
+ $message['body'][] = _user_mail_text($key . '_body', $language, $variables);
}
/**
@@ -1538,7 +1538,7 @@ function user_mail($key, &$message, $params) {
function _user_mail_text($key, $language = NULL, $variables = array()) {
$langcode = isset($language) ? $language->language : NULL;
- if ($admin_setting = variable_get('user_mail_'. $key, FALSE)) {
+ if ($admin_setting = variable_get('user_mail_' . $key, FALSE)) {
// An admin setting overrides the default string.
return strtr($admin_setting, $variables);
}
@@ -1653,12 +1653,12 @@ function user_user_operations($form_state = array()) {
$add_roles = array();
foreach ($roles as $key => $value) {
- $add_roles['add_role-'. $key] = $value;
+ $add_roles['add_role-' . $key] = $value;
}
$remove_roles = array();
foreach ($roles as $key => $value) {
- $remove_roles['remove_role-'. $key] = $value;
+ $remove_roles['remove_role-' . $key] = $value;
}
if (count($roles)) {
@@ -1763,7 +1763,7 @@ function user_multiple_delete_confirm(&$form_state) {
// array_filter() returns only elements with TRUE values.
foreach (array_filter($edit['accounts']) as $uid => $value) {
$user = db_result(db_query('SELECT name FROM {users} WHERE uid = %d', $uid));
- $form['accounts'][$uid] = array('#type' => 'hidden', '#value' => $uid, '#prefix' => '<li>', '#suffix' => check_plain($user) ."</li>\n");
+ $form['accounts'][$uid] = array('#type' => 'hidden', '#value' => $uid, '#prefix' => '<li>', '#suffix' => check_plain($user) . "</li>\n");
}
$form['operation'] = array('#type' => 'hidden', '#value' => 'delete');
@@ -1792,18 +1792,18 @@ function user_help($path, $arg) {
switch ($path) {
case 'admin/help#user':
- $output = '<p>'. t('The user module allows users to register, login, and log out. Users benefit from being able to sign on because it associates content they create with their account and allows various permissions to be set for their roles. The user module supports user roles which establish fine grained permissions allowing each role to do only what the administrator wants them to. Each user is assigned to one or more roles. By default there are two roles <em>anonymous</em> - a user who has not logged in, and <em>authenticated</em> a user who has signed up and who has been authorized.') .'</p>';
- $output .= '<p>'. t("Users can use their own name or handle and can specify personal configuration settings through their individual <em>My account</em> page. Users must authenticate by supplying a local username and password or through their OpenID, an optional and secure method for logging into many websites with a single username and password. In some configurations, users may authenticate using a username and password from another Drupal site, or through some other site-specific mechanism.") .'</p>';
- $output .= '<p>'. t('A visitor accessing your website is assigned a unique ID, or session ID, which is stored in a cookie. The cookie does not contain personal information, but acts as a key to retrieve information from your site. Users should have cookies enabled in their web browser when using your site.') .'</p>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@user">User module</a>.', array('@user' => 'http://drupal.org/handbook/modules/user/')) .'</p>';
+ $output = '<p>' . t('The user module allows users to register, login, and log out. Users benefit from being able to sign on because it associates content they create with their account and allows various permissions to be set for their roles. The user module supports user roles which establish fine grained permissions allowing each role to do only what the administrator wants them to. Each user is assigned to one or more roles. By default there are two roles <em>anonymous</em> - a user who has not logged in, and <em>authenticated</em> a user who has signed up and who has been authorized.') . '</p>';
+ $output .= '<p>' . t("Users can use their own name or handle and can specify personal configuration settings through their individual <em>My account</em> page. Users must authenticate by supplying a local username and password or through their OpenID, an optional and secure method for logging into many websites with a single username and password. In some configurations, users may authenticate using a username and password from another Drupal site, or through some other site-specific mechanism.") . '</p>';
+ $output .= '<p>' . t('A visitor accessing your website is assigned a unique ID, or session ID, which is stored in a cookie. The cookie does not contain personal information, but acts as a key to retrieve information from your site. Users should have cookies enabled in their web browser when using your site.') . '</p>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@user">User module</a>.', array('@user' => 'http://drupal.org/handbook/modules/user/')) . '</p>';
return $output;
case 'admin/user/user':
- return '<p>'. t('Drupal allows users to register, login, log out, maintain user profiles, etc. Users of the site may not use their own names to post content until they have signed up for a user account.') .'</p>';
+ return '<p>' . t('Drupal allows users to register, login, log out, maintain user profiles, etc. Users of the site may not use their own names to post content until they have signed up for a user account.') . '</p>';
case 'admin/user/user/create':
case 'admin/user/user/account/create':
- return '<p>'. t("This web page allows administrators to register new users. Users' e-mail addresses and usernames must be unique.") .'</p>';
+ return '<p>' . t("This web page allows administrators to register new users. Users' e-mail addresses and usernames must be unique.") . '</p>';
case 'admin/user/permissions':
- return '<p>'. t('Permissions let you control what users can do on your site. Each user role (defined on the <a href="@role">user roles page</a>) has its own set of permissions. For example, you could give users classified as "Administrators" permission to "administer nodes" but deny this power to ordinary, "authenticated" users. You can use permissions to reveal new features to privileged users (those with subscriptions, for example). Permissions also allow trusted users to share the administrative burden of running a busy site.', array('@role' => url('admin/user/roles'))) .'</p>';
+ return '<p>' . t('Permissions let you control what users can do on your site. Each user role (defined on the <a href="@role">user roles page</a>) has its own set of permissions. For example, you could give users classified as "Administrators" permission to "administer nodes" but deny this power to ordinary, "authenticated" users. You can use permissions to reveal new features to privileged users (those with subscriptions, for example). Permissions also allow trusted users to share the administrative burden of running a busy site.', array('@role' => url('admin/user/roles'))) . '</p>';
case 'admin/user/roles':
return t('<p>Roles allow you to fine tune the security and administration of Drupal. A role defines a group of users that have certain privileges as defined in <a href="@permissions">user permissions</a>. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the <em>role names</em> of the various roles. To delete a role choose "edit".</p><p>By default, Drupal comes with two user roles:</p>
<ul>
@@ -1811,7 +1811,7 @@ function user_help($path, $arg) {
<li>Authenticated user: this role is automatically granted to all logged in users.</li>
</ul>', array('@permissions' => url('admin/user/permissions')));
case 'admin/user/search':
- return '<p>'. t('Enter a simple pattern ("*" may be used as a wildcard match) to search for a username or e-mail address. For example, one may search for "br" and Drupal might return "brian", "brad", and "brenda@example.com".') .'</p>';
+ return '<p>' . t('Enter a simple pattern ("*" may be used as a wildcard match) to search for a username or e-mail address. For example, one may search for "br" and Drupal might return "brian", "brad", and "brenda@example.com".') . '</p>';
}
}
@@ -1906,8 +1906,8 @@ function user_build_filter_query() {
$args[] = $value;
$join[] = $filters[$key]['join'];
}
- $where = !empty($where) ? 'AND '. implode(' AND ', $where) : '';
- $join = !empty($join) ? ' '. implode(' ', array_unique($join)) : '';
+ $where = !empty($where) ? 'AND ' . implode(' AND ', $where) : '';
+ $join = !empty($join) ? ' ' . implode(' ', array_unique($join)) : '';
return array('where' => $where,
'join' => $join,
@@ -1979,7 +1979,7 @@ function user_mail_tokens($account, $language) {
'!mailto' => $account->mail,
'!date' => format_date(time(), 'medium', '', NULL, $language->language),
'!login_uri' => url('user', array('absolute' => TRUE, 'language' => $language)),
- '!edit_uri' => url('user/'. $account->uid .'/edit', array('absolute' => TRUE, 'language' => $language)),
+ '!edit_uri' => url('user/' . $account->uid . '/edit', array('absolute' => TRUE, 'language' => $language)),
);
if (!empty($account->password)) {
$tokens['!password'] = $account->password;
@@ -2038,7 +2038,7 @@ function user_preferred_language($account, $default = NULL) {
function _user_mail_notify($op, $account, $language = NULL) {
// By default, we always notify except for deleted and blocked.
$default_notify = ($op != 'status_deleted' && $op != 'status_blocked');
- $notify = variable_get('user_mail_'. $op .'_notify', $default_notify);
+ $notify = variable_get('user_mail_' . $op . '_notify', $default_notify);
if ($notify) {
$params['account'] = $account;
$language = $language ? $language : user_preferred_language($account);
@@ -2064,7 +2064,7 @@ function _user_password_dynamic_validation() {
global $user;
// Only need to do once per page.
if (!$complete) {
- drupal_add_js(drupal_get_path('module', 'user') .'/user.js', 'module');
+ drupal_add_js(drupal_get_path('module', 'user') . '/user.js', 'module');
drupal_add_js(array(
'password' => array(
@@ -2202,7 +2202,7 @@ function user_register_submit($form, &$form_state) {
}
$form_state['user'] = $account;
- watchdog('user', 'New user: %name (%email).', array('%name' => $name, '%email' => $mail), WATCHDOG_NOTICE, l(t('edit'), 'user/'. $account->uid .'/edit'));
+ watchdog('user', 'New user: %name (%email).', array('%name' => $name, '%email' => $mail), WATCHDOG_NOTICE, l(t('edit'), 'user/' . $account->uid . '/edit'));
// The first user may login immediately, and receives a customized welcome e-mail.
if ($account->uid == 1) {
@@ -2270,7 +2270,7 @@ function user_register() {
// If we aren't admin but already logged on, go to the user page instead.
if (!$admin && $user->uid) {
- drupal_goto('user/'. $user->uid);
+ drupal_goto('user/' . $user->uid);
}
$form = array();
diff --git a/modules/user/user.pages.inc b/modules/user/user.pages.inc
index e2c991607..8a32f87c4 100644
--- a/modules/user/user.pages.inc
+++ b/modules/user/user.pages.inc
@@ -102,11 +102,11 @@ function user_pass_reset(&$form_state, $uid, $timestamp, $hashed_pass, $action =
// user, which invalidates further use of the one-time login link.
user_authenticate_finalize($form_state['values']);
drupal_set_message(t('You have just used your one-time login link. It is no longer necessary to use this link to login. Please change your password.'));
- drupal_goto('user/'. $user->uid .'/edit');
+ drupal_goto('user/' . $user->uid . '/edit');
}
else {
$form['message'] = array('#value' => t('<p>This is a one-time login for %user_name and will expire on %expiration_date.</p><p>Click on this button to login to the site and change your password.</p>', array('%user_name' => $account->name, '%expiration_date' => format_date($timestamp + $timeout))));
- $form['help'] = array('#value' => '<p>'. t('This login can be used only once.') .'</p>');
+ $form['help'] = array('#value' => '<p>' . t('This login can be used only once.') . '</p>');
$form['submit'] = array('#type' => 'submit', '#value' => t('Log in'));
$form['#action'] = url("user/reset/$uid/$timestamp/$hashed_pass/login");
return $form;
@@ -291,7 +291,7 @@ function user_edit_delete_submit($form, &$form_state) {
unset($_REQUEST['destination']);
}
// Note: We redirect from user/uid/edit to user/uid/delete to make the tabs disappear.
- $form_state['redirect'] = array("user/". $form_state['values']['_account']->uid ."/delete", $destination);
+ $form_state['redirect'] = array("user/" . $form_state['values']['_account']->uid . "/delete", $destination);
}
/**
@@ -306,7 +306,7 @@ function user_confirm_delete(&$form_state, $account) {
return confirm_form($form,
t('Are you sure you want to delete the account %name?', array('%name' => $account->name)),
- 'user/'. $account->uid,
+ 'user/' . $account->uid,
t('All submissions made by this user will be attributed to the anonymous account. This action cannot be undone.'),
t('Delete'), t('Cancel'));
}
@@ -356,7 +356,7 @@ function user_edit_submit($form, &$form_state) {
function user_page() {
global $user;
if ($user->uid) {
- menu_set_active_item('user/'. $user->uid);
+ menu_set_active_item('user/' . $user->uid);
return menu_execute_active_handler();
}
else {
diff --git a/themes/bluemarine/comment.tpl.php b/themes/bluemarine/comment.tpl.php
index bd1249119..013b0afa0 100644
--- a/themes/bluemarine/comment.tpl.php
+++ b/themes/bluemarine/comment.tpl.php
@@ -1,7 +1,7 @@
<?php
// $Id$
?>
- <div class="comment<?php print ' '. $status; ?>">
+ <div class="comment<?php print ' ' . $status; ?>">
<?php if ($picture) {
print $picture;
} ?>
diff --git a/themes/chameleon/chameleon.theme b/themes/chameleon/chameleon.theme
index 8f3a51904..7725035f4 100644
--- a/themes/chameleon/chameleon.theme
+++ b/themes/chameleon/chameleon.theme
@@ -18,7 +18,7 @@ function chameleon_page($content, $show_blocks = TRUE, $show_messages = TRUE) {
$direction = $GLOBALS['language']->direction ? 'rtl' : 'ltr';
if (theme_get_setting('toggle_favicon')) {
- drupal_set_html_head('<link rel="shortcut icon" href="'. check_url(theme_get_setting('favicon')) .'" type="image/x-icon" />');
+ drupal_set_html_head('<link rel="shortcut icon" href="' . check_url(theme_get_setting('favicon')) . '" type="image/x-icon" />');
}
$title = drupal_get_title();
@@ -30,7 +30,7 @@ function chameleon_page($content, $show_blocks = TRUE, $show_messages = TRUE) {
$output = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
$output .= "<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"$language\" xml:lang=\"$language\" dir=\"$direction\">\n";
$output .= "<head>\n";
- $output .= " <title>". ($title ? strip_tags($title) ." | ". variable_get("site_name", "Drupal") : variable_get("site_name", "Drupal") ." | ". variable_get("site_slogan", "")) ."</title>\n";
+ $output .= " <title>" . ($title ? strip_tags($title) . " | " . variable_get("site_name", "Drupal") : variable_get("site_name", "Drupal") . " | " . variable_get("site_slogan", "")) . "</title>\n";
$output .= drupal_get_html_head();
$output .= drupal_get_css();
$output .= drupal_get_js();
@@ -39,13 +39,13 @@ function chameleon_page($content, $show_blocks = TRUE, $show_messages = TRUE) {
$output .= " <div id=\"header\">";
if ($logo = theme_get_setting('logo')) {
- $output .= " <a href=\"". url() ."\" title=\"". t('Home') ."\"><img src=\"$logo\" alt=\"". t('Home') ."\" /></a>";
+ $output .= " <a href=\"" . url() . "\" title=\"" . t('Home') . "\"><img src=\"$logo\" alt=\"" . t('Home') . "\" /></a>";
}
if (theme_get_setting('toggle_name')) {
- $output .= " <h1 class=\"site-name title\">". l(variable_get('site_name', 'drupal'), "") ."</h1>";
+ $output .= " <h1 class=\"site-name title\">" . l(variable_get('site_name', 'drupal'), "") . "</h1>";
}
if (theme_get_setting('toggle_slogan')) {
- $output .= " <div class=\"site-slogan\">". variable_get('site_slogan', '') ."</div>";
+ $output .= " <div class=\"site-slogan\">" . variable_get('site_slogan', '') . "</div>";
}
$output .= "</div>\n";
@@ -114,10 +114,10 @@ function chameleon_page($content, $show_blocks = TRUE, $show_messages = TRUE) {
function chameleon_node($node, $teaser = 0, $page = 0) {
- $output = "<div class=\"node". ((!$node->status) ? ' node-unpublished' : '') . (($node->sticky) ? ' sticky' : '') ."\">\n";
+ $output = "<div class=\"node" . ((!$node->status) ? ' node-unpublished' : '') . (($node->sticky) ? ' sticky' : '') . "\">\n";
if (!$page) {
- $output .= " <h2 class=\"title\">". ($teaser ? l($node->title, "node/$node->nid") : check_plain($node->title)) ."</h2>\n";
+ $output .= " <h2 class=\"title\">" . ($teaser ? l($node->title, "node/$node->nid") : check_plain($node->title)) . "</h2>\n";
}
$output .= " <div class=\"content\">\n";
@@ -145,7 +145,7 @@ function chameleon_node($node, $teaser = 0, $page = 0) {
$links = array_merge($links, $node->links);
}
if (count($links)) {
- $output .= '<div class="links">'. theme('links', $links, array('class' => 'links inline')) ."</div>\n";
+ $output .= '<div class="links">' . theme('links', $links, array('class' => 'links inline')) . "</div>\n";
}
$output .= "</div>\n";
@@ -158,17 +158,17 @@ function chameleon_comment($comment, $node, $links = array()) {
'title' => t('By !author at @date', array('!author' => theme('username', $comment), '@date' => format_date($comment->timestamp, 'small'))),
'html' => TRUE);
- $output = "<div class=\"comment". ' '. $status ."\">\n";
- $output .= " <h3 class=\"title\">". l($comment->subject, $_GET['q'], array('fragment' => "comment-$comment->cid")) ."</h3>\n";
- $output .= " <div class=\"content\">". $comment->comment;
+ $output = "<div class=\"comment" . ' ' . $status . "\">\n";
+ $output .= " <h3 class=\"title\">" . l($comment->subject, $_GET['q'], array('fragment' => "comment-$comment->cid")) . "</h3>\n";
+ $output .= " <div class=\"content\">" . $comment->comment;
if (!empty($signature)) {
$output .= " <div class=\"clear-block\">";
$output .= "<div>—</div>\n";
- $output .= $signature ."\n";
+ $output .= $signature . "\n";
$output .= " </div>\n";
}
$output .= " </div>\n";
- $output .= " <div class=\"links\">". theme('links', array_merge($submitted, $links)) ."</div>\n";
+ $output .= " <div class=\"links\">" . theme('links', array_merge($submitted, $links)) . "</div>\n";
$output .= "</div>\n";
return $output;
@@ -176,7 +176,7 @@ function chameleon_comment($comment, $node, $links = array()) {
function chameleon_help() {
if ($help = menu_get_active_help()) {
- return '<div class="help">'. $help .'</div><hr />';
+ return '<div class="help">' . $help . '</div><hr />';
}
}
diff --git a/themes/engines/phptemplate/phptemplate.engine b/themes/engines/phptemplate/phptemplate.engine
index 4d638d18f..ed34815a8 100644
--- a/themes/engines/phptemplate/phptemplate.engine
+++ b/themes/engines/phptemplate/phptemplate.engine
@@ -7,7 +7,7 @@
*/
function phptemplate_init($template) {
- $file = dirname($template->filename) .'/template.php';
+ $file = dirname($template->filename) . '/template.php';
if (file_exists($file)) {
include_once "./$file";
}
diff --git a/themes/garland/block.tpl.php b/themes/garland/block.tpl.php
index 1b7ae308e..8bbd37118 100644
--- a/themes/garland/block.tpl.php
+++ b/themes/garland/block.tpl.php
@@ -1,7 +1,7 @@
<?php
// $Id$
?>
-<div id="block-<?php print $block->module .'-'. $block->delta; ?>" class="clear-block block block-<?php print $block->module ?>">
+<div id="block-<?php print $block->module . '-' . $block->delta; ?>" class="clear-block block block-<?php print $block->module ?>">
<?php if (!empty($block->subject)): ?>
<h2><?php print $block->subject ?></h2>
diff --git a/themes/garland/comment.tpl.php b/themes/garland/comment.tpl.php
index ea83a24d8..ab68a8cf7 100644
--- a/themes/garland/comment.tpl.php
+++ b/themes/garland/comment.tpl.php
@@ -1,7 +1,7 @@
<?php
// $Id$
?>
-<div class="comment<?php print ($comment->new) ? ' comment-new' : ''; print ' '. $status; print ' '. $zebra; ?>">
+<div class="comment<?php print ($comment->new) ? ' comment-new' : ''; print ' ' . $status; print ' ' . $zebra; ?>">
<div class="clear-block">
<?php if ($submitted): ?>
diff --git a/themes/garland/maintenance-page.tpl.php b/themes/garland/maintenance-page.tpl.php
index e3d1b9d66..e299fc92e 100644
--- a/themes/garland/maintenance-page.tpl.php
+++ b/themes/garland/maintenance-page.tpl.php
@@ -44,16 +44,16 @@
}
$site_title = implode(' ', $site_fields);
if ($site_fields) {
- $site_fields[0] = '<span>'. $site_fields[0] .'</span>';
+ $site_fields[0] = '<span>' . $site_fields[0] . '</span>';
}
$site_html = implode(' ', $site_fields);
if ($logo || $site_title) {
- print '<h1><a href="'. check_url($base_path) .'" title="'. $site_title .'">';
+ print '<h1><a href="' . check_url($base_path) . '" title="' . $site_title . '">';
if ($logo) {
- print '<img src="'. check_url($logo) .'" alt="'. $site_title .'" id="logo" />';
+ print '<img src="' . check_url($logo) . '" alt="' . $site_title . '" id="logo" />';
}
- print $site_html .'</a></h1>';
+ print $site_html . '</a></h1>';
}
?>
</div>
@@ -68,7 +68,7 @@
<?php endif; ?>
<div id="center"><div id="squeeze"><div class="right-corner"><div class="left-corner">
- <?php if ($title): print '<h2'. ($tabs ? ' class="with-tabs"' : '') .'>'. $title .'</h2>'; endif; ?>
+ <?php if ($title): print '<h2' . ($tabs ? ' class="with-tabs"' : '') . '>' . $title . '</h2>'; endif; ?>
<?php print $help; ?>
<?php print $messages; ?>
<div class="clear-block">
diff --git a/themes/garland/page.tpl.php b/themes/garland/page.tpl.php
index 92559d814..5aed7ccc9 100644
--- a/themes/garland/page.tpl.php
+++ b/themes/garland/page.tpl.php
@@ -33,16 +33,16 @@
}
$site_title = implode(' ', $site_fields);
if ($site_fields) {
- $site_fields[0] = '<span>'. $site_fields[0] .'</span>';
+ $site_fields[0] = '<span>' . $site_fields[0] . '</span>';
}
$site_html = implode(' ', $site_fields);
if ($logo || $site_title) {
- print '<h1><a href="'. check_url($front_page) .'" title="'. $site_title .'">';
+ print '<h1><a href="' . check_url($front_page) . '" title="' . $site_title . '">';
if ($logo) {
- print '<img src="'. check_url($logo) .'" alt="'. $site_title .'" id="logo" />';
+ print '<img src="' . check_url($logo) . '" alt="' . $site_title . '" id="logo" />';
}
- print $site_html .'</a></h1>';
+ print $site_html . '</a></h1>';
}
?>
</div>
@@ -65,11 +65,11 @@
<div id="center"><div id="squeeze"><div class="right-corner"><div class="left-corner">
<?php print $breadcrumb; ?>
- <?php if ($mission): print '<div id="mission">'. $mission .'</div>'; endif; ?>
+ <?php if ($mission): print '<div id="mission">' . $mission . '</div>'; endif; ?>
<?php if ($tabs): print '<div id="tabs-wrapper" class="clear-block">'; endif; ?>
- <?php if ($title): print '<h2'. ($tabs ? ' class="with-tabs"' : '') .'>'. $title .'</h2>'; endif; ?>
- <?php if ($tabs): print '<ul class="tabs primary">'. $tabs .'</ul></div>'; endif; ?>
- <?php if ($tabs2): print '<ul class="tabs secondary">'. $tabs2 .'</ul>'; endif; ?>
+ <?php if ($title): print '<h2' . ($tabs ? ' class="with-tabs"' : '') . '>' . $title . '</h2>'; endif; ?>
+ <?php if ($tabs): print '<ul class="tabs primary">' . $tabs . '</ul></div>'; endif; ?>
+ <?php if ($tabs2): print '<ul class="tabs secondary">' . $tabs2 . '</ul>'; endif; ?>
<?php if ($show_messages && $messages): print $messages; endif; ?>
<?php print $help; ?>
<div class="clear-block">
diff --git a/themes/garland/template.php b/themes/garland/template.php
index 0d06bb44e..a38ba1519 100644
--- a/themes/garland/template.php
+++ b/themes/garland/template.php
@@ -20,7 +20,7 @@ function phptemplate_body_class($left, $right) {
}
if (isset($class)) {
- print ' class="'. $class .'"';
+ print ' class="' . $class . '"';
}
}
@@ -33,7 +33,7 @@ function phptemplate_body_class($left, $right) {
*/
function phptemplate_breadcrumb($breadcrumb) {
if (!empty($breadcrumb)) {
- return '<div class="breadcrumb">'. implode(' › ', $breadcrumb) .'</div>';
+ return '<div class="breadcrumb">' . implode(' › ', $breadcrumb) . '</div>';
}
}
@@ -42,10 +42,10 @@ function phptemplate_breadcrumb($breadcrumb) {
*/
function phptemplate_comment_wrapper($content, $node) {
if (!$content || $node->type == 'forum') {
- return '<div id="comments">'. $content .'</div>';
+ return '<div id="comments">' . $content . '</div>';
}
else {
- return '<div id="comments"><h2 class="comments">'. t('Comments') .'</h2>'. $content .'</div>';
+ return '<div id="comments"><h2 class="comments">' . t('Comments') . '</h2>' . $content . '</div>';
}
}
@@ -93,9 +93,9 @@ function phptemplate_node_submitted($node) {
function phptemplate_get_ie_styles() {
global $language;
- $iecss = '<link type="text/css" rel="stylesheet" media="all" href="'. base_path() . path_to_theme() .'/fix-ie.css" />';
+ $iecss = '<link type="text/css" rel="stylesheet" media="all" href="' . base_path() . path_to_theme() . '/fix-ie.css" />';
if (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL) {
- $iecss .= '<style type="text/css" media="all">@import "'. base_path() . path_to_theme() .'/fix-ie-rtl.css";</style>';
+ $iecss .= '<style type="text/css" media="all">@import "' . base_path() . path_to_theme() . '/fix-ie-rtl.css";</style>';
}
return $iecss;
diff --git a/themes/pushbutton/comment.tpl.php b/themes/pushbutton/comment.tpl.php
index 264561b69..5e9ca7a4a 100644
--- a/themes/pushbutton/comment.tpl.php
+++ b/themes/pushbutton/comment.tpl.php
@@ -1,7 +1,7 @@
<?php
// $Id$
?>
-<div class="comment<?php print ' '. $status; ?>">
+<div class="comment<?php print ' ' . $status; ?>">
<?php if ($picture) : ?>
<?php print $picture ?>
<?php endif; ?>
diff --git a/update.php b/update.php
index 1db7779a6..c0bf4a38f 100644
--- a/update.php
+++ b/update.php
@@ -66,15 +66,15 @@ function db_add_column(&$ret, $table, $column, $type, $attributes = array()) {
}
}
- $ret[] = update_sql("ALTER TABLE {". $table ."} ADD $column $type");
+ $ret[] = update_sql("ALTER TABLE {" . $table . "} ADD $column $type");
if (!empty($default)) {
- $ret[] = update_sql("ALTER TABLE {". $table ."} ALTER $column SET $default");
+ $ret[] = update_sql("ALTER TABLE {" . $table . "} ALTER $column SET $default");
}
if (!empty($not_null)) {
if (!empty($default)) {
- $ret[] = update_sql("UPDATE {". $table ."} SET $column = $default_val");
+ $ret[] = update_sql("UPDATE {" . $table . "} SET $column = $default_val");
}
- $ret[] = update_sql("ALTER TABLE {". $table ."} ALTER $column SET NOT NULL");
+ $ret[] = update_sql("ALTER TABLE {" . $table . "} ALTER $column SET NOT NULL");
}
}
@@ -122,16 +122,16 @@ function db_change_column(&$ret, $table, $column, $column_new, $type, $attribute
}
}
- $ret[] = update_sql("ALTER TABLE {". $table ."} RENAME $column TO ". $column ."_old");
- $ret[] = update_sql("ALTER TABLE {". $table ."} ADD $column_new $type");
- $ret[] = update_sql("UPDATE {". $table ."} SET $column_new = ". $column ."_old");
+ $ret[] = update_sql("ALTER TABLE {" . $table . "} RENAME $column TO " . $column . "_old");
+ $ret[] = update_sql("ALTER TABLE {" . $table . "} ADD $column_new $type");
+ $ret[] = update_sql("UPDATE {" . $table . "} SET $column_new = " . $column . "_old");
if ($default) {
- $ret[] = update_sql("ALTER TABLE {". $table ."} ALTER $column_new SET $default");
+ $ret[] = update_sql("ALTER TABLE {" . $table . "} ALTER $column_new SET $default");
}
if ($not_null) {
- $ret[] = update_sql("ALTER TABLE {". $table ."} ALTER $column_new SET NOT NULL");
+ $ret[] = update_sql("ALTER TABLE {" . $table . "} ALTER $column_new SET NOT NULL");
}
- $ret[] = update_sql("ALTER TABLE {". $table ."} DROP ". $column ."_old");
+ $ret[] = update_sql("ALTER TABLE {" . $table . "} DROP " . $column . "_old");
}
/**
@@ -159,7 +159,7 @@ function update_do_one($module, $number, &$context) {
return;
}
- $function = $module .'_update_'. $number;
+ $function = $module . '_update_' . $number;
if (function_exists($function)) {
$ret = $function($context['sandbox']);
}
@@ -185,7 +185,7 @@ function update_do_one($module, $number, &$context) {
drupal_set_installed_schema_version($module, $number);
}
- $context['message'] = 'Updating '. check_plain($module) .' module';
+ $context['message'] = 'Updating ' . check_plain($module) . ' module';
}
function update_selection_page() {
@@ -223,7 +223,7 @@ function update_script_selection_form() {
$last_removed = module_invoke($module, 'update_last_removed');
if ($schema_version < $last_removed) {
$form['start'][$module] = array(
- '#value' => '<em>'. $module .'</em> module can not be updated. Its schema version is '. $schema_version .'. Updates up to and including '. $last_removed .' have been removed in this release. In order to update <em>'. $module .'</em> module, you will first <a href="http://drupal.org/upgrade">need to upgrade</a> to the last version in which these updates were available.',
+ '#value' => '<em>' . $module . '</em> module can not be updated. Its schema version is ' . $schema_version . '. Updates up to and including ' . $last_removed . ' have been removed in this release. In order to update <em>' . $module . '</em> module, you will first <a href="http://drupal.org/upgrade">need to upgrade</a> to the last version in which these updates were available.',
'#prefix' => '<div class="warning">',
'#suffix' => '</div>',
);
@@ -241,7 +241,7 @@ function update_script_selection_form() {
}
$form['start'][$module] = array(
'#type' => 'select',
- '#title' => $module .' module',
+ '#title' => $module . ' module',
'#default_value' => $default,
'#options' => $updates,
);
@@ -285,7 +285,7 @@ function update_batch() {
'finished' => 'update_finished',
);
batch_set($batch);
- batch_process($base_url .'/update.php?op=results', $base_url .'/update.php');
+ batch_process($base_url . '/update.php?op=results', $base_url . '/update.php');
}
function update_finished($success, $results, $operations) {
@@ -300,24 +300,24 @@ function update_finished($success, $results, $operations) {
function update_results_page() {
drupal_set_title('Drupal database update');
// NOTE: we can't use l() here because the URL would point to 'update.php?q=admin'.
- $links[] = '<a href="'. base_path() .'">Main page</a>';
- $links[] = '<a href="'. base_path() .'?q=admin">Administration pages</a>';
+ $links[] = '<a href="' . base_path() . '">Main page</a>';
+ $links[] = '<a href="' . base_path() . '?q=admin">Administration pages</a>';
update_task_list();
// Report end result
if (module_exists('dblog')) {
- $log_message = ' All errors have been <a href="'. base_path() .'?q=admin/reports/dblog">logged</a>.';
+ $log_message = ' All errors have been <a href="' . base_path() . '?q=admin/reports/dblog">logged</a>.';
}
else {
$log_message = ' All errors have been logged.';
}
if ($_SESSION['update_success']) {
- $output = '<p>Updates were attempted. If you see no failures below, you may proceed happily to the <a href="'. base_path() .'?q=admin">administration pages</a>. Otherwise, you may need to update your database manually.'. $log_message .'</p>';
+ $output = '<p>Updates were attempted. If you see no failures below, you may proceed happily to the <a href="' . base_path() . '?q=admin">administration pages</a>. Otherwise, you may need to update your database manually.' . $log_message . '</p>';
}
else {
list($module, $version) = array_pop(reset($_SESSION['updates_remaining']));
- $output = '<p class="error">The update process was aborted prematurely while running <strong>update #'. $version .' in '. $module .'.module</strong>.'. $log_message;
+ $output = '<p class="error">The update process was aborted prematurely while running <strong>update #' . $version . ' in ' . $module . '.module</strong>.' . $log_message;
if (module_exists('dblog')) {
$output .= ' You may need to check the <code>watchdog</code> database table manually.';
}
@@ -335,17 +335,17 @@ function update_results_page() {
$output .= '<div id="update-results">';
$output .= '<h2>The following queries were executed</h2>';
foreach ($_SESSION['update_results'] as $module => $updates) {
- $output .= '<h3>'. $module .' module</h3>';
+ $output .= '<h3>' . $module . ' module</h3>';
foreach ($updates as $number => $queries) {
if ($number != '#abort') {
- $output .= '<h4>Update #'. $number .'</h4>';
+ $output .= '<h4>Update #' . $number . '</h4>';
$output .= '<ul>';
foreach ($queries as $query) {
if ($query['success']) {
- $output .= '<li class="success">'. $query['query'] .'</li>';
+ $output .= '<li class="success">' . $query['query'] . '</li>';
}
else {
- $output .= '<li class="failure"><strong>Failed:</strong> '. $query['query'] .'</li>';
+ $output .= '<li class="failure"><strong>Failed:</strong> ' . $query['query'] . '</li>';
}
}
if (!count($queries)) {
@@ -377,7 +377,7 @@ function update_info_page() {
$output .= "<ol>\n";
$output .= "<li><strong>Back up your database</strong>. This process will change your database values and in case of emergency you may need to revert to a backup.</li>\n";
$output .= "<li><strong>Back up your code</strong>. Hint: when backing up module code, do not leave that backup in the 'modules' or 'sites/*/modules' directories as this may confuse Drupal's auto-discovery mechanism.</li>\n";
- $output .= '<li>Put your site into <a href="'. base_path() .'?q=admin/settings/site-maintenance">maintenance mode</a>.</li>'."\n";
+ $output .= '<li>Put your site into <a href="' . base_path() . '?q=admin/settings/site-maintenance">maintenance mode</a>.</li>' . "\n";
$output .= "<li>Install your new files in the appropriate location, as described in the handbook.</li>\n";
$output .= "</ol>\n";
$output .= "<p>When you have performed the steps above, you may proceed.</p>\n";
@@ -439,7 +439,7 @@ function update_fix_compatibility() {
}
}
if (!empty($incompatible)) {
- $ret[] = update_sql("UPDATE {system} SET status = 0 WHERE name IN ('". implode("','", $incompatible) ."')");
+ $ret[] = update_sql("UPDATE {system} SET status = 0 WHERE name IN ('" . implode("','", $incompatible) . "')");
}
return $ret;
}
@@ -555,7 +555,7 @@ function update_check_requirements() {
if (isset($requirement['severity']) && $requirement['severity'] != REQUIREMENT_OK) {
$message = isset($requirement['description']) ? $requirement['description'] : '';
if (isset($requirement['value']) && $requirement['value']) {
- $message .= ' (Currently using '. $requirement['title'] .' '. $requirement['value'] .')';
+ $message .= ' (Currently using ' . $requirement['title'] . ' ' . $requirement['value'] . ')';
}
drupal_set_message($message, 'warning');
}