diff --git a/includes/actions.inc b/includes/actions.inc index 8eeca815de353ca2bed96e379d6851a07c3be935..8811383a08fa6004264b344b088911c378752037 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 cd2127f0be42ea8bf5a7c5af12d86069b33d2e3b..798d2b3ebc7bc07df20c4cb3a76bc2f13c5c7e84 100644 --- a/includes/batch.inc +++ b/includes/batch.inc @@ -78,7 +78,7 @@ function _batch_progress_page_js() { $url = url($batch['url'], array('query' => array('id' => $batch['id']))); $js_setting = array( 'batch' => array( - 'errorMessage' => $current_set['error_message'] .'
'. $batch['error_message'], + 'errorMessage' => $current_set['error_message'] . '
' . $batch['error_message'], 'initMessage' => $current_set['init_message'], 'uri' => $url, ), @@ -132,7 +132,7 @@ function _batch_progress_page_nojs() { // function), it will output whatever is in the output buffer, // followed by the error message. ob_start(); - $fallback = $current_set['error_message'] .'
'. $batch['error_message']; + $fallback = $current_set['error_message'] . '
' . $batch['error_message']; $fallback = theme('maintenance_page', $fallback, FALSE, FALSE); // We strip the end of the page using a marker in the template, so any @@ -153,7 +153,7 @@ function _batch_progress_page_nojs() { } $url = url($batch['url'], array('query' => array('id' => $batch['id'], 'op' => $new_op))); - drupal_set_html_head(''); + drupal_set_html_head(''); $output = theme('progress_bar', $percentage, $message); return $output; } @@ -243,7 +243,7 @@ function _batch_process() { '@current' => floor($current), '@percentage' => $percentage, ); - $message = strtr($progress_message, $values) .'
'; + $message = strtr($progress_message, $values) . '
'; $message .= $task_message ? $task_message : ' '; return array($percentage, $message); diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index 106320c250a5947e515cbce9093973620ab7efaf..49659f8caf26ecb6cb04fb821a30a25029934256 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 9fe7602c010b55d1c0dd8e1b69049aa96cc7778c..06b03fe2cfbcb49f4963fa43d950013e83bfbb56 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 721091bad282aac3e84fcfc9af250c6352d7f57e..371f3443f0e1ffc0322bd625558622ca350e58f1 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -105,7 +105,7 @@ function drupal_set_html_head($data = NULL) { static $stored_head = ''; if (!is_null($data)) { - $stored_head .= $data ."\n"; + $stored_head .= $data . "\n"; } return $stored_head; } @@ -209,7 +209,7 @@ function drupal_query_string_encode($query, $exclude = array(), $parent = '') { foreach ($query as $key => $value) { $key = drupal_urlencode($key); if ($parent) { - $key = $parent .'['. $key .']'; + $key = $parent . '[' . $key . ']'; } if (in_array($key, $exclude)) { @@ -220,7 +220,7 @@ function drupal_query_string_encode($query, $exclude = array(), $parent = '') { $params[] = drupal_query_string_encode($value, $exclude, $key); } else { - $params[] = $key .'='. drupal_urlencode($value); + $params[] = $key . '=' . drupal_urlencode($value); } } @@ -239,16 +239,16 @@ function drupal_query_string_encode($query, $exclude = array(), $parent = '') { */ function drupal_get_destination() { if (isset($_REQUEST['destination'])) { - return 'destination='. urlencode($_REQUEST['destination']); + return 'destination=' . urlencode($_REQUEST['destination']); } else { // Use $_GET here to retrieve the original path in source form. $path = isset($_GET['q']) ? $_GET['q'] : ''; $query = drupal_query_string_encode($_GET, array('q')); if ($query != '') { - $path .= '?'. $query; + $path .= '?' . $query; } - return 'destination='. urlencode($path); + return 'destination=' . urlencode($path); } } @@ -316,7 +316,7 @@ function drupal_goto($path = '', $query = NULL, $fragment = NULL, $http_response // need all session data written to the database before redirecting. session_write_close(); - header('Location: '. $url, TRUE, $http_response_code); + header('Location: ' . $url, TRUE, $http_response_code); // The "Location" header sends a redirect status code to the HTTP daemon. In // some cases this can be wrong, so we make sure none of the code below the @@ -438,17 +438,17 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data = switch ($uri['scheme']) { case 'http': $port = isset($uri['port']) ? $uri['port'] : 80; - $host = $uri['host'] . ($port != 80 ? ':'. $port : ''); + $host = $uri['host'] . ($port != 80 ? ':' . $port : ''); $fp = @fsockopen($uri['host'], $port, $errno, $errstr, 15); break; case 'https': // Note: Only works for PHP 4.3 compiled with OpenSSL. $port = isset($uri['port']) ? $uri['port'] : 443; - $host = $uri['host'] . ($port != 443 ? ':'. $port : ''); - $fp = @fsockopen('ssl://'. $uri['host'], $port, $errno, $errstr, 20); + $host = $uri['host'] . ($port != 443 ? ':' . $port : ''); + $fp = @fsockopen('ssl://' . $uri['host'], $port, $errno, $errstr, 20); break; default: - $result->error = 'invalid schema '. $uri['scheme']; + $result->error = 'invalid schema ' . $uri['scheme']; return $result; } @@ -464,7 +464,7 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data = // Construct the path to act on. $path = isset($uri['path']) ? $uri['path'] : '/'; if (isset($uri['query'])) { - $path .= '?'. $uri['query']; + $path .= '?' . $uri['query']; } // Create HTTP request. @@ -474,23 +474,23 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data = // host that do not take into account the port number. 'Host' => "Host: $host", 'User-Agent' => 'User-Agent: Drupal (+http://drupal.org/)', - 'Content-Length' => 'Content-Length: '. strlen($data) + 'Content-Length' => 'Content-Length: ' . strlen($data) ); // If the server url has a user then attempt to use basic authentication if (isset($uri['user'])) { - $defaults['Authorization'] = 'Authorization: Basic '. base64_encode($uri['user'] . (!empty($uri['pass']) ? ":". $uri['pass'] : '')); + $defaults['Authorization'] = 'Authorization: Basic ' . base64_encode($uri['user'] . (!empty($uri['pass']) ? ":" . $uri['pass'] : '')); } foreach ($headers as $header => $value) { - $defaults[$header] = $header .': '. $value; + $defaults[$header] = $header . ': ' . $value; } - $request = $method .' '. $path ." HTTP/1.0\r\n"; + $request = $method . ' ' . $path . " HTTP/1.0\r\n"; $request .= implode("\r\n", $defaults); $request .= "\r\n\r\n"; if ($data) { - $request .= $data ."\r\n"; + $request .= $data . "\r\n"; } $result->request = $request; @@ -516,7 +516,7 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data = if (isset($result->headers[$header]) && $header == 'Set-Cookie') { // RFC 2109: the Set-Cookie response header comprises the token Set- // Cookie:, followed by a comma-separated list of one or more cookies. - $result->headers[$header] .= ','. trim($value); + $result->headers[$header] .= ',' . trim($value); } else { $result->headers[$header] = trim($value); @@ -599,7 +599,7 @@ function drupal_error_handler($errno, $message, $filename, $line, $context) { } } - $entry = $types[$errno] .': '. $message .' in '. $filename .' on line '. $line .'.'; + $entry = $types[$errno] . ': ' . $message . ' in ' . $filename . ' on line ' . $line . '.'; // Force display of error messages in update.php. if (variable_get('error_level', 1) == 1 || strstr($_SERVER['SCRIPT_NAME'], 'update.php')) { @@ -719,7 +719,7 @@ function fix_gpc_magic() { * * Here is an example of t() used correctly: * @code - * $output .= '

'. t('Go to the contact page.', array('@contact-page' => url('contact'))) .'

'; + * $output .= '

' . t('Go to the contact page.', array('@contact-page' => url('contact'))) . '

'; * @endcode * * Also avoid escaping quotation marks wherever possible. @@ -761,7 +761,7 @@ function t($string, $args = array(), $langcode = NULL) { // handful of string replacements. See settings.php for examples. // Cache the $custom_strings variable to improve performance. if (!isset($custom_strings[$langcode])) { - $custom_strings[$langcode] = variable_get('locale_custom_strings_'. $langcode, array()); + $custom_strings[$langcode] = variable_get('locale_custom_strings_' . $langcode, array()); } // Custom strings work for English too, even if locale module is disabled. if (isset($custom_strings[$langcode][$string])) { @@ -838,10 +838,10 @@ function valid_email_address($mail) { function valid_url($url, $absolute = FALSE) { $allowed_characters = '[a-z0-9\/:_\-_\.\?\$,;~=#&%\+]'; if ($absolute) { - return preg_match("/^(http|https|ftp):\/\/". $allowed_characters ."+$/i", $url); + return preg_match("/^(http|https|ftp):\/\/" . $allowed_characters . "+$/i", $url); } else { - return preg_match("/^". $allowed_characters ."+$/i", $url); + return preg_match("/^" . $allowed_characters . "+$/i", $url); } } @@ -904,14 +904,14 @@ function format_rss_channel($title, $link, $description, $items, $langcode = NUL $langcode = $langcode ? $langcode : $language->language; $output = "\n"; - $output .= ' '. check_plain($title) ."\n"; - $output .= ' '. check_url($link) ."\n"; + $output .= ' ' . check_plain($title) . "\n"; + $output .= ' ' . check_url($link) . "\n"; // The RSS 2.0 "spec" doesn't indicate HTML can be used in the description. // We strip all HTML tags, but need to prevent double encoding from properly // escaped source data (such as & becoming &amp;). - $output .= ' '. check_plain(decode_entities(strip_tags($description))) ."\n"; - $output .= ' '. check_plain($langcode) ."\n"; + $output .= ' ' . check_plain(decode_entities(strip_tags($description))) . "\n"; + $output .= ' ' . check_plain($langcode) . "\n"; $output .= format_xml_elements($args); $output .= $items; $output .= "\n"; @@ -926,9 +926,9 @@ function format_rss_channel($title, $link, $description, $items, $langcode = NUL */ function format_rss_item($title, $link, $description, $args = array()) { $output = "\n"; - $output .= ' '. check_plain($title) ."\n"; - $output .= ' '. check_url($link) ."\n"; - $output .= ' '. check_plain($description) ."\n"; + $output .= ' ' . check_plain($title) . "\n"; + $output .= ' ' . check_url($link) . "\n"; + $output .= ' ' . check_plain($description) . "\n"; $output .= format_xml_elements($args); $output .= "\n"; @@ -954,13 +954,13 @@ function format_xml_elements($array) { foreach ($array as $key => $value) { if (is_numeric($key)) { if ($value['key']) { - $output .= ' <'. $value['key']; + $output .= ' <' . $value['key']; if (isset($value['attributes']) && is_array($value['attributes'])) { $output .= drupal_attributes($value['attributes']); } if ($value['value'] != '') { - $output .= '>'. (is_array($value['value']) ? format_xml_elements($value['value']) : check_plain($value['value'])) .'\n"; + $output .= '>' . (is_array($value['value']) ? format_xml_elements($value['value']) : check_plain($value['value'])) . '\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)) ."\n"; + $output .= ' <' . $key . '>' . (is_array($value) ? format_xml_elements($value) : check_plain($value)) . "\n"; } } return $output; @@ -1040,8 +1040,8 @@ function format_plural($count, $singular, $plural, $args = array(), $langcode = return t($plural, $args, $langcode); default: unset($args['@count']); - $args['@count['. $index .']'] = $count; - return t(strtr($plural, array('@count' => '@count['. $index .']')), $args, $langcode); + $args['@count[' . $index . ']'] = $count; + return t(strtr($plural, array('@count' => '@count[' . $index . ']')), $args, $langcode); } } } @@ -1187,7 +1187,7 @@ function format_date($timestamp, $type = 'medium', $format = '', $timezone = NUL // Special treatment for long month names: May is both an abbreviation // and a full month name in English, but other languages have // different abbreviations. - $date .= trim(t('!long-month-name '. gmdate($c, $timestamp), array('!long-month-name' => ''), $langcode)); + $date .= trim(t('!long-month-name ' . gmdate($c, $timestamp), array('!long-month-name' => ''), $langcode)); } else if (strpos('BdgGhHiIjLmnsStTUwWYyz', $c) !== FALSE) { $date .= gmdate($c, $timestamp); @@ -1276,7 +1276,7 @@ function url($path = NULL, $options = array()) { language_url_rewrite($path, $options); } if ($options['fragment']) { - $options['fragment'] = '#'. $options['fragment']; + $options['fragment'] = '#' . $options['fragment']; } if (is_array($options['query'])) { $options['query'] = drupal_query_string_encode($options['query']); @@ -1287,7 +1287,7 @@ function url($path = NULL, $options = array()) { if (strpos($path, '#') !== FALSE) { list($path, $old_fragment) = explode('#', $path, 2); if (isset($old_fragment) && !$options['fragment']) { - $options['fragment'] = '#'. $old_fragment; + $options['fragment'] = '#' . $old_fragment; } } // Append the query. @@ -1335,14 +1335,14 @@ function url($path = NULL, $options = array()) { custom_url_rewrite_outbound($path, $options, $original_path); } - $base = $options['absolute'] ? $options['base_url'] .'/' : base_path(); + $base = $options['absolute'] ? $options['base_url'] . '/' : base_path(); $prefix = empty($path) ? rtrim($options['prefix'], '/') : $options['prefix']; $path = drupal_urlencode($prefix . $path); if ($clean_url) { // With Clean URLs. if ($options['query']) { - return $base . $path .'?'. $options['query'] . $options['fragment']; + return $base . $path . '?' . $options['query'] . $options['fragment']; } else { return $base . $path . $options['fragment']; @@ -1352,13 +1352,13 @@ function url($path = NULL, $options = array()) { // Without Clean URLs. $variables = array(); if (!empty($path)) { - $variables[] = 'q='. $path; + $variables[] = 'q=' . $path; } if (!empty($options['query'])) { $variables[] = $options['query']; } if ($query = join('&', $variables)) { - return $base . $script .'?'. $query . $options['fragment']; + return $base . $script . '?' . $query . $options['fragment']; } else { return $base . $options['fragment']; @@ -1378,7 +1378,7 @@ function drupal_attributes($attributes = array()) { if (is_array($attributes)) { $t = ''; foreach ($attributes as $key => $value) { - $t .= " $key=".'"'. check_plain($value) .'"'; + $t .= " $key=" . '"' . check_plain($value) . '"'; } return $t; } @@ -1450,7 +1450,7 @@ function l($text, $path, $options = array()) { $options['attributes']['title'] = strip_tags($options['attributes']['title']); } - return ''. ($options['html'] ? $text : check_plain($text)) .''; + return '' . ($options['html'] ? $text : check_plain($text)) . ''; } /** @@ -1534,7 +1534,7 @@ function drupal_eval($code) { } ob_start(); - print eval('?>'. $code); + print eval('?>' . $code); $output = ob_get_contents(); ob_end_clean(); @@ -1571,7 +1571,7 @@ function base_path() { * Add a tag to the page's HEAD. */ function drupal_add_link($attributes) { - drupal_set_html_head('\n"); + drupal_set_html_head('\n"); } /** @@ -1688,7 +1688,7 @@ function drupal_get_css($css = NULL) { // browser-caching. The string changes on every update or full cache // flush, forcing browsers to load a new copy of the files, as the // URL changed. - $query_string = '?'. substr(variable_get('css_js_query_string', '0'), 0, 1); + $query_string = '?' . substr(variable_get('css_js_query_string', '0'), 0, 1); foreach ($css as $media => $types) { // If CSS preprocessing is off, we still need to output the styles. @@ -1713,24 +1713,24 @@ function drupal_get_css($css = NULL) { // If a CSS file is not to be preprocessed and it's a module CSS file, it needs to *always* appear at the *top*, // regardless of whether preprocessing is on or off. if (!$preprocess && $type == 'module') { - $no_module_preprocess .= ''."\n"; + $no_module_preprocess .= '' . "\n"; } // If a CSS file is not to be preprocessed and it's a theme CSS file, it needs to *always* appear at the *bottom*, // regardless of whether preprocessing is on or off. else if (!$preprocess && $type == 'theme') { - $no_theme_preprocess .= ''."\n"; + $no_theme_preprocess .= '' . "\n"; } else { - $output .= ''."\n"; + $output .= '' . "\n"; } } } } if ($is_writable && $preprocess_css) { - $filename = md5(serialize($types) . $query_string) .'.css'; + $filename = md5(serialize($types) . $query_string) . '.css'; $preprocess_file = drupal_build_css_cache($types, $filename); - $output .= ''."\n"; + $output .= '' . "\n"; } } @@ -1755,14 +1755,14 @@ function drupal_build_css_cache($types, $filename) { $csspath = file_create_path('css'); file_check_directory($csspath, FILE_CREATE_DIRECTORY); - if (!file_exists($csspath .'/'. $filename)) { + if (!file_exists($csspath . '/' . $filename)) { // Build aggregate CSS file. foreach ($types as $type) { foreach ($type as $file => $cache) { if ($cache) { $contents = drupal_load_stylesheet($file, TRUE); // Return the path to where this CSS file originated from. - $base = base_path() . dirname($file) .'/'; + $base = base_path() . dirname($file) . '/'; _drupal_build_css_path(NULL, $base); // Prefix all paths within this CSS file, ignoring external and absolute paths. $data .= preg_replace_callback('/url\([\'"]?(?![a-z]+:|\/+)([^\'")]+)[\'"]?\)/i', '_drupal_build_css_path', $contents); @@ -1778,9 +1778,9 @@ function drupal_build_css_cache($types, $filename) { $data = implode('', $matches[0]) . $data; // Create the CSS file. - file_save_data($data, $csspath .'/'. $filename, FILE_EXISTS_REPLACE); + file_save_data($data, $csspath . '/' . $filename, FILE_EXISTS_REPLACE); } - return $csspath .'/'. $filename; + return $csspath . '/' . $filename; } /** @@ -1802,7 +1802,7 @@ function _drupal_build_css_path($matches, $base = NULL) { $last = $path; $path = preg_replace('`(^|/)(?!../)([^/]+)/../`', '$1', $path); } - return 'url('. $path .')'; + return 'url(' . $path . ')'; } /** @@ -1872,7 +1872,7 @@ function _drupal_load_stylesheet($matches) { // Load the imported stylesheet and replace @import commands in there as well. $file = drupal_load_stylesheet($filename); // Alter all url() paths, but not external. - return preg_replace('/url\(([\'"]?)(?![a-z]+:)([^\'")]+)[\'"]?\)?;/i', 'url(\1'. dirname($filename) .'/', $file); + return preg_replace('/url\(([\'"]?)(?![a-z]+:)([^\'")]+)[\'"]?\)?;/i', 'url(\1' . dirname($filename) . '/', $file); } /** @@ -2039,7 +2039,7 @@ function drupal_get_js($scope = 'header', $javascript = NULL) { // URL changed. Files that should not be cached (see drupal_add_js()) // get time() as query-string instead, to enforce reload on every // page request. - $query_string = '?'. substr(variable_get('css_js_query_string', '0'), 0, 1); + $query_string = '?' . substr(variable_get('css_js_query_string', '0'), 0, 1); foreach ($javascript as $type => $data) { @@ -2047,11 +2047,11 @@ function drupal_get_js($scope = 'header', $javascript = NULL) { switch ($type) { case 'setting': - $output .= '\n"; + $output .= '\n"; break; case 'inline': foreach ($data as $info) { - $output .= '\n"; + $output .= '\n"; } break; default: @@ -2059,7 +2059,7 @@ function drupal_get_js($scope = 'header', $javascript = NULL) { // Additionally, go through any remaining scripts if JS preprocessing is on and output the non-cached ones. foreach ($data as $path => $info) { if (!$info['preprocess'] || !$is_writable || !$preprocess_js) { - $no_preprocess[$type] .= '\n"; + $no_preprocess[$type] .= '\n"; } else { $files[$path] = $info; @@ -2070,9 +2070,9 @@ function drupal_get_js($scope = 'header', $javascript = NULL) { // Aggregate any remaining JS files that haven't already been output. if ($is_writable && $preprocess_js && count($files) > 0) { - $filename = md5(serialize($files) . $query_string) .'.js'; + $filename = md5(serialize($files) . $query_string) . '.js'; $preprocess_file = drupal_build_js_cache($files, $filename); - $preprocessed .= ''."\n"; + $preprocessed .= '' . "\n"; } // Keep the order of JS files consistent as some are preprocessed and others are not. @@ -2131,16 +2131,16 @@ function drupal_get_js($scope = 'header', $javascript = NULL) { * the block regions on the admin/build/block page), a separate subgroup class * must also be added to differentiate the groups. * @code - * $form['my_elements'][$region][$delta]['weight']['#attributes']['class'] = "my-elements-weight my-elements-weight-". $region; + * $form['my_elements'][$region][$delta]['weight']['#attributes']['class'] = "my-elements-weight my-elements-weight-" . $region; * @endcode * * $group is still 'my-element-weight', and the additional $subgroup variable - * will be passed in as 'my-elements-weight-'. $region. This also means that + * will be passed in as 'my-elements-weight-' . $region. This also means that * you'll need to call drupal_add_tabledrag() once for every region added. * * @code * foreach ($regions as $region) { - * drupal_add_tabledrag('my-module-table', 'order', 'sibling', 'my-elements-weight', 'my-elements-weight-'. $region); + * drupal_add_tabledrag('my-module-table', 'order', 'sibling', 'my-elements-weight', 'my-elements-weight-' . $region); * } * @endcode * @@ -2227,20 +2227,20 @@ function drupal_build_js_cache($files, $filename) { $jspath = file_create_path('js'); file_check_directory($jspath, FILE_CREATE_DIRECTORY); - if (!file_exists($jspath .'/'. $filename)) { + if (!file_exists($jspath . '/' . $filename)) { // Build aggregate JS file. foreach ($files as $path => $info) { if ($info['preprocess']) { // Append a ';' after each JS file to prevent them from running together. - $contents .= file_get_contents($path) .';'; + $contents .= file_get_contents($path) . ';'; } } // Create the JS file. - file_save_data($contents, $jspath .'/'. $filename, FILE_EXISTS_REPLACE); + file_save_data($contents, $jspath . '/' . $filename, FILE_EXISTS_REPLACE); } - return $jspath .'/'. $filename; + return $jspath . '/' . $filename; } /** @@ -2598,7 +2598,7 @@ function drupal_system_listing($mask, $directory, $key = 'name', $min_depth = 1) $files = array(); // Always search sites/all/* as well as the global directories - $searchdir[] = 'sites/all/'. $directory; + $searchdir[] = 'sites/all/' . $directory; // The 'profiles' directory contains pristine collections of modules and // themes as organized by a distribution. It is pristine in the same way @@ -2663,8 +2663,8 @@ function drupal_alter($type, &$data) { array_shift($additional_args); $args = array_merge($args, $additional_args); - foreach (module_implements($type .'_alter') as $module) { - $function = $module .'_'. $type .'_alter'; + foreach (module_implements($type . '_alter') as $module) { + $function = $module . '_' . $type . '_alter'; call_user_func_array($function, $args); } } @@ -3293,7 +3293,7 @@ function drupal_write_record($table, &$object, $update = array()) { // Build the SQL. $query = ''; if (!count($update)) { - $query = "INSERT INTO {". $table ."} (". implode(', ', $fields) .') VALUES ('. implode(', ', $placeholders) .')'; + $query = "INSERT INTO {" . $table . "} (" . implode(', ', $fields) . ') VALUES (' . implode(', ', $placeholders) . ')'; $return = SAVED_NEW; } else { @@ -3302,15 +3302,15 @@ function drupal_write_record($table, &$object, $update = array()) { if ($query) { $query .= ', '; } - $query .= $field .' = '. $placeholders[$id]; + $query .= $field . ' = ' . $placeholders[$id]; } foreach ($update as $key){ - $conditions[] = "$key = ". db_type_placeholder($schema['fields'][$key]['type']); + $conditions[] = "$key = " . db_type_placeholder($schema['fields'][$key]['type']); $values[] = $object->$key; } - $query = "UPDATE {". $table ."} SET $query WHERE ". implode(' AND ', $conditions); + $query = "UPDATE {" . $table . "} SET $query WHERE " . implode(' AND ', $conditions); $return = SAVED_UPDATED; } @@ -3510,7 +3510,7 @@ function drupal_implode_tags($tags) { foreach ($tags as $tag) { // Commas and quotes in tag names are special cases, so encode them. if (strpos($tag, ',') !== FALSE || strpos($tag, '"') !== FALSE) { - $tag = '"'. str_replace('"', '""', $tag) .'"'; + $tag = '"' . str_replace('"', '""', $tag) . '"'; } $encoded_tags[] = $tag; diff --git a/includes/database.inc b/includes/database.inc index d3de06cd8af75e2048141b0b3155fbc71dd226b8..145290ab08dbb2b4636beee5dddc5d883332cdc6 100644 --- a/includes/database.inc +++ b/includes/database.inc @@ -87,13 +87,13 @@ function db_prefix_tables($sql) { $tmp = $db_prefix; unset($tmp['default']); foreach ($tmp as $key => $val) { - $sql = strtr($sql, array('{'. $key .'}' => $val . $key)); + $sql = strtr($sql, array('{' . $key . '}' => $val . $key)); } return strtr($sql, array('{' => $db_prefix['default'], '}' => '')); } else { foreach ($db_prefix as $key => $val) { - $sql = strtr($sql, array('{'. $key .'}' => $val . $key)); + $sql = strtr($sql, array('{' . $key . '}' => $val . $key)); } return strtr($sql, array('{' => '', '}' => '')); } @@ -146,7 +146,7 @@ function db_set_active($name = 'default') { include_once $handler; } else { - _db_error_page("The database type '". $db_type ."' is unsupported. Please use either 'mysql' or 'mysqli' for MySQL, or 'pgsql' for PostgreSQL databases."); + _db_error_page("The database type '" . $db_type . "' is unsupported. Please use either 'mysql' or 'mysqli' for MySQL, or 'pgsql' for PostgreSQL databases."); } $db_conns[$name] = db_connect($connect_url); @@ -180,7 +180,7 @@ function _db_error_page($error = '') { $message .= '

If you are the maintainer of this site, please check your database settings in the settings.php file and ensure that your hosting provider\'s database server is running. For more help, see the handbook, or contact your hosting provider.

'; if ($error && ini_get('display_errors')) { - $message .= '

The '. theme('placeholder', $db_type) .' error was: '. theme('placeholder', $error) .'.

'; + $message .= '

The ' . theme('placeholder', $db_type) . ' error was: ' . theme('placeholder', $error) . '.

'; } print theme('maintenance_page', $message); @@ -282,7 +282,7 @@ function _db_rewrite_sql($query = '', $primary_table = 'n', $primary_field = 'ni } } - $where = empty($where) ? '' : '('. implode(') AND (', $where) .')'; + $where = empty($where) ? '' : '(' . implode(') AND (', $where) . ')'; $join = empty($join) ? '' : implode(' ', $join); return array($join, $where, $distinct); @@ -331,7 +331,7 @@ function db_rewrite_sql($query, $primary_table = 'n', $primary_field = 'nid', $ if ($where) { $n = strlen($matches[1]); $second_part = substr($query, $n); - $first_part = substr($matches[1], 0, $n - 5) ." $join WHERE $where AND ( "; + $first_part = substr($matches[1], 0, $n - 5) . " $join WHERE $where AND ( "; // PHP 4 does not support strrpos for strings. We emulate it. $haystack_reverse = strrev($second_part); // No need to use strrev on the needle, we supply GROUP, ORDER, LIMIT @@ -345,14 +345,14 @@ function db_rewrite_sql($query, $primary_table = 'n', $primary_field = 'nid', $ } } if ($pos === FALSE) { - $query = $first_part . $second_part .')'; + $query = $first_part . $second_part . ')'; } else { - $query = $first_part . substr($second_part, 0, -$pos) .')'. substr($second_part, -$pos); + $query = $first_part . substr($second_part, 0, -$pos) . ')' . substr($second_part, -$pos); } } else { - $query = $matches[1] ." $join ". substr($query, strlen($matches[1])); + $query = $matches[1] . " $join " . substr($query, strlen($matches[1])); } } @@ -564,7 +564,7 @@ function db_type_placeholder($type) { // There is no safe value to return here, so return something that // will cause the query to fail. - return 'unsupported type '. $type .'for db_type_placeholder'; + return 'unsupported type ' . $type . 'for db_type_placeholder'; } /** diff --git a/includes/database.mysql-common.inc b/includes/database.mysql-common.inc index 73ae6395ec121eb945f230f2873de9086c8b362a..dc834349a422803621f54f75c12c1d453c32f348 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 e8f831d710562d32b573b2ebc9802d42dda94cc8..81b1308cb26dda0e96a1ec24a17e03fbd71ff2a3 100644 --- a/includes/database.mysql.inc +++ b/includes/database.mysql.inc @@ -65,7 +65,7 @@ function db_connect($url) { // Allow for non-standard MySQL port. if (isset($url['port'])) { - $url['host'] = $url['host'] .':'. $url['port']; + $url['host'] = $url['host'] . ':' . $url['port']; } // - TRUE makes mysql_connect() always open a new link, even if @@ -103,13 +103,13 @@ function _db_query($query, $debug = 0) { $name = $user->uid ? $user->name : variable_get('anonymous', 'Anonymous'); // str_replace() to prevent SQL injection via username or anonymous name. $name = str_replace(array('*', '/'), '', $name); - $query = '/* '. $name .' : '. $bt[2]['function'] .' */ '. $query; + $query = '/* ' . $name . ' : ' . $bt[2]['function'] . ' */ ' . $query; } $result = mysql_query($query, $active_db); if (variable_get('dev_query', 0)) { - $query = $bt[2]['function'] ."\n". $query; + $query = $bt[2]['function'] . "\n" . $query; list($usec, $sec) = explode(' ', microtime()); $stop = (float)$usec + (float)$sec; $diff = $stop - $timer; @@ -117,7 +117,7 @@ function _db_query($query, $debug = 0) { } if ($debug) { - print '

query: '. $query .'
error:'. mysql_error($active_db) .'

'; + print '

query: ' . $query . '
error:' . mysql_error($active_db) . '

'; } if (!mysql_errno($active_db)) { @@ -126,7 +126,7 @@ function _db_query($query, $debug = 0) { else { // Indicate to drupal_error_handler that this is a database error. ${DB_ERROR} = TRUE; - trigger_error(check_plain(mysql_error($active_db) ."\nquery: ". $query), E_USER_WARNING); + trigger_error(check_plain(mysql_error($active_db) . "\nquery: " . $query), E_USER_WARNING); return FALSE; } } @@ -239,7 +239,7 @@ function db_query_range($query) { } _db_query_callback($args, TRUE); $query = preg_replace_callback(DB_QUERY_REGEXP, '_db_query_callback', $query); - $query .= ' LIMIT '. (int)$from .', '. (int)$count; + $query .= ' LIMIT ' . (int)$from . ', ' . (int)$count; return _db_query($query); } @@ -280,7 +280,7 @@ function db_query_temporary($query) { $tablename = array_pop($args); array_shift($args); - $query = preg_replace('/^SELECT/i', 'CREATE TEMPORARY TABLE '. $tablename .' Engine=HEAP SELECT', db_prefix_tables($query)); + $query = preg_replace('/^SELECT/i', 'CREATE TEMPORARY TABLE ' . $tablename . ' Engine=HEAP SELECT', db_prefix_tables($query)); if (isset($args[0]) and is_array($args[0])) { // 'All arguments in one array' syntax $args = $args[0]; } @@ -299,7 +299,7 @@ function db_query_temporary($query) { */ function db_encode_blob($data) { global $active_db; - return "'". mysql_real_escape_string($data, $active_db) ."'"; + return "'" . mysql_real_escape_string($data, $active_db) . "'"; } /** @@ -326,7 +326,7 @@ function db_escape_string($text) { * Lock a table. */ function db_lock_table($table) { - db_query('LOCK TABLES {'. db_escape_table($table) .'} WRITE'); + db_query('LOCK TABLES {' . db_escape_table($table) . '} WRITE'); } /** @@ -340,14 +340,14 @@ function db_unlock_tables() { * Check if a table exists. */ function db_table_exists($table) { - return (bool) db_fetch_object(db_query("SHOW TABLES LIKE '{". db_escape_table($table) ."}'")); + return (bool) db_fetch_object(db_query("SHOW TABLES LIKE '{" . db_escape_table($table) . "}'")); } /** * Check if a column exists in the given table. */ function db_column_exists($table, $column) { - return (bool) db_fetch_object(db_query("SHOW COLUMNS FROM {". db_escape_table($table) ."} LIKE '". db_escape_table($column) ."'")); + return (bool) db_fetch_object(db_query("SHOW COLUMNS FROM {" . db_escape_table($table) . "} LIKE '" . db_escape_table($column) . "'")); } /** @@ -362,9 +362,9 @@ function db_column_exists($table, $column) { * @return SQL query with the DISTINCT wrapper surrounding the given table.field. */ function db_distinct_field($table, $field, $query) { - $field_to_select = 'DISTINCT('. $table .'.'. $field .')'; + $field_to_select = 'DISTINCT(' . $table . '.' . $field . ')'; // (?uid ? $user->name : variable_get('anonymous', 'Anonymous'); // str_replace() to prevent SQL injection via username or anonymous name. $name = str_replace(array('*', '/'), '', $name); - $query = '/* '. $name .' : '. $bt[2]['function'] .' */ '. $query; + $query = '/* ' . $name . ' : ' . $bt[2]['function'] . ' */ ' . $query; } $result = mysqli_query($active_db, $query); if (variable_get('dev_query', 0)) { - $query = $bt[2]['function'] ."\n". $query; + $query = $bt[2]['function'] . "\n" . $query; list($usec, $sec) = explode(' ', microtime()); $stop = (float)$usec + (float)$sec; $diff = $stop - $timer; @@ -118,7 +118,7 @@ function _db_query($query, $debug = 0) { } if ($debug) { - print '

query: '. $query .'
error:'. mysqli_error($active_db) .'

'; + print '

query: ' . $query . '
error:' . mysqli_error($active_db) . '

'; } if (!mysqli_errno($active_db)) { @@ -127,7 +127,7 @@ function _db_query($query, $debug = 0) { else { // Indicate to drupal_error_handler that this is a database error. ${DB_ERROR} = TRUE; - trigger_error(check_plain(mysqli_error($active_db) ."\nquery: ". $query), E_USER_WARNING); + trigger_error(check_plain(mysqli_error($active_db) . "\nquery: " . $query), E_USER_WARNING); return FALSE; } } @@ -242,7 +242,7 @@ function db_query_range($query) { } _db_query_callback($args, TRUE); $query = preg_replace_callback(DB_QUERY_REGEXP, '_db_query_callback', $query); - $query .= ' LIMIT '. (int)$from .', '. (int)$count; + $query .= ' LIMIT ' . (int)$from . ', ' . (int)$count; return _db_query($query); } @@ -283,7 +283,7 @@ function db_query_temporary($query) { $tablename = array_pop($args); array_shift($args); - $query = preg_replace('/^SELECT/i', 'CREATE TEMPORARY TABLE '. $tablename .' Engine=HEAP SELECT', db_prefix_tables($query)); + $query = preg_replace('/^SELECT/i', 'CREATE TEMPORARY TABLE ' . $tablename . ' Engine=HEAP SELECT', db_prefix_tables($query)); if (isset($args[0]) and is_array($args[0])) { // 'All arguments in one array' syntax $args = $args[0]; } @@ -302,7 +302,7 @@ function db_query_temporary($query) { */ function db_encode_blob($data) { global $active_db; - return "'". mysqli_real_escape_string($active_db, $data) ."'"; + return "'" . mysqli_real_escape_string($active_db, $data) . "'"; } /** @@ -329,7 +329,7 @@ function db_escape_string($text) { * Lock a table. */ function db_lock_table($table) { - db_query('LOCK TABLES {'. db_escape_table($table) .'} WRITE'); + db_query('LOCK TABLES {' . db_escape_table($table) . '} WRITE'); } /** @@ -343,14 +343,14 @@ function db_unlock_tables() { * Check if a table exists. */ function db_table_exists($table) { - return (bool) db_fetch_object(db_query("SHOW TABLES LIKE '{". db_escape_table($table) ."}'")); + return (bool) db_fetch_object(db_query("SHOW TABLES LIKE '{" . db_escape_table($table) . "}'")); } /** * Check if a column exists in the given table. */ function db_column_exists($table, $column) { - return (bool) db_fetch_object(db_query("SHOW COLUMNS FROM {". db_escape_table($table) ."} LIKE '". db_escape_table($column) ."'")); + return (bool) db_fetch_object(db_query("SHOW COLUMNS FROM {" . db_escape_table($table) . "} LIKE '" . db_escape_table($column) . "'")); } /** @@ -365,9 +365,9 @@ function db_column_exists($table, $column) { * @return SQL query with the DISTINCT wrapper surrounding the given table.field. */ function db_distinct_field($table, $field, $query) { - $field_to_select = 'DISTINCT('. $table .'.'. $field .')'; + $field_to_select = 'DISTINCT(' . $table . '.' . $field . ')'; // (?query: '. $query .'
error:'. pg_last_error($active_db) .'

'; + print '

query: ' . $query . '
error:' . pg_last_error($active_db) . '

'; } if ($last_result !== FALSE) { @@ -156,7 +156,7 @@ function _db_query($query, $debug = 0) { else { // Indicate to drupal_error_handler that this is a database error. ${DB_ERROR} = TRUE; - trigger_error(check_plain(pg_last_error($active_db) ."\nquery: ". $query), E_USER_WARNING); + trigger_error(check_plain(pg_last_error($active_db) . "\nquery: " . $query), E_USER_WARNING); return FALSE; } } @@ -228,7 +228,7 @@ function db_error() { * The name of the autoincrement field. */ function db_last_insert_id($table, $field) { - return db_result(db_query("SELECT CURRVAL('{". db_escape_table($table) ."}_". db_escape_table($field) ."_seq')")); + return db_result(db_query("SELECT CURRVAL('{" . db_escape_table($table) . "}_" . db_escape_table($field) . "_seq')")); } /** @@ -280,7 +280,7 @@ function db_query_range($query) { } _db_query_callback($args, TRUE); $query = preg_replace_callback(DB_QUERY_REGEXP, '_db_query_callback', $query); - $query .= ' LIMIT '. (int)$count .' OFFSET '. (int)$from; + $query .= ' LIMIT ' . (int)$count . ' OFFSET ' . (int)$from; return _db_query($query); } @@ -321,7 +321,7 @@ function db_query_temporary($query) { $tablename = array_pop($args); array_shift($args); - $query = preg_replace('/^SELECT/i', 'CREATE TEMPORARY TABLE '. $tablename .' AS SELECT', db_prefix_tables($query)); + $query = preg_replace('/^SELECT/i', 'CREATE TEMPORARY TABLE ' . $tablename . ' AS SELECT', db_prefix_tables($query)); if (isset($args[0]) and is_array($args[0])) { // 'All arguments in one array' syntax $args = $args[0]; } @@ -340,7 +340,7 @@ function db_query_temporary($query) { * Encoded data. */ function db_encode_blob($data) { - return "'". pg_escape_bytea($data) ."'"; + return "'" . pg_escape_bytea($data) . "'"; } /** @@ -369,7 +369,7 @@ function db_escape_string($text) { * This function automatically starts a transaction. */ function db_lock_table($table) { - db_query('BEGIN; LOCK TABLE {'. db_escape_table($table) .'} IN EXCLUSIVE MODE'); + db_query('BEGIN; LOCK TABLE {' . db_escape_table($table) . '} IN EXCLUSIVE MODE'); } /** @@ -384,14 +384,14 @@ function db_unlock_tables() { * Check if a table exists. */ function db_table_exists($table) { - return (bool) db_result(db_query("SELECT COUNT(*) FROM pg_class WHERE relname = '{". db_escape_table($table) ."}'")); + return (bool) db_result(db_query("SELECT COUNT(*) FROM pg_class WHERE relname = '{" . db_escape_table($table) . "}'")); } /** * Check if a column exists in the given table. */ function db_column_exists($table, $column) { - return (bool) db_result(db_query("SELECT COUNT(pg_attribute.attname) FROM pg_class, pg_attribute WHERE pg_attribute.attrelid = pg_class.oid AND pg_class.relname = '{". db_escape_table($table) ."}' AND attname = '". db_escape_table($column) ."'")); + return (bool) db_result(db_query("SELECT COUNT(pg_attribute.attname) FROM pg_class, pg_attribute WHERE pg_attribute.attrelid = pg_class.oid AND pg_class.relname = '{" . db_escape_table($table) . "}' AND attname = '" . db_escape_table($column) . "'")); } /** @@ -418,10 +418,10 @@ function db_check_setup() { * @return SQL query with the DISTINCT wrapper surrounding the given table.field. */ function db_distinct_field($table, $field, $query) { - $field_to_select = 'DISTINCT ON ('. $table .'.'. $field .") $table.$field"; + $field_to_select = 'DISTINCT ON (' . $table . '.' . $field . ") $table.$field"; // (? $key) { - $sql_keys[] = 'CONSTRAINT {'. $name .'}_'. $key_name .'_key UNIQUE ('. implode(', ', $key) .')'; + $sql_keys[] = 'CONSTRAINT {' . $name . '}_' . $key_name . '_key UNIQUE (' . implode(', ', $key) . ')'; } } - $sql = "CREATE TABLE {". $name ."} (\n\t"; + $sql = "CREATE TABLE {" . $name . "} (\n\t"; $sql .= implode(",\n\t", $sql_fields); if (count($sql_keys) > 0) { $sql .= ",\n\t"; @@ -525,8 +525,8 @@ function db_create_table_sql($name, $table) { } function _db_create_index_sql($table, $name, $fields) { - $query = 'CREATE INDEX {'. $table .'}_'. $name .'_idx ON {'. $table .'} ('; - $query .= _db_create_key_sql($fields) .')'; + $query = 'CREATE INDEX {' . $table . '}_' . $name . '_idx ON {' . $table . '} ('; + $query .= _db_create_key_sql($fields) . ')'; return $query; } @@ -534,7 +534,7 @@ function _db_create_key_sql($fields) { $ret = array(); foreach ($fields as $field) { if (is_array($field)) { - $ret[] = 'substr('. $field[0] .', 1, '. $field[1] .')'; + $ret[] = 'substr(' . $field[0] . ', 1, ' . $field[1] . ')'; } else { $ret[] = $field; @@ -572,7 +572,7 @@ function _db_process_field($field) { // Set the correct database-engine specific datatype. if (!isset($field['pgsql_type'])) { $map = db_type_map(); - $field['pgsql_type'] = $map[$field['type'] .':'. $field['size']]; + $field['pgsql_type'] = $map[$field['type'] . ':' . $field['size']]; } if ($field['type'] == 'serial') { unset($field['not null']); @@ -592,7 +592,7 @@ function _db_process_field($field) { * The field specification, as per the schema data structure format. */ function _db_create_field_sql($name, $spec) { - $sql = $name .' '. $spec['pgsql_type']; + $sql = $name . ' ' . $spec['pgsql_type']; if ($spec['type'] == 'serial') { unset($spec['not null']); @@ -607,17 +607,17 @@ function _db_create_field_sql($name, $spec) { } if (!empty($spec['length'])) { - $sql .= '('. $spec['length'] .')'; + $sql .= '(' . $spec['length'] . ')'; } elseif (isset($spec['precision']) && isset($spec['scale'])) { - $sql .= '('. $spec['precision'] .', '. $spec['scale'] .')'; + $sql .= '(' . $spec['precision'] . ', ' . $spec['scale'] . ')'; } if (isset($spec['not null']) && $spec['not null']) { $sql .= ' NOT NULL'; } if (isset($spec['default'])) { - $default = is_string($spec['default']) ? "'". $spec['default'] ."'" : $spec['default']; + $default = is_string($spec['default']) ? "'" . $spec['default'] . "'" : $spec['default']; $sql .= " default $default"; } @@ -635,7 +635,7 @@ function _db_create_field_sql($name, $spec) { * The new name for the table. */ function db_rename_table(&$ret, $table, $new_name) { - $ret[] = update_sql('ALTER TABLE {'. $table .'} RENAME TO {'. $new_name .'}'); + $ret[] = update_sql('ALTER TABLE {' . $table . '} RENAME TO {' . $new_name . '}'); } /** @@ -647,7 +647,7 @@ function db_rename_table(&$ret, $table, $new_name) { * The table to be dropped. */ function db_drop_table(&$ret, $table) { - $ret[] = update_sql('DROP TABLE {'. $table .'}'); + $ret[] = update_sql('DROP TABLE {' . $table . '}'); } /** @@ -679,17 +679,17 @@ function db_add_field(&$ret, $table, $field, $spec, $new_keys = array()) { $fixnull = TRUE; $spec['not null'] = FALSE; } - $query = 'ALTER TABLE {'. $table .'} ADD COLUMN '; + $query = 'ALTER TABLE {' . $table . '} ADD COLUMN '; $query .= _db_create_field_sql($field, _db_process_field($spec)); $ret[] = update_sql($query); if (isset($spec['initial'])) { // All this because update_sql does not support %-placeholders. - $sql = 'UPDATE {'. $table .'} SET '. $field .' = '. db_type_placeholder($spec['type']); + $sql = 'UPDATE {' . $table . '} SET ' . $field . ' = ' . db_type_placeholder($spec['type']); $result = db_query($sql, $spec['initial']); - $ret[] = array('success' => $result !== FALSE, 'query' => check_plain($sql .' ('. $spec['initial'] .')')); + $ret[] = array('success' => $result !== FALSE, 'query' => check_plain($sql . ' (' . $spec['initial'] . ')')); } if ($fixnull) { - $ret[] = update_sql("ALTER TABLE {". $table ."} ALTER $field SET NOT NULL"); + $ret[] = update_sql("ALTER TABLE {" . $table . "} ALTER $field SET NOT NULL"); } if (isset($new_keys)) { _db_create_keys($ret, $table, $new_keys); @@ -707,7 +707,7 @@ function db_add_field(&$ret, $table, $field, $spec, $new_keys = array()) { * The field to be dropped. */ function db_drop_field(&$ret, $table, $field) { - $ret[] = update_sql('ALTER TABLE {'. $table .'} DROP COLUMN '. $field); + $ret[] = update_sql('ALTER TABLE {' . $table . '} DROP COLUMN ' . $field); } /** @@ -730,7 +730,7 @@ function db_field_set_default(&$ret, $table, $field, $default) { $default = is_string($default) ? "'$default'" : $default; } - $ret[] = update_sql('ALTER TABLE {'. $table .'} ALTER COLUMN '. $field .' SET DEFAULT '. $default); + $ret[] = update_sql('ALTER TABLE {' . $table . '} ALTER COLUMN ' . $field . ' SET DEFAULT ' . $default); } /** @@ -744,7 +744,7 @@ function db_field_set_default(&$ret, $table, $field, $default) { * The field to be altered. */ function db_field_set_no_default(&$ret, $table, $field) { - $ret[] = update_sql('ALTER TABLE {'. $table .'} ALTER COLUMN '. $field .' DROP DEFAULT'); + $ret[] = update_sql('ALTER TABLE {' . $table . '} ALTER COLUMN ' . $field . ' DROP DEFAULT'); } /** @@ -758,8 +758,8 @@ function db_field_set_no_default(&$ret, $table, $field) { * Fields for the primary key. */ function db_add_primary_key(&$ret, $table, $fields) { - $ret[] = update_sql('ALTER TABLE {'. $table .'} ADD PRIMARY KEY ('. - implode(',', $fields) .')'); + $ret[] = update_sql('ALTER TABLE {' . $table . '} ADD PRIMARY KEY (' . + implode(',', $fields) . ')'); } /** @@ -771,7 +771,7 @@ function db_add_primary_key(&$ret, $table, $fields) { * The table to be altered. */ function db_drop_primary_key(&$ret, $table) { - $ret[] = update_sql('ALTER TABLE {'. $table .'} DROP CONSTRAINT {'. $table .'}_pkey'); + $ret[] = update_sql('ALTER TABLE {' . $table . '} DROP CONSTRAINT {' . $table . '}_pkey'); } /** @@ -787,9 +787,9 @@ function db_drop_primary_key(&$ret, $table) { * An array of field names. */ function db_add_unique_key(&$ret, $table, $name, $fields) { - $name = '{'. $table .'}_'. $name .'_key'; - $ret[] = update_sql('ALTER TABLE {'. $table .'} ADD CONSTRAINT '. - $name .' UNIQUE ('. implode(',', $fields) .')'); + $name = '{' . $table . '}_' . $name . '_key'; + $ret[] = update_sql('ALTER TABLE {' . $table . '} ADD CONSTRAINT ' . + $name . ' UNIQUE (' . implode(',', $fields) . ')'); } /** @@ -803,8 +803,8 @@ function db_add_unique_key(&$ret, $table, $name, $fields) { * The name of the key. */ function db_drop_unique_key(&$ret, $table, $name) { - $name = '{'. $table .'}_'. $name .'_key'; - $ret[] = update_sql('ALTER TABLE {'. $table .'} DROP CONSTRAINT '. $name); + $name = '{' . $table . '}_' . $name . '_key'; + $ret[] = update_sql('ALTER TABLE {' . $table . '} DROP CONSTRAINT ' . $name); } /** @@ -834,8 +834,8 @@ function db_add_index(&$ret, $table, $name, $fields) { * The name of the index. */ function db_drop_index(&$ret, $table, $name) { - $name = '{'. $table .'}_'. $name .'_idx'; - $ret[] = update_sql('DROP INDEX '. $name); + $name = '{' . $table . '}_' . $name . '_idx'; + $ret[] = update_sql('DROP INDEX ' . $name); } /** @@ -901,19 +901,19 @@ function db_drop_index(&$ret, $table, $name) { * table specification but without the 'fields' element. */ function db_change_field(&$ret, $table, $field, $field_new, $spec, $new_keys = array()) { - $ret[] = update_sql("ALTER TABLE {". $table ."} RENAME $field TO ". $field ."_old"); + $ret[] = update_sql("ALTER TABLE {" . $table . "} RENAME $field TO " . $field . "_old"); $not_null = isset($spec['not null']) ? $spec['not null'] : FALSE; unset($spec['not null']); db_add_field($ret, $table, "$field_new", $spec); - $ret[] = update_sql("UPDATE {". $table ."} SET $field_new = ". $field ."_old"); + $ret[] = update_sql("UPDATE {" . $table . "} SET $field_new = " . $field . "_old"); if ($not_null) { - $ret[] = update_sql("ALTER TABLE {". $table ."} ALTER $field_new SET NOT NULL"); + $ret[] = update_sql("ALTER TABLE {" . $table . "} ALTER $field_new SET NOT NULL"); } - db_drop_field($ret, $table, $field .'_old'); + db_drop_field($ret, $table, $field . '_old'); if (isset($new_keys)) { _db_create_keys($ret, $table, $new_keys); diff --git a/includes/file.inc b/includes/file.inc index 5f1b6ae1a996be6406aec763284f1a61eff1a2f2..16f5c56290fb6aea13c11e42f1d81eaa1c080f67 100644 --- a/includes/file.inc +++ b/includes/file.inc @@ -40,14 +40,14 @@ */ function file_create_url($path) { // Strip file_directory_path from $path. We only include relative paths in urls. - if (strpos($path, file_directory_path() .'/') === 0) { + if (strpos($path, file_directory_path() . '/') === 0) { $path = trim(substr($path, strlen(file_directory_path())), '\\/'); } switch (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC)) { case FILE_DOWNLOADS_PUBLIC: - return $GLOBALS['base_url'] .'/'. file_directory_path() .'/'. str_replace('\\', '/', $path); + return $GLOBALS['base_url'] . '/' . file_directory_path() . '/' . str_replace('\\', '/', $path); case FILE_DOWNLOADS_PRIVATE: - return url('system/files/'. $path, array('absolute' => TRUE)); + return url('system/files/' . $path, array('absolute' => TRUE)); } } @@ -75,8 +75,8 @@ function file_create_path($dest = 0) { return $dest; } // Not found, try again with prefixed directory path. - else if (file_check_location($file_path .'/'. $dest, $file_path)) { - return $file_path .'/'. $dest; + else if (file_check_location($file_path . '/' . $dest, $file_path)) { + return $file_path . '/' . $dest; } // File not found. return FALSE; @@ -128,10 +128,10 @@ function file_check_directory(&$directory, $mode = 0, $form_item = NULL) { $htaccess_lines = "SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006\nOptions None\nOptions +FollowSymLinks"; if (($fp = fopen("$directory/.htaccess", 'w')) && fputs($fp, $htaccess_lines)) { fclose($fp); - chmod($directory .'/.htaccess', 0664); + chmod($directory . '/.htaccess', 0664); } else { - $variables = array('%directory' => $directory, '!htaccess' => '
'. nl2br(check_plain($htaccess_lines))); + $variables = array('%directory' => $directory, '!htaccess' => '
' . nl2br(check_plain($htaccess_lines))); form_set_error($form_item, t("Security warning: Couldn't write .htaccess file. Please create a .htaccess file in your %directory directory which contains the following lines: !htaccess", $variables)); watchdog('security', "Security warning: Couldn't write .htaccess file. Please create a .htaccess file in your %directory directory which contains the following lines: !htaccess", $variables, WATCHDOG_ERROR); } @@ -185,7 +185,7 @@ function file_check_location($source, $directory = '') { } else { // This file does not yet exist - $source = realpath(dirname($source)) .'/'. basename($source); + $source = realpath(dirname($source)) . '/' . basename($source); } $directory = realpath($directory); if ($directory && strpos($source, $directory) !== 0) { @@ -244,7 +244,7 @@ function file_copy(&$source, $dest = 0, $replace = FILE_EXISTS_RENAME) { // If the destination file is not specified then use the filename of the source file. $basename = $basename ? $basename : basename($source); - $dest = $directory .'/'. $basename; + $dest = $directory . '/' . $basename; // Make sure source and destination filenames are not the same, makes no sense // to copy it if they are. In fact copying the file will most likely result in @@ -369,12 +369,12 @@ function file_munge_filename($filename, $extensions, $alerts = TRUE) { // end of each section that could be a file extension but isn't in the list // of allowed extensions. foreach ($filename_parts as $filename_part) { - $new_filename .= '.'. $filename_part; + $new_filename .= '.' . $filename_part; if (!in_array($filename_part, $whitelist) && preg_match("/^[a-zA-Z]{2,5}\d?$/", $filename_part)) { $new_filename .= '_'; } } - $filename = $new_filename .'.'. $final_extension; + $filename = $new_filename . '.' . $final_extension; if ($alerts && $original != $filename) { drupal_set_message(t('For security reasons, your upload has been renamed to %filename.', array('%filename' => $filename))); @@ -403,7 +403,7 @@ function file_unmunge_filename($filename) { * @return */ function file_create_filename($basename, $directory) { - $dest = $directory .'/'. $basename; + $dest = $directory . '/' . $basename; if (file_exists($dest)) { // Destination file already exists, generate an alternative. @@ -417,7 +417,7 @@ function file_create_filename($basename, $directory) { $counter = 0; do { - $dest = $directory .'/'. $name .'_'. $counter++ . $ext; + $dest = $directory . '/' . $name . '_' . $counter++ . $ext; } while (file_exists($dest)); } @@ -519,7 +519,7 @@ function file_save_upload($source, $validators = array(), $dest = FALSE, $replac // @todo: this should not be here. we need to figure out the right place. $extensions = ''; foreach ($user->roles as $rid => $name) { - $extensions .= ' '. variable_get("upload_extensions_$rid", + $extensions .= ' ' . variable_get("upload_extensions_$rid", variable_get('upload_extensions_default', 'jpg jpeg gif png txt html doc xls pdf ppt pps odt ods odp')); } @@ -543,7 +543,7 @@ function file_save_upload($source, $validators = array(), $dest = FALSE, $replac } $file->source = $source; - $file->destination = file_destination(file_create_path($dest .'/'. $file->filename), $replace); + $file->destination = file_destination(file_create_path($dest . '/' . $file->filename), $replace); $file->filesize = $_FILES['files']['size'][$source]; // Call the validation functions. @@ -557,10 +557,10 @@ function file_save_upload($source, $validators = array(), $dest = FALSE, $replac if (!empty($errors)) { $message = t('The selected file %name could not be uploaded.', array('%name' => $file->filename)); if (count($errors) > 1) { - $message .= ''; + $message .= ''; } 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 c7738d029dd8a33f937e2db8d0af8af4aa60c448..ac9ea2bb9e6e6872c124da0e0dc461626f5655fe 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, ''); + return theme('form_element', $element, ''); } function form_select_options($element, $choices = NULL) { @@ -1392,7 +1392,7 @@ function form_select_options($element, $choices = NULL) { $options = ''; foreach ($choices as $key => $choice) { if (is_array($choice)) { - $options .= ''; + $options .= ''; $options .= form_select_options($element, $choice); $options .= ''; } @@ -1407,7 +1407,7 @@ function form_select_options($element, $choices = NULL) { else { $selected = ''; } - $options .= ''; + $options .= ''; } } return $options; @@ -1488,7 +1488,7 @@ function theme_fieldset($element) { } } - return ''. ($element['#title'] ? ''. $element['#title'] .'' : '') . (isset($element['#description']) && $element['#description'] ? '
'. $element['#description'] .'
' : '') . (!empty($element['#children']) ? $element['#children'] : '') . $element['#value'] ."\n"; + return '' . ($element['#title'] ? '' . $element['#title'] . '' : '') . (isset($element['#description']) && $element['#description'] ? '
' . $element['#description'] . '
' : '') . (!empty($element['#children']) ? $element['#children'] : '') . $element['#value'] . "\n"; } /** @@ -1505,12 +1505,12 @@ function theme_fieldset($element) { function theme_radio($element) { _form_set_class($element, array('form-radio')); $output = ''; + $output .= drupal_attributes($element['#attributes']) . ' />'; if (!is_null($element['#title'])) { - $output = ''; + $output = ''; } unset($element['#title']); @@ -1531,9 +1531,9 @@ function theme_radio($element) { function theme_radios($element) { $class = 'form-radios'; if (isset($element['#attributes']['class'])) { - $class .= ' '. $element['#attributes']['class']; + $class .= ' ' . $element['#attributes']['class']; } - $element['#children'] = '
'. (!empty($element['#children']) ? $element['#children'] : '') .'
'; + $element['#children'] = '
' . (!empty($element['#children']) ? $element['#children'] : '') . '
'; if ($element['#title'] || $element['#description']) { unset($element['#id']); return theme('form_element', $element, $element['#children']); @@ -1623,7 +1623,7 @@ function password_confirm_validate($form, &$form_state) { * @ingroup themeable */ function theme_date($element) { - return theme('form_element', $element, '
'. $element['#children'] .'
'); + return theme('form_element', $element, '
' . $element['#children'] . '
'); } /** @@ -1720,7 +1720,7 @@ function expand_radios($element) { '#default_value' => isset($element['#default_value']) ? $element['#default_value'] : NULL, '#attributes' => $element['#attributes'], '#parents' => $element['#parents'], - '#id' => form_clean_id('edit-'. implode('-', $parents_for_id)), + '#id' => form_clean_id('edit-' . implode('-', $parents_for_id)), ); } } @@ -1782,7 +1782,7 @@ function form_expand_ahah($element) { 'event' => $element['#ahah']['event'], 'keypress' => empty($element['#ahah']['keypress']) ? NULL : $element['#ahah']['keypress'], 'wrapper' => empty($element['#ahah']['wrapper']) ? NULL : $element['#ahah']['wrapper'], - 'selector' => empty($element['#ahah']['selector']) ? '#'. $element['#id'] : $element['#ahah']['selector'], + 'selector' => empty($element['#ahah']['selector']) ? '#' . $element['#id'] : $element['#ahah']['selector'], 'effect' => empty($element['#ahah']['effect']) ? 'none' : $element['#ahah']['effect'], 'method' => empty($element['#ahah']['method']) ? 'replace' : $element['#ahah']['method'], 'progress' => empty($element['#ahah']['progress']) ? array('type' => 'throbber') : $element['#ahah']['progress'], @@ -1841,14 +1841,14 @@ function theme_checkbox($element) { _form_set_class($element, array('form-checkbox')); $checkbox = ''; + $checkbox .= drupal_attributes($element['#attributes']) . ' />'; if (!is_null($element['#title'])) { - $checkbox = ''; + $checkbox = ''; } unset($element['#title']); @@ -1868,9 +1868,9 @@ function theme_checkbox($element) { function theme_checkboxes($element) { $class = 'form-checkboxes'; if (isset($element['#attributes']['class'])) { - $class .= ' '. $element['#attributes']['class']; + $class .= ' ' . $element['#attributes']['class']; } - $element['#children'] = '
'. (!empty($element['#children']) ? $element['#children'] : '') .'
'; + $element['#children'] = '
' . (!empty($element['#children']) ? $element['#children'] : '') . '
'; if ($element['#title'] || $element['#description']) { unset($element['#id']); return theme('form_element', $element, $element['#children']); @@ -1913,13 +1913,13 @@ function theme_submit($element) { function theme_button($element) { // Make sure not to overwrite classes. if (isset($element['#attributes']['class'])) { - $element['#attributes']['class'] = 'form-'. $element['#button_type'] .' '. $element['#attributes']['class']; + $element['#attributes']['class'] = 'form-' . $element['#button_type'] . ' ' . $element['#attributes']['class']; } else { - $element['#attributes']['class'] = 'form-'. $element['#button_type']; + $element['#attributes']['class'] = 'form-' . $element['#button_type']; } - return '\n"; + return '\n"; } /** @@ -1930,18 +1930,18 @@ function theme_button($element) { function theme_image_button($element) { // Make sure not to overwrite classes. if (isset($element['#attributes']['class'])) { - $element['#attributes']['class'] = 'form-'. $element['#button_type'] .' '. $element['#attributes']['class']; + $element['#attributes']['class'] = 'form-' . $element['#button_type'] . ' ' . $element['#attributes']['class']; } else { - $element['#attributes']['class'] = 'form-'. $element['#button_type']; + $element['#attributes']['class'] = 'form-' . $element['#button_type']; } - return '\n"; } @@ -1957,7 +1957,7 @@ function theme_image_button($element) { * @ingroup themeable */ function theme_hidden($element) { - return '\n"; + return '\n"; } /** @@ -1981,8 +1981,8 @@ function theme_token($element) { * @ingroup themeable */ function theme_textfield($element) { - $size = empty($element['#size']) ? '' : ' size="'. $element['#size'] .'"'; - $maxlength = empty($element['#maxlength']) ? '' : ' maxlength="'. $element['#maxlength'] .'"'; + $size = empty($element['#size']) ? '' : ' size="' . $element['#size'] . '"'; + $maxlength = empty($element['#maxlength']) ? '' : ' maxlength="' . $element['#maxlength'] . '"'; $class = array('form-text'); $extra = ''; $output = ''; @@ -1990,18 +1990,18 @@ function theme_textfield($element) { if ($element['#autocomplete_path']) { drupal_add_js('misc/autocomplete.js'); $class[] = 'form-autocomplete'; - $extra = ''; + $extra = ''; } _form_set_class($element, $class); if (isset($element['#field_prefix'])) { - $output .= ''. $element['#field_prefix'] .' '; + $output .= '' . $element['#field_prefix'] . ' '; } - $output .= ''; + $output .= ''; if (isset($element['#field_suffix'])) { - $output .= ' '. $element['#field_suffix'] .''; + $output .= ' ' . $element['#field_suffix'] . ''; } return theme('form_element', $element, $output) . $extra; @@ -2020,8 +2020,8 @@ function theme_textfield($element) { */ function theme_form($element) { // Anonymous div to satisfy XHTML compliance. - $action = $element['#action'] ? 'action="'. check_url($element['#action']) .'" ' : ''; - return '
\n
". $element['#children'] ."\n
\n"; + $action = $element['#action'] ? 'action="' . check_url($element['#action']) . '" ' : ''; + return '
\n
" . $element['#children'] . "\n
\n"; } /** @@ -2054,7 +2054,7 @@ function theme_textarea($element) { } _form_set_class($element, $class); - return theme('form_element', $element, ''); + return theme('form_element', $element, ''); } /** @@ -2087,11 +2087,11 @@ function theme_markup($element) { * @ingroup themeable */ function theme_password($element) { - $size = $element['#size'] ? ' size="'. $element['#size'] .'" ' : ''; - $maxlength = $element['#maxlength'] ? ' maxlength="'. $element['#maxlength'] .'" ' : ''; + $size = $element['#size'] ? ' size="' . $element['#size'] . '" ' : ''; + $maxlength = $element['#maxlength'] ? ' maxlength="' . $element['#maxlength'] . '" ' : ''; _form_set_class($element, array('form-text')); - $output = ''; + $output = ''; return theme('form_element', $element, $output); } @@ -2132,7 +2132,7 @@ function process_weight($element) { */ function theme_file($element) { _form_set_class($element, array('form-file')); - return theme('form_element', $element, '\n"); + return theme('form_element', $element, '\n"); } /** @@ -2154,25 +2154,25 @@ function theme_form_element($element, $value) { $output = '
*' : ''; + $required = !empty($element['#required']) ? '*' : ''; if (!empty($element['#title'])) { $title = $element['#title']; if (!empty($element['#id'])) { - $output .= ' \n"; + $output .= ' \n"; } else { - $output .= ' \n"; + $output .= ' \n"; } } $output .= " $value\n"; if (!empty($element['#description'])) { - $output .= '
'. $element['#description'] ."
\n"; + $output .= '
' . $element['#description'] . "
\n"; } $output .= "
\n"; @@ -2235,7 +2235,7 @@ function form_clean_id($id = NULL, $flush = FALSE) { // outputting duplicate IDs, which would break JS code and XHTML // validity anyways. For now, it's an acceptable stopgap solution. if (isset($seen_ids[$id])) { - $id = $id .'-'. $seen_ids[$id]++; + $id = $id . '-' . $seen_ids[$id]++; } else { $seen_ids[$id] = 1; @@ -2296,7 +2296,7 @@ function form_clean_id($id = NULL, $flush = FALSE) { * // and the batch processing can continue to the next operation. * * $node = node_load(array('uid' => $uid, 'type' => $type)); - * $context['results'][] = $node->nid .' : '. $node->title; + * $context['results'][] = $node->nid . ' : ' . $node->title; * $context['message'] = $node->title; * } * @@ -2311,7 +2311,7 @@ function form_clean_id($id = NULL, $flush = FALSE) { * $result = db_query_range("SELECT nid FROM {node} WHERE nid > %d ORDER BY nid ASC", $context['sandbox']['current_node'], 0, $limit); * while ($row = db_fetch_array($result)) { * $node = node_load($row['nid'], NULL, TRUE); - * $context['results'][] = $node->nid .' : '. $node->title; + * $context['results'][] = $node->nid . ' : ' . $node->title; * $context['sandbox']['progress']++; * $context['sandbox']['current_node'] = $node->nid; * $context['message'] = $node->title; @@ -2483,7 +2483,7 @@ function batch_process($redirect = NULL, $url = NULL) { // Actually store the batch data and the token generated form the batch id. db_query("UPDATE {batch} SET token = '%s', batch = '%s' WHERE bid = %d", drupal_get_token($batch['id']), serialize($batch), $batch['id']); - drupal_goto($batch['url'], 'op=start&id='. $batch['id']); + drupal_goto($batch['url'], 'op=start&id=' . $batch['id']); } else { // Non-progressive execution: bypass the whole progressbar workflow diff --git a/includes/image.gd.inc b/includes/image.gd.inc index c9378ca7fe753c57c9f3f8f953b9cde346221e2f..ab26371f6ae6a6b7bcef309dc5c3c4fc3c927fba 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 03f5278878d2c5c38a1a12b40fdfca8f664e8f57..d86b62b01f5bc19d8958bfcba401117d4d85ad6b 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 6d6d4349ec4b697941602186174ef538f85d6745..2d74a9230ed1de59d4fed191765654cd5aafd42f 100644 --- a/includes/install.inc +++ b/includes/install.inc @@ -42,8 +42,8 @@ function drupal_get_schema_versions($module) { $updates = array(); $functions = get_defined_functions(); foreach ($functions['user'] as $function) { - if (strpos($function, $module .'_update_') === 0) { - $version = substr($function, strlen($module .'_update_')); + if (strpos($function, $module . '_update_') === 0) { + $version = substr($function, strlen($module . '_update_')); if (is_numeric($version)) { $updates[] = $version; } @@ -110,7 +110,7 @@ function drupal_install_profile_name() { if (!isset($name)) { // Load profile details. - $function = $profile .'_profile_details'; + $function = $profile . '_profile_details'; if (function_exists($function)) { $details = $function(); } @@ -134,7 +134,7 @@ function drupal_detect_baseurl($file = 'install.php') { global $profile; $proto = $_SERVER['HTTPS'] ? 'https://' : 'http://'; $host = $_SERVER['SERVER_NAME']; - $port = ($_SERVER['SERVER_PORT'] == 80 ? '' : ':'. $_SERVER['SERVER_PORT']); + $port = ($_SERVER['SERVER_PORT'] == 80 ? '' : ':' . $_SERVER['SERVER_PORT']); $uri = preg_replace("/\?.*/", '', $_SERVER['REQUEST_URI']); $dir = str_replace("/$file", '', $uri); @@ -152,9 +152,9 @@ function drupal_detect_database_types() { $databases = array(); foreach (array('mysql', 'mysqli', 'pgsql') as $type) { - if (file_exists('./includes/install.'. $type .'.inc')) { - include_once './includes/install.'. $type .'.inc'; - $function = $type .'_is_available'; + if (file_exists('./includes/install.' . $type . '.inc')) { + include_once './includes/install.' . $type . '.inc'; + $function = $type . '_is_available'; if ($function()) { $databases[$type] = $type; } @@ -173,7 +173,7 @@ function drupal_detect_database_types() { */ function drupal_rewrite_settings($settings = array(), $prefix = '') { $default_settings = './sites/default/default.settings.php'; - $settings_file = './'. conf_path(FALSE, TRUE) .'/'. $prefix .'settings.php'; + $settings_file = './' . conf_path(FALSE, TRUE) . '/' . $prefix . 'settings.php'; // Build list of setting names and insert the values into the global namespace. $keys = array(); @@ -197,7 +197,7 @@ function drupal_rewrite_settings($settings = array(), $prefix = '') { preg_match('/define\(\s*[\'"]([A-Z_-]+)[\'"]\s*,(.*?)\);/', $line, $variable); if (in_array($variable[1], $keys)) { $setting = $settings[$variable[1]]; - $buffer .= str_replace($variable[2], " '". $setting['value'] ."'", $line); + $buffer .= str_replace($variable[2], " '" . $setting['value'] . "'", $line); unset($settings[$variable[1]]); unset($settings[$variable[2]]); } @@ -212,7 +212,7 @@ function drupal_rewrite_settings($settings = array(), $prefix = '') { // Write new value to settings.php in the following format: // $'setting' = 'value'; // 'comment' $setting = $settings[$variable[1]]; - $buffer .= '$'. $variable[1] ." = '". $setting['value'] ."';". (!empty($setting['comment']) ? ' // '. $setting['comment'] ."\n" : "\n"); + $buffer .= '$' . $variable[1] . " = '" . $setting['value'] . "';" . (!empty($setting['comment']) ? ' // ' . $setting['comment'] . "\n" : "\n"); unset($settings[$variable[1]]); } else { @@ -228,7 +228,7 @@ function drupal_rewrite_settings($settings = array(), $prefix = '') { // Add required settings that were missing from settings.php. foreach ($settings as $setting => $data) { if ($data['required']) { - $buffer .= "\$$setting = '". $data['value'] ."';\n"; + $buffer .= "\$$setting = '" . $data['value'] . "';\n"; } } @@ -251,7 +251,7 @@ function drupal_rewrite_settings($settings = array(), $prefix = '') { function drupal_get_install_files($module_list = array()) { $installs = array(); foreach ($module_list as $module) { - $installs = array_merge($installs, drupal_system_listing($module .'.install$', 'modules')); + $installs = array_merge($installs, drupal_system_listing($module . '.install$', 'modules')); } return $installs; } @@ -279,7 +279,7 @@ function drupal_verify_profile($profile, $locale) { require_once($profile_file); // Get a list of modules required by this profile. - $function = $profile .'_profile_modules'; + $function = $profile . '_profile_modules'; $module_list = array_merge(drupal_required_modules(), $function(), ($locale != 'en' ? array('locale') : array())); // Get a list of modules that exist in Drupal's assorted subdirectories. @@ -355,11 +355,11 @@ function _drupal_install_module($module) { */ function drupal_install_system() { $system_path = dirname(drupal_get_filename('module', 'system', NULL)); - require_once './'. $system_path .'/system.install'; + require_once './' . $system_path . '/system.install'; module_invoke('system', 'install'); $system_versions = drupal_get_schema_versions('system'); $system_version = $system_versions ? max($system_versions) : SCHEMA_INSTALLED; - db_query("INSERT INTO {system} (filename, name, type, owner, status, throttle, bootstrap, schema_version) VALUES('%s', '%s', '%s', '%s', %d, %d, %d, %d)", $system_path .'/system.module', 'system', 'module', '', 1, 0, 0, $system_version); + db_query("INSERT INTO {system} (filename, name, type, owner, status, throttle, bootstrap, schema_version) VALUES('%s', '%s', '%s', '%s', %d, %d, %d, %d)", $system_path . '/system.module', 'system', 'module', '', 1, 0, 0, $system_version); // Now that we've installed things properly, bootstrap the full Drupal environment drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); module_rebuild_cache(); @@ -396,7 +396,7 @@ function drupal_uninstall_module($module) { } $placeholders = implode(', ', array_fill(0, count($paths), "'%s'")); - $result = db_query('SELECT * FROM {menu_links} WHERE router_path IN ('. $placeholders .') AND external = 0 ORDER BY depth DESC', $paths); + $result = db_query('SELECT * FROM {menu_links} WHERE router_path IN (' . $placeholders . ') AND external = 0 ORDER BY depth DESC', $paths); // Remove all such items. Starting from those with the greatest depth will // minimize the amount of re-parenting done by menu_link_delete(). while ($item = db_fetch_array($result)) { @@ -427,7 +427,7 @@ function drupal_verify_install_file($file, $mask = NULL, $type = 'file') { } // Verify that the file is the type of file it is supposed to be. if (isset($type) && file_exists($file)) { - $check = 'is_'. $type; + $check = 'is_' . $type; if (!function_exists($check) || !$check($file)) { $return = FALSE; } @@ -614,7 +614,7 @@ function drupal_install_fix_file($file, $mask, $message = TRUE) { */ function install_goto($path) { global $base_url; - header('Location: '. $base_url .'/'. $path); + header('Location: ' . $base_url . '/' . $path); header('Cache-Control: no-cache'); // Not a permanent redirect. exit(); } @@ -630,7 +630,7 @@ function st($string, $args = array()) { if (!isset($locale_strings)) { $locale_strings = array(); - $filename = './profiles/'. $profile .'/translations/'. $install_locale .'.po'; + $filename = './profiles/' . $profile . '/translations/' . $install_locale . '.po'; if (file_exists($filename)) { require_once './includes/locale.inc'; $file = (object) array('filepath' => $filename); @@ -650,7 +650,7 @@ function st($string, $args = array()) { // Escaped and placeholder case '%': default: - $args[$key] = ''. check_plain($value) .''; + $args[$key] = '' . check_plain($value) . ''; break; // Pass-through case '!': @@ -677,7 +677,7 @@ function drupal_check_profile($profile) { require_once($profile_file); // Get a list of modules required by this profile. - $function = $profile .'_profile_modules'; + $function = $profile . '_profile_modules'; $module_list = array_unique(array_merge(drupal_required_modules(), $function())); // Get a list of all .install files. @@ -724,7 +724,7 @@ function drupal_check_module($module) { if (isset($requirement['severity']) && $requirement['severity'] == REQUIREMENT_ERROR) { $message = $requirement['description']; if (isset($requirement['value']) && $requirement['value']) { - $message .= ' ('. t('Currently using !item !version', array('!item' => $requirement['title'], '!version' => $requirement['value'])) .')'; + $message .= ' (' . t('Currently using !item !version', array('!item' => $requirement['title'], '!version' => $requirement['value'])) . ')'; } drupal_set_message($message, 'error'); } diff --git a/includes/install.mysql.inc b/includes/install.mysql.inc index dc268525c00e500b51926675a19870c157dc26f0..2945fab7bd95876c5e2fed2043af5962fe496b95 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 f03159ebb5d70fc23b6998628280084b5d349775..c5ad5f2f389e0afeb20c504792a4724888a78fa0 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 e92f36d6d5c5329bda511eb2f4053c86255d8565..866947ea309e36d88b81fa2437b3a1abd8b1c639 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 14176bd7d1ba4a82cf94608519aea32e470b63e3..9f51306f9b01fb591bd795ad867cebef1865afbb 100644 --- a/includes/locale.inc +++ b/includes/locale.inc @@ -78,12 +78,12 @@ function theme_locale_languages_overview_form($form) { $rows[] = array( array('data' => drupal_render($form['enabled'][$key]), 'align' => 'center'), check_plain($key), - ''. drupal_render($form['name'][$key]) .'', + '' . drupal_render($form['name'][$key]) . '', drupal_render($form['native'][$key]), drupal_render($form['direction'][$key]), drupal_render($form['site_default'][$key]), drupal_render($form['weight'][$key]), - l(t('edit'), 'admin/settings/language/edit/'. $key) . (($key != 'en' && $key != $default->language) ? ' '. l(t('delete'), 'admin/settings/language/delete/'. $key) : '') + l(t('edit'), 'admin/settings/language/edit/' . $key) . (($key != 'en' && $key != $default->language) ? ' ' . l(t('delete'), 'admin/settings/language/delete/' . $key) : '') ); } } @@ -412,7 +412,7 @@ function locale_languages_delete_form_submit($form, &$form_state) { if (isset($languages[$form_state['values']['langcode']])) { // Remove translations first. db_query("DELETE FROM {locales_target} WHERE language = '%s'", $form_state['values']['langcode']); - cache_clear_all('locale:'. $form_state['values']['langcode'], 'cache'); + cache_clear_all('locale:' . $form_state['values']['langcode'], 'cache'); // With no translations, this removes existing JavaScript translations file. _locale_rebuild_js($form_state['values']['langcode']); // Remove the language. @@ -500,7 +500,7 @@ function locale_translate_overview_screen() { foreach ($languages as $langcode => $language) { $rows[$langcode] = array('name' => ($langcode == 'en' ? t('English (built-in)') : t($language->name))); foreach ($groups as $group => $name) { - $rows[$langcode][$group] = ($langcode == 'en' ? t('n/a') : '0/'. (isset($groupsums[$group]) ? $groupsums[$group] : 0) .' (0%)'); + $rows[$langcode][$group] = ($langcode == 'en' ? t('n/a') : '0/' . (isset($groupsums[$group]) ? $groupsums[$group] : 0) . ' (0%)'); } } @@ -508,7 +508,7 @@ function locale_translate_overview_screen() { $translations = db_query("SELECT COUNT(*) AS translation, t.language, s.textgroup FROM {locales_source} s INNER JOIN {locales_target} t ON s.lid = t.lid GROUP BY textgroup, language"); while ($data = db_fetch_object($translations)) { $ratio = (!empty($groupsums[$data->textgroup]) && $data->translation > 0) ? round(($data->translation/$groupsums[$data->textgroup])*100., 2) : 0; - $rows[$data->language][$data->textgroup] = $data->translation .'/'. $groupsums[$data->textgroup] ." ($ratio%)"; + $rows[$data->language][$data->textgroup] = $data->translation . '/' . $groupsums[$data->textgroup] . " ($ratio%)"; } return theme('table', $headers, $rows); @@ -1062,7 +1062,7 @@ function _locale_import_read_po($op, $file, $mode = NULL, $lang = NULL, $group = _locale_import_message('The translation file %filename contains a syntax error on line %line.', $file, $lineno); return FALSE; } - $current["msgid"] = $current["msgid"] ."\0". $quoted; + $current["msgid"] = $current["msgid"] . "\0" . $quoted; $context = "MSGID_PLURAL"; } elseif (!strncmp("msgid", $line, 5)) { @@ -1453,13 +1453,13 @@ function _locale_import_parse_arithmetic($string) { if (!empty($prec[$op])) { $f = ""; if ($op == ":") { - $f = $elstk[$i - 2] ."):". $elstk[$i - 1] .")"; + $f = $elstk[$i - 2] . "):" . $elstk[$i - 1] . ")"; } elseif ($op == "?") { - $f = "(". $elstk[$i - 2] ."?(". $elstk[$i - 1]; + $f = "(" . $elstk[$i - 2] . "?(" . $elstk[$i - 1]; } else { - $f = "(". $elstk[$i - 2] . $op . $elstk[$i - 1] .")"; + $f = "(" . $elstk[$i - 2] . $op . $elstk[$i - 1] . ")"; } array_splice($elstk, $i - 2, 3, $f); break; @@ -1506,7 +1506,7 @@ function _locale_import_tokenize_formula($formula) { case 3: case 4: if ($next == '=') { - $tokens[] = $formula[$i] .'='; + $tokens[] = $formula[$i] . '='; $i++; } else { @@ -1572,7 +1572,7 @@ function _locale_import_append_plural($entry, $key) { function _locale_import_shorten_comments($comment) { $comm = ''; while (count($comment)) { - $test = $comm . substr(array_shift($comment), 1) .', '; + $test = $comm . substr(array_shift($comment), 1) . ', '; if (strlen($comm) < 130) { $comm = $test; } @@ -1623,10 +1623,10 @@ function _locale_parse_js_file($filepath) { // Match all calls to Drupal.t() in an array. // Note: \s also matches newlines with the 's' modifier. - preg_match_all('~[^\w]Drupal\s*\.\s*t\s*\(\s*('. LOCALE_JS_STRING .')\s*[,\)]~s', $file, $t_matches); + preg_match_all('~[^\w]Drupal\s*\.\s*t\s*\(\s*(' . LOCALE_JS_STRING . ')\s*[,\)]~s', $file, $t_matches); // Match all Drupal.formatPlural() calls in another array. - preg_match_all('~[^\w]Drupal\s*\.\s*formatPlural\s*\(\s*.+?\s*,\s*('. LOCALE_JS_STRING .')\s*,\s*((?:(?:\'(?:\\\\\'|[^\'])*@count(?:\\\\\'|[^\'])*\'|"(?:\\\\"|[^"])*@count(?:\\\\"|[^"])*")(?:\s*\+\s*)?)+)\s*[,\)]~s', $file, $plural_matches); + preg_match_all('~[^\w]Drupal\s*\.\s*formatPlural\s*\(\s*.+?\s*,\s*(' . LOCALE_JS_STRING . ')\s*,\s*((?:(?:\'(?:\\\\\'|[^\'])*@count(?:\\\\\'|[^\'])*\'|"(?:\\\\"|[^"])*@count(?:\\\\"|[^"])*")(?:\s*\+\s*)?)+)\s*[,\)]~s', $file, $plural_matches); // Loop through all matches and process them. $all_matches = array_merge($plural_matches[1], $t_matches[1]); @@ -1725,21 +1725,21 @@ function _locale_export_po_generate($language = NULL, $strings = array(), $heade if (!isset($header)) { if (isset($language)) { - $header = '# '. $language->name .' translation of '. variable_get('site_name', 'Drupal') ."\n"; - $header .= '# Generated by '. $user->name .' <'. $user->mail .">\n"; + $header = '# ' . $language->name . ' translation of ' . variable_get('site_name', 'Drupal') . "\n"; + $header .= '# Generated by ' . $user->name . ' <' . $user->mail . ">\n"; $header .= "#\n"; $header .= "msgid \"\"\n"; $header .= "msgstr \"\"\n"; $header .= "\"Project-Id-Version: PROJECT VERSION\\n\"\n"; - $header .= "\"POT-Creation-Date: ". date("Y-m-d H:iO") ."\\n\"\n"; - $header .= "\"PO-Revision-Date: ". date("Y-m-d H:iO") ."\\n\"\n"; + $header .= "\"POT-Creation-Date: " . date("Y-m-d H:iO") . "\\n\"\n"; + $header .= "\"PO-Revision-Date: " . date("Y-m-d H:iO") . "\\n\"\n"; $header .= "\"Last-Translator: NAME \\n\"\n"; $header .= "\"Language-Team: LANGUAGE \\n\"\n"; $header .= "\"MIME-Version: 1.0\\n\"\n"; $header .= "\"Content-Type: text/plain; charset=utf-8\\n\"\n"; $header .= "\"Content-Transfer-Encoding: 8bit\\n\"\n"; if ($language->formula && $language->plurals) { - $header .= "\"Plural-Forms: nplurals=". $language->plurals ."; plural=". strtr($language->formula, array('$' => '')) .";\\n\"\n"; + $header .= "\"Plural-Forms: nplurals=" . $language->plurals . "; plural=" . strtr($language->formula, array('$' => '')) . ";\\n\"\n"; } } else { @@ -1749,7 +1749,7 @@ function _locale_export_po_generate($language = NULL, $strings = array(), $heade $header .= "msgid \"\"\n"; $header .= "msgstr \"\"\n"; $header .= "\"Project-Id-Version: PROJECT VERSION\\n\"\n"; - $header .= "\"POT-Creation-Date: ". date("Y-m-d H:iO") ."\\n\"\n"; + $header .= "\"POT-Creation-Date: " . date("Y-m-d H:iO") . "\\n\"\n"; $header .= "\"PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\\n\"\n"; $header .= "\"Last-Translator: NAME \\n\"\n"; $header .= "\"Language-Team: LANGUAGE \\n\"\n"; @@ -1760,22 +1760,22 @@ function _locale_export_po_generate($language = NULL, $strings = array(), $heade } } - $output = $header ."\n"; + $output = $header . "\n"; foreach ($strings as $lid => $string) { // Only process non-children, children are output below their parent. if (!isset($string['child'])) { if ($string['comment']) { - $output .= '#: '. $string['comment'] ."\n"; + $output .= '#: ' . $string['comment'] . "\n"; } - $output .= 'msgid '. _locale_export_string($string['source']); + $output .= 'msgid ' . _locale_export_string($string['source']); if (!empty($string['plural'])) { $plural = $string['plural']; - $output .= 'msgid_plural '. _locale_export_string($strings[$plural]['source']); + $output .= 'msgid_plural ' . _locale_export_string($strings[$plural]['source']); if (isset($language)) { $translation = $string['translation']; for ($i = 0; $i < $language->plurals; $i++) { - $output .= 'msgstr['. $i .'] '. _locale_export_string($translation); + $output .= 'msgstr[' . $i . '] ' . _locale_export_string($translation); if ($plural) { $translation = _locale_export_remove_plural($strings[$plural]['translation']); $plural = isset($strings[$plural]['plural']) ? $strings[$plural]['plural'] : 0; @@ -1786,12 +1786,12 @@ function _locale_export_po_generate($language = NULL, $strings = array(), $heade } } else { - $output .= 'msgstr[0] ""'."\n"; - $output .= 'msgstr[1] ""'."\n"; + $output .= 'msgstr[0] ""' . "\n"; + $output .= 'msgstr[1] ""' . "\n"; } } else { - $output .= 'msgstr '. _locale_export_string($string['translation']); + $output .= 'msgstr ' . _locale_export_string($string['translation']); } $output .= "\n"; } @@ -1812,7 +1812,7 @@ function _locale_export_po_generate($language = NULL, $strings = array(), $heade function _locale_export_po($language = NULL, $output = NULL) { // Log the export event. if (isset($language)) { - $filename = $language->language .'.po'; + $filename = $language->language . '.po'; watchdog('locale', 'Exported %locale translation file: %filename.', array('%locale' => $language->name, '%filename' => $filename)); } else { @@ -1850,7 +1850,7 @@ function _locale_export_string($str) { // Multiline string if (count($parts) > 1) { - return "\"\"\n\"". implode("\"\n\"", $parts) ."\"\n"; + return "\"\"\n\"" . implode("\"\n\"", $parts) . "\"\n"; } // Single line string elseif (count($parts) == 1) { @@ -1878,7 +1878,7 @@ function _locale_export_wrap($str, $len) { $nstr = 0; } elseif (strlen("$cur $word") > $len) { - $ret[] = $cur ." "; + $ret[] = $cur . " "; $cur = $word; } else { @@ -1946,7 +1946,7 @@ function _locale_translate_seek() { switch ($query['language']) { // Force search in source strings case "en": - $sql = $join ." WHERE s.source LIKE '%%%s%%' $grouplimit ORDER BY s.source"; + $sql = $join . " WHERE s.source LIKE '%%%s%%' $grouplimit ORDER BY s.source"; $arguments = array($query['string']); // $where is not used, discard its arguments if (!empty($grouplimit)) { $arguments[] = $query['group']; @@ -1979,7 +1979,7 @@ function _locale_translate_seek() { foreach ($arr as $lid => $value) { $rows[] = array( $value['group'], - array('data' => check_plain(truncate_utf8($value['source'], 150, FALSE, TRUE)) .'
'. $value['location'] .''), + array('data' => check_plain(truncate_utf8($value['source'], 150, FALSE, TRUE)) . '
' . $value['location'] . ''), array('data' => _locale_translate_language_list($value['languages'], $limit_language), 'align' => 'center'), array('data' => l(t('edit'), "admin/build/translate/edit/$lid"), 'class' => 'nowrap'), array('data' => l(t('delete'), "admin/build/translate/delete/$lid"), 'class' => 'nowrap'), @@ -2038,12 +2038,12 @@ function _locale_invalidate_js($langcode = NULL) { $languages = language_list(); unset($languages['en']); foreach ($languages as $lcode => $data) { - $parsed['refresh:'. $lcode] = 'waiting'; + $parsed['refresh:' . $lcode] = 'waiting'; } } else { // Invalidate single language. - $parsed['refresh:'. $langcode] = 'waiting'; + $parsed['refresh:' . $langcode] = 'waiting'; } variable_set('javascript_parsed', $parsed); @@ -2108,7 +2108,7 @@ function _locale_rebuild_js($langcode = NULL) { $data .= "'pluralFormula': function(\$n) { return Number({$language->formula}); }, "; } - $data .= "'strings': ". drupal_to_js($translations) ." };"; + $data .= "'strings': " . drupal_to_js($translations) . " };"; $data_hash = md5($data); } @@ -2118,7 +2118,7 @@ function _locale_rebuild_js($langcode = NULL) { // Delete old file, if we have no translations anymore, or a different file to be saved. if (!empty($language->javascript) && (!$data || $language->javascript != $data_hash)) { - file_delete(file_create_path($dir .'/'. $language->language .'_'. $language->javascript .'.js')); + file_delete(file_create_path($dir . '/' . $language->language . '_' . $language->javascript . '.js')); $language->javascript = ''; $status = 'deleted'; } @@ -2129,7 +2129,7 @@ function _locale_rebuild_js($langcode = NULL) { file_check_directory($dir, TRUE); // Save the file. - $dest = $dir .'/'. $language->language .'_'. $data_hash .'.js'; + $dest = $dir . '/' . $language->language . '_' . $data_hash . '.js'; if (file_save_data($data, $dest)) { $language->javascript = $data_hash; $status = ($status == 'deleted') ? 'updated' : 'created'; @@ -2180,14 +2180,14 @@ function _locale_rebuild_js($langcode = NULL) { */ function _locale_translate_language_list($translation, $limit_language) { // Add CSS - drupal_add_css(drupal_get_path('module', 'locale') .'/locale.css', 'module', 'all', FALSE); + drupal_add_css(drupal_get_path('module', 'locale') . '/locale.css', 'module', 'all', FALSE); $languages = language_list(); unset($languages['en']); $output = ''; foreach ($languages as $langcode => $language) { if (!$limit_language || $limit_language == $langcode) { - $output .= (!empty($translation[$langcode])) ? $langcode .' ' : "$langcode "; + $output .= (!empty($translation[$langcode])) ? $langcode . ' ' : "$langcode "; } } @@ -2442,7 +2442,7 @@ function locale_batch_by_language($langcode, $finished = NULL, $skip = array()) $components = array(); $query = "SELECT name, filename FROM {system} WHERE status = 1"; if (count($skip)) { - $query .= " AND name NOT IN (". db_placeholders($skip, 'varchar') .")"; + $query .= " AND name NOT IN (" . db_placeholders($skip, 'varchar') . ")"; } $result = db_query($query, $skip); while ($component = db_fetch_object($result)) { @@ -2450,7 +2450,7 @@ function locale_batch_by_language($langcode, $finished = NULL, $skip = array()) // with names ending with $langcode.po. This allows for filenames // like node-module.de.po to let translators use small files and // be able to import in smaller chunks. - $files = array_merge($files, file_scan_directory(dirname($component->filename) .'/translations', '(^|\.)'. $langcode .'\.po$', array('.', '..', 'CVS'), 0, FALSE)); + $files = array_merge($files, file_scan_directory(dirname($component->filename) . '/translations', '(^|\.)' . $langcode . '\.po$', array('.', '..', 'CVS'), 0, FALSE)); $components[] = $component->name; } @@ -2482,7 +2482,7 @@ function locale_batch_by_component($components, $finished = '_locale_batch_syste // as $langcode.po or with names ending with $langcode.po. This allows // for filenames like node-module.de.po to let translators use small // files and be able to import in smaller chunks. - $files = array_merge($files, file_scan_directory(dirname($component->filename) .'/translations', '(^|\.)('. $language_list .')\.po$', array('.', '..', 'CVS'), 0, FALSE)); + $files = array_merge($files, file_scan_directory(dirname($component->filename) . '/translations', '(^|\.)(' . $language_list . ')\.po$', array('.', '..', 'CVS'), 0, FALSE)); } } return _locale_batch_build($files, $finished); diff --git a/includes/mail.inc b/includes/mail.inc index 3f943652bb6bb9cb03519aafa186b7daab4cf5ff..56c765e7c4f4f1e54d3b5270fc52b74f8f428166 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 235fd9f8cee8f1198e50adf178d0b6f693f52440..914f5c8f1cdeff58d31be0927090d719db19bbd6 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -312,7 +312,7 @@ function menu_get_item($path = NULL, $router_item = NULL) { $parts = array_slice($original_map, 0, MENU_MAX_PARTS); list($ancestors, $placeholders) = menu_get_ancestors($parts); - if ($router_item = db_fetch_array(db_query_range('SELECT * FROM {menu_router} WHERE path IN ('. implode (',', $placeholders) .') ORDER BY fit DESC', $ancestors, 0, 1))) { + if ($router_item = db_fetch_array(db_query_range('SELECT * FROM {menu_router} WHERE path IN (' . implode (',', $placeholders) . ') ORDER BY fit DESC', $ancestors, 0, 1))) { $map = _menu_translate($router_item, $original_map); if ($map === FALSE) { $router_items[$path] = FALSE; @@ -685,7 +685,7 @@ function _menu_link_translate(&$item) { */ function menu_get_object($type = 'node', $position = 1, $path = NULL) { $router_item = menu_get_item($path); - if (isset($router_item['load_functions'][$position]) && !empty($router_item['map'][$position]) && $router_item['load_functions'][$position] == $type .'_load') { + if (isset($router_item['load_functions'][$position]) && !empty($router_item['map'][$position]) && $router_item['load_functions'][$position] == $type . '_load') { return $router_item['map'][$position]; } } @@ -773,7 +773,7 @@ function menu_tree_all_data($menu_name = 'navigation', $item = NULL) { // Use $mlid as a flag for whether the data being loaded is for the whole tree. $mlid = isset($item['mlid']) ? $item['mlid'] : 0; // Generate a cache ID (cid) specific for this $menu_name and $item. - $cid = 'links:'. $menu_name .':all-cid:'. $mlid; + $cid = 'links:' . $menu_name . ':all-cid:' . $mlid; if (!isset($tree[$cid])) { // If the static variable doesn't have the data, check {cache_menu}. @@ -798,7 +798,7 @@ function menu_tree_all_data($menu_name = 'navigation', $item = NULL) { } $args = array_unique($args); $placeholders = implode(', ', array_fill(0, count($args), '%d')); - $where = ' AND ml.plid IN ('. $placeholders .')'; + $where = ' AND ml.plid IN (' . $placeholders . ')'; $parents = $args; $parents[] = $item['mlid']; } @@ -815,7 +815,7 @@ function menu_tree_all_data($menu_name = 'navigation', $item = NULL) { $data['tree'] = menu_tree_data(db_query(" SELECT m.load_functions, m.to_arg_functions, m.access_callback, m.access_arguments, m.page_callback, m.page_arguments, m.title, m.title_callback, m.title_arguments, m.type, m.description, ml.* FROM {menu_links} ml LEFT JOIN {menu_router} m ON m.path = ml.router_path - WHERE ml.menu_name = '%s'". $where ." + WHERE ml.menu_name = '%s'" . $where . " ORDER BY p1 ASC, p2 ASC, p3 ASC, p4 ASC, p5 ASC, p6 ASC, p7 ASC, p8 ASC, p9 ASC", $args), $parents); $data['node_links'] = array(); menu_tree_collect_node_links($data['tree'], $data['node_links']); @@ -856,7 +856,7 @@ function menu_tree_page_data($menu_name = 'navigation') { // Load the menu item corresponding to the current page. if ($item = menu_get_item()) { // Generate a cache ID (cid) specific for this page. - $cid = 'links:'. $menu_name .':page-cid:'. $item['href'] .':'. (int)$item['access']; + $cid = 'links:' . $menu_name . ':page-cid:' . $item['href'] . ':' . (int)$item['access']; if (!isset($tree[$cid])) { // If the static variable doesn't have the data, check {cache_menu}. @@ -880,7 +880,7 @@ function menu_tree_page_data($menu_name = 'navigation') { $args[] = ''; $placeholders .= ", '%s'"; } - $parents = db_fetch_array(db_query("SELECT p1, p2, p3, p4, p5, p6, p7, p8 FROM {menu_links} WHERE menu_name = '%s' AND link_path IN (". $placeholders .")", $args)); + $parents = db_fetch_array(db_query("SELECT p1, p2, p3, p4, p5, p6, p7, p8 FROM {menu_links} WHERE menu_name = '%s' AND link_path IN (" . $placeholders . ")", $args)); if (empty($parents)) { // If no link exists, we may be on a local task that's not in the links. @@ -899,7 +899,7 @@ function menu_tree_page_data($menu_name = 'navigation') { // Collect all the links set to be expanded, and then add all of // their children to the list as well. do { - $result = db_query("SELECT mlid FROM {menu_links} WHERE menu_name = '%s' AND expanded = 1 AND has_children = 1 AND plid IN (". $placeholders .') AND mlid NOT IN ('. $placeholders .')', array_merge(array($menu_name), $args, $args)); + $result = db_query("SELECT mlid FROM {menu_links} WHERE menu_name = '%s' AND expanded = 1 AND has_children = 1 AND plid IN (" . $placeholders . ') AND mlid NOT IN (' . $placeholders . ')', array_merge(array($menu_name), $args, $args)); $num_rows = FALSE; while ($item = db_fetch_array($result)) { $args[] = $item['mlid']; @@ -922,7 +922,7 @@ function menu_tree_page_data($menu_name = 'navigation') { $data['tree'] = menu_tree_data(db_query(" SELECT m.load_functions, m.to_arg_functions, m.access_callback, m.access_arguments, m.page_callback, m.page_arguments, m.title, m.title_callback, m.title_arguments, m.type, m.description, ml.* FROM {menu_links} ml LEFT JOIN {menu_router} m ON m.path = ml.router_path - WHERE ml.menu_name = '%s' AND ml.plid IN (". $placeholders .") + WHERE ml.menu_name = '%s' AND ml.plid IN (" . $placeholders . ") ORDER BY p1 ASC, p2 ASC, p3 ASC, p4 ASC, p5 ASC, p6 ASC, p7 ASC, p8 ASC, p9 ASC", $args), $parents); $data['node_links'] = array(); menu_tree_collect_node_links($data['tree'], $data['node_links']); @@ -948,7 +948,7 @@ function menu_tree_page_data($menu_name = 'navigation') { * Helper function - compute the real cache ID for menu tree data. */ function _menu_tree_cid($menu_name, $data) { - return 'links:'. $menu_name .':tree-data:'. md5(serialize($data)); + return 'links:' . $menu_name . ':tree-data:' . md5(serialize($data)); } /** @@ -977,8 +977,8 @@ function menu_tree_check_access(&$tree, $node_links = array()) { if ($node_links) { // Use db_rewrite_sql to evaluate view access without loading each full node. $nids = array_keys($node_links); - $placeholders = '%d'. str_repeat(', %d', count($nids) - 1); - $result = db_query(db_rewrite_sql("SELECT n.nid FROM {node} n WHERE n.status = 1 AND n.nid IN (". $placeholders .")"), $nids); + $placeholders = '%d' . str_repeat(', %d', count($nids) - 1); + $result = db_query(db_rewrite_sql("SELECT n.nid FROM {node} n WHERE n.status = 1 AND n.nid IN (" . $placeholders . ")"), $nids); while ($node = db_fetch_array($result)) { $nid = $node['nid']; foreach ($node_links[$nid] as $mlid => $link) { @@ -1005,7 +1005,7 @@ function _menu_tree_check_access(&$tree) { // The weights are made a uniform 5 digits by adding 50000 as an offset. // After _menu_link_translate(), $item['title'] has the localized link title. // Adding the mlid to the end of the index insures that it is unique. - $new_tree[(50000 + $item['weight']) .' '. $item['title'] .' '. $item['mlid']] = $tree[$key]; + $new_tree[(50000 + $item['weight']) . ' ' . $item['title'] . ' ' . $item['mlid']] = $tree[$key]; } } // Sort siblings in the tree based on the weights and localized titles. @@ -1112,7 +1112,7 @@ function theme_menu_item_link($link) { * @ingroup themeable */ function theme_menu_tree($tree) { - return ''; + return ''; } /** @@ -1123,12 +1123,12 @@ function theme_menu_tree($tree) { function theme_menu_item($link, $has_children, $menu = '', $in_active_trail = FALSE, $extra_class = NULL) { $class = ($menu ? 'expanded' : ($has_children ? 'collapsed' : 'leaf')); if (!empty($extra_class)) { - $class .= ' '. $extra_class; + $class .= ' ' . $extra_class; } if ($in_active_trail) { $class .= ' active-trail'; } - return '
  • '. $link . $menu ."
  • \n"; + return '
  • ' . $link . $menu . "
  • \n"; } /** @@ -1137,7 +1137,7 @@ function theme_menu_item($link, $has_children, $menu = '', $in_active_trail = FA * @ingroup themeable */ function theme_menu_local_task($link, $active = FALSE) { - return '
  • '. $link ."
  • \n"; + return '
  • ' . $link . "
  • \n"; } /** @@ -1162,12 +1162,12 @@ function menu_get_active_help() { if (module_hook($name, 'help')) { // Lookup help for this path. if ($help = module_invoke($name, 'help', $router_path, $arg)) { - $output .= $help ."\n"; + $output .= $help . "\n"; } // Add "more help" link on admin pages if the module provides a // standalone help page. - if ($arg[0] == "admin" && module_exists('help') && module_invoke($name, 'help', 'admin/help#'. $arg[2], $empty_arg) && $help) { - $output .= theme("more_help_link", url('admin/help/'. $arg[2])); + if ($arg[0] == "admin" && module_exists('help') && module_invoke($name, 'help', 'admin/help#' . $arg[2], $empty_arg) && $help) { + $output .= theme("more_help_link", url('admin/help/' . $arg[2])); } } } @@ -1258,7 +1258,7 @@ function menu_navigation_links($menu_name, $level = 0) { $l['href'] = $item['link']['href']; $l['title'] = $item['link']['title']; // Keyed with unique menu id to generate classes from theme_links(). - $links['menu-'. $item['link']['mlid']] = $l; + $links['menu-' . $item['link']['mlid']] = $l; } } return $links; @@ -1424,10 +1424,10 @@ function theme_menu_local_tasks() { $output = ''; if ($primary = menu_primary_local_tasks()) { - $output .= "
      \n". $primary ."
    \n"; + $output .= "
      \n" . $primary . "
    \n"; } if ($secondary = menu_secondary_local_tasks()) { - $output .= "
      \n". $secondary ."
    \n"; + $output .= "
      \n" . $secondary . "
    \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 034f54ed7ecfe0238e4900a2b2914fbd13d1e1e6..c87393c7b225fc11e1345636b42902e01af8a6b1 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 df20c0eb1591d5996f7dfa93aba6ee28b3eb5f58..8f2939c3356fe857be97fd2ca927650db103561c 100644 --- a/includes/path.inc +++ b/includes/path.inc @@ -231,7 +231,7 @@ function drupal_match_path($path, $patterns) { static $regexps; if (!isset($regexps[$patterns])) { - $regexps[$patterns] = '/^('. preg_replace(array('/(\r\n?|\n)/', '/\\\\\*/', '/(^|\|)\\\\($|\|)/'), array('|', '.*', '\1'. preg_quote(variable_get('site_frontpage', 'node'), '/') .'\2'), preg_quote($patterns, '/')) .')$/'; + $regexps[$patterns] = '/^(' . preg_replace(array('/(\r\n?|\n)/', '/\\\\\*/', '/(^|\|)\\\\($|\|)/'), array('|', '.*', '\1' . preg_quote(variable_get('site_frontpage', 'node'), '/') . '\2'), preg_quote($patterns, '/')) . ')$/'; } return preg_match($regexps[$patterns], $path); } diff --git a/includes/session.inc b/includes/session.inc index 74ddb2c3f6159111cb6dcf2d620317a46d0e005c..25d2479d4ab2a23eec8a85791d19581d526d680e 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 9c39c5ce8457824910fc98bd997e8b28006ddc3b..3c2068e1b8a5536e01b1d4ad32bddecd1442cbe1 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 7693a482a1664ae9d5613d12fef5332d35cb7f5a..8f389a0cc6b646ac35c9b5e528570e9997228d20 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -153,14 +153,14 @@ function _init_theme($theme, $base_theme = array(), $registry_callback = '_theme // Initialize the theme. if (isset($theme->engine)) { // Include the engine. - include_once './'. $theme->owner; + include_once './' . $theme->owner; $theme_engine = $theme->engine; - if (function_exists($theme_engine .'_init')) { + if (function_exists($theme_engine . '_init')) { foreach ($base_theme as $base) { - call_user_func($theme_engine .'_init', $base); + call_user_func($theme_engine . '_init', $base); } - call_user_func($theme_engine .'_init', $theme); + call_user_func($theme_engine . '_init', $theme); } } else { @@ -168,12 +168,12 @@ function _init_theme($theme, $base_theme = array(), $registry_callback = '_theme foreach ($base_theme as $base) { // Include the theme file or the engine. if (!empty($base->owner)) { - include_once './'. $base->owner; + include_once './' . $base->owner; } } // and our theme gets one too. if (!empty($theme->owner)) { - include_once './'. $theme->owner; + include_once './' . $theme->owner; } } @@ -261,7 +261,7 @@ function drupal_rebuild_theme_registry() { * over how and when the preprocess functions are run. */ function _theme_process_registry(&$cache, $name, $type, $theme, $path) { - $function = $name .'_theme'; + $function = $name . '_theme'; if (function_exists($function)) { $result = $function($cache, $type, $theme, $path); @@ -271,7 +271,7 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) { // if function and file are left out, default to standard naming // conventions. if (!isset($info['template']) && !isset($info['function'])) { - $result[$hook]['function'] = ($type == 'module' ? 'theme_' : $name .'_') . $hook; + $result[$hook]['function'] = ($type == 'module' ? 'theme_' : $name . '_') . $hook; } // If a path is set in the info, use what was set. Otherwise use the // default path. This is mostly so system.module can declare theme @@ -279,15 +279,15 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) { // All files are included to be safe. Conditionally included // files can prevent them from getting registered. if (isset($info['file']) && !isset($info['path'])) { - $result[$hook]['file'] = $path .'/'. $info['file']; + $result[$hook]['file'] = $path . '/' . $info['file']; include_once($result[$hook]['file']); } elseif (isset($info['file']) && isset($info['path'])) { - include_once($info['path'] .'/'. $info['file']); + include_once($info['path'] . '/' . $info['file']); } if (isset($info['template']) && !isset($info['path'])) { - $result[$hook]['template'] = $path .'/'. $info['template']; + $result[$hook]['template'] = $path . '/' . $info['template']; } // If 'arguments' have been defined previously, carry them forward. // This should happen if a theme overrides a Drupal defined theme @@ -316,7 +316,7 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) { } elseif ($type == 'theme_engine') { // Theme engines get an extra set that come before the normally named preprocessors. - $prefixes[] = $name .'_engine'; + $prefixes[] = $name . '_engine'; // The theme engine also registers on behalf of the theme. The theme or engine name can be used. $prefixes[] = $name; $prefixes[] = $theme; @@ -327,11 +327,11 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) { } foreach ($prefixes as $prefix) { - if (function_exists($prefix .'_preprocess')) { - $info['preprocess functions'][] = $prefix .'_preprocess'; + if (function_exists($prefix . '_preprocess')) { + $info['preprocess functions'][] = $prefix . '_preprocess'; } - if (function_exists($prefix .'_preprocess_'. $hook)) { - $info['preprocess functions'][] = $prefix .'_preprocess_'. $hook; + if (function_exists($prefix . '_preprocess_' . $hook)) { + $info['preprocess functions'][] = $prefix . '_preprocess_' . $hook; } } } @@ -582,7 +582,7 @@ function theme() { if (!empty($info['file'])) { $include_file = $info['file']; if (isset($info['path'])) { - $include_file = $info['path'] .'/'. $include_file; + $include_file = $info['path'] . '/' . $include_file; } include_once($include_file); } @@ -613,10 +613,10 @@ function theme() { // If theme or theme engine is implementing this, it may have // a different extension and a different renderer. if ($info['type'] != 'module') { - if (function_exists($theme_engine .'_render_template')) { - $render_function = $theme_engine .'_render_template'; + if (function_exists($theme_engine . '_render_template')) { + $render_function = $theme_engine . '_render_template'; } - $extension_function = $theme_engine .'_extension'; + $extension_function = $theme_engine . '_extension'; if (function_exists($extension_function)) { $extension = $extension_function(); } @@ -654,7 +654,7 @@ function theme() { if (empty($template_file)) { $template_file = $info['template'] . $extension; if (isset($info['path'])) { - $template_file = $info['path'] .'/'. $template_file; + $template_file = $info['path'] . '/' . $template_file; } } $output = $render_function($template_file, $variables); @@ -678,7 +678,7 @@ function drupal_discover_template($paths, $suggestions, $extension = '.tpl.php') foreach ($suggestions as $suggestion) { if (!empty($suggestion)) { foreach ($paths as $path) { - if (file_exists($file = $path .'/'. $suggestion . $extension)) { + if (file_exists($file = $path . '/' . $suggestion . $extension)) { return $file; } } @@ -718,10 +718,10 @@ function drupal_find_theme_functions($cache, $prefixes) { foreach ($cache as $hook => $info) { foreach ($prefixes as $prefix) { if (!empty($info['pattern'])) { - $matches = preg_grep('/^'. $prefix .'_'. $info['pattern'] .'/', $functions['user']); + $matches = preg_grep('/^' . $prefix . '_' . $info['pattern'] . '/', $functions['user']); if ($matches) { foreach ($matches as $match) { - $new_hook = str_replace($prefix .'_', '', $match); + $new_hook = str_replace($prefix . '_', '', $match); $templates[$new_hook] = array( 'function' => $match, 'arguments' => $info['arguments'], @@ -729,9 +729,9 @@ function drupal_find_theme_functions($cache, $prefixes) { } } } - if (function_exists($prefix .'_'. $hook)) { + if (function_exists($prefix . '_' . $hook)) { $templates[$hook] = array( - 'function' => $prefix .'_'. $hook, + 'function' => $prefix . '_' . $hook, ); } } @@ -774,7 +774,7 @@ function drupal_find_theme_templates($cache, $extension, $path) { $subtheme_paths = isset($theme_paths[$theme]) ? $theme_paths[$theme] : array(); // Escape the periods in the extension. - $regex = str_replace('.', '\.', $extension) .'$'; + $regex = str_replace('.', '\.', $extension) . '$'; // Because drupal_system_listing works the way it does, we check for real // templates separately from checking for patterns. $files = drupal_system_listing($regex, $path, 'name', 0); @@ -808,7 +808,7 @@ function drupal_find_theme_templates($cache, $extension, $path) { // for the purposes of searching. $pattern = strtr($info['pattern'], '_', '-'); - $matches = preg_grep('/^'. $pattern .'/', $patterns); + $matches = preg_grep('/^' . $pattern . '/', $patterns); if ($matches) { foreach ($matches as $match) { $file = substr($match, 0, strpos($match, '.')); @@ -865,13 +865,13 @@ function theme_get_settings($key = NULL) { if (module_exists('node')) { foreach (node_get_types() as $type => $name) { - $defaults['toggle_node_info_'. $type] = 1; + $defaults['toggle_node_info_' . $type] = 1; } } $settings = array_merge($defaults, variable_get('theme_settings', array())); if ($key) { - $settings = array_merge($settings, variable_get(str_replace('/', '_', 'theme_'. $key .'_settings'), array())); + $settings = array_merge($settings, variable_get(str_replace('/', '_', 'theme_' . $key . '_settings'), array())); } // Only offer search box if search.module is enabled. @@ -918,7 +918,7 @@ function theme_get_setting($setting_name, $refresh = FALSE) { if ($settings['toggle_logo']) { if ($settings['default_logo']) { - $settings['logo'] = base_path() . dirname($theme_object->filename) .'/logo.png'; + $settings['logo'] = base_path() . dirname($theme_object->filename) . '/logo.png'; } elseif ($settings['logo_path']) { $settings['logo'] = base_path() . $settings['logo_path']; @@ -927,11 +927,11 @@ function theme_get_setting($setting_name, $refresh = FALSE) { if ($settings['toggle_favicon']) { if ($settings['default_favicon']) { - if (file_exists($favicon = dirname($theme_object->filename) .'/favicon.ico')) { + if (file_exists($favicon = dirname($theme_object->filename) . '/favicon.ico')) { $settings['favicon'] = base_path() . $favicon; } else { - $settings['favicon'] = base_path() .'misc/favicon.ico'; + $settings['favicon'] = base_path() . 'misc/favicon.ico'; } } elseif ($settings['favicon_path']) { @@ -1042,7 +1042,7 @@ function theme_render_template($file, $variables) { * The formatted text (html). */ function theme_placeholder($text) { - return ''. check_plain($text) .''; + return '' . check_plain($text) . ''; } /** @@ -1062,7 +1062,7 @@ function theme_status_messages($display = NULL) { if (count($messages) > 1) { $output .= "
      \n"; foreach ($messages as $message) { - $output .= '
    • '. $message ."
    • \n"; + $output .= '
    • ' . $message . "
    • \n"; } $output .= "
    \n"; } @@ -1088,7 +1088,7 @@ function theme_links($links, $attributes = array('class' => 'links')) { $output = ''; if (count($links) > 0) { - $output = ''; + $output = ''; $num_links = count($links); $i = 1; @@ -1106,7 +1106,7 @@ function theme_links($links, $attributes = array('class' => 'links')) { if (isset($link['href']) && ($link['href'] == $_GET['q'] || ($link['href'] == '' && drupal_is_front_page()))) { $class .= ' active'; } - $output .= '
  • '; + $output .= '
  • '; if (isset($link['href'])) { // Pass in $link as $options, they share the same keys. @@ -1121,7 +1121,7 @@ function theme_links($links, $attributes = array('class' => 'links')) { if (isset($link['attributes'])) { $span_attributes = drupal_attributes($link['attributes']); } - $output .= ''. $link['title'] .''; + $output .= '' . $link['title'] . ''; } $i++; @@ -1154,7 +1154,7 @@ function theme_image($path, $alt = '', $title = '', $attributes = NULL, $getsize if (!$getsize || (is_file($path) && (list($width, $height, $type, $image_attributes) = @getimagesize($path)))) { $attributes = drupal_attributes($attributes); $url = (url($path) == $path) ? $path : (base_path() . $path); - return ''. check_plain($alt) .''; + return '' . check_plain($alt) . ''; } } @@ -1167,7 +1167,7 @@ function theme_image($path, $alt = '', $title = '', $attributes = NULL, $getsize */ function theme_breadcrumb($breadcrumb) { if (!empty($breadcrumb)) { - return ''; + return ''; } } @@ -1178,7 +1178,7 @@ function theme_breadcrumb($breadcrumb) { */ function theme_help() { if ($help = menu_get_active_help()) { - return '
    '. $help .'
    '; + return '
    ' . $help . '
    '; } } @@ -1189,7 +1189,7 @@ function theme_help() { * An array of links. */ function theme_submenu($links) { - return ''; + return ''; } /** @@ -1242,13 +1242,13 @@ function theme_table($header, $rows, $attributes = array(), $caption = NULL) { drupal_add_js('misc/tableheader.js'); // Add 'sticky-enabled' class to the table to identify it for JS. // This is needed to target tables constructed by this function. - $attributes['class'] = empty($attributes['class']) ? 'sticky-enabled' : ($attributes['class'] .' sticky-enabled'); + $attributes['class'] = empty($attributes['class']) ? 'sticky-enabled' : ($attributes['class'] . ' sticky-enabled'); } - $output = '\n"; + $output = '\n"; if (isset($caption)) { - $output .= ''. $caption ."\n"; + $output .= '' . $caption . "\n"; } // Format the table header: @@ -1294,14 +1294,14 @@ function theme_table($header, $rows, $attributes = array(), $caption = NULL) { // Add odd/even class $class = $flip[$class]; if (isset($attributes['class'])) { - $attributes['class'] .= ' '. $class; + $attributes['class'] .= ' ' . $class; } else { $attributes['class'] = $class; } // Build row - $output .= ' '; + $output .= ' '; $i = 0; foreach ($cells as $cell) { $cell = tablesort_cell($cell, $header, $ts, $i++); @@ -1356,7 +1356,7 @@ function theme_tablesort_indicator($style) { * A string containing the box output. */ function theme_box($title, $content, $region = 'main') { - $output = '

    '. $title .'

    '. $content .'
    '; + $output = '

    ' . $title . '

    ' . $content . '
    '; return $output; } @@ -1374,10 +1374,10 @@ function theme_mark($type = MARK_NEW) { global $user; if ($user->uid) { if ($type == MARK_NEW) { - return ' '. t('new') .''; + return ' ' . t('new') . ''; } else if ($type == MARK_UPDATED) { - return ' '. t('updated') .''; + return ' ' . t('updated') . ''; } } } @@ -1403,11 +1403,11 @@ function theme_mark($type = MARK_NEW) { function theme_item_list($items = array(), $title = NULL, $type = 'ul', $attributes = NULL) { $output = '
    '; if (isset($title)) { - $output .= '

    '. $title .'

    '; + $output .= '

    ' . $title . '

    '; } if (!empty($items)) { - $output .= "<$type". drupal_attributes($attributes) .'>'; + $output .= "<$type" . drupal_attributes($attributes) . '>'; $num_items = count($items); foreach ($items as $i => $item) { $attributes = array(); @@ -1432,12 +1432,12 @@ function theme_item_list($items = array(), $title = NULL, $type = 'ul', $attribu $data .= theme_item_list($children, NULL, $type, $attributes); // Render nested list } if ($i == 0) { - $attributes['class'] = empty($attributes['class']) ? 'first' : ($attributes['class'] .' first'); + $attributes['class'] = empty($attributes['class']) ? 'first' : ($attributes['class'] . ' first'); } if ($i == $num_items - 1) { - $attributes['class'] = empty($attributes['class']) ? 'last' : ($attributes['class'] .' last'); + $attributes['class'] = empty($attributes['class']) ? 'last' : ($attributes['class'] . ' last'); } - $output .= ''. $data ."
  • \n"; + $output .= '' . $data . "\n"; } $output .= ""; } @@ -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 ''; + return ''; } /** @@ -1463,7 +1463,7 @@ function theme_more_help_link($url) { */ function theme_xml_icon($url) { if ($image = theme('image', 'misc/xml.png', t('XML feed'), t('XML feed'))) { - return ''. $image .''; + return '' . $image . ''; } } @@ -1477,7 +1477,7 @@ function theme_xml_icon($url) { */ function theme_feed_icon($url, $title) { if ($image = theme('image', 'misc/feed.png', t('Syndicate content'), $title)) { - return ''. $image .''; + return '' . $image . ''; } } @@ -1490,7 +1490,7 @@ function theme_feed_icon($url, $title) { * A descriptive verb for the link, like 'Read more' */ function theme_more_link($url, $title) { - return ''; + return ''; } /** @@ -1545,14 +1545,14 @@ function theme_username($object) { if ($object->uid && $object->name) { // Shorten the name when it is too long or it will break many tables. if (drupal_strlen($object->name) > 20) { - $name = drupal_substr($object->name, 0, 15) .'...'; + $name = drupal_substr($object->name, 0, 15) . '...'; } else { $name = $object->name; } if (user_access('access user profiles')) { - $output = l($name, 'user/'. $object->uid, array('title' => t('View user profile.'))); + $output = l($name, 'user/' . $object->uid, array('title' => t('View user profile.'))); } else { $output = check_plain($name); @@ -1570,7 +1570,7 @@ function theme_username($object) { $output = check_plain($object->name); } - $output .= ' ('. t('not verified') .')'; + $output .= ' (' . t('not verified') . ')'; } else { $output = variable_get('anonymous', t('Anonymous')); @@ -1591,9 +1591,9 @@ function theme_username($object) { */ function theme_progress_bar($percent, $message) { $output = '
    '; - $output .= '
    '; - $output .= '
    '. $percent .'%
    '; - $output .= '
    '. $message .'
    '; + $output .= '
    '; + $output .= '
    ' . $percent . '%
    '; + $output .= '
    ' . $message . '
    '; $output .= '
    '; return $output; @@ -1702,7 +1702,7 @@ function template_preprocess(&$variables, $hook) { function template_preprocess_page(&$variables) { // Add favicon if (theme_get_setting('toggle_favicon')) { - drupal_set_html_head(''); + drupal_set_html_head(''); } global $theme; @@ -1786,10 +1786,10 @@ function template_preprocess_page(&$variables) { // type (e.g. node, admin, user, etc.). To avoid illegal characters in the class, // we're removing everything disallowed. We are not using 'a-z' as that might leave // in certain international characters (e.g. German umlauts). - $body_classes[] = preg_replace('![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s', '', 'page-'. form_clean_id(drupal_strtolower(arg(0)))); + $body_classes[] = preg_replace('![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s', '', 'page-' . form_clean_id(drupal_strtolower(arg(0)))); // If on an individual node page, add the node type. if (isset($variables['node']) && $variables['node']->type) { - $body_classes[] = 'node-type-'. form_clean_id($variables['node']->type); + $body_classes[] = 'node-type-' . form_clean_id($variables['node']->type); } // Add information about the number of sidebars. if ($variables['layout'] == 'both') { @@ -1799,7 +1799,7 @@ function template_preprocess_page(&$variables) { $body_classes[] = 'no-sidebars'; } else { - $body_classes[] = 'one-sidebar sidebar-'. $variables['layout']; + $body_classes[] = 'one-sidebar sidebar-' . $variables['layout']; } // Implode with spaces. $variables['body_classes'] = implode(' ', $body_classes); @@ -1818,9 +1818,9 @@ function template_preprocess_page(&$variables) { $suggestion = 'page'; $suggestions = array(); while ($arg = arg($i++)) { - $suggestions[] = $suggestion .'-'. $arg; + $suggestions[] = $suggestion . '-' . $arg; if (!is_numeric($arg)) { - $suggestion .= '-'. $arg; + $suggestion .= '-' . $arg; } } if (drupal_is_front_page()) { @@ -1868,7 +1868,7 @@ function template_preprocess_node(&$variables) { $variables['date'] = format_date($node->created); $variables['links'] = !empty($node->links) ? theme('links', $node->links, array('class' => 'links inline')) : ''; $variables['name'] = theme('username', $node); - $variables['node_url'] = url('node/'. $node->nid); + $variables['node_url'] = url('node/' . $node->nid); $variables['terms'] = theme('links', $variables['taxonomy'], array('class' => 'links inline')); $variables['title'] = check_plain($node->title); @@ -1876,7 +1876,7 @@ function template_preprocess_node(&$variables) { $variables = array_merge((array)$node, $variables); // Display info only on certain node types. - if (theme_get_setting('toggle_node_info_'. $node->type)) { + if (theme_get_setting('toggle_node_info_' . $node->type)) { $variables['submitted'] = theme('node_submitted', $node); $variables['picture'] = theme_get_setting('toggle_node_user_picture') ? theme('user_picture', $node) : ''; } @@ -1885,7 +1885,7 @@ function template_preprocess_node(&$variables) { $variables['picture'] = ''; } // Clean up name so there are no underscores. - $variables['template_files'][] = 'node-'. $node->type; + $variables['template_files'][] = 'node-' . $node->type; } /** @@ -1915,8 +1915,8 @@ function template_preprocess_block(&$variables) { $variables['block_zebra'] = ($block_counter[$variables['block']->region] % 2) ? 'odd' : 'even'; $variables['block_id'] = $block_counter[$variables['block']->region]++; - $variables['template_files'][] = 'block-'. $variables['block']->region; - $variables['template_files'][] = 'block-'. $variables['block']->module; - $variables['template_files'][] = 'block-'. $variables['block']->module .'-'. $variables['block']->delta; + $variables['template_files'][] = 'block-' . $variables['block']->region; + $variables['template_files'][] = 'block-' . $variables['block']->module; + $variables['template_files'][] = 'block-' . $variables['block']->module . '-' . $variables['block']->delta; } diff --git a/includes/theme.maintenance.inc b/includes/theme.maintenance.inc index 9a99e833e6ebeedd0792b00dba26abfd6026e51c..965eed45091eff1c609a2f3fb38dda58e0163ec5 100644 --- a/includes/theme.maintenance.inc +++ b/includes/theme.maintenance.inc @@ -62,10 +62,10 @@ function _drupal_maintenance_theme() { // These are usually added from system_init() -except maintenance.css. // When the database is inactive it's not called so we add it here. - drupal_add_css(drupal_get_path('module', 'system') .'/defaults.css', 'module'); - drupal_add_css(drupal_get_path('module', 'system') .'/system.css', 'module'); - drupal_add_css(drupal_get_path('module', 'system') .'/system-menus.css', 'module'); - drupal_add_css(drupal_get_path('module', 'system') .'/maintenance.css', 'module'); + drupal_add_css(drupal_get_path('module', 'system') . '/defaults.css', 'module'); + drupal_add_css(drupal_get_path('module', 'system') . '/system.css', 'module'); + drupal_add_css(drupal_get_path('module', 'system') . '/system-menus.css', 'module'); + drupal_add_css(drupal_get_path('module', 'system') . '/maintenance.css', 'module'); } /** @@ -92,7 +92,7 @@ function theme_task_list($items, $active = NULL) { else { $class = $done ? 'done' : ''; } - $output .= '
  • '. $item .'
  • '; + $output .= '
  • ' . $item . '
  • '; } $output .= ''; return $output; @@ -120,22 +120,22 @@ function theme_install_page($content) { $messages = drupal_set_message(); if (isset($messages['error'])) { $title = count($messages['error']) > 1 ? st('The following errors must be resolved before you can continue the installation process') : st('The following error must be resolved before you can continue the installation process'); - $variables['messages'] .= '

    '. $title .':

    '; + $variables['messages'] .= '

    ' . $title . ':

    '; $variables['messages'] .= theme('status_messages', 'error'); - $variables['content'] .= '

    '. st('Please check the error messages and try again.', array('!url' => request_uri())) .'

    '; + $variables['content'] .= '

    ' . st('Please check the error messages and try again.', array('!url' => request_uri())) . '

    '; } // Special handling of warning messages if (isset($messages['warning'])) { $title = count($messages['warning']) > 1 ? st('The following installation warnings should be carefully reviewed') : st('The following installation warning should be carefully reviewed'); - $variables['messages'] .= '

    '. $title .':

    '; + $variables['messages'] .= '

    ' . $title . ':

    '; $variables['messages'] .= theme('status_messages', 'warning'); } // Special handling of status messages if (isset($messages['status'])) { $title = count($messages['status']) > 1 ? st('The following installation warnings should be carefully reviewed, but in most cases may be safely ignored') : st('The following installation warning should be carefully reviewed, but in most cases may be safely ignored'); - $variables['messages'] .= '

    '. $title .':

    '; + $variables['messages'] .= '

    ' . $title . ':

    '; $variables['messages'] .= theme('status_messages', 'status'); } @@ -173,7 +173,7 @@ function theme_update_page($content, $show_messages = TRUE) { $messages = drupal_set_message(); if (isset($messages['warning'])) { $title = count($messages['warning']) > 1 ? 'The following update warnings should be carefully reviewed before continuing' : 'The following update warning should be carefully reviewed before continuing'; - $variables['messages'] .= '

    '. $title .':

    '; + $variables['messages'] .= '

    ' . $title . ':

    '; $variables['messages'] .= theme('status_messages', 'warning'); } @@ -205,7 +205,7 @@ function theme_update_page($content, $show_messages = TRUE) { function template_preprocess_maintenance_page(&$variables) { // Add favicon if (theme_get_setting('toggle_favicon')) { - drupal_set_html_head(''); + drupal_set_html_head(''); } global $theme; @@ -276,7 +276,7 @@ function template_preprocess_maintenance_page(&$variables) { $body_classes[] = 'no-sidebars'; } else { - $body_classes[] = 'one-sidebar sidebar-'. $variables['layout']; + $body_classes[] = 'one-sidebar sidebar-' . $variables['layout']; } $variables['body_classes'] = implode(' ', $body_classes); diff --git a/includes/unicode.inc b/includes/unicode.inc index 19c74422bfcf67fd2dac8fd1cd0e923dfeb683b3..cb3b0a8fcff0e5fdf900fb954f44797f9580949a 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 c7751e1c1caf3416f7c565573c9f3052da4ef0ca..569871b8fd6492a09f08b35ec2a0b7cc1168141b 100644 --- a/includes/xmlrpc.inc +++ b/includes/xmlrpc.inc @@ -90,32 +90,32 @@ function xmlrpc_value_calculate_type(&$xmlrpc_value) { function xmlrpc_value_get_xml($xmlrpc_value) { switch ($xmlrpc_value->type) { case 'boolean': - return ''. (($xmlrpc_value->data) ? '1' : '0') .''; + return '' . (($xmlrpc_value->data) ? '1' : '0') . ''; break; case 'int': - return ''. $xmlrpc_value->data .''; + return '' . $xmlrpc_value->data . ''; break; case 'double': - return ''. $xmlrpc_value->data .''; + return '' . $xmlrpc_value->data . ''; break; case 'string': // Note: we don't escape apostrophes because of the many blogging clients // that don't support numerical entities (and XML in general) properly. - return ''. htmlspecialchars($xmlrpc_value->data) .''; + return '' . htmlspecialchars($xmlrpc_value->data) . ''; break; case 'array': - $return = ''."\n"; + $return = '' . "\n"; foreach ($xmlrpc_value->data as $item) { - $return .= ' '. xmlrpc_value_get_xml($item) ."\n"; + $return .= ' ' . xmlrpc_value_get_xml($item) . "\n"; } $return .= ''; return $return; break; case 'struct': - $return = ''."\n"; + $return = '' . "\n"; foreach ($xmlrpc_value->data as $name => $value) { - $return .= " ". check_plain($name) .""; - $return .= xmlrpc_value_get_xml($value) ."\n"; + $return .= " " . check_plain($name) . ""; + $return .= xmlrpc_value_get_xml($value) . "\n"; } $return .= ''; return $return; @@ -158,7 +158,7 @@ function xmlrpc_message($message) { */ function xmlrpc_message_parse(&$xmlrpc_message) { // First remove the XML declaration - $xmlrpc_message->message = preg_replace('/<\?xml(.*)?\?'.'>/', '', $xmlrpc_message->message); + $xmlrpc_message->message = preg_replace('/<\?xml(.*)?\?' . '>/', '', $xmlrpc_message->message); if (trim($xmlrpc_message->message) == '') { return FALSE; } @@ -403,7 +403,7 @@ function xmlrpc_date($time) { } function xmlrpc_date_get_xml($xmlrpc_date) { - return ''. $xmlrpc_date->year . $xmlrpc_date->month . $xmlrpc_date->day .'T'. $xmlrpc_date->hour .':'. $xmlrpc_date->minute .':'. $xmlrpc_date->second .''; + return '' . $xmlrpc_date->year . $xmlrpc_date->month . $xmlrpc_date->day . 'T' . $xmlrpc_date->hour . ':' . $xmlrpc_date->minute . ':' . $xmlrpc_date->second . ''; } function xmlrpc_base64($data) { @@ -414,7 +414,7 @@ function xmlrpc_base64($data) { } function xmlrpc_base64_get_xml($xmlrpc_base64) { - return ''. base64_encode($xmlrpc_base64->data) .''; + return '' . base64_encode($xmlrpc_base64->data) . ''; } /** diff --git a/includes/xmlrpcs.inc b/includes/xmlrpcs.inc index 11744a98e0e2f02ae679c0c0743d454b276e1abd..33e5bb209e92c92ec27e1f4807805390e16c96b0 100644 --- a/includes/xmlrpcs.inc +++ b/includes/xmlrpcs.inc @@ -77,9 +77,9 @@ function xmlrpc_server($callbacks) { - '. + ' . xmlrpc_value_get_xml($r) - .' + . ' @@ -105,11 +105,11 @@ function xmlrpc_server_error($error, $message = FALSE) { } function xmlrpc_server_output($xml) { - $xml = ''."\n". $xml; + $xml = '' . "\n" . $xml; header('Connection: close'); - header('Content-Length: '. strlen($xml)); + header('Content-Length: ' . strlen($xml)); header('Content-Type: text/xml'); - header('Date: '. date('r')); + header('Date: ' . date('r')); echo $xml; exit; } diff --git a/install.php b/install.php index aa3b8a4b11bd945227a471c51867291b9e7cefd1..0341500008a89b3a540df3ea06b07fbb5a42a71a 100644 --- a/install.php +++ b/install.php @@ -159,7 +159,7 @@ function install_verify_settings() { $db_host = urldecode($url['host']); $db_port = isset($url['port']) ? urldecode($url['port']) : ''; $db_path = ltrim(urldecode($url['path']), '/'); - $settings_file = './'. conf_path(FALSE, TRUE) .'/settings.php'; + $settings_file = './' . conf_path(FALSE, TRUE) . '/settings.php'; $form_state = array(); _install_settings_form_validate($db_prefix, $db_type, $db_user, $db_pass, $db_host, $db_port, $db_path, $settings_file, $form_state); @@ -182,8 +182,8 @@ function install_change_settings($profile = 'default', $install_locale = '') { $db_host = isset($url['host']) ? urldecode($url['host']) : ''; $db_port = isset($url['port']) ? urldecode($url['port']) : ''; $db_path = ltrim(urldecode($url['path']), '/'); - $conf_path = './'. conf_path(FALSE, TRUE); - $settings_file = $conf_path .'/settings.php'; + $conf_path = './' . conf_path(FALSE, TRUE); + $settings_file = $conf_path . '/settings.php'; // We always need this because we want to run form_get_errors. include_once './includes/form.inc'; @@ -227,7 +227,7 @@ function install_settings_form(&$form_state, $profile, $install_locale, $setting $form['basic_options'] = array( '#type' => 'fieldset', '#title' => st('Basic options'), - '#description' => '

    '. st('To set up your @drupal database, enter the following information.', array('@drupal' => drupal_install_profile_name())) .'

    ', + '#description' => '

    ' . st('To set up your @drupal database, enter the following information.', array('@drupal' => drupal_install_profile_name())) . '

    ', ); if (count($db_types) > 1) { @@ -312,7 +312,7 @@ function install_settings_form(&$form_state, $profile, $install_locale, $setting ); // Table prefix - $prefix = ($profile == 'default') ? 'drupal_' : $profile .'_'; + $prefix = ($profile == 'default') ? 'drupal_' : $profile . '_'; $form['advanced_options']['db_prefix'] = array( '#type' => 'textfield', '#title' => st('Table prefix'), @@ -330,7 +330,7 @@ function install_settings_form(&$form_state, $profile, $install_locale, $setting $form['errors'] = array(); $form['settings_file'] = array('#type' => 'value', '#value' => $settings_file); $form['_db_url'] = array('#type' => 'value'); - $form['#action'] = "install.php?profile=$profile". ($install_locale ? "&locale=$install_locale" : ''); + $form['#action'] = "install.php?profile=$profile" . ($install_locale ? "&locale=$install_locale" : ''); $form['#redirect'] = FALSE; } return $form; @@ -370,13 +370,13 @@ function _install_settings_form_validate($db_prefix, $db_type, $db_user, $db_pas } else { // Verify - $db_url = $db_type .'://'. urlencode($db_user) . ($db_pass ? ':'. urlencode($db_pass) : '') .'@'. ($db_host ? urlencode($db_host) : 'localhost') . ($db_port ? ":$db_port" : '') .'/'. urlencode($db_path); + $db_url = $db_type . '://' . urlencode($db_user) . ($db_pass ? ':' . urlencode($db_pass) : '') . '@' . ($db_host ? urlencode($db_host) : 'localhost') . ($db_port ? ":$db_port" : '') . '/' . urlencode($db_path); if (isset($form)) { form_set_value($form['_db_url'], $db_url, $form_state); } $success = array(); - $function = 'drupal_test_'. $db_type; + $function = 'drupal_test_' . $db_type; if (!$function($db_url, $success)) { if (isset($success['CONNECT'])) { form_set_error('db_type', st('In order for Drupal to work, and to continue with the installation process, you must resolve all permission issues reported above. We were able to verify that we have permission for the following commands: %commands. For more help with configuring your database server, see the Installation and upgrading handbook. If you are unsure what any of this means you should probably contact your hosting provider.', array('%commands' => implode($success, ', ')))); @@ -406,7 +406,7 @@ function install_settings_form_submit($form, &$form_state) { drupal_rewrite_settings($settings); // Continue to install profile step - install_goto("install.php?profile=$profile". ($install_locale ? "&locale=$install_locale" : '')); + install_goto("install.php?profile=$profile" . ($install_locale ? "&locale=$install_locale" : '')); } /** @@ -454,7 +454,7 @@ function install_select_profile_form(&$form_state, $profiles) { foreach ($profiles as $profile) { include_once($profile->filename); // Load profile details. - $function = $profile->name .'_profile_details'; + $function = $profile->name . '_profile_details'; if (function_exists($function)) { $details = $function(); } @@ -480,7 +480,7 @@ function install_select_profile_form(&$form_state, $profiles) { * Find all .po files for the current profile. */ function install_find_locales($profilename) { - $locales = file_scan_directory('./profiles/'. $profilename .'/translations', '\.po$', array('.', '..', 'CVS'), 0, FALSE); + $locales = file_scan_directory('./profiles/' . $profilename . '/translations', '\.po$', array('.', '..', 'CVS'), 0, FALSE); array_unshift($locales, (object) array('name' => 'en')); return $locales; } @@ -507,16 +507,16 @@ function install_select_locale($profilename) { install_task_list('locale-select'); drupal_set_title(st('Choose language')); if (!empty($_GET['localize'])) { - $output = '

    '. st('With the addition of an appropriate translation package, this installer is capable of proceeding in another language of your choice. To install and use Drupal in a language other than English:') .'

    '; - $output .= '
    • '. st('Determine if a translation of this Drupal version is available in your language of choice. A translation is provided via a translation package; each translation package enables the display of a specific version of Drupal in a specific language. Not all languages are available for every version of Drupal.', array('@translations' => 'http://drupal.org/project/translations')) .'
    • '; - $output .= '
    • '. st('If an alternative translation package of your choice is available, download and extract its contents to your Drupal root directory.') .'
    • '; - $output .= '
    • '. st('Return to choose language using the second link below and select your desired language from the displayed list. Reloading the page allows the list to automatically adjust to the presence of new translation packages.') .'
    • '; - $output .= '

    '. st('Alternatively, to install and use Drupal in English, or to defer the selection of an alternative language until after installation, select the first link below.') .'

    '; - $output .= '

    '. st('How should the installation continue?') .'

    '; - $output .= ''; + $output = '

    ' . st('With the addition of an appropriate translation package, this installer is capable of proceeding in another language of your choice. To install and use Drupal in a language other than English:') . '

    '; + $output .= '
    • ' . st('Determine if a translation of this Drupal version is available in your language of choice. A translation is provided via a translation package; each translation package enables the display of a specific version of Drupal in a specific language. Not all languages are available for every version of Drupal.', array('@translations' => 'http://drupal.org/project/translations')) . '
    • '; + $output .= '
    • ' . st('If an alternative translation package of your choice is available, download and extract its contents to your Drupal root directory.') . '
    • '; + $output .= '
    • ' . st('Return to choose language using the second link below and select your desired language from the displayed list. Reloading the page allows the list to automatically adjust to the presence of new translation packages.') . '
    • '; + $output .= '

    ' . st('Alternatively, to install and use Drupal in English, or to defer the selection of an alternative language until after installation, select the first link below.') . '

    '; + $output .= '

    ' . st('How should the installation continue?') . '

    '; + $output .= ''; } else { - $output = ''; + $output = ''; } print theme('install_page', $output); exit; @@ -527,7 +527,7 @@ function install_select_locale($profilename) { } else { // Allow profile to pre-select the language, skipping the selection. - $function = $profilename .'_profile_details'; + $function = $profilename . '_profile_details'; if (function_exists($function)) { $details = $function(); if (isset($details['language'])) { @@ -563,13 +563,13 @@ function install_select_locale_form(&$form_state, $locales) { // Try to use verbose locale name $name = $locale->name; if (isset($languages[$name])) { - $name = $languages[$name][0] . (isset($languages[$name][1]) ? ' '. st('(@language)', array('@language' => $languages[$name][1])) : ''); + $name = $languages[$name][0] . (isset($languages[$name][1]) ? ' ' . st('(@language)', array('@language' => $languages[$name][1])) : ''); } $form['locale'][$locale->name] = array( '#type' => 'radio', '#return_value' => $locale->name, '#default_value' => ($locale->name == 'en' ? TRUE : FALSE), - '#title' => $name . ($locale->name == 'en' ? ' '. st('(built-in)') : ''), + '#title' => $name . ($locale->name == 'en' ? ' ' . st('(built-in)') : ''), '#parents' => array('locale') ); } @@ -586,7 +586,7 @@ function install_select_locale_form(&$form_state, $locales) { function install_no_profile_error() { install_task_list('profile-select'); drupal_set_title(st('No profiles available')); - print theme('install_page', '

    '. st('We were unable to find any installer profiles. Installer profiles tell us what modules to enable and what schema to install in the database. A profile is necessary to continue with the installation process.') .'

    '); + print theme('install_page', '

    ' . st('We were unable to find any installer profiles. Installer profiles tell us what modules to enable and what schema to install in the database. A profile is necessary to continue with the installation process.') . '

    '); exit; } @@ -614,7 +614,7 @@ function install_tasks($profile, $task) { $_SESSION['messages'] = $messages; // URL used to direct page requests. - $url = $base_url .'/install.php?locale='. $install_locale .'&profile='. $profile; + $url = $base_url . '/install.php?locale=' . $install_locale . '&profile=' . $profile; // Build a page for final tasks. if (empty($task)) { @@ -697,8 +697,8 @@ function install_tasks($profile, $task) { drupal_set_title(st('Configure site')); // Warn about settings.php permissions risk - $settings_dir = './'. conf_path(); - $settings_file = $settings_dir .'/settings.php'; + $settings_dir = './' . conf_path(); + $settings_file = $settings_dir . '/settings.php'; if (!drupal_verify_install_file($settings_file, FILE_EXIST|FILE_READABLE|FILE_NOT_WRITABLE) || !drupal_verify_install_file($settings_dir, FILE_NOT_WRITABLE, 'dir')) { drupal_set_message(st('All necessary changes to %dir and %file have been made, so you should remove write permissions to them now in order to avoid security risks. If you are unsure how to do so, please consult the on-line handbook.', array('%dir' => $settings_dir, '%file' => $settings_file, '@handbook_url' => 'http://drupal.org/getting-started')), 'error'); } @@ -708,7 +708,7 @@ function install_tasks($profile, $task) { // Add JavaScript validation. _user_password_dynamic_validation(); - drupal_add_js(drupal_get_path('module', 'system') .'/system.js', 'module'); + drupal_add_js(drupal_get_path('module', 'system') . '/system.js', 'module'); // We add these strings as settings because JavaScript translation does not // work on install time. drupal_add_js(array('copyFieldValue' => array('edit-site-mail' => array('edit-account-mail')), 'cleanURL' => array('success' => st('Your server has been successfully tested to support this feature.'), 'failure' => st('Your system configuration does not currently support this feature. The handbook page on Clean URLs has additional troubleshooting information.'), 'testing' => st('Testing clean URLs...'))), 'setting'); @@ -733,7 +733,7 @@ function install_tasks($profile, $task) { // 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 @@ function install_tasks($profile, $task) { if ($task == 'finished') { drupal_set_title(st('@drupal installation complete', array('@drupal' => drupal_install_profile_name()))); $messages = drupal_set_message(); - $output = '

    '. st('Congratulations, @drupal has been successfully installed.', array('@drupal' => drupal_install_profile_name())) .'

    '; - $output .= '

    '. (isset($messages['error']) ? st('Please review the messages above before continuing on to your new site.', array('@url' => url(''))) : st('You may now visit your new site.', array('@url' => url('')))) .'

    '; + $output = '

    ' . st('Congratulations, @drupal has been successfully installed.', array('@drupal' => drupal_install_profile_name())) . '

    '; + $output .= '

    ' . (isset($messages['error']) ? st('Please review the messages above before continuing on to your new site.', array('@url' => url(''))) : st('You may now visit your new site.', array('@url' => url('')))) . '

    '; $task = 'done'; } @@ -821,7 +821,7 @@ function _install_module_batch($module, $module_name, &$context) { // steps. module_enable(array($module)); $context['results'][] = $module; - $context['message'] = 'Installed '. $module_name .' module.'; + $context['message'] = 'Installed ' . $module_name . ' module.'; } /** @@ -866,8 +866,8 @@ function install_check_requirements($profile, $verify) { // If Drupal is not set up already, we need to create a settings file. if (!$verify) { $writable = FALSE; - $conf_path = './'. conf_path(FALSE, TRUE); - $settings_file = $conf_path .'/settings.php'; + $conf_path = './' . conf_path(FALSE, TRUE); + $settings_file = $conf_path . '/settings.php'; $file = $conf_path; // Verify that the directory exists. if (drupal_verify_install_file($conf_path, FILE_EXIST, 'dir')) { @@ -899,7 +899,7 @@ function install_check_requirements($profile, $verify) { if (isset($requirement['severity']) && $requirement['severity'] == REQUIREMENT_ERROR) { $message = $requirement['description']; if (isset($requirement['value']) && $requirement['value']) { - $message .= ' ('. st('Currently using !item !version', array('!item' => $requirement['title'], '!version' => $requirement['value'])) .')'; + $message .= ' (' . st('Currently using !item !version', array('!item' => $requirement['title'], '!version' => $requirement['value'])) . ')'; } drupal_set_message($message, 'error'); } @@ -911,7 +911,7 @@ function install_check_requirements($profile, $verify) { if (isset($requirement['severity']) && $requirement['severity'] == REQUIREMENT_WARNING) { $message = $requirement['description']; if (isset($requirement['value']) && $requirement['value']) { - $message .= ' ('. st('Currently using !item !version', array('!item' => $requirement['title'], '!version' => $requirement['value'])) .')'; + $message .= ' (' . st('Currently using !item !version', array('!item' => $requirement['title'], '!version' => $requirement['value'])) . ')'; } drupal_set_message($message, 'warning'); } @@ -947,7 +947,7 @@ function install_task_list($active = NULL) { // Add tasks defined by the profile. if ($profile) { - $function = $profile .'_profile_task_list'; + $function = $profile . '_profile_task_list'; if (function_exists($function)) { $result = $function(); if (is_array($result)) { @@ -1013,7 +1013,7 @@ function install_configure_form(&$form_state, $url) { ); $form['admin_account']['account']['#tree'] = TRUE; $form['admin_account']['markup'] = array( - '#value' => '

    '. st('The administrator account has complete access to the site; it will automatically be granted all permissions and can perform any administrative activity. This will be the only account that can perform certain activities, so keep its credentials safe.') .'

    ', + '#value' => '

    ' . st('The administrator account has complete access to the site; it will automatically be granted all permissions and can perform any administrative activity. This will be the only account that can perform certain activities, so keep its credentials safe.') . '

    ', '#weight' => -10, ); @@ -1085,7 +1085,7 @@ function install_configure_form(&$form_state, $url) { // Allow the profile to alter this form. $form_state isn't available // here, but to conform to the hook_form_alter() signature, we pass // an empty array. - $hook_form_alter = $_GET['profile'] .'_form_alter'; + $hook_form_alter = $_GET['profile'] . '_form_alter'; if (function_exists($hook_form_alter)) { $hook_form_alter($form, array(), 'install_configure'); } diff --git a/modules/aggregator/aggregator.admin.inc b/modules/aggregator/aggregator.admin.inc index 2f1485cf50473b3b5ac80d33135650ef7936403c..38b273c8fceb087b0227e8814f0f8f0afd32f4d2 100644 --- a/modules/aggregator/aggregator.admin.inc +++ b/modules/aggregator/aggregator.admin.inc @@ -22,7 +22,7 @@ function aggregator_admin_overview() { function aggregator_view() { $result = db_query('SELECT f.*, COUNT(i.iid) AS items FROM {aggregator_feed} f LEFT JOIN {aggregator_item} i ON f.fid = i.fid GROUP BY f.fid, f.title, f.url, f.refresh, f.checked, f.link, f.description, f.etag, f.modified, f.image, f.block ORDER BY f.title'); - $output = '

    '. t('Feed overview') .'

    '; + $output = '

    ' . t('Feed overview') . '

    '; $header = array(t('Title'), t('Items'), t('Last update'), t('Next update'), array('data' => t('Operations'), 'colspan' => '3')); $rows = array(); @@ -33,7 +33,7 @@ function aggregator_view() { $result = db_query('SELECT c.cid, c.title, count(ci.iid) as items FROM {aggregator_category} c LEFT JOIN {aggregator_category_item} ci ON c.cid = ci.cid GROUP BY c.cid, c.title ORDER BY title'); - $output .= '

    '. t('Category overview') .'

    '; + $output .= '

    ' . t('Category overview') . '

    '; $header = array(t('Title'), t('Items'), t('Operations')); $rows = array(); @@ -153,7 +153,7 @@ function aggregator_form_feed_submit($form, &$form_state) { return; } else { - $form_state['redirect'] = 'aggregator/sources/'. $form_state['values']['fid']; + $form_state['redirect'] = 'aggregator/sources/' . $form_state['values']['fid']; return; } } @@ -317,7 +317,7 @@ function aggregator_form_category_submit($form, &$form_state) { return; } else { - $form_state['redirect'] = 'aggregator/categories/'. $form_state['values']['cid']; + $form_state['redirect'] = 'aggregator/categories/' . $form_state['values']['cid']; return; } } diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index 36f5eb0eb867f7e576634c7c6bc0021d02d1f9b0..7b749ec28e19545958e9c83957c9b91d569b628f 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -12,18 +12,18 @@ function aggregator_help($path, $arg) { switch ($path) { case 'admin/help#aggregator': - $output = '

    '. t('The aggregator is a powerful on-site syndicator and news reader that gathers fresh content from RSS-, RDF-, and Atom-based feeds made available across the web. Thousands of sites (particularly news sites and blogs) publish their latest headlines and posts in feeds, using a number of standardized XML-based formats. Formats supported by the aggregator include RSS, RDF, and Atom.', array('@rss' => 'http://cyber.law.harvard.edu/rss/', '@rdf' => 'http://www.w3.org/RDF/', '@atom' => 'http://www.atomenabled.org')) .'

    '; - $output .= '

    '. t('Feeds contain feed items, or individual posts published by the site providing the feed. Feeds may be grouped in categories, generally by topic. Users view feed items in the main aggregator display or by their source. Administrators can add, edit and delete feeds and choose how often to check each feed for newly updated items. The most recent items in either a feed or category can be displayed as a block through the blocks administration page. A machine-readable OPML file of all feeds is available. A correctly configured cron maintenance task is required to update feeds automatically.', array('@aggregator' => url('aggregator'), '@aggregator-sources' => url('aggregator/sources'), '@feededit' => url('admin/content/aggregator'), '@admin-block' => url('admin/build/block'), '@aggregator-opml' => url('aggregator/opml'), '@cron' => url('admin/reports/status'))) .'

    '; - $output .= '

    '. t('For more information, see the online handbook entry for Aggregator module.', array('@aggregator' => 'http://drupal.org/handbook/modules/aggregator/')) .'

    '; + $output = '

    ' . t('The aggregator is a powerful on-site syndicator and news reader that gathers fresh content from RSS-, RDF-, and Atom-based feeds made available across the web. Thousands of sites (particularly news sites and blogs) publish their latest headlines and posts in feeds, using a number of standardized XML-based formats. Formats supported by the aggregator include RSS, RDF, and Atom.', array('@rss' => 'http://cyber.law.harvard.edu/rss/', '@rdf' => 'http://www.w3.org/RDF/', '@atom' => 'http://www.atomenabled.org')) . '

    '; + $output .= '

    ' . t('Feeds contain feed items, or individual posts published by the site providing the feed. Feeds may be grouped in categories, generally by topic. Users view feed items in the main aggregator display or by their source. Administrators can add, edit and delete feeds and choose how often to check each feed for newly updated items. The most recent items in either a feed or category can be displayed as a block through the blocks administration page. A machine-readable OPML file of all feeds is available. A correctly configured cron maintenance task is required to update feeds automatically.', array('@aggregator' => url('aggregator'), '@aggregator-sources' => url('aggregator/sources'), '@feededit' => url('admin/content/aggregator'), '@admin-block' => url('admin/build/block'), '@aggregator-opml' => url('aggregator/opml'), '@cron' => url('admin/reports/status'))) . '

    '; + $output .= '

    ' . t('For more information, see the online handbook entry for Aggregator module.', array('@aggregator' => 'http://drupal.org/handbook/modules/aggregator/')) . '

    '; return $output; case 'admin/content/aggregator': - $output = '

    '. t('Thousands of sites (particularly news sites and blogs) publish their latest headlines and posts in feeds, using a number of standardized XML-based formats. Formats supported by the aggregator include RSS, RDF, and Atom.', array('@rss' => 'http://cyber.law.harvard.edu/rss/', '@rdf' => 'hsttp://www.w3.org/RDF/', '@atom' => 'http://www.atomenabled.org')) .'

    '; - $output .= '

    '. t('Current feeds are listed below, and new feeds may be added. For each feed or feed category, the latest items block may be enabled at the blocks administration page.', array('@addfeed' => url('admin/content/aggregator/add/feed'), '@block' => url('admin/build/block'))) .'

    '; + $output = '

    ' . t('Thousands of sites (particularly news sites and blogs) publish their latest headlines and posts in feeds, using a number of standardized XML-based formats. Formats supported by the aggregator include RSS, RDF, and Atom.', array('@rss' => 'http://cyber.law.harvard.edu/rss/', '@rdf' => 'hsttp://www.w3.org/RDF/', '@atom' => 'http://www.atomenabled.org')) . '

    '; + $output .= '

    ' . t('Current feeds are listed below, and new feeds may be added. For each feed or feed category, the latest items block may be enabled at the blocks administration page.', array('@addfeed' => url('admin/content/aggregator/add/feed'), '@block' => url('admin/build/block'))) . '

    '; return $output; case 'admin/content/aggregator/add/feed': - return '

    '. t('Add a feed in RSS, RDF or Atom format. A feed may only have one entry.') .'

    '; + return '

    ' . t('Add a feed in RSS, RDF or Atom format. A feed may only have one entry.') . '

    '; case 'admin/content/aggregator/add/category': - return '

    '. t('Categories allow feed items from different feeds to be grouped together. For example, several sport-related feeds may belong to a category named Sports. Feed items may be grouped automatically (by selecting a category when creating or editing a feed) or manually (via the Categorize page available from feed item listings). Each category provides its own feed page and block.') .'

    '; + return '

    ' . t('Categories allow feed items from different feeds to be grouped together. For example, several sport-related feeds may belong to a category named Sports. Feed items may be grouped automatically (by selecting a category when creating or editing a feed) or manually (via the Categorize page available from feed item listings). Each category provides its own feed page and block.') . '

    '; } } @@ -260,7 +260,7 @@ function _aggregator_category_title($category) { * Implementation of hook_init(). */ function aggregator_init() { - drupal_add_css(drupal_get_path('module', 'aggregator') .'/aggregator.css'); + drupal_add_css(drupal_get_path('module', 'aggregator') . '/aggregator.css'); } /** @@ -305,11 +305,11 @@ function aggregator_block($op = 'list', $delta = '', $edit = array()) { if ($op == 'list') { $result = db_query('SELECT cid, title FROM {aggregator_category} ORDER BY title'); while ($category = db_fetch_object($result)) { - $block['category-'. $category->cid]['info'] = t('!title category latest items', array('!title' => $category->title)); + $block['category-' . $category->cid]['info'] = t('!title category latest items', array('!title' => $category->title)); } $result = db_query('SELECT fid, title FROM {aggregator_feed} ORDER BY fid'); while ($feed = db_fetch_object($result)) { - $block['feed-'. $feed->fid]['info'] = t('!title feed latest items', array('!title' => $feed->title)); + $block['feed-' . $feed->fid]['info'] = t('!title feed latest items', array('!title' => $feed->title)); } } else if ($op == 'configure') { @@ -339,7 +339,7 @@ function aggregator_block($op = 'list', $delta = '', $edit = array()) { if ($feed = db_fetch_object(db_query('SELECT fid, title, block FROM {aggregator_feed} WHERE fid = %d', $id))) { $block['subject'] = check_plain($feed->title); $result = db_query_range('SELECT * FROM {aggregator_item} WHERE fid = %d ORDER BY timestamp DESC, iid DESC', $feed->fid, 0, $feed->block); - $read_more = theme('more_link', url('aggregator/sources/'. $feed->fid), t("View this feed's recent news.")); + $read_more = theme('more_link', url('aggregator/sources/' . $feed->fid), t("View this feed's recent news.")); } break; @@ -347,7 +347,7 @@ function aggregator_block($op = 'list', $delta = '', $edit = array()) { if ($category = db_fetch_object(db_query('SELECT cid, title, block FROM {aggregator_category} WHERE cid = %d', $id))) { $block['subject'] = check_plain($category->title); $result = db_query_range('SELECT i.* FROM {aggregator_category_item} ci LEFT JOIN {aggregator_item} i ON ci.iid = i.iid WHERE ci.cid = %d ORDER BY i.timestamp DESC, i.iid DESC', $category->cid, 0, $category->block); - $read_more = theme('more_link', url('aggregator/categories/'. $category->cid), t("View this category's recent news.")); + $read_more = theme('more_link', url('aggregator/categories/' . $category->cid), t("View this category's recent news.")); } break; } @@ -419,7 +419,7 @@ function aggregator_save_feed($edit) { $items[] = "iid = $item->iid"; } if (!empty($items)) { - db_query('DELETE FROM {aggregator_category_item} WHERE '. implode(' OR ', $items)); + db_query('DELETE FROM {aggregator_category_item} WHERE ' . implode(' OR ', $items)); } db_query('DELETE FROM {aggregator_feed} WHERE fid = %d', $edit['fid']); db_query('DELETE FROM {aggregator_item} WHERE fid = %d', $edit['fid']); @@ -453,7 +453,7 @@ function aggregator_remove($feed) { $items[] = "iid = $item->iid"; } if (!empty($items)) { - db_query('DELETE FROM {aggregator_category_item} WHERE '. implode(' OR ', $items)); + db_query('DELETE FROM {aggregator_category_item} WHERE ' . implode(' OR ', $items)); } db_query('DELETE FROM {aggregator_item} WHERE fid = %d', $feed['fid']); db_query("UPDATE {aggregator_feed} SET checked = 0, etag = '', modified = 0 WHERE fid = %d", $feed['fid']); @@ -588,7 +588,7 @@ function aggregator_refresh($feed) { $headers['If-None-Match'] = $feed['etag']; } if ($feed['modified']) { - $headers['If-Modified-Since'] = gmdate('D, d M Y H:i:s', $feed['modified']) .' GMT'; + $headers['If-Modified-Since'] = gmdate('D, d M Y H:i:s', $feed['modified']) . ' GMT'; } // Request feed. @@ -623,7 +623,7 @@ function aggregator_refresh($feed) { if (!empty($image['LINK']) && !empty($image['URL']) && !empty($image['TITLE'])) { // Note, we should really use theme_image() here but that only works with local images it won't work with images fetched with a URL unless PHP version > 5 - $image = ''. check_plain($image['TITLE']) .''; + $image = '' . check_plain($image['TITLE']) . ''; } else { $image = NULL; @@ -643,8 +643,8 @@ function aggregator_refresh($feed) { $result->error = t('feed not parseable'); // Deliberate no break. default: - watchdog('aggregator', 'The feed from %site seems to be broken, due to "%error".', array('%site' => $feed['title'], '%error' => $result->code .' '. $result->error), WATCHDOG_WARNING); - drupal_set_message(t('The feed from %site seems to be broken, because of error "%error".', array('%site' => $feed['title'], '%error' => $result->code .' '. $result->error))); + watchdog('aggregator', 'The feed from %site seems to be broken, due to "%error".', array('%site' => $feed['title'], '%error' => $result->code . ' ' . $result->error), WATCHDOG_WARNING); + drupal_set_message(t('The feed from %site seems to be broken, because of error "%error".', array('%site' => $feed['title'], '%error' => $result->code . ' ' . $result->error))); module_invoke('system', 'check_http_request'); } } @@ -811,7 +811,7 @@ function aggregator_parse_feed(&$data, $feed) { $num_rows = TRUE; } if ($num_rows) { - db_query('DELETE FROM {aggregator_category_item} WHERE iid IN ('. implode(', ', $items) .')'); + db_query('DELETE FROM {aggregator_category_item} WHERE iid IN (' . implode(', ', $items) . ')'); db_query('DELETE FROM {aggregator_item} WHERE fid = %d AND timestamp < %d', $feed['fid'], $age); } @@ -892,12 +892,12 @@ function theme_aggregator_block_item($item, $feed = 0) { $output = ''; if ($user->uid && module_exists('blog') && user_access('create blog entries')) { if ($image = theme('image', 'misc/blog.png', t('blog it'), t('blog it'))) { - $output .= '
    '. l($image, 'node/add/blog', array('attributes' => array('title' => t('Comment on this news item in your personal blog.'), 'class' => 'blog-it'), 'query' => "iid=$item->iid", 'html' => TRUE)) .'
    '; + $output .= '
    ' . l($image, 'node/add/blog', array('attributes' => array('title' => t('Comment on this news item in your personal blog.'), 'class' => 'blog-it'), 'query' => "iid=$item->iid", 'html' => TRUE)) . '
    '; } } // Display the external link to the item. - $output .= ''. check_plain($item->title) ."\n"; + $output .= '' . check_plain($item->title) . "\n"; return $output; } diff --git a/modules/aggregator/aggregator.pages.inc b/modules/aggregator/aggregator.pages.inc index 2e90379bd3a394b3a0883390f8f39ec3c89e8ebb..e2e708a4bcd2c712e2ff13be699d18a375fb3708 100644 --- a/modules/aggregator/aggregator.pages.inc +++ b/modules/aggregator/aggregator.pages.inc @@ -13,7 +13,7 @@ * The items HTML. */ function aggregator_page_last() { - drupal_add_feed(url('aggregator/rss'), variable_get('site_name', 'Drupal') .' '. t('aggregator')); + drupal_add_feed(url('aggregator/rss'), variable_get('site_name', 'Drupal') . ' ' . t('aggregator')); $items = aggregator_feed_items_load('SELECT i.*, f.title AS ftitle, f.link AS flink FROM {aggregator_item} i INNER JOIN {aggregator_feed} f ON i.fid = f.fid ORDER BY i.timestamp DESC, i.iid DESC'); @@ -42,7 +42,7 @@ function aggregator_page_source($arg1, $arg2 = NULL) { // It is safe to include the fid in the query because it's loaded from the // database by aggregator_feed_load. - $items = aggregator_feed_items_load('SELECT * FROM {aggregator_item} WHERE fid = '. $feed->fid .' ORDER BY timestamp DESC, iid DESC'); + $items = aggregator_feed_items_load('SELECT * FROM {aggregator_item} WHERE fid = ' . $feed->fid . ' ORDER BY timestamp DESC, iid DESC'); return _aggregator_page_list($items, arg(3), $feed_source); } @@ -65,11 +65,11 @@ function aggregator_page_category($arg1, $arg2 = NULL) { // $form_state and $arg2 is $category. Otherwise, $arg1 is $category. $category = is_array($arg2) ? $arg2 : $arg1; - drupal_add_feed(url('aggregator/rss/'. $category['cid']), variable_get('site_name', 'Drupal') .' '. t('aggregator - @title', array('@title' => $category['title']))); + drupal_add_feed(url('aggregator/rss/' . $category['cid']), variable_get('site_name', 'Drupal') . ' ' . t('aggregator - @title', array('@title' => $category['title']))); // It is safe to include the cid in the query because it's loaded from the // database by aggregator_category_load. - $items = aggregator_feed_items_load('SELECT i.*, f.title AS ftitle, f.link AS flink FROM {aggregator_category_item} c LEFT JOIN {aggregator_item} i ON c.iid = i.iid LEFT JOIN {aggregator_feed} f ON i.fid = f.fid WHERE cid = '. $category['cid'] .' ORDER BY timestamp DESC, i.iid DESC'); + $items = aggregator_feed_items_load('SELECT i.*, f.title AS ftitle, f.link AS flink FROM {aggregator_category_item} c LEFT JOIN {aggregator_item} i ON c.iid = i.iid LEFT JOIN {aggregator_feed} f ON i.fid = f.fid WHERE cid = ' . $category['cid'] . ' ORDER BY timestamp DESC, i.iid DESC'); return _aggregator_page_list($items, arg(3)); } @@ -267,7 +267,7 @@ function template_preprocess_aggregator_item(&$variables) { $variables['categories'] = array(); foreach ($item->categories as $category) { - $variables['categories'][$category->cid] = l($category->title, 'aggregator/categories/'. $category->cid); + $variables['categories'][$category->cid] = l($category->title, 'aggregator/categories/' . $category->cid); } } @@ -287,7 +287,7 @@ function aggregator_page_sources() { $summary_items[] = theme('aggregator_summary_item', $item); } } - $feed->url = url('aggregator/sources/'. $feed->fid); + $feed->url = url('aggregator/sources/' . $feed->fid); $output .= theme('aggregator_summary_items', $summary_items, $feed); } $output .= theme('feed_icon', url('aggregator/opml'), t('OPML feed')); @@ -310,7 +310,7 @@ function aggregator_page_categories() { $summary_items[] = theme('aggregator_summary_item', $item); } } - $category->url = url('aggregator/categories/'. $category->cid); + $category->url = url('aggregator/categories/' . $category->cid); $output .= theme('aggregator_summary_items', $summary_items, $category); } @@ -361,7 +361,7 @@ function theme_aggregator_page_rss($feeds, $category = NULL) { case 'teaser': $teaser = node_teaser($feed->description); if ($teaser != $feed->description) { - $teaser .= '

    '. t('read more') ."

    \n"; + $teaser .= '

    ' . t('read more') . "

    \n"; } $feed->description = $teaser; break; @@ -369,11 +369,11 @@ function theme_aggregator_page_rss($feeds, $category = NULL) { $feed->description = ''; break; } - $items .= format_rss_item($feed->ftitle .': '. $feed->title, $feed->link, $feed->description, array('pubDate' => date('r', $feed->timestamp))); + $items .= format_rss_item($feed->ftitle . ': ' . $feed->title, $feed->link, $feed->description, array('pubDate' => date('r', $feed->timestamp))); } $site_name = variable_get('site_name', 'Drupal'); - $url = url((isset($category) ? 'aggregator/categories/'. $category->cid : 'aggregator'), array('absolute' => TRUE)); + $url = url((isset($category) ? 'aggregator/categories/' . $category->cid : 'aggregator'), array('absolute' => TRUE)); $description = isset($category) ? t('@site_name - aggregated feeds in category @title', array('@site_name' => $site_name, '@title' => $category->title)) : t('@site_name - aggregated feeds', array('@site_name' => $site_name)); $output = "\n"; @@ -422,12 +422,12 @@ function theme_aggregator_page_opml($feeds) { $output = "\n"; $output .= "\n"; $output .= "\n"; - $output .= ''. check_plain(variable_get('site_name', 'Drupal')) ."\n"; - $output .= ''. gmdate('r') ."\n"; + $output .= '' . check_plain(variable_get('site_name', 'Drupal')) . "\n"; + $output .= '' . gmdate('r') . "\n"; $output .= "\n"; $output .= "\n"; foreach ($feeds as $feed) { - $output .= '\n"; + $output .= '\n"; } $output .= "\n"; $output .= "\n"; diff --git a/modules/block/block-admin-display-form.tpl.php b/modules/block/block-admin-display-form.tpl.php index 91d805137076263ba623f1e118f2f0bbf5507abc..369d0934630d9908fe773f59bb223008cfffee19 100644 --- a/modules/block/block-admin-display-form.tpl.php +++ b/modules/block/block-admin-display-form.tpl.php @@ -29,10 +29,10 @@ $title) { - drupal_add_tabledrag('blocks', 'match', 'sibling', 'block-region-select', 'block-region-'. $region, NULL, FALSE); - drupal_add_tabledrag('blocks', 'order', 'sibling', 'block-weight', 'block-weight-'. $region); + drupal_add_tabledrag('blocks', 'match', 'sibling', 'block-region-select', 'block-region-' . $region, NULL, FALSE); + drupal_add_tabledrag('blocks', 'order', 'sibling', 'block-weight', 'block-weight-' . $region); } ?> @@ -57,7 +57,7 @@ $data): ?> - + diff --git a/modules/block/block.admin.inc b/modules/block/block.admin.inc index 8ef68d554377270858a86e11fc8f7a58186a7e62..ab125d7928888b7ecf514c17770a32f12c150a59 100644 --- a/modules/block/block.admin.inc +++ b/modules/block/block.admin.inc @@ -29,23 +29,23 @@ function block_admin_display_form(&$form_state, $blocks, $theme = NULL) { global $theme_key, $custom_theme; // Add CSS - drupal_add_css(drupal_get_path('module', 'block') .'/block.css', 'module', 'all', FALSE); + drupal_add_css(drupal_get_path('module', 'block') . '/block.css', 'module', 'all', FALSE); // If non-default theme configuration has been selected, set the custom theme. $custom_theme = isset($theme) ? $theme : variable_get('theme_default', 'garland'); init_theme(); $throttle = module_exists('throttle'); - $block_regions = system_region_list($theme_key) + array(BLOCK_REGION_NONE => '<'. t('none') .'>'); + $block_regions = system_region_list($theme_key) + array(BLOCK_REGION_NONE => '<' . t('none') . '>'); // Build form tree $form = array( - '#action' => arg(3) ? url('admin/build/block/list/'. $theme_key) : url('admin/build/block'), + '#action' => arg(3) ? url('admin/build/block/list/' . $theme_key) : url('admin/build/block'), '#tree' => TRUE, ); foreach ($blocks as $i => $block) { - $key = $block['module'] .'_'. $block['delta']; + $key = $block['module'] . '_' . $block['delta']; $form[$key]['module'] = array( '#type' => 'value', '#value' => $block['module'], @@ -74,9 +74,9 @@ function block_admin_display_form(&$form_state, $blocks, $theme = NULL) { if ($throttle) { $form[$key]['throttle'] = array('#type' => 'checkbox', '#default_value' => isset($block['throttle']) ? $block['throttle'] : FALSE); } - $form[$key]['configure'] = array('#value' => l(t('configure'), 'admin/build/block/configure/'. $block['module'] .'/'. $block['delta'])); + $form[$key]['configure'] = array('#value' => l(t('configure'), 'admin/build/block/configure/' . $block['module'] . '/' . $block['delta'])); if ($block['module'] == 'block') { - $form[$key]['delete'] = array('#value' => l(t('delete'), 'admin/build/block/delete/'. $block['delta'])); + $form[$key]['delete'] = array('#value' => l(t('delete'), 'admin/build/block/delete/' . $block['delta'])); } } @@ -234,7 +234,7 @@ function block_admin_configure(&$form_state, $module = NULL, $delta = 0) { if ($access) { $options[] = t('Show if the following PHP code returns TRUE (PHP-mode, experts only).'); - $description .= ' '. t('If the PHP-mode is chosen, enter PHP code between %php. Note that executing incorrect PHP-code can break your Drupal site.', array('%php' => '')); + $description .= ' ' . t('If the PHP-mode is chosen, enter PHP code between %php. Note that executing incorrect PHP-code can break your Drupal site.', array('%php' => '')); } $form['page_vis_settings']['visibility'] = array( '#type' => 'radios', @@ -359,7 +359,7 @@ function template_preprocess_block_admin_display_form(&$variables) { foreach ($block_regions as $key => $value) { // Highlight regions on page to provide visual reference. - drupal_set_content($key, '
    '. $value .'
    '); + drupal_set_content($key, '
    ' . $value . '
    '); // Initialize an empty array for the region. $variables['block_listing'][$key] = array(); } @@ -378,8 +378,8 @@ function template_preprocess_block_admin_display_form(&$variables) { $region = $block['region']['#default_value']; // Set special classes needed for table drag and drop. - $variables['form'][$i]['region']['#attributes']['class'] = 'block-region-select block-region-'. $region; - $variables['form'][$i]['weight']['#attributes']['class'] = 'block-weight block-weight-'. $region; + $variables['form'][$i]['region']['#attributes']['class'] = 'block-region-select block-region-' . $region; + $variables['form'][$i]['weight']['#attributes']['class'] = 'block-weight block-weight-' . $region; $variables['block_listing'][$region][$i]->row_class = isset($block['#attributes']['class']) ? $block['#attributes']['class'] : ''; $variables['block_listing'][$region][$i]->block_modified = isset($block['#attributes']['class']) && strpos($block['#attributes']['class'], 'block-modified') !== FALSE ? TRUE : FALSE; diff --git a/modules/block/block.module b/modules/block/block.module index 7ca8a659499fdecc7108f688e5e4eda02cc30a7d..c6e9ebd0bd05703b822b816d471e8953d615affd 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -67,29 +67,29 @@ function block_help($path, $arg) { switch ($path) { case 'admin/help#block': - $output = '

    '. t('Blocks are boxes of content rendered into an area, or region, of a web page. The default theme Garland, for example, implements the regions "left sidebar", "right sidebar", "content", "header", and "footer", and a block may appear in any one of these areas. The blocks administration page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions.', array('@blocks' => url('admin/build/block'))) .'

    '; - $output .= '

    '. t('Although blocks are usually generated automatically by modules (like the User login block, for example), administrators can also define custom blocks. Custom blocks have a title, description, and body. The body of the block can be as long as necessary, and can contain content supported by any available input format.', array('@input-format' => url('admin/settings/filters'))) .'

    '; - $output .= '

    '. t('When working with blocks, remember that:') .'

    '; - $output .= '
    • '. t('since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis.') .'
    • '; - $output .= '
    • '. t('disabled blocks, or blocks not in a region, are never shown.') .'
    • '; - $output .= '
    • '. t('when throttle module is enabled, throttled blocks (blocks with the Throttle checkbox selected) are hidden during high server loads.') .'
    • '; - $output .= '
    • '. t('blocks can be configured to be visible only on certain pages.') .'
    • '; - $output .= '
    • '. t('blocks can be configured to be visible only when specific conditions are true.') .'
    • '; - $output .= '
    • '. t('blocks can be configured to be visible only for certain user roles.') .'
    • '; - $output .= '
    • '. t('when allowed by an administrator, specific blocks may be enabled or disabled on a per-user basis using the My account page.') .'
    • '; - $output .= '
    • '. t('some dynamic blocks, such as those generated by modules, will be displayed only on certain pages.') .'
    '; - $output .= '

    '. t('For more information, see the online handbook entry for Block module.', array('@block' => 'http://drupal.org/handbook/modules/block/')) .'

    '; + $output = '

    ' . t('Blocks are boxes of content rendered into an area, or region, of a web page. The default theme Garland, for example, implements the regions "left sidebar", "right sidebar", "content", "header", and "footer", and a block may appear in any one of these areas. The blocks administration page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions.', array('@blocks' => url('admin/build/block'))) . '

    '; + $output .= '

    ' . t('Although blocks are usually generated automatically by modules (like the User login block, for example), administrators can also define custom blocks. Custom blocks have a title, description, and body. The body of the block can be as long as necessary, and can contain content supported by any available input format.', array('@input-format' => url('admin/settings/filters'))) . '

    '; + $output .= '

    ' . t('When working with blocks, remember that:') . '

    '; + $output .= '
    • ' . t('since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis.') . '
    • '; + $output .= '
    • ' . t('disabled blocks, or blocks not in a region, are never shown.') . '
    • '; + $output .= '
    • ' . t('when throttle module is enabled, throttled blocks (blocks with the Throttle checkbox selected) are hidden during high server loads.') . '
    • '; + $output .= '
    • ' . t('blocks can be configured to be visible only on certain pages.') . '
    • '; + $output .= '
    • ' . t('blocks can be configured to be visible only when specific conditions are true.') . '
    • '; + $output .= '
    • ' . t('blocks can be configured to be visible only for certain user roles.') . '
    • '; + $output .= '
    • ' . t('when allowed by an administrator, specific blocks may be enabled or disabled on a per-user basis using the My account page.') . '
    • '; + $output .= '
    • ' . t('some dynamic blocks, such as those generated by modules, will be displayed only on certain pages.') . '
    '; + $output .= '

    ' . t('For more information, see the online handbook entry for Block module.', array('@block' => 'http://drupal.org/handbook/modules/block/')) . '

    '; return $output; case 'admin/build/block': $throttle = module_exists('throttle'); - $output = '

    '. t('This page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. To change the region or order of a block, grab a drag-and-drop handle under the Block column and drag the block to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the Save blocks button at the bottom of the page.') .'

    '; + $output = '

    ' . t('This page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. To change the region or order of a block, grab a drag-and-drop handle under the Block column and drag the block to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the Save blocks button at the bottom of the page.') . '

    '; if ($throttle) { - $output .= '

    '. t('To reduce CPU usage, database traffic or bandwidth, blocks may be automatically disabled during high server loads by selecting their Throttle checkbox. Adjust throttle thresholds on the throttle configuration page.', array('@throttleconfig' => url('admin/settings/throttle'))) .'

    '; + $output .= '

    ' . t('To reduce CPU usage, database traffic or bandwidth, blocks may be automatically disabled during high server loads by selecting their Throttle checkbox. Adjust throttle thresholds on the throttle configuration page.', array('@throttleconfig' => url('admin/settings/throttle'))) . '

    '; } - $output .= '

    '. t('Click the configure link next to each block to configure its specific title and visibility settings. Use the add block page to create a custom block.', array('@add-block' => url('admin/build/block/add'))) .'

    '; + $output .= '

    ' . t('Click the configure link next to each block to configure its specific title and visibility settings. Use the add block page to create a custom block.', array('@add-block' => url('admin/build/block/add'))) . '

    '; return $output; case 'admin/build/block/add': - return '

    '. t('Use this page to create a new custom block. New blocks are disabled by default, and must be moved to a region on the blocks administration page to be visible.', array('@blocks' => url('admin/build/block'))) .'

    '; + return '

    ' . t('Use this page to create a new custom block. New blocks are disabled by default, and must be moved to a region on the blocks administration page to be visible.', array('@blocks' => url('admin/build/block'))) . '

    '; } } @@ -161,7 +161,7 @@ function block_menu() { ); $default = variable_get('theme_default', 'garland'); foreach (list_themes() as $key => $theme) { - $items['admin/build/block/list/'. $key] = array( + $items['admin/build/block/list/' . $key] = array( 'title' => check_plain($theme->info['name']), 'page arguments' => array($key), 'type' => $key == $default ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK, @@ -356,7 +356,7 @@ function block_user($type, $edit, &$account, $category = NULL) { case 'form': if ($category == 'account') { $rids = array_keys($account->roles); - $result = db_query("SELECT DISTINCT b.* FROM {blocks} b LEFT JOIN {blocks_roles} r ON b.module = r.module AND b.delta = r.delta WHERE b.status = 1 AND b.custom != 0 AND (r.rid IN (". db_placeholders($rids) .") OR r.rid IS NULL) ORDER BY b.weight, b.module", $rids); + $result = db_query("SELECT DISTINCT b.* FROM {blocks} b LEFT JOIN {blocks_roles} r ON b.module = r.module AND b.delta = r.delta WHERE b.status = 1 AND b.custom != 0 AND (r.rid IN (" . db_placeholders($rids) . ") OR r.rid IS NULL) ORDER BY b.weight, b.module", $rids); $form['block'] = array('#type' => 'fieldset', '#title' => t('Block configuration'), '#weight' => 3, '#collapsible' => TRUE, '#tree' => TRUE); while ($block = db_fetch_object($result)) { $data = module_invoke($block->module, 'block', 'list'); @@ -421,7 +421,7 @@ function _block_load_blocks() { $blocks = array(); $rids = array_keys($user->roles); - $result = db_query(db_rewrite_sql("SELECT DISTINCT b.* FROM {blocks} b LEFT JOIN {blocks_roles} r ON b.module = r.module AND b.delta = r.delta WHERE b.theme = '%s' AND b.status = 1 AND (r.rid IN (". db_placeholders($rids) .") OR r.rid IS NULL) ORDER BY b.region, b.weight, b.module", 'b', 'bid'), array_merge(array($theme_key), $rids)); + $result = db_query(db_rewrite_sql("SELECT DISTINCT b.* FROM {blocks} b LEFT JOIN {blocks_roles} r ON b.module = r.module AND b.delta = r.delta WHERE b.theme = '%s' AND b.status = 1 AND (r.rid IN (" . db_placeholders($rids) . ") OR r.rid IS NULL) ORDER BY b.region, b.weight, b.module", 'b', 'bid'), array_merge(array($theme_key), $rids)); while ($block = db_fetch_object($result)) { if (!isset($blocks[$block->region])) { $blocks[$block->region] = array(); @@ -560,7 +560,7 @@ function _block_get_cache_id($block) { // resource drag for sites with many users, so when a module is being // equivocal, we favor the less expensive 'PER_ROLE' pattern. if ($block->cache & BLOCK_CACHE_PER_ROLE) { - $cid_parts[] = 'r.'. implode(',', array_keys($user->roles)); + $cid_parts[] = 'r.' . implode(',', array_keys($user->roles)); } elseif ($block->cache & BLOCK_CACHE_PER_USER) { $cid_parts[] = "u.$user->uid"; diff --git a/modules/blog/blog.module b/modules/blog/blog.module index 0e6f0a01376504843cd5e38d40fe62dcc890fc0e..d483d48f90c46b84077565932bcf3168750aea19 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -61,11 +61,11 @@ function blog_user($type, &$edit, &$user) { function blog_help($path, $arg) { switch ($path) { case 'admin/help#blog': - $output = '

    '. t('The blog module allows registered users to maintain an online journal, or blog. Blogs are made up of individual blog entries, and the blog entries are most often displayed in descending order by creation time.') .'

    '; - $output .= '

    '. t('There is an (optional) Blogs menu item added to the Navigation menu, which displays all blogs available on your site, and a My blog item displaying the current user\'s blog entries. The Blog entry menu item under Create content allows new blog entries to be created.') .'

    '; - $output .= '

    '. t('Each blog entry is displayed with an automatic link to other blogs created by the same user. By default, blog entries have comments enabled and are automatically promoted to the site front page. The blog module also creates a Recent blog posts block that may be enabled at the blocks administration page.', array('@blocks' => url('admin/build/block'))) .'

    '; - $output .= '

    '. t('When using the aggregator module an automatic blog it icon is displayed next to the items in a feed\'s latest items block. Clicking this icon populates a blog entry with a title (the title of the feed item) and body (a link to the source item on its original site and illustrative content suitable for use in a block quote). Blog authors can use this feature to easily comment on items of interest that appear in aggregator feeds from other sites. To use this feature, be sure to enable the aggregator module, add and configure a feed from another site, and position the feed\'s latest items block.', array('@modules' => url('admin/build/modules'), '@feeds' => url('admin/content/aggregator'), '@blocks' => url('admin/build/block'))) .'

    '; - $output .= '

    '. t('For more information, see the online handbook entry for Blog module.', array('@blog' => 'http://drupal.org/handbook/modules/blog/')) .'

    '; + $output = '

    ' . t('The blog module allows registered users to maintain an online journal, or blog. Blogs are made up of individual blog entries, and the blog entries are most often displayed in descending order by creation time.') . '

    '; + $output .= '

    ' . t('There is an (optional) Blogs menu item added to the Navigation menu, which displays all blogs available on your site, and a My blog item displaying the current user\'s blog entries. The Blog entry menu item under Create content allows new blog entries to be created.') . '

    '; + $output .= '

    ' . t('Each blog entry is displayed with an automatic link to other blogs created by the same user. By default, blog entries have comments enabled and are automatically promoted to the site front page. The blog module also creates a Recent blog posts block that may be enabled at the blocks administration page.', array('@blocks' => url('admin/build/block'))) . '

    '; + $output .= '

    ' . t('When using the aggregator module an automatic blog it icon is displayed next to the items in a feed\'s latest items block. Clicking this icon populates a blog entry with a title (the title of the feed item) and body (a link to the source item on its original site and illustrative content suitable for use in a block quote). Blog authors can use this feature to easily comment on items of interest that appear in aggregator feeds from other sites. To use this feature, be sure to enable the aggregator module, add and configure a feed from another site, and position the feed\'s latest items block.', array('@modules' => url('admin/build/modules'), '@feeds' => url('admin/content/aggregator'), '@blocks' => url('admin/build/block'))) . '

    '; + $output .= '

    ' . t('For more information, see the online handbook entry for Blog module.', array('@blog' => 'http://drupal.org/handbook/modules/blog/')) . '

    '; return $output; } } @@ -83,13 +83,13 @@ function blog_form(&$node) { // If the user clicked a "blog it" link, we load the data from the // database and quote it in the blog. if ($nid && $blog = node_load($nid)) { - $node->body = ''. $blog->body .' ['. l($blog->name, "node/$nid") .']'; + $node->body = '' . $blog->body . ' [' . l($blog->name, "node/$nid") . ']'; } if ($iid && $item = db_fetch_object(db_query('SELECT i.*, f.title as ftitle, f.link as flink FROM {aggregator_item} i, {aggregator_feed} f WHERE i.iid = %d AND i.fid = f.fid', $iid))) { $node->title = $item->title; // Note: $item->description has been validated on aggregation. - $node->body = ''. check_plain($item->title) .' - '. $item->description .' ['. check_plain($item->ftitle) ."]\n"; + $node->body = '' . check_plain($item->title) . ' - ' . $item->description . ' [' . check_plain($item->ftitle) . "]\n"; } } @@ -105,7 +105,7 @@ function blog_form(&$node) { function blog_view($node, $teaser = FALSE, $page = FALSE) { if ($page) { // Breadcrumb navigation - drupal_set_breadcrumb(array(l(t('Home'), NULL), l(t('Blogs'), 'blog'), l(t("@name's blog", array('@name' => $node->name)), 'blog/'. $node->uid))); + drupal_set_breadcrumb(array(l(t('Home'), NULL), l(t('Blogs'), 'blog'), l(t("@name's blog", array('@name' => $node->name)), 'blog/' . $node->uid))); } return node_prepare($node, $teaser); } diff --git a/modules/blog/blog.pages.inc b/modules/blog/blog.pages.inc index 8548ede628585f5dd0a8581609999ac969ecab84..caa47a207fe0d15d2494a980d2d9e88db0c8bddd 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 c7cc3e561e30960177cf54e529211d9af8f0a0f6..1855b4935f0d785310138555b0adf93c0f81904e 100644 --- a/modules/blogapi/blogapi.install +++ b/modules/blogapi/blogapi.install @@ -10,7 +10,7 @@ * Inform users about the new permission. */ function blogapi_update_6000() { - drupal_set_message("Blog API module does not depend on blog module's permissions anymore, but provides its own 'administer content with blog api' permission instead. Until 'module-blogapi')) .'">this permission is assigned to at least one user role, only the site administrator will be able to use Blog API features.'); + drupal_set_message("Blog API module does not depend on blog module's permissions anymore, but provides its own 'administer content with blog api' permission instead. Until 'module-blogapi')) . '">this permission is assigned to at least one user role, only the site administrator will be able to use Blog API features.'); return array(); } diff --git a/modules/blogapi/blogapi.module b/modules/blogapi/blogapi.module index b23f288d4d1fb628f98d54f04356914d52139640..598e14a3f145fedb45b6f297968cff3f23372ab2 100644 --- a/modules/blogapi/blogapi.module +++ b/modules/blogapi/blogapi.module @@ -12,10 +12,10 @@ function blogapi_help($path, $arg) { switch ($path) { case 'admin/help#blogapi': - $output = '

    '. t("The Blog API module allows your site's users to access and post to their blogs from external blogging clients. External blogging clients are available for a wide range of desktop operating systems, and generally provide a feature-rich graphical environment for creating and editing posts.") .'

    '; - $output .= '

    '. t('Ecto, a blogging client available for both Mac OS X and Microsoft Windows, can be used with Blog API. Blog API also supports Blogger API, MetaWeblog API, and most of the Movable Type API. Blogging clients and other services (e.g. Flickr\'s "post to blog") that support these APIs may also be compatible.', array('@ecto-link' => url('http://infinite-sushi.com/software/ecto/'), '@blogger-api' => url('http://www.blogger.com/developers/api/1_docs/'), '@metaweblog-api' => url('http://www.xmlrpc.com/metaWeblogApi'), '@movabletype-api' => url('http://www.movabletype.org/docs/mtmanual_programmatic.html'), '@flickr' => url('http://www.flickr.com'))) .'

    '; - $output .= '

    '. t('Select the content types available to external clients on the Blog API settings page. If supported and available, each content type will be displayed as a separate "blog" by the external client.', array('@blogapi-settings' => url('admin/settings/blogapi'))) .'

    '; - $output .= '

    '. t('For more information, see the online handbook entry for Blog API module.', array('@blogapi' => url('http://drupal.org/handbook/modules/blogapi/'))) .'

    '; + $output = '

    ' . t("The Blog API module allows your site's users to access and post to their blogs from external blogging clients. External blogging clients are available for a wide range of desktop operating systems, and generally provide a feature-rich graphical environment for creating and editing posts.") . '

    '; + $output .= '

    ' . t('Ecto, a blogging client available for both Mac OS X and Microsoft Windows, can be used with Blog API. Blog API also supports Blogger API, MetaWeblog API, and most of the Movable Type API. Blogging clients and other services (e.g. Flickr\'s "post to blog") that support these APIs may also be compatible.', array('@ecto-link' => url('http://infinite-sushi.com/software/ecto/'), '@blogger-api' => url('http://www.blogger.com/developers/api/1_docs/'), '@metaweblog-api' => url('http://www.xmlrpc.com/metaWeblogApi'), '@movabletype-api' => url('http://www.movabletype.org/docs/mtmanual_programmatic.html'), '@flickr' => url('http://www.flickr.com'))) . '

    '; + $output .= '

    ' . t('Select the content types available to external clients on the Blog API settings page. If supported and available, each content type will be displayed as a separate "blog" by the external client.', array('@blogapi-settings' => url('admin/settings/blogapi'))) . '

    '; + $output .= '

    ' . t('For more information, see the online handbook entry for Blog API module.', array('@blogapi' => url('http://drupal.org/handbook/modules/blogapi/'))) . '

    '; return $output; } } @@ -147,7 +147,7 @@ function blogapi_blogger_get_users_blogs($appid, $username, $password) { $types = _blogapi_get_node_types(); $structs = array(); foreach ($types as $type) { - $structs[] = array('url' => url('blog/'. $user->uid, array('absolute' => TRUE)), 'blogid' => $type, 'blogName' => $user->name .": ". $type); + $structs[] = array('url' => url('blog/' . $user->uid, array('absolute' => TRUE)), 'blogid' => $type, 'blogName' => $user->name . ": " . $type); } return $structs; } @@ -170,7 +170,7 @@ function blogapi_blogger_get_user_info($appkey, $username, $password) { 'firstname' => $name[0], 'nickname' => $user->name, 'email' => $user->mail, - 'url' => url('blog/'. $user->uid, array('absolute' => TRUE))); + 'url' => url('blog/' . $user->uid, array('absolute' => TRUE))); } else { return blogapi_error($user); @@ -194,11 +194,11 @@ function blogapi_blogger_new_post($appkey, $blogid, $username, $password, $conte $edit = array(); $edit['type'] = $blogid; // get the node type defaults - $node_type_default = variable_get('node_options_'. $edit['type'], array('status', 'promote')); + $node_type_default = variable_get('node_options_' . $edit['type'], array('status', 'promote')); $edit['uid'] = $user->uid; $edit['name'] = $user->name; $edit['promote'] = in_array('promote', $node_type_default); - $edit['comment'] = variable_get('comment_'. $edit['type'], 2); + $edit['comment'] = variable_get('comment_' . $edit['type'], 2); $edit['revision'] = in_array('revision', $node_type_default); $edit['format'] = FILTER_FORMAT_DEFAULT; $edit['status'] = $publish; @@ -405,7 +405,7 @@ function blogapi_metaweblog_get_category_list($blogid, $username, $password) { foreach ($terms as $term) { $term_name = $term->name; foreach (module_invoke('taxonomy', 'get_parents', $term->tid, 'tid') as $parent) { - $term_name = $parent->name .'/'. $term_name; + $term_name = $parent->name . '/' . $term_name; } $categories[] = array('categoryName' => $term_name, 'categoryId' => $term->tid); } @@ -442,7 +442,7 @@ function blogapi_mt_get_post_categories($postid, $username, $password) { foreach ($terms as $term) { $term_name = $term->name; foreach (module_invoke('taxonomy', 'get_parents', $term->tid, 'tid') as $parent) { - $term_name = $parent->name .'/'. $term_name; + $term_name = $parent->name . '/' . $term_name; } $categories[] = array('categoryName' => $term_name, 'categoryId' => $term->tid, 'isPrimary' => TRUE); } @@ -604,7 +604,7 @@ function blogapi_init() { function blogapi_rsd() { global $base_url; - $xmlrpc = $base_url .'/xmlrpc.php'; + $xmlrpc = $base_url . '/xmlrpc.php'; $base = url('', array('absolute' => TRUE)); $blogid = 1; # until we figure out how to handle multiple bloggers @@ -653,10 +653,10 @@ function _blogapi_mt_extra(&$node, $struct) { // merge the 3 body sections (description, mt_excerpt, mt_text_more) into // one body if ($struct['mt_excerpt']) { - $node->body = $struct['mt_excerpt'] .''. $node->body; + $node->body = $struct['mt_excerpt'] . '' . $node->body; } if ($struct['mt_text_more']) { - $node->body = $node->body .''. $struct['mt_text_more']; + $node->body = $node->body . '' . $struct['mt_text_more']; } // mt_convert_breaks @@ -680,8 +680,8 @@ function _blogapi_get_post($node, $bodies = TRUE) { 'dateCreated' => xmlrpc_date($node->created), 'title' => $node->title, 'postid' => $node->nid, - 'link' => url('node/'. $node->nid, array('absolute' => TRUE)), - 'permaLink' => url('node/'. $node->nid, array('absolute' => TRUE)), + 'link' => url('node/' . $node->nid, array('absolute' => TRUE)), + 'permaLink' => url('node/' . $node->nid, array('absolute' => TRUE)), ); if ($bodies) { if ($node->comment == 1) { diff --git a/modules/book/book.admin.inc b/modules/book/book.admin.inc index ed53c6926cce005a8c3a696456418e0060e3ad63..1b9bb30bfa69ed70076cfc9f750d7789b0e831f5 100644 --- a/modules/book/book.admin.inc +++ b/modules/book/book.admin.inc @@ -12,7 +12,7 @@ function book_admin_overview() { $rows = array(); foreach (book_get_books() as $book) { - $rows[] = array(l($book['title'], $book['href'], $book['options']), l(t('edit order and titles'), "admin/content/book/". $book['nid'])); + $rows[] = array(l($book['title'], $book['href'], $book['options']), l(t('edit order and titles'), "admin/content/book/" . $book['nid'])); } $headers = array(t('Book'), t('Operations')); @@ -115,7 +115,7 @@ function book_admin_edit_submit($form, &$form_state) { $node->revision = 1; $node->log = t('Title changed from %original to %current.', array('%original' => $node->title, '%current' => $values['title'])); node_save($node); - watchdog('content', 'book: updated %title.', array('%title' => $node->title), WATCHDOG_NOTICE, l(t('view'), 'node/'. $node->nid)); + watchdog('content', 'book: updated %title.', array('%title' => $node->title), WATCHDOG_NOTICE, l(t('view'), 'node/' . $node->nid)); } } } @@ -212,14 +212,14 @@ function theme_book_admin_table($form) { drupal_render($form[$key]['weight']), drupal_render($form[$key]['plid']) . drupal_render($form[$key]['mlid']), l(t('view'), $href), - $access ? l(t('edit'), 'node/'. $nid .'/edit', array('query' => $destination)) : ' ', - $access ? l(t('delete'), 'node/'. $nid .'/delete', array('query' => $destination) ) : ' ', + $access ? l(t('edit'), 'node/' . $nid . '/edit', array('query' => $destination)) : ' ', + $access ? l(t('delete'), 'node/' . $nid . '/delete', array('query' => $destination) ) : ' ', ); $row = array('data' => $data); if (isset($form[$key]['#attributes'])) { $row = array_merge($row, $form[$key]['#attributes']); } - $row['class'] = empty($row['class']) ? 'draggable' : $row['class'] .' draggable'; + $row['class'] = empty($row['class']) ? 'draggable' : $row['class'] . ' draggable'; $rows[] = $row; } diff --git a/modules/book/book.install b/modules/book/book.install index 88ed1a64a5c5ca79af06171c99e9d336d46ca149..7b8cbf47398dde51b609e5920f90c03f9dc28cb4 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 ff94c662a132904cf8c434279d7a26cd90db2524..cc58531ee301070b62f902021657d14a56f7cbc4 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -60,14 +60,14 @@ function book_link($type, $node = NULL, $teaser = FALSE) { if ((user_access('add content to books') || user_access('administer book outlines')) && node_access('create', $child_type) && $node->status == 1 && $node->book['depth'] < MENU_MAX_DEPTH) { $links['book_add_child'] = array( 'title' => t('Add child page'), - 'href' => "node/add/". str_replace('_', '-', $child_type), - 'query' => "parent=". $node->book['mlid'], + 'href' => "node/add/" . str_replace('_', '-', $child_type), + 'query' => "parent=" . $node->book['mlid'], ); } if (user_access('access printer-friendly version')) { $links['book_printer'] = array( 'title' => t('Printer-friendly version'), - 'href' => 'book/export/html/'. $node->nid, + 'href' => 'book/export/html/' . $node->nid, 'attributes' => array('title' => t('Show a printer-friendly version of this book page and its sub-pages.')) ); } @@ -169,7 +169,7 @@ function _book_outline_remove_access($node) { * Implementation of hook_init(). Add's the book module's CSS. */ function book_init() { - drupal_add_css(drupal_get_path('module', 'book') .'/book.css'); + drupal_add_css(drupal_get_path('module', 'book') . '/book.css'); } /** @@ -269,7 +269,7 @@ function book_get_books() { $nids[] = $book['bid']; } if ($nids) { - $result2 = db_query(db_rewrite_sql("SELECT n.type, n.title, b.*, ml.* FROM {book} b INNER JOIN {node} n on b.nid = n.nid INNER JOIN {menu_links} ml ON b.mlid = ml.mlid WHERE n.nid IN (". implode(',', $nids) .") AND n.status = 1 ORDER BY ml.weight, ml.link_title")); + $result2 = db_query(db_rewrite_sql("SELECT n.type, n.title, b.*, ml.* FROM {book} b INNER JOIN {node} n on b.nid = n.nid INNER JOIN {menu_links} ml ON b.mlid = ml.mlid WHERE n.nid IN (" . implode(',', $nids) . ") AND n.status = 1 ORDER BY ml.weight, ml.link_title")); while ($link = db_fetch_array($result2)) { $link['href'] = $link['link_path']; $link['options'] = unserialize($link['options']); @@ -288,7 +288,7 @@ function book_get_books() { */ function book_form_alter(&$form, $form_state, $form_id) { - if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'] .'_node_form' == $form_id) { + if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'] . '_node_form' == $form_id) { // Add elements to the node form $node = $form['#node']; @@ -339,14 +339,14 @@ function _book_parent_select($book_link) { if ($book_link['nid'] === $book_link['bid']) { // This is a book - at the top level. if ($book_link['original_bid'] === $book_link['bid']) { - $form['#prefix'] .= ''. t('This is the top-level page in this book.') .''; + $form['#prefix'] .= '' . t('This is the top-level page in this book.') . ''; } else { - $form['#prefix'] .= ''. t('This will be the top-level page in this book.') .''; + $form['#prefix'] .= '' . t('This will be the top-level page in this book.') . ''; } } elseif (!$book_link['bid']) { - $form['#prefix'] .= ''. t('No book selected.') .''; + $form['#prefix'] .= '' . t('No book selected.') . ''; } else { $form = array( @@ -410,11 +410,11 @@ function _book_add_form_elements(&$form, $node) { if (user_access('create new books') && ($nid == 'new' || ($nid != $node->book['original_bid']))) { // The node can become a new book, if it is not one already. - $options = array($nid => '<'. t('create a new book') .'>') + $options; + $options = array($nid => '<' . t('create a new book') . '>') + $options; } if (!$node->book['mlid']) { // The node is not currently in a the hierarchy. - $options = array(0 => '<'. t('none') .'>') + $options; + $options = array(0 => '<' . t('none') . '>') + $options; } // Add a drop-down to select the destination book. @@ -447,7 +447,7 @@ function _book_update_outline(&$node) { } $new = empty($node->book['mlid']); - $node->book['link_path'] = 'node/'. $node->nid; + $node->book['link_path'] = 'node/' . $node->nid; $node->book['link_title'] = $node->title; $node->book['parent_mismatch'] = FALSE; // The normal case. @@ -494,14 +494,14 @@ function book_update_bid($book_link) { $match[] = "p$i = %d"; $args[] = $book_link["p$i"]; } - $result = db_query("SELECT mlid FROM {menu_links} WHERE ". implode(' AND ', $match), $args); + $result = db_query("SELECT mlid FROM {menu_links} WHERE " . implode(' AND ', $match), $args); $mlids = array(); while ($a = db_fetch_array($result)) { $mlids[] = $a['mlid']; } if ($mlids) { - db_query("UPDATE {book} SET bid = %d WHERE mlid IN (". implode(',', $mlids) .")", $book_link['bid']); + db_query("UPDATE {book} SET bid = %d WHERE mlid IN (" . implode(',', $mlids) . ")", $book_link['bid']); } } @@ -616,7 +616,7 @@ function book_children($book_link) { * Generate the corresponding menu name from a book ID. */ function book_menu_name($bid) { - return 'book-toc-'. $bid; + return 'book-toc-' . $bid; } /** @@ -765,7 +765,7 @@ function book_form_node_delete_confirm_alter(&$form, $form_state) { if (isset($node->book) && $node->book['has_children']) { $form['book_warning'] = array( - '#value' => '

    '. t('%title is part of a book outline, and has associated child pages. If you proceed with deletion, the child pages will be relocated automatically.', array('%title' => $node->title)) .'

    ', + '#value' => '

    ' . t('%title is part of a book outline, and has associated child pages. If you proceed with deletion, the child pages will be relocated automatically.', array('%title' => $node->title)) . '

    ', '#weight' => -10, ); } @@ -792,7 +792,7 @@ function template_preprocess_book_navigation(&$variables) { // Provide extra variables for themers. Not needed by default. $variables['book_id'] = $book_link['bid']; $variables['book_title'] = check_plain($book_link['link_title']); - $variables['book_url'] = 'node/'. $book_link['bid']; + $variables['book_url'] = 'node/' . $book_link['bid']; $variables['current_depth'] = $book_link['depth']; $variables['tree'] = ''; @@ -844,9 +844,9 @@ function _book_toc_recurse($tree, $indent, &$toc, $exclude, $depth_limit) { break; } if (!in_array($data['link']['mlid'], $exclude)) { - $toc[$data['link']['mlid']] = $indent .' '. truncate_utf8($data['link']['title'], 30, TRUE, TRUE); + $toc[$data['link']['mlid']] = $indent . ' ' . truncate_utf8($data['link']['title'], 30, TRUE, TRUE); if ($data['below']) { - _book_toc_recurse($data['below'], $indent .'--', $toc, $exclude, $depth_limit); + _book_toc_recurse($data['below'], $indent . '--', $toc, $exclude, $depth_limit); } } } @@ -1008,17 +1008,17 @@ function book_node_type($op, $type) { function book_help($path, $arg) { switch ($path) { case 'admin/help#book': - $output = '

    '. t('The book module is suited for creating structured, multi-page hypertexts such as site resource guides, manuals, and Frequently Asked Questions (FAQs). It permits a document to have chapters, sections, subsections, etc. Authors with suitable permissions can add pages to a collaborative book, placing them into the existing document by adding them to a table of contents menu.') .'

    '; - $output .= '

    '. t('Pages in the book hierarchy have navigation elements at the bottom of the page for moving through the text. These links lead to the previous and next pages in the book, and to the level above the current page in the book\'s structure. More comprehensive navigation may be provided by enabling the book navigation block on the blocks administration page.', array('@admin-block' => url('admin/build/block'))) .'

    '; - $output .= '

    '. t('Users can select the printer-friendly version link visible at the bottom of a book page to generate a printer-friendly display of the page and all of its subsections. ') .'

    '; - $output .= '

    '. t("Users with the administer book outlines permission can add a post of any content type to a book, by selecting the appropriate book while editing the post or by using the interface available on the post's outline tab.") .'

    '; - $output .= '

    '. t('Administrators can view a list of all books on the book administration page. The Outline page for each book allows section titles to be edited or rearranged.', array('@admin-node-book' => url('admin/content/book'))) .'

    '; - $output .= '

    '. t('For more information, see the online handbook entry for Book module.', array('@book' => 'http://drupal.org/handbook/modules/book/')) .'

    '; + $output = '

    ' . t('The book module is suited for creating structured, multi-page hypertexts such as site resource guides, manuals, and Frequently Asked Questions (FAQs). It permits a document to have chapters, sections, subsections, etc. Authors with suitable permissions can add pages to a collaborative book, placing them into the existing document by adding them to a table of contents menu.') . '

    '; + $output .= '

    ' . t('Pages in the book hierarchy have navigation elements at the bottom of the page for moving through the text. These links lead to the previous and next pages in the book, and to the level above the current page in the book\'s structure. More comprehensive navigation may be provided by enabling the book navigation block on the blocks administration page.', array('@admin-block' => url('admin/build/block'))) . '

    '; + $output .= '

    ' . t('Users can select the printer-friendly version link visible at the bottom of a book page to generate a printer-friendly display of the page and all of its subsections. ') . '

    '; + $output .= '

    ' . t("Users with the administer book outlines permission can add a post of any content type to a book, by selecting the appropriate book while editing the post or by using the interface available on the post's outline tab.") . '

    '; + $output .= '

    ' . t('Administrators can view a list of all books on the book administration page. The Outline page for each book allows section titles to be edited or rearranged.', array('@admin-node-book' => url('admin/content/book'))) . '

    '; + $output .= '

    ' . t('For more information, see the online handbook entry for Book module.', array('@book' => 'http://drupal.org/handbook/modules/book/')) . '

    '; return $output; case 'admin/content/book': - return '

    '. t('The book module offers a means to organize a collection of related posts, collectively known as a book. When viewed, these posts automatically display links to adjacent book pages, providing a simple navigation system for creating and reviewing structured content.') .'

    '; + return '

    ' . t('The book module offers a means to organize a collection of related posts, collectively known as a book. When viewed, these posts automatically display links to adjacent book pages, providing a simple navigation system for creating and reviewing structured content.') . '

    '; case 'node/%/outline': - return '

    '. t('The outline feature allows you to include posts in the book hierarchy, as well as move them within the hierarchy or to reorder an entire book.', array('@book' => url('book'), '@book-admin' => url('admin/content/book'))) .'

    '; + return '

    ' . t('The outline feature allows you to include posts in the book hierarchy, as well as move them within the hierarchy or to reorder an entire book.', array('@book' => url('book'), '@book-admin' => url('admin/content/book'))) . '

    '; } } @@ -1050,7 +1050,7 @@ function book_menu_subtree_data($item) { static $tree = array(); // Generate a cache ID (cid) specific for this $menu_name and $item. - $cid = 'links:'. $item['menu_name'] .':subtree-cid:'. $item['mlid']; + $cid = 'links:' . $item['menu_name'] . ':subtree-cid:' . $item['mlid']; if (!isset($tree[$cid])) { $cache = cache_get($cid, 'cache_menu'); @@ -1076,14 +1076,14 @@ function book_menu_subtree_data($item) { SELECT b.*, m.load_functions, m.to_arg_functions, m.access_callback, m.access_arguments, m.page_callback, m.page_arguments, m.title, m.title_callback, m.title_arguments, m.type, ml.* FROM {menu_links} ml INNER JOIN {menu_router} m ON m.path = ml.router_path INNER JOIN {book} b ON ml.mlid = b.mlid - WHERE ". implode(' AND ', $match) ." + WHERE " . implode(' AND ', $match) . " ORDER BY p1 ASC, p2 ASC, p3 ASC, p4 ASC, p5 ASC, p6 ASC, p7 ASC, p8 ASC, p9 ASC"; $data['tree'] = menu_tree_data(db_query($sql, $args), array(), $item['depth']); $data['node_links'] = array(); menu_tree_collect_node_links($data['tree'], $data['node_links']); // Compute the real cid for book subtree data. - $tree_cid = 'links:'. $menu_name .':subtree-data:'. md5(serialize($data)); + $tree_cid = 'links:' . $menu_name . ':subtree-data:' . md5(serialize($data)); // Cache the data, if it is not already in the cache. if (!cache_get($tree_cid, 'cache_menu')) { cache_set($tree_cid, $data, 'cache_menu'); diff --git a/modules/book/book.pages.inc b/modules/book/book.pages.inc index a744e97a40cc648bab2725de1ca6210f92c1a43d..72121c808e1c4558d9c274eb9e878e09635fa57f 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 5fa20701460f631fb3b53c0023ad29e943f19baf..b7491344f9236eada3b0c9191277f45f49fa78d3 100644 --- a/modules/color/color.module +++ b/modules/color/color.module @@ -7,10 +7,10 @@ function color_help($path, $arg) { switch ($path) { case 'admin/help#color': - $output = '

    '. t('The color module allows a site administrator to quickly and easily change the color scheme of certain themes. Although not all themes support color module, both Garland (the default theme) and Minnelli were designed to take advantage of its features. By using color module with a compatible theme, you can easily change the color of links, backgrounds, text, and other theme elements. Color module requires that your file download method be set to public.', array('@url' => url('admin/settings/file-system'))) .'

    '; - $output .= '

    '. t("It is important to remember that color module saves a modified copy of the theme's specified stylesheets in the files directory. This means that if you make any manual changes to your theme's stylesheet, you must save your color settings again, even if they haven't changed. This causes the color module generated version of the stylesheets in the files directory to be recreated using the new version of the original file.") .'

    '; - $output .= '

    '. t('To change the color settings for a compatible theme, select the "configure" link for the theme on the themes administration page.', array('@themes' => url('admin/build/themes'))) .'

    '; - $output .= '

    '. t('For more information, see the online handbook entry for Color module.', array('@color' => 'http://drupal.org/handbook/modules/color/')) .'

    '; + $output = '

    ' . t('The color module allows a site administrator to quickly and easily change the color scheme of certain themes. Although not all themes support color module, both Garland (the default theme) and Minnelli were designed to take advantage of its features. By using color module with a compatible theme, you can easily change the color of links, backgrounds, text, and other theme elements. Color module requires that your file download method be set to public.', array('@url' => url('admin/settings/file-system'))) . '

    '; + $output .= '

    ' . t("It is important to remember that color module saves a modified copy of the theme's specified stylesheets in the files directory. This means that if you make any manual changes to your theme's stylesheet, you must save your color settings again, even if they haven't changed. This causes the color module generated version of the stylesheets in the files directory to be recreated using the new version of the original file.") . '

    '; + $output .= '

    ' . t('To change the color settings for a compatible theme, select the "configure" link for the theme on the themes administration page.', array('@themes' => url('admin/build/themes'))) . '

    '; + $output .= '

    ' . t('For more information, see the online handbook entry for Color module.', array('@color' => 'http://drupal.org/handbook/modules/color/')) . '

    '; return $output; } } @@ -54,7 +54,7 @@ function color_form_alter(&$form, $form_state, $form_id) { if ($form_id == 'system_theme_select_form' || $form_id == 'system_themes') { $themes = list_themes(); foreach (element_children($form) as $theme) { - if ($screenshot = variable_get('color_'. $theme .'_screenshot', NULL)) { + if ($screenshot = variable_get('color_' . $theme . '_screenshot', NULL)) { if (isset($form[$theme]['screenshot'])) { $form[$theme]['screenshot']['#value'] = theme('image', $screenshot, '', '', array('class' => 'screenshot'), FALSE); } @@ -70,7 +70,7 @@ function _color_page_alter(&$vars) { global $language, $theme_key; // Override stylesheets. - $color_paths = variable_get('color_'. $theme_key .'_stylesheets', array()); + $color_paths = variable_get('color_' . $theme_key . '_stylesheets', array()); if (!empty($color_paths)) { // Loop over theme CSS files and try to rebuild CSS array with rewritten // stylesheets. Keep the orginal order intact for CSS cascading. @@ -110,8 +110,8 @@ function _color_page_alter(&$vars) { } // Override logo. - $logo = variable_get('color_'. $theme_key .'_logo', NULL); - if ($logo && $vars['logo'] && preg_match('!'. $theme_key .'/logo.png$!', $vars['logo'])) { + $logo = variable_get('color_' . $theme_key . '_logo', NULL); + if ($logo && $vars['logo'] && preg_match('!' . $theme_key . '/logo.png$!', $vars['logo'])) { $vars['logo'] = base_path() . $logo; } } @@ -121,7 +121,7 @@ function _color_page_alter(&$vars) { */ function color_get_info($theme) { $path = drupal_get_path('theme', $theme); - $file = $path .'/color/color.inc'; + $file = $path . '/color/color.inc'; if ($path && file_exists($file)) { include $file; return $info; @@ -141,7 +141,7 @@ function color_get_palette($theme, $default = false) { } // Load variable - return $default ? $palette : variable_get('color_'. $theme .'_palette', $palette); + return $default ? $palette : variable_get('color_' . $theme . '_palette', $palette); } /** @@ -156,14 +156,14 @@ function color_scheme_form(&$form_state, $theme) { drupal_add_js('misc/farbtastic/farbtastic.js'); // Add custom CSS/JS - drupal_add_css($base .'/color.css', 'module', 'all', FALSE); - drupal_add_js($base .'/color.js'); + drupal_add_css($base . '/color.css', 'module', 'all', FALSE); + drupal_add_js($base . '/color.js'); drupal_add_js(array('color' => array( 'reference' => color_get_palette($theme, true) )), 'setting'); // See if we're using a predefined scheme - $current = implode(',', variable_get('color_'. $theme .'_palette', array())); + $current = implode(',', variable_get('color_' . $theme . '_palette', array())); // Note: we use the original theme when the default scheme is chosen. $current = isset($info['schemes'][$current]) ? $current : ($current == '' ? reset($info['schemes']) : ''); @@ -209,7 +209,7 @@ function theme_color_scheme_form($form) { // Include stylesheet $theme = $form['theme']['#value']; $info = $form['info']['#value']; - $path = drupal_get_path('theme', $theme) .'/'; + $path = drupal_get_path('theme', $theme) . '/'; drupal_add_css($path . $info['preview_css']); $output = ''; // Wrapper @@ -227,8 +227,8 @@ function theme_color_scheme_form($form) { // Preview $output .= drupal_render($form); - $output .= '

    '. t('Preview') .'

    '; - $output .= '

    Lorem ipsum dolor

    Sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    '; + $output .= '

    ' . t('Preview') . '

    '; + $output .= '

    Lorem ipsum dolor

    Sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    '; // Close wrapper $output .= ''; @@ -259,7 +259,7 @@ function color_scheme_form_submit($form, &$form_state) { // Make sure enough memory is available, if PHP's memory limit is compiled in. if (function_exists('memory_get_usage')) { // Fetch source image dimensions. - $source = drupal_get_path('theme', $theme) .'/'. $info['base_image']; + $source = drupal_get_path('theme', $theme) . '/' . $info['base_image']; list($width, $height) = getimagesize($source); // We need at least a copy of the source and a target buffer of the same @@ -274,7 +274,7 @@ function color_scheme_form_submit($form, &$form_state) { } // Delete old files - foreach (variable_get('color_'. $theme .'_files', array()) as $file) { + foreach (variable_get('color_' . $theme . '_files', array()) as $file) { @unlink($file); } if (isset($file) && $file = dirname($file)) { @@ -284,29 +284,29 @@ function color_scheme_form_submit($form, &$form_state) { // Don't render the default colorscheme, use the standard theme instead. if (implode(',', color_get_palette($theme, true)) == implode(',', $palette) || $form_state['values']['op'] == t('Reset to defaults')) { - variable_del('color_'. $theme .'_palette'); - variable_del('color_'. $theme .'_stylesheets'); - variable_del('color_'. $theme .'_logo'); - variable_del('color_'. $theme .'_files'); - variable_del('color_'. $theme .'_screenshot'); + variable_del('color_' . $theme . '_palette'); + variable_del('color_' . $theme . '_stylesheets'); + variable_del('color_' . $theme . '_logo'); + variable_del('color_' . $theme . '_files'); + variable_del('color_' . $theme . '_screenshot'); return; } // Prepare target locations for generated files. - $id = $theme .'-'. substr(md5(serialize($palette) . microtime()), 0, 8); - $paths['color'] = file_directory_path() .'/color'; - $paths['target'] = $paths['color'] .'/'. $id; + $id = $theme . '-' . substr(md5(serialize($palette) . microtime()), 0, 8); + $paths['color'] = file_directory_path() . '/color'; + $paths['target'] = $paths['color'] . '/' . $id; foreach ($paths as $path) { file_check_directory($path, FILE_CREATE_DIRECTORY); } - $paths['target'] = $paths['target'] .'/'; + $paths['target'] = $paths['target'] . '/'; $paths['id'] = $id; - $paths['source'] = drupal_get_path('theme', $theme) .'/'; + $paths['source'] = drupal_get_path('theme', $theme) . '/'; $paths['files'] = $paths['map'] = array(); // Save palette and logo location. - variable_set('color_'. $theme .'_palette', $palette); - variable_set('color_'. $theme .'_logo', $paths['target'] .'logo.png'); + variable_set('color_' . $theme . '_palette', $palette); + variable_set('color_' . $theme . '_logo', $paths['target'] . 'logo.png'); // Copy over neutral images. foreach ($info['copy'] as $file) { @@ -344,7 +344,7 @@ function color_scheme_form_submit($form, &$form_state) { // Return the path to where this CSS file originated from, stripping // off the name of the file at the end of the path. - $base = base_path() . dirname($paths['source'] . $file) .'/'; + $base = base_path() . dirname($paths['source'] . $file) . '/'; _drupal_build_css_path(NULL, $base); // Prefix all paths within this CSS file, ignoring absolute paths. @@ -359,8 +359,8 @@ function color_scheme_form_submit($form, &$form_state) { } // Maintain list of files. - variable_set('color_'. $theme .'_stylesheets', $css); - variable_set('color_'. $theme .'_files', $paths['files']); + variable_set('color_' . $theme . '_stylesheets', $css); + variable_set('color_' . $theme . '_files', $paths['files']); } /** @@ -455,7 +455,7 @@ function _color_save_stylesheet($file, $style, &$paths) { function _color_render_images($theme, &$info, &$paths, $palette) { // Prepare template image. - $source = $paths['source'] .'/'. $info['base_image']; + $source = $paths['source'] . '/' . $info['base_image']; $source = imagecreatefrompng($source); $width = imagesx($source); $height = imagesy($source); @@ -491,7 +491,7 @@ function _color_render_images($theme, &$info, &$paths, $palette) { if ($file == 'screenshot.png') { $slice = imagecreatetruecolor(150, 90); imagecopyresampled($slice, $target, 0, 0, $x, $y, 150, 90, $width, $height); - variable_set('color_'. $theme .'_screenshot', $image); + variable_set('color_' . $theme . '_screenshot', $image); } else { $slice = imagecreatetruecolor($width, $height); @@ -617,7 +617,7 @@ function _color_pack($rgb, $normalize = false) { foreach ($rgb as $k => $v) { $out |= (($v * ($normalize ? 255 : 1)) << (16 - $k * 8)); } - return '#'. str_pad(dechex($out), 6, 0, STR_PAD_LEFT); + return '#' . str_pad(dechex($out), 6, 0, STR_PAD_LEFT); } /** diff --git a/modules/comment/comment-folded.tpl.php b/modules/comment/comment-folded.tpl.php index 016656bfb6b34c8b91b118de92b51b359d7fe35b..37f77a5a8b6d4a5f853e814de9b311d42d40395d 100644 --- a/modules/comment/comment-folded.tpl.php +++ b/modules/comment/comment-folded.tpl.php @@ -17,5 +17,5 @@ */ ?>
    - +
    diff --git a/modules/comment/comment.admin.inc b/modules/comment/comment.admin.inc index a40502a6b0488f3cb277c6de2e418517a1d84ba3..144804e36d6c24f6f0f744af944b539198cdbe22 100644 --- a/modules/comment/comment.admin.inc +++ b/modules/comment/comment.admin.inc @@ -57,18 +57,18 @@ function comment_admin_overview($type = 'new', $arg) { array('data' => t('Time'), 'field' => 'timestamp', 'sort' => 'desc'), array('data' => t('Operations')) )); - $result = pager_query('SELECT c.subject, c.nid, c.cid, c.comment, c.timestamp, c.status, c.name, c.homepage, u.name AS registered_name, u.uid, n.title as node_title FROM {comments} c INNER JOIN {users} u ON u.uid = c.uid INNER JOIN {node} n ON n.nid = c.nid WHERE c.status = %d'. tablesort_sql($form['header']['#value']), 50, 0, NULL, $status); + $result = pager_query('SELECT c.subject, c.nid, c.cid, c.comment, c.timestamp, c.status, c.name, c.homepage, u.name AS registered_name, u.uid, n.title as node_title FROM {comments} c INNER JOIN {users} u ON u.uid = c.uid INNER JOIN {node} n ON n.nid = c.nid WHERE c.status = %d' . tablesort_sql($form['header']['#value']), 50, 0, NULL, $status); // build a table listing the appropriate comments $destination = drupal_get_destination(); while ($comment = db_fetch_object($result)) { $comments[$comment->cid] = ''; $comment->name = $comment->uid ? $comment->registered_name : $comment->name; - $form['subject'][$comment->cid] = array('#value' => l($comment->subject, 'node/'. $comment->nid, array('title' => truncate_utf8($comment->comment, 128), 'fragment' => 'comment-'. $comment->cid))); + $form['subject'][$comment->cid] = array('#value' => l($comment->subject, 'node/' . $comment->nid, array('title' => truncate_utf8($comment->comment, 128), 'fragment' => 'comment-' . $comment->cid))); $form['username'][$comment->cid] = array('#value' => theme('username', $comment)); - $form['node_title'][$comment->cid] = array('#value' => l($comment->node_title, 'node/'. $comment->nid)); + $form['node_title'][$comment->cid] = array('#value' => l($comment->node_title, 'node/' . $comment->nid)); $form['timestamp'][$comment->cid] = array('#value' => format_date($comment->timestamp, 'small')); - $form['operations'][$comment->cid] = array('#value' => l(t('edit'), 'comment/edit/'. $comment->cid, array('query' => $destination))); + $form['operations'][$comment->cid] = array('#value' => l(t('edit'), 'comment/edit/' . $comment->cid, array('query' => $destination))); } $form['comments'] = array('#type' => 'checkboxes', '#options' => isset($comments) ? $comments: array()); $form['pager'] = array('#value' => theme('pager', NULL, 50, 0)); @@ -108,7 +108,7 @@ function comment_admin_overview_submit($form, &$form_state) { // Allow modules to respond to the updating of a comment. comment_invoke_comment($comment, $form_state['values']['operation']); // Add an entry to the watchdog log. - watchdog('content', 'Comment: updated %subject.', array('%subject' => $comment->subject), WATCHDOG_NOTICE, l(t('view'), 'node/'. $comment->nid, array('fragment' => 'comment-'. $comment->cid))); + watchdog('content', 'Comment: updated %subject.', array('%subject' => $comment->subject), WATCHDOG_NOTICE, l(t('view'), 'node/' . $comment->nid, array('fragment' => 'comment-' . $comment->cid))); } } cache_clear_all(); @@ -173,7 +173,7 @@ function comment_multiple_delete_confirm(&$form_state) { $comment = comment_load($cid); if (is_object($comment) && is_numeric($comment->cid)) { $subject = db_result(db_query('SELECT subject FROM {comments} WHERE cid = %d', $cid)); - $form['comments'][$cid] = array('#type' => 'hidden', '#value' => $cid, '#prefix' => '
  • ', '#suffix' => check_plain($subject) .'
  • '); + $form['comments'][$cid] = array('#type' => 'hidden', '#value' => $cid, '#prefix' => '
  • ', '#suffix' => check_plain($subject) . '
  • '); $comment_counter++; } } @@ -243,7 +243,7 @@ function comment_confirm_delete(&$form_state, $comment) { return confirm_form( $form, t('Are you sure you want to delete the comment %title?', array('%title' => $comment->subject)), - 'node/'. $comment->nid, + 'node/' . $comment->nid, t('Any replies to this comment will be lost. This action cannot be undone.'), t('Delete'), t('Cancel'), diff --git a/modules/comment/comment.install b/modules/comment/comment.install index 82dec3488d225e34d87f0cb34ce57ec2161d5dff..3a6cd974adf4c827ae636fe858044d7cc7605f2b 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 ca2d522e124fa3a3bbb98efe71a31030baa40811..031bb61a58a7e393a4bd77067aedab1b79ef5095 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -126,14 +126,14 @@ function comment_help($path, $arg) { switch ($path) { case 'admin/help#comment': - $output = '

    '. t('The comment module allows visitors to comment on your posts, creating ad hoc discussion boards. Any content type may have its Default comment setting set to Read/Write to allow comments, or Disabled, to prevent comments. Comment display settings and other controls may also be customized for each content type (some display settings are customizable by individual users).', array('@content-type' => url('admin/build/types'))) .'

    '; - $output .= '

    '. t('Comment permissions are assigned to user roles, and are used to determine whether anonymous users (or other roles) are allowed to comment on posts. If anonymous users are allowed to comment, their individual contact information may be retained in cookies stored on their local computer for use in later comment submissions. When a comment has no replies, it may be (optionally) edited by its author. The comment module uses the same input formats and HTML tags available when creating other forms of content.') .'

    '; - $output .= '

    '. t('For more information, see the online handbook entry for Comment module.', array('@comment' => 'http://drupal.org/handbook/modules/comment/')) .'

    '; + $output = '

    ' . t('The comment module allows visitors to comment on your posts, creating ad hoc discussion boards. Any content type may have its Default comment setting set to Read/Write to allow comments, or Disabled, to prevent comments. Comment display settings and other controls may also be customized for each content type (some display settings are customizable by individual users).', array('@content-type' => url('admin/build/types'))) . '

    '; + $output .= '

    ' . t('Comment permissions are assigned to user roles, and are used to determine whether anonymous users (or other roles) are allowed to comment on posts. If anonymous users are allowed to comment, their individual contact information may be retained in cookies stored on their local computer for use in later comment submissions. When a comment has no replies, it may be (optionally) edited by its author. The comment module uses the same input formats and HTML tags available when creating other forms of content.') . '

    '; + $output .= '

    ' . t('For more information, see the online handbook entry for Comment module.', array('@comment' => 'http://drupal.org/handbook/modules/comment/')) . '

    '; return $output; case 'admin/content/comment': - return '

    '. t("Below is a list of the latest comments posted to your site. Click on a subject to see the comment, the author's name to edit the author's user information, 'edit' to modify the text, and 'delete' to remove their submission.") .'

    '; + return '

    ' . t("Below is a list of the latest comments posted to your site. Click on a subject to see the comment, the author's name to edit the author's user information, 'edit' to modify the text, and 'delete' to remove their submission.") . '

    '; case 'admin/content/comment/approval': - return '

    '. t("Below is a list of the comments posted to your site that need approval. To approve a comment, click on 'edit' and then change its 'moderation status' to Approved. Click on a subject to see the comment, the author's name to edit the author's user information, 'edit' to modify the text, and 'delete' to remove their submission.") .'

    '; + return '

    ' . t("Below is a list of the comments posted to your site that need approval. To approve a comment, click on 'edit' and then change its 'moderation status' to Approved. Click on a subject to see the comment, the author's name to edit the author's user information, 'edit' to modify the text, and 'delete' to remove their submission.") . '

    '; } } @@ -261,7 +261,7 @@ function comment_node_type($op, $info) { switch ($op) { case 'delete': foreach ($settings as $setting) { - variable_del($setting .'_'. $info->type); + variable_del($setting . '_' . $info->type); } break; } @@ -343,7 +343,7 @@ function comment_get_recent($number = 10) { if (!empty($nids)) { // From among the comments on the nodes selected in the first query, // find the $number most recent comments. - $result = db_query_range('SELECT c.nid, c.subject, c.cid, c.timestamp FROM {comments} c INNER JOIN {node} n ON n.nid = c.nid WHERE c.nid IN ('. implode(',', $nids) .') AND n.status = 1 AND c.status = %d ORDER BY c.cid DESC', COMMENT_PUBLISHED, 0, $number); + $result = db_query_range('SELECT c.nid, c.subject, c.cid, c.timestamp FROM {comments} c INNER JOIN {node} n ON n.nid = c.nid WHERE c.nid IN (' . implode(',', $nids) . ') AND n.status = 1 AND c.status = %d ORDER BY c.cid DESC', COMMENT_PUBLISHED, 0, $number); while ($comment = db_fetch_object($result)) { $comments[] = $comment; } @@ -386,20 +386,20 @@ function comment_new_page_count($num_comments, $new_replies, $node) { // Newest first: find the last thread with new comment $result = db_query('(SELECT thread FROM {comments} WHERE nid = %d AND status = 0 ORDER BY timestamp DESC LIMIT %d) ORDER BY thread DESC LIMIT 1', $node->nid, $new_replies); $thread = db_result($result); - $result_count = db_query("SELECT COUNT(*) FROM {comments} WHERE nid = %d AND status = 0 AND thread > '". $thread ."'", $node->nid); + $result_count = db_query("SELECT COUNT(*) FROM {comments} WHERE nid = %d AND status = 0 AND thread > '" . $thread . "'", $node->nid); } else { // Oldest first: find the first thread with new comment $result = db_query('(SELECT thread FROM {comments} WHERE nid = %d AND status = 0 ORDER BY timestamp DESC LIMIT %d) ORDER BY SUBSTRING(thread, 1, (LENGTH(thread) - 1)) LIMIT 1', $node->nid, $new_replies); $thread = substr(db_result($result), 0, -1); - $result_count = db_query("SELECT COUNT(*) FROM {comments} WHERE nid = %d AND status = 0 AND SUBSTRING(thread, 1, (LENGTH(thread) - 1)) < '". $thread ."'", $node->nid); + $result_count = db_query("SELECT COUNT(*) FROM {comments} WHERE nid = %d AND status = 0 AND SUBSTRING(thread, 1, (LENGTH(thread) - 1)) < '" . $thread . "'", $node->nid); } $count = db_result($result_count); } $pageno = $count / $comments_per_page; } if ($pageno >= 1) { - $pagenum = "page=". intval($pageno); + $pagenum = "page=" . intval($pageno); } return $pagenum; } @@ -415,7 +415,7 @@ function theme_comment_block() { $items = array(); $number = variable_get('comment_block_count', 10); foreach (comment_get_recent($number) as $comment) { - $items[] = l($comment->subject, 'node/'. $comment->nid, array('fragment' => 'comment-'. $comment->cid)) .'
    '. t('@time ago', array('@time' => format_interval(time() - $comment->timestamp))); + $items[] = l($comment->subject, 'node/' . $comment->nid, array('fragment' => 'comment-' . $comment->cid)) . '
    ' . t('@time ago', array('@time' => format_interval(time() - $comment->timestamp))); } if ($items) { return theme('item_list', $items); @@ -479,7 +479,7 @@ function comment_link($type, $node = NULL, $teaser = FALSE) { if ($node->comment == COMMENT_NODE_READ_WRITE) { if (user_access('post comments')) { - if (variable_get('comment_form_location_'. $node->type, COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_SEPARATE_PAGE) { + if (variable_get('comment_form_location_' . $node->type, COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_SEPARATE_PAGE) { $links['comment_add'] = array( 'title' => t('Add new comment'), 'href' => "comment/reply/$node->nid", @@ -519,35 +519,35 @@ function comment_form_alter(&$form, $form_state, $form_id) { $form['comment']['comment'] = array( '#type' => 'radios', '#title' => t('Default comment setting'), - '#default_value' => variable_get('comment_'. $form['#node_type']->type, COMMENT_NODE_READ_WRITE), + '#default_value' => variable_get('comment_' . $form['#node_type']->type, COMMENT_NODE_READ_WRITE), '#options' => array(t('Disabled'), t('Read only'), t('Read/Write')), '#description' => t('Users with the administer comments permission will be able to override this setting.'), ); $form['comment']['comment_default_mode'] = array( '#type' => 'radios', '#title' => t('Default display mode'), - '#default_value' => variable_get('comment_default_mode_'. $form['#node_type']->type, COMMENT_MODE_THREADED_EXPANDED), + '#default_value' => variable_get('comment_default_mode_' . $form['#node_type']->type, COMMENT_MODE_THREADED_EXPANDED), '#options' => _comment_get_modes(), '#description' => t('The default view for comments. Expanded views display the body of the comment. Threaded views keep replies together.'), ); $form['comment']['comment_default_order'] = array( '#type' => 'radios', '#title' => t('Default display order'), - '#default_value' => variable_get('comment_default_order_'. $form['#node_type']->type, COMMENT_ORDER_NEWEST_FIRST), + '#default_value' => variable_get('comment_default_order_' . $form['#node_type']->type, COMMENT_ORDER_NEWEST_FIRST), '#options' => _comment_get_orders(), '#description' => t('The default sorting for new users and anonymous users while viewing comments. These users may change their view using the comment control panel. For registered users, this change is remembered as a persistent user preference.'), ); $form['comment']['comment_default_per_page'] = array( '#type' => 'select', '#title' => t('Default comments per page'), - '#default_value' => variable_get('comment_default_per_page_'. $form['#node_type']->type, 50), + '#default_value' => variable_get('comment_default_per_page_' . $form['#node_type']->type, 50), '#options' => _comment_per_page(), '#description' => t('Default number of comments for each page: more comments are distributed in several pages.'), ); $form['comment']['comment_controls'] = array( '#type' => 'radios', '#title' => t('Comment controls'), - '#default_value' => variable_get('comment_controls_'. $form['#node_type']->type, COMMENT_CONTROLS_HIDDEN), + '#default_value' => variable_get('comment_controls_' . $form['#node_type']->type, COMMENT_CONTROLS_HIDDEN), '#options' => array( t('Display above the comments'), t('Display below the comments'), @@ -558,7 +558,7 @@ function comment_form_alter(&$form, $form_state, $form_id) { $form['comment']['comment_anonymous'] = array( '#type' => 'radios', '#title' => t('Anonymous commenting'), - '#default_value' => variable_get('comment_anonymous_'. $form['#node_type']->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT), + '#default_value' => variable_get('comment_anonymous_' . $form['#node_type']->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT), '#options' => array( COMMENT_ANONYMOUS_MAYNOT_CONTACT => t('Anonymous posters may not enter their contact information'), COMMENT_ANONYMOUS_MAY_CONTACT => t('Anonymous posters may leave their contact information'), @@ -571,26 +571,26 @@ function comment_form_alter(&$form, $form_state, $form_id) { $form['comment']['comment_subject_field'] = array( '#type' => 'radios', '#title' => t('Comment subject field'), - '#default_value' => variable_get('comment_subject_field_'. $form['#node_type']->type, 1), + '#default_value' => variable_get('comment_subject_field_' . $form['#node_type']->type, 1), '#options' => array(t('Disabled'), t('Enabled')), '#description' => t('Can users provide a unique subject for their comments?'), ); $form['comment']['comment_preview'] = array( '#type' => 'radios', '#title' => t('Preview comment'), - '#default_value' => variable_get('comment_preview_'. $form['#node_type']->type, COMMENT_PREVIEW_REQUIRED), + '#default_value' => variable_get('comment_preview_' . $form['#node_type']->type, COMMENT_PREVIEW_REQUIRED), '#options' => array(t('Optional'), t('Required')), '#description' => t("Forces a user to look at their comment by clicking on a 'Preview' button before they can actually add the comment"), ); $form['comment']['comment_form_location'] = array( '#type' => 'radios', '#title' => t('Location of comment submission form'), - '#default_value' => variable_get('comment_form_location_'. $form['#node_type']->type, COMMENT_FORM_SEPARATE_PAGE), + '#default_value' => variable_get('comment_form_location_' . $form['#node_type']->type, COMMENT_FORM_SEPARATE_PAGE), '#options' => array(t('Display on separate page'), t('Display below post or comments')), ); } elseif (isset($form['type']) && isset($form['#node'])) { - if ($form['type']['#value'] .'_node_form' == $form_id) { + if ($form['type']['#value'] . '_node_form' == $form_id) { $node = $form['#node']; $form['comment_settings'] = array( '#type' => 'fieldset', @@ -638,7 +638,7 @@ function comment_nodeapi(&$node, $op, $arg = 0) { $text = ''; $comments = db_query('SELECT subject, comment, format FROM {comments} WHERE nid = %d AND status = %d', $node->nid, COMMENT_PUBLISHED); while ($comment = db_fetch_object($comments)) { - $text .= '

    '. check_plain($comment->subject) .'

    '. check_markup($comment->comment, $comment->format, FALSE); + $text .= '

    ' . check_plain($comment->subject) . '

    ' . check_markup($comment->comment, $comment->format, FALSE); } return $text; @@ -648,7 +648,7 @@ function comment_nodeapi(&$node, $op, $arg = 0) { case 'rss item': if ($node->comment != COMMENT_NODE_DISABLED) { - return array(array('key' => 'comments', 'value' => url('node/'. $node->nid, array('fragment' => 'comments', 'absolute' => TRUE)))); + return array(array('key' => 'comments', 'value' => url('node/' . $node->nid, array('fragment' => 'comments', 'absolute' => TRUE)))); } else { return array(); @@ -696,7 +696,7 @@ function comment_access($op, $comment) { * The 0th and the 1st path components joined by a slash. */ function comment_node_url() { - return arg(0) .'/'. arg(1); + return arg(0) . '/' . arg(1); } /** @@ -727,7 +727,7 @@ function comment_save($edit) { comment_invoke_comment($edit, 'update'); // Add an entry to the watchdog log. - watchdog('content', 'Comment: updated %subject.', array('%subject' => $edit['subject']), WATCHDOG_NOTICE, l(t('view'), 'node/'. $edit['nid'], array('fragment' => 'comment-'. $edit['cid']))); + watchdog('content', 'Comment: updated %subject.', array('%subject' => $edit['subject']), WATCHDOG_NOTICE, l(t('view'), 'node/' . $edit['nid'], array('fragment' => 'comment-' . $edit['cid']))); } else { // Add the comment to database. @@ -742,7 +742,7 @@ function comment_save($edit) { $max = rtrim($max, '/'); // Finally, build the thread field for this new comment. - $thread = int2vancode(vancode2int($max) + 1) .'/'; + $thread = int2vancode(vancode2int($max) + 1) . '/'; } else { // This is comment with a parent comment: we increase @@ -759,7 +759,7 @@ function comment_save($edit) { if ($max == '') { // First child of this parent. - $thread = $parent->thread .'.'. int2vancode(0) .'/'; + $thread = $parent->thread . '.' . int2vancode(0) . '/'; } else { // Strip the "/" at the end of the thread. @@ -771,7 +771,7 @@ function comment_save($edit) { $last = $parts[$parent_depth]; // Finally, build the thread field for this new comment. - $thread = $parent->thread .'.'. int2vancode(vancode2int($last) + 1) .'/'; + $thread = $parent->thread . '.' . int2vancode(vancode2int($last) + 1) . '/'; } } @@ -788,7 +788,7 @@ function comment_save($edit) { comment_invoke_comment($edit, 'insert'); // Add an entry to the watchdog log. - watchdog('content', 'Comment: added %subject.', array('%subject' => $edit['subject']), WATCHDOG_NOTICE, l(t('view'), 'node/'. $edit['nid'], array('fragment' => 'comment-'. $edit['cid']))); + watchdog('content', 'Comment: added %subject.', array('%subject' => $edit['subject']), WATCHDOG_NOTICE, l(t('view'), 'node/' . $edit['nid'], array('fragment' => 'comment-' . $edit['cid']))); } _comment_update_node_statistics($edit['nid']); @@ -1014,7 +1014,7 @@ function comment_render($node, $cid = 0) { $divs = 0; $num_rows = FALSE; $comments = ''; - drupal_add_css(drupal_get_path('module', 'comment') .'/comment.css'); + drupal_add_css(drupal_get_path('module', 'comment') . '/comment.css'); while ($comment = db_fetch_object($result)) { $comment = drupal_unpack($comment); $comment->name = $comment->uid ? $comment->registered_name : $comment->name; @@ -1052,7 +1052,7 @@ function comment_render($node, $cid = 0) { $comments .= ''; } - $comment_controls = variable_get('comment_controls_'. $node->type, COMMENT_CONTROLS_HIDDEN); + $comment_controls = variable_get('comment_controls_' . $node->type, COMMENT_CONTROLS_HIDDEN); if ($num_rows && ($comment_controls == COMMENT_CONTROLS_ABOVE || $comment_controls == COMMENT_CONTROLS_ABOVE_BELOW)) { $output .= drupal_get_form('comment_controls', $mode, $order, $comments_per_page); } @@ -1067,7 +1067,7 @@ function comment_render($node, $cid = 0) { // If enabled, show new comment form if it's not already being displayed. $reply = arg(0) == 'comment' && arg(1) == 'reply'; - if (user_access('post comments') && node_comment_mode($nid) == COMMENT_NODE_READ_WRITE && (variable_get('comment_form_location_'. $node->type, COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_BELOW) && !$reply) { + if (user_access('post comments') && node_comment_mode($nid) == COMMENT_NODE_READ_WRITE && (variable_get('comment_form_location_' . $node->type, COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_BELOW) && !$reply) { $output .= comment_form_box(array('nid' => $nid), t('Post new comment')); } @@ -1089,20 +1089,20 @@ function comment_render($node, $cid = 0) { function comment_operations($action = NULL) { if ($action == 'publish') { $operations = array( - 'publish' => array(t('Publish the selected comments'), 'UPDATE {comments} SET status = '. COMMENT_PUBLISHED .' WHERE cid = %d'), + 'publish' => array(t('Publish the selected comments'), 'UPDATE {comments} SET status = ' . COMMENT_PUBLISHED . ' WHERE cid = %d'), 'delete' => array(t('Delete the selected comments'), '') ); } else if ($action == 'unpublish') { $operations = array( - 'unpublish' => array(t('Unpublish the selected comments'), 'UPDATE {comments} SET status = '. COMMENT_NOT_PUBLISHED .' WHERE cid = %d'), + 'unpublish' => array(t('Unpublish the selected comments'), 'UPDATE {comments} SET status = ' . COMMENT_NOT_PUBLISHED . ' WHERE cid = %d'), 'delete' => array(t('Delete the selected comments'), '') ); } else { $operations = array( - 'publish' => array(t('Publish the selected comments'), 'UPDATE {comments} SET status = '. COMMENT_PUBLISHED .' WHERE cid = %d'), - 'unpublish' => array(t('Unpublish the selected comments'), 'UPDATE {comments} SET status = '. COMMENT_NOT_PUBLISHED .' WHERE cid = %d'), + 'publish' => array(t('Publish the selected comments'), 'UPDATE {comments} SET status = ' . COMMENT_PUBLISHED . ' WHERE cid = %d'), + 'unpublish' => array(t('Unpublish the selected comments'), 'UPDATE {comments} SET status = ' . COMMENT_NOT_PUBLISHED . ' WHERE cid = %d'), 'delete' => array(t('Delete the selected comments'), '') ); } @@ -1218,7 +1218,7 @@ function comment_validate($edit) { // Check validity of name, mail and homepage (if given) if (!$user->uid || isset($edit['is_anonymous'])) { $node = node_load($edit['nid']); - if (variable_get('comment_anonymous_'. $node->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT) > COMMENT_ANONYMOUS_MAYNOT_CONTACT) { + if (variable_get('comment_anonymous_' . $node->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT) > COMMENT_ANONYMOUS_MAYNOT_CONTACT) { if ($edit['name']) { $taken = db_result(db_query("SELECT COUNT(uid) FROM {users} WHERE LOWER(name) = '%s'", $edit['name'])); @@ -1227,7 +1227,7 @@ function comment_validate($edit) { } } - else if (variable_get('comment_anonymous_'. $node->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT) == COMMENT_ANONYMOUS_MUST_CONTACT) { + else if (variable_get('comment_anonymous_' . $node->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT) == COMMENT_ANONYMOUS_MUST_CONTACT) { form_set_error('name', t('You have to leave your name.')); } @@ -1236,7 +1236,7 @@ function comment_validate($edit) { form_set_error('mail', t('The e-mail address you specified is not valid.')); } } - else if (variable_get('comment_anonymous_'. $node->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT) == COMMENT_ANONYMOUS_MUST_CONTACT) { + else if (variable_get('comment_anonymous_' . $node->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT) == COMMENT_ANONYMOUS_MUST_CONTACT) { form_set_error('mail', t('You have to leave an e-mail address.')); } @@ -1266,8 +1266,8 @@ function comment_form(&$form_state, $edit, $title = NULL) { $op = isset($_POST['op']) ? $_POST['op'] : ''; $node = node_load($edit['nid']); - if (!$user->uid && variable_get('comment_anonymous_'. $node->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT) != COMMENT_ANONYMOUS_MAYNOT_CONTACT) { - drupal_add_js(drupal_get_path('module', 'comment') .'/comment.js'); + if (!$user->uid && variable_get('comment_anonymous_' . $node->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT) != COMMENT_ANONYMOUS_MAYNOT_CONTACT) { + drupal_add_js(drupal_get_path('module', 'comment') . '/comment.js'); } $edit += array('name' => '', 'mail' => '', 'homepage' => ''); if ($user->uid) { @@ -1359,7 +1359,7 @@ function comment_form(&$form_state, $edit, $title = NULL) { $form['author'] = array('#type' => 'value', '#value' => $user->name); } } - else if (variable_get('comment_anonymous_'. $node->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT) == COMMENT_ANONYMOUS_MAY_CONTACT) { + else if (variable_get('comment_anonymous_' . $node->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT) == COMMENT_ANONYMOUS_MAY_CONTACT) { $form['name'] = array('#type' => 'textfield', '#title' => t('Your name'), '#maxlength' => 60, '#size' => 30, '#default_value' => $edit['name'] ? $edit['name'] : variable_get('anonymous', t('Anonymous')) ); @@ -1368,7 +1368,7 @@ function comment_form(&$form_state, $edit, $title = NULL) { $form['homepage'] = array('#type' => 'textfield', '#title' => t('Homepage'), '#maxlength' => 255, '#size' => 30, '#default_value' => $edit['homepage']); } - else if (variable_get('comment_anonymous_'. $node->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT) == COMMENT_ANONYMOUS_MUST_CONTACT) { + else if (variable_get('comment_anonymous_' . $node->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT) == COMMENT_ANONYMOUS_MUST_CONTACT) { $form['name'] = array('#type' => 'textfield', '#title' => t('Your name'), '#maxlength' => 60, '#size' => 30, '#default_value' => $edit['name'] ? $edit['name'] : variable_get('anonymous', t('Anonymous')), '#required' => TRUE); $form['mail'] = array('#type' => 'textfield', '#title' => t('E-mail'), '#maxlength' => 64, '#size' => 30, '#default_value' => $edit['mail'], '#description' => t('The content of this field is kept private and will not be shown publicly.'), '#required' => TRUE); @@ -1376,7 +1376,7 @@ function comment_form(&$form_state, $edit, $title = NULL) { $form['homepage'] = array('#type' => 'textfield', '#title' => t('Homepage'), '#maxlength' => 255, '#size' => 30, '#default_value' => $edit['homepage']); } - if (variable_get('comment_subject_field_'. $node->type, 1) == 1) { + if (variable_get('comment_subject_field_' . $node->type, 1) == 1) { $form['subject'] = array('#type' => 'textfield', '#title' => t('Subject'), '#maxlength' => 64, '#default_value' => !empty($edit['subject']) ? $edit['subject'] : ''); } @@ -1407,19 +1407,19 @@ function comment_form(&$form_state, $edit, $title = NULL) { // Only show save button if preview is optional or if we are in preview mode. // We show the save button in preview mode even if there are form errors so that // optional form elements (e.g., captcha) can be updated in preview mode. - if (!form_get_errors() && ((variable_get('comment_preview_'. $node->type, COMMENT_PREVIEW_REQUIRED) == COMMENT_PREVIEW_OPTIONAL) || ($op == t('Preview')) || ($op == t('Save')))) { + if (!form_get_errors() && ((variable_get('comment_preview_' . $node->type, COMMENT_PREVIEW_REQUIRED) == COMMENT_PREVIEW_OPTIONAL) || ($op == t('Preview')) || ($op == t('Save')))) { $form['submit'] = array('#type' => 'submit', '#value' => t('Save'), '#weight' => 19); } $form['preview'] = array('#type' => 'button', '#value' => t('Preview'), '#weight' => 20); - $form['#token'] = 'comment'. $edit['nid'] . (isset($edit['pid']) ? $edit['pid'] : ''); + $form['#token'] = 'comment' . $edit['nid'] . (isset($edit['pid']) ? $edit['pid'] : ''); if ($op == t('Preview')) { $form['#after_build'] = array('comment_form_add_preview'); } if (empty($edit['cid']) && empty($edit['pid'])) { - $form['#action'] = url('comment/reply/'. $edit['nid']); + $form['#action'] = url('comment/reply/' . $edit['nid']); } return $form; @@ -1511,7 +1511,7 @@ function comment_form_validate($form, &$form_state) { foreach (array('name', 'homepage', 'mail') as $field) { // Set cookie for 365 days. if (isset($form_state['values'][$field])) { - setcookie('comment_info_'. $field, $form_state['values'][$field], time() + 31536000, '/'); + setcookie('comment_info_' . $field, $form_state['values'][$field], time() + 31536000, '/'); } } } @@ -1560,7 +1560,7 @@ function comment_form_submit($form, &$form_state) { if ($cid = comment_save($form_state['values'])) { $node = node_load($form_state['values']['nid']); $page = comment_new_page_count($node->comment_count, 1, $node); - $form_state['redirect'] = array('node/'. $node->nid, $page, "comment-$cid"); + $form_state['redirect'] = array('node/' . $node->nid, $page, "comment-$cid"); return; } } @@ -1660,7 +1660,7 @@ function theme_comment_controls($form) { $output = '
    '; $output .= drupal_render($form); $output .= '
    '; - $output .= '
    '. t('Select your preferred way to display the comments and click "Save settings" to activate your changes.') .'
    '; + $output .= '
    ' . t('Select your preferred way to display the comments and click "Save settings" to activate your changes.') . '
    '; return theme('box', t('Comment viewing options'), $output); } @@ -1708,7 +1708,7 @@ function template_preprocess_comment(&$variables) { $variables['signature'] = $comment->signature; $variables['submitted'] = theme('comment_submitted', $comment); $variables['title'] = l($comment->subject, $_GET['q'], array('fragment' => "comment-$comment->cid")); - $variables['template_files'][] = 'comment-'. $node->type; + $variables['template_files'][] = 'comment-' . $node->type; // set status to a string representation of comment->status. if (isset($comment->preview)) { $variables['status'] = 'comment-preview'; @@ -1729,7 +1729,7 @@ function template_preprocess_comment_folded(&$variables) { $variables['author'] = theme('username', $comment); $variables['date'] = format_date($comment->timestamp); $variables['new'] = $comment->new ? t('new') : ''; - $variables['title'] = l($comment->subject, comment_node_url() .'/'. $comment->cid, array('fragment' => "comment-$comment->cid")); + $variables['title'] = l($comment->subject, comment_node_url() . '/' . $comment->cid, array('fragment' => "comment-$comment->cid")); } /** @@ -1805,11 +1805,11 @@ function theme_comment_post_forbidden($node) { if ($authenticated_post_comments) { // We cannot use drupal_get_destination() because these links // sometimes appear on /node and taxonomy listing pages. - if (variable_get('comment_form_location_'. $node->type, COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_SEPARATE_PAGE) { - $destination = 'destination='. drupal_urlencode("comment/reply/$node->nid#comment-form"); + if (variable_get('comment_form_location_' . $node->type, COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_SEPARATE_PAGE) { + $destination = 'destination=' . drupal_urlencode("comment/reply/$node->nid#comment-form"); } else { - $destination = 'destination='. drupal_urlencode("node/$node->nid#comment-form"); + $destination = 'destination=' . drupal_urlencode("node/$node->nid#comment-form"); } if (variable_get('user_register', 1)) { @@ -1834,8 +1834,8 @@ function template_preprocess_comment_wrapper(&$variables) { // Provide contextual information. $variables['display_mode'] = _comment_get_display_setting('mode', $variables['node']); $variables['display_order'] = _comment_get_display_setting('sort', $variables['node']); - $variables['comment_controls_state'] = variable_get('comment_controls_'. $variables['node']->type, COMMENT_CONTROLS_HIDDEN); - $variables['template_files'][] = 'comment-wrapper-'. $variables['node']->type; + $variables['comment_controls_state'] = variable_get('comment_controls_' . $variables['node']->type, COMMENT_CONTROLS_HIDDEN); + $variables['template_files'][] = 'comment-wrapper-' . $variables['node']->type; } /** @@ -1907,15 +1907,15 @@ function _comment_get_display_setting($setting, $node) { // get the setting's site default switch ($setting) { case 'mode': - $default = variable_get('comment_default_mode_'. $node->type, COMMENT_MODE_THREADED_EXPANDED); + $default = variable_get('comment_default_mode_' . $node->type, COMMENT_MODE_THREADED_EXPANDED); break; case 'sort': - $default = variable_get('comment_default_order_'. $node->type, COMMENT_ORDER_NEWEST_FIRST); + $default = variable_get('comment_default_order_' . $node->type, COMMENT_ORDER_NEWEST_FIRST); break; case 'comments_per_page': - $default = variable_get('comment_default_per_page_'. $node->type, 50); + $default = variable_get('comment_default_per_page_' . $node->type, 50); } - if (variable_get('comment_controls_'. $node->type, COMMENT_CONTROLS_HIDDEN) == COMMENT_CONTROLS_HIDDEN) { + if (variable_get('comment_controls_' . $node->type, COMMENT_CONTROLS_HIDDEN) == COMMENT_CONTROLS_HIDDEN) { // if comment controls are disabled use site default $value = $default; } @@ -1924,8 +1924,8 @@ function _comment_get_display_setting($setting, $node) { if (isset($user->$setting) && $user->$setting) { $value = $user->$setting; } - else if (isset($_SESSION['comment_'. $setting]) && $_SESSION['comment_'. $setting]) { - $value = $_SESSION['comment_'. $setting]; + else if (isset($_SESSION['comment_' . $setting]) && $_SESSION['comment_' . $setting]) { + $value = $_SESSION['comment_' . $setting]; } else { $value = $default; @@ -1974,7 +1974,7 @@ function _comment_update_node_statistics($nid) { function comment_invoke_comment(&$comment, $op) { $return = array(); foreach (module_implements('comment') as $name) { - $function = $name .'_comment'; + $function = $name . '_comment'; $result = $function($comment, $op); if (isset($result) && is_array($result)) { $return = array_merge($return, $result); @@ -2090,7 +2090,7 @@ function comment_unpublish_by_keyword_action_form($context) { $form['keywords'] = array( '#title' => t('Keywords'), '#type' => 'textarea', - '#description' => t('The comment will be unpublished if it contains any of the character sequences above. Use a comma-separated list of character sequences. Example: funny, bungee jumping, "Company, Inc.". Character sequences are case-sensitive.'), + '#description' => t('The comment will be unpublished if it contains any of the character sequences above. Use a comma-separated list of character sequences. Example: funny, bungee jumping, "Company, Inc." . Character sequences are case-sensitive.'), '#default_value' => isset($context['keywords']) ? drupal_implode_tags($context['keywords']) : '', ); return $form; diff --git a/modules/comment/comment.pages.inc b/modules/comment/comment.pages.inc index f4b770677b3543276aa0c2bc9bf971ebc93261b5..a83fc54df3e815c3124519bd1c0d37e697a3e71b 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 2207246821424d8245236304d9de872d2350fe9a..69a5ff5216f0ebbb5ceaeb3b16119e776169df46 100644 --- a/modules/comment/comment.tpl.php +++ b/modules/comment/comment.tpl.php @@ -26,7 +26,7 @@ * @see theme_comment() */ ?> -
    +
    new): ?> diff --git a/modules/contact/contact.admin.inc b/modules/contact/contact.admin.inc index 38360d4fb2c393a4cd1538c1354c6840e029dbaf..16178078c438a14b6222debed2897c4b451d59a5 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 7883fe869559c04833ceb35d175e62fe3d5aa021..94ebc0922e399931ebf914faa9df6f5f628e181f 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 = '

    '. 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 contact page). 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'))) .'

    '; - $output .= '

    '. 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 My account page. If enabled, a Contact 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 Contact tab is only visible when viewing another user's profile (users do not see their own Contact tab).") .'

    '; - $output .= '

    '. t('The contact page 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 access site-wide contact form permission may access the contact page.', array('@contact' => url('contact'))) .'

    '; - $output .= '

    '. t('A link to your site\'s contact page from the main Navigation 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'))) .'

    '; - $output .= '

    '. t('Customize the contact page with additional information (like physical location, mailing address, and telephone number) using the contact form settings page. The settings page 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'))) .'

    '; - $output .= '

    '. t('For more information, see the online handbook entry for Contact module.', array('@contact' => url('http://drupal.org/handbook/modules/contact/', array('absolute' => TRUE)))) .'

    '; + $output = '

    ' . 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 contact page). 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'))) . '

    '; + $output .= '

    ' . 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 My account page. If enabled, a Contact 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 Contact tab is only visible when viewing another user's profile (users do not see their own Contact tab).") . '

    '; + $output .= '

    ' . t('The contact page 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 access site-wide contact form permission may access the contact page.', array('@contact' => url('contact'))) . '

    '; + $output .= '

    ' . t('A link to your site\'s contact page from the main Navigation 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'))) . '

    '; + $output .= '

    ' . t('Customize the contact page with additional information (like physical location, mailing address, and telephone number) using the contact form settings page. The settings page 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'))) . '

    '; + $output .= '

    ' . t('For more information, see the online handbook entry for Contact module.', array('@contact' => url('http://drupal.org/handbook/modules/contact/', array('absolute' => TRUE)))) . '

    '; return $output; case 'admin/build/contact': - $output = '

    '. t('This page lets you set up your site-wide contact form. 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 settings page, 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'))) .'

    '; + $output = '

    ' . t('This page lets you set up your site-wide contact form. 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 settings page, 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'))) . '

    '; if (!module_exists('menu')) { $menu_note = t('The menu item can be customized and configured only once the menu module has been enabled.', array('@modules-page' => url('admin/settings/modules'))); } else { $menu_note = ''; } - $output .= '

    '. t('The contact module also adds a menu item (disabled by default) to the navigation block.', array('@menu-settings' => url('admin/build/menu'))) .' '. $menu_note .'

    '; + $output .= '

    ' . t('The contact module also adds a menu item (disabled by default) to the navigation block.', array('@menu-settings' => url('admin/build/menu'))) . ' ' . $menu_note . '

    '; 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 5a53eeddd2ff3a666f21d557c294a9f4aceab3ff..d801024f9c1cc732a8babf1ce0313fa326e64a78 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) .' <'. check_plain($user->mail) .'>', + '#value' => check_plain($user->name) . ' <' . check_plain($user->mail) . '>', ); $form['to'] = array('#type' => 'item', '#title' => t('To'), diff --git a/modules/dblog/dblog.admin.inc b/modules/dblog/dblog.admin.inc index 2c5924bb5969c328f05b33c818e2926808106df8..4a38e8c6275115c74d4376b5fef6bfeaaf92c4bc 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 04529d64aefe09f47c16d6f258ea0b956a5745e5..0fb1d093c6a635479b68d7c3f61dba7b401939b7 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 = '

    '. 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.') .'

    '; - $output .= '

    '. 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.') .'

    '; - $output .= '

    '. t('For more information, see the online handbook entry for Dblog module.', array('@dblog' => 'http://drupal.org/handbook/modules/dblog/')) .'

    '; + $output = '

    ' . 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.') . '

    '; + $output .= '

    ' . 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.') . '

    '; + $output .= '

    ' . t('For more information, see the online handbook entry for Dblog module.', array('@dblog' => 'http://drupal.org/handbook/modules/dblog/')) . '

    '; return $output; case 'admin/reports/dblog': - return '

    '. 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.') .'

    '; + return '

    ' . 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.') . '

    '; } } @@ -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 .= '
    '. drupal_render($form['buttons']) .'
    '; + $output .= '
    ' . drupal_render($form['buttons']) . '
    '; return $output; } diff --git a/modules/filter/filter.admin.inc b/modules/filter/filter.admin.inc index 83b918cb8ac51b64aa620b63f737a6585f7fb60f..60214e47b40fc376c8d32afef7bf8cc8ddfb6507 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 = '

    '. l(t('More information about formatting options'), 'filter/tips') .'

    '; + $extra = '

    ' . l(t('More information about formatting options'), 'filter/tips') . '

    '; $tiplist = theme('filter_tips', $tips, FALSE, $extra); if (!$tiplist) { - $tiplist = '

    '. t('No guidelines available.') .'

    '; + $tiplist = '

    ' . t('No guidelines available.') . '

    '; } - $group = '

    '. t('These are the guidelines that users will see for posting in this input format. They are automatically generated from the filter settings.') .'

    '; + $group = '

    ' . t('These are the guidelines that users will see for posting in this input format. They are automatically generated from the filter settings.') . '

    '; $group .= $tiplist; - $form['tips'] = array('#value' => '

    '. t('Formatting guidelines') .'

    '. $group); + $form['tips'] = array('#value' => '

    ' . t('Formatting guidelines') . '

    ' . $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 fc01608a80d8a27d9cd439b88833a1d1d9c8fa40..27f7a98fda1907aacfb53c2a893292d2c3c0947d 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 61ea76d5eb3f4ff1da2e38594d8fb39130445c2e..98bbba41b61c1e6b8cabc2d338c6131c9c4cb0b5 100644 --- a/modules/filter/filter.module +++ b/modules/filter/filter.module @@ -20,22 +20,22 @@ function filter_help($path, $arg) { switch ($path) { case 'admin/help#filter': - $output = '

    '. 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 Filtered HTML (which allows only an administrator-approved subset of HTML tags) and Full HTML (which allows the full set of HTML tags). Additional input formats may be created by an administrator.") .'

    '; - $output .= '

    '. 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.') .'

    '; - $output .= '

    '. t('Users with access to more than one input format can use the Input format 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 Input format fieldset.') .'

    '; - $output .= '

    '. t('For more information, see the online handbook entry for Filter module.', array('@filter' => 'http://drupal.org/handbook/modules/filter/')) .'

    '; + $output = '

    ' . 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 Filtered HTML (which allows only an administrator-approved subset of HTML tags) and Full HTML (which allows the full set of HTML tags). Additional input formats may be created by an administrator.") . '

    '; + $output .= '

    ' . 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.') . '

    '; + $output .= '

    ' . t('Users with access to more than one input format can use the Input format 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 Input format fieldset.') . '

    '; + $output .= '

    ' . t('For more information, see the online handbook entry for Filter module.', array('@filter' => 'http://drupal.org/handbook/modules/filter/')) . '

    '; return $output; case 'admin/settings/filters': - $output = '

    '. 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 Input format fieldset. (The Input format fieldset is displayed below textareas when users with access to more than one input format create multi-line content.) The input format selected as Default 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.') .'

    '; - $output .= '

    '. 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 Name 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 Save changes button at the bottom of the page.') .'

    '; + $output = '

    ' . 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 Input format fieldset. (The Input format fieldset is displayed below textareas when users with access to more than one input format create multi-line content.) The input format selected as Default 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.') . '

    '; + $output .= '

    ' . 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 Name 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 Save changes button at the bottom of the page.') . '

    '; return $output; case 'admin/settings/filters/%': - return '

    '. t('Every filter 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 rearrange them.', array('@rearrange' => url('admin/settings/filters/'. $arg[3] .'/order'))) .'

    '; + return '

    ' . t('Every filter 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 rearrange them.', array('@rearrange' => url('admin/settings/filters/' . $arg[3] . '/order'))) . '

    '; case 'admin/settings/filters/%/configure': - return '

    '. t('If you cannot find the settings for a certain filter, make sure you have enabled it on the view tab first.', array('@url' => url('admin/settings/filters/'. $arg[3]))) .'

    '; + return '

    ' . t('If you cannot find the settings for a certain filter, make sure you have enabled it on the view tab first.', array('@url' => url('admin/settings/filters/' . $arg[3]))) . '

    '; case 'admin/settings/filters/%/order': - $output = '

    '. 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.') .'

    '; - $output .= '

    '. t("Filters are executed from top-to-bottom. To change the order of the filters, modify the values in the Weight column or grab a drag-and-drop handle under the Name 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 Save configuration button at the bottom of the page.") .'

    '; + $output = '

    ' . 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.') . '

    '; + $output .= '

    ' . t("Filters are executed from top-to-bottom. To change the order of the filters, modify the values in the Weight column or grab a drag-and-drop handle under the Name 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 Save configuration button at the bottom of the page.") . '

    '; 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 = '

    '. t('Allowed HTML tags: @tags', array('@tags' => $allowed_html)) .'

    '; + $output = '

    ' . t('Allowed HTML tags: @tags', array('@tags' => $allowed_html)) . '

    '; if (!variable_get("filter_html_help_$format", 1)) { return $output; } - $output .= '

    '. 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.') .'

    '; - $output .= '

    '. t('For more information see W3C\'s HTML Specifications or use your favorite search engine to find other sites that explain HTML.', array('@html-specifications' => 'http://www.w3.org/TR/html/')) .'

    '; + $output .= '

    ' . 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.') . '

    '; + $output .= '

    ' . t('For more information see W3C\'s HTML Specifications or use your favorite search engine to find other sites that explain HTML.', array('@html-specifications' => 'http://www.w3.org/TR/html/')) . '

    '; $tips = array( - 'a' => array( t('Anchors are used to make links to other pages.'), ''. variable_get('site_name', 'Drupal') .''), + 'a' => array( t('Anchors are used to make links to other pages.'), '' . variable_get('site_name', 'Drupal') . ''), '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
    line break')), - 'p' => array( t('By default paragraph tags are automatically added, so use this tag to add additional ones.'), '

    '. t('Paragraph one.') .'

    '. t('Paragraph two.') .'

    '), - 'strong' => array( t('Strong'), ''. t('Strong') .''), - 'em' => array( t('Emphasized'), ''. t('Emphasized') .''), - 'cite' => array( t('Cited'), ''. t('Cited') .''), - 'code' => array( t('Coded text used to show programming source code'), ''. t('Coded') .''), - 'b' => array( t('Bolded'), ''. t('Bolded') .''), - 'u' => array( t('Underlined'), ''. t('Underlined') .''), - 'i' => array( t('Italicized'), ''. t('Italicized') .''), + 'p' => array( t('By default paragraph tags are automatically added, so use this tag to add additional ones.'), '

    ' . t('Paragraph one.') . '

    ' . t('Paragraph two.') . '

    '), + 'strong' => array( t('Strong'), '' . t('Strong') . ''), + 'em' => array( t('Emphasized'), '' . t('Emphasized') . ''), + 'cite' => array( t('Cited'), '' . t('Cited') . ''), + 'code' => array( t('Coded text used to show programming source code'), '' . t('Coded') . ''), + 'b' => array( t('Bolded'), '' . t('Bolded') . ''), + 'u' => array( t('Underlined'), '' . t('Underlined') . ''), + 'i' => array( t('Italicized'), '' . t('Italicized') . ''), 'sup' => array( t('Superscripted'), t('Superscripted')), 'sub' => array( t('Subscripted'), t('Subscripted')), - 'pre' => array( t('Preformatted'), '
    '. t('Preformatted') .'
    '), + 'pre' => array( t('Preformatted'), '
    ' . t('Preformatted') . '
    '), 'abbr' => array( t('Abbreviation'), t('Abbrev.')), 'acronym' => array( t('Acronym'), t('TLA')), - 'blockquote' => array( t('Block quoted'), '
    '. t('Block quoted') .'
    '), - 'q' => array( t('Quoted inline'), ''. t('Quoted inline') .''), + 'blockquote' => array( t('Block quoted'), '
    ' . t('Block quoted') . '
    '), + 'q' => array( t('Quoted inline'), '' . t('Quoted inline') . ''), // Assumes and describes tr, td, th. - 'table' => array( t('Table'), '
    block_title; ?> region_select; ?> weight_select; ?>
    '. t('Table header') .'
    '. t('Table cell') .'
    '), + 'table' => array( t('Table'), '
    ' . t('Table header') . '
    ' . t('Table cell') . '
    '), 'tr' => NULL, 'td' => NULL, 'th' => NULL, - 'del' => array( t('Deleted'), ''. t('Deleted') .''), - 'ins' => array( t('Inserted'), ''. t('Inserted') .''), + 'del' => array( t('Deleted'), '' . t('Deleted') . ''), + 'ins' => array( t('Inserted'), '' . t('Inserted') . ''), // Assumes and describes li. - 'ol' => array( t('Ordered list - use the <li> to begin each list item'), '
    1. '. t('First item') .'
    2. '. t('Second item') .'
    '), - 'ul' => array( t('Unordered list - use the <li> to begin each list item'), '
    • '. t('First item') .'
    • '. t('Second item') .'
    '), + 'ol' => array( t('Ordered list - use the <li> to begin each list item'), '
    1. ' . t('First item') . '
    2. ' . t('Second item') . '
    '), + 'ul' => array( t('Unordered list - use the <li> to begin each list item'), '
    • ' . t('First item') . '
    • ' . t('Second item') . '
    '), 'li' => NULL, // Assumes and describes dt and dd. - 'dl' => array( t('Definition lists are similar to other HTML lists. <dl> begins the definition list, <dt> begins the definition term and <dd> begins the definition description.'), '
    '. t('First term') .'
    '. t('First definition') .'
    '. t('Second term') .'
    '. t('Second definition') .'
    '), + 'dl' => array( t('Definition lists are similar to other HTML lists. <dl> begins the definition list, <dt> begins the definition term and <dd> begins the definition description.'), '
    ' . t('First term') . '
    ' . t('First definition') . '
    ' . t('Second term') . '
    ' . t('Second definition') . '
    '), 'dt' => NULL, 'dd' => NULL, - 'h1' => array( t('Header'), '

    '. t('Title') .'

    '), - 'h2' => array( t('Header'), '

    '. t('Subtitle') .'

    '), - 'h3' => array( t('Header'), '

    '. t('Subtitle three') .'

    '), - 'h4' => array( t('Header'), '

    '. t('Subtitle four') .'

    '), - 'h5' => array( t('Header'), '
    '. t('Subtitle five') .'
    '), - 'h6' => array( t('Header'), '
    '. t('Subtitle six') .'
    ') + 'h1' => array( t('Header'), '

    ' . t('Title') . '

    '), + 'h2' => array( t('Header'), '

    ' . t('Subtitle') . '

    '), + 'h3' => array( t('Header'), '

    ' . t('Subtitle three') . '

    '), + 'h4' => array( t('Header'), '

    ' . t('Subtitle four') . '

    '), + 'h5' => array( t('Header'), '
    ' . t('Subtitle five') . '
    '), + 'h6' => array( t('Header'), '
    ' . t('Subtitle six') . '
    ') ); $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' => ''. check_plain($tips[$tag][1]) .'', 'class' => 'type'), + array('data' => '' . check_plain($tips[$tag][1]) . '', '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 .= '

    '. t('Most unusual characters can be directly entered without any problems.') .'

    '; - $output .= '

    '. t('If you do encounter problems, try using HTML character entities. A common example looks like &amp; for an ampersand & character. For a full list of entities see HTML\'s entities page. Some of the available characters include:', array('@html-entities' => 'http://www.w3.org/TR/html4/sgml/entities.html')) .'

    '; + $output .= '

    ' . t('Most unusual characters can be directly entered without any problems.') . '

    '; + $output .= '

    ' . t('If you do encounter problems, try using HTML character entities. A common example looks like &amp; for an ampersand & character. For a full list of entities see HTML\'s entities page. Some of the available characters include:', array('@html-entities' => 'http://www.w3.org/TR/html4/sgml/entities.html')) . '

    '; $entities = array( array( t('Ampersand'), '&'), @@ -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' => ''. check_plain($entity[1]) .'', 'class' => 'type'), + array('data' => '' . check_plain($entity[1]) . '', '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 '

    '. l(t('More information about formatting options'), 'filter/tips') .'

    '; + return '

    ' . l(t('More information about formatting options'), 'filter/tips') . '

    '; } /** @@ -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("`(

    |

  • ||[ \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@:%_+*~#&=/;-]))([.,?!]*?)(?=(

    |
  • ||[ \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 .= ''; + $output .= ''; } 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 .= ''; + $output .= ''; } // 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 .= ''; + $output .= ''; } 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] .''. $caption .''. $match[5]; + return $match[1] . '' . $caption . '' . $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] .''. $caption .''. $match[3]; + return $match[1] . '' . $caption . '' . $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('|
    \s*
    |', "\n\n", $chunk); - $chunk = preg_replace('!(<'. $block .'[^>]*>)!', "\n$1", $chunk); // Space things out a little - $chunk = preg_replace('!()!', "$1\n\n", $chunk); // Space things out a little + $chunk = preg_replace('!(<' . $block . '[^>]*>)!', "\n$1", $chunk); // Space things out a little + $chunk = preg_replace('!()!', "$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', "

    $1

    \n", $chunk); // make paragraphs, including one at the end $chunk = preg_replace('|

    \s*

    \n|', '', $chunk); // under certain strange conditions it could create a P of entirely whitespace $chunk = preg_replace("|

    (|", "$1", $chunk); // problem with nested lists $chunk = preg_replace('|

    ]*)>|i', "

    ", $chunk); $chunk = str_replace('

    ', '

    ', $chunk); - $chunk = preg_replace('!

    \s*(]*>)!', "$1", $chunk); - $chunk = preg_replace('!(]*>)\s*

    !', "$1", $chunk); + $chunk = preg_replace('!

    \s*(]*>)!', "$1", $chunk); + $chunk = preg_replace('!(]*>)\s*

    !', "$1", $chunk); $chunk = preg_replace('|(?)\s*\n|', "
    \n", $chunk); // make line breaks - $chunk = preg_replace('!(]*>)\s*
    !', "$1", $chunk); + $chunk = preg_replace('!(]*>)\s*
    !', "$1", $chunk); $chunk = preg_replace('!
    (\s*)!', '$1', $chunk); $chunk = preg_replace('/&([^#])(?![A-Za-z0-9]{1,8};)/', '&$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 20c42095d64f826d295519542292c79a33c386b0..46af8bdcd0e48a6ad0dddd8b8d79c522d19e96a5 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 .= '
  • '; - $output .= ''. $name .':
    '; + $output .= '' . $name . ':
    '; } if (count($tiplist) > 0) { $output .= '
      '; foreach ($tiplist as $tip) { - $output .= '' : '>') . $tip['tip'] .''; + $output .= '' : '>') . $tip['tip'] . ''; } $output .= '
    '; } diff --git a/modules/forum/forum.admin.inc b/modules/forum/forum.admin.inc index e7b12d33552a7b0c0515e395333dab0613d8733d..ce910f9328fe47dfc6b49976cb54d0cff783ce52 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'] = ''. t('There are no existing containers or forums. Containers and forums may be added using the add container and add forum pages.', array('@container' => url('admin/content/forum/add/container'), '@forum' => url('admin/content/forum/add/forum'))) .''; + $form['#empty_text'] = '' . t('There are no existing containers or forums. Containers and forums may be added using the add container and add forum pages.', array('@container' => url('admin/content/forum/add/container'), '@forum' => url('admin/content/forum/add/forum'))) . ''; 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 4bf6ec90772c8416a8065dc8d77876c9bddd4d38..16cda7bd959c74b233c14ad25d6b99954ba04987 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 = '

    '. 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 forum topic menu item (under Create content on the Navigation menu) creates the initial post of a new threaded discussion, or thread.', array('@create-topic' => url('node/add/forum'))) .'

    '; - $output .= '

    '. 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.') .'

    '; - $output .= '

    '. t('When administering a forum, note that:') .'

    '; - $output .= '
    • '. t('a forum topic (and all of its comments) may be moved between forums by selecting a different forum while editing a forum topic.') .'
    • '; - $output .= '
    • '. t('when moving a forum topic between forums, the Leave shadow copy option creates a link in the original forum pointing to the new location.') .'
    • '; - $output .= '
    • '. t('selecting Read only under Comment settings while editing a forum topic will lock (prevent new comments) on the thread.') .'
    • '; - $output .= '
    • '. t('selecting Disabled under Comment settings while editing a forum topic will hide all existing comments on the thread, and prevent new ones.') .'
    '; - $output .= '

    '. t('For more information, see the online handbook entry for Forum module.', array('@forum' => 'http://drupal.org/handbook/modules/forum/')) .'

    '; + $output = '

    ' . 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 forum topic menu item (under Create content on the Navigation menu) creates the initial post of a new threaded discussion, or thread.', array('@create-topic' => url('node/add/forum'))) . '

    '; + $output .= '

    ' . 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.') . '

    '; + $output .= '

    ' . t('When administering a forum, note that:') . '

    '; + $output .= '
    • ' . t('a forum topic (and all of its comments) may be moved between forums by selecting a different forum while editing a forum topic.') . '
    • '; + $output .= '
    • ' . t('when moving a forum topic between forums, the Leave shadow copy option creates a link in the original forum pointing to the new location.') . '
    • '; + $output .= '
    • ' . t('selecting Read only under Comment settings while editing a forum topic will lock (prevent new comments) on the thread.') . '
    • '; + $output .= '
    • ' . t('selecting Disabled under Comment settings while editing a forum topic will hide all existing comments on the thread, and prevent new ones.') . '
    '; + $output .= '

    ' . t('For more information, see the online handbook entry for Forum module.', array('@forum' => 'http://drupal.org/handbook/modules/forum/')) . '

    '; return $output; case 'admin/content/forum': - return '

    '. 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 Name 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 Save button at the bottom of the page.') .'

    '; + return '

    ' . 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 Name 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 Save button at the bottom of the page.') . '

    '; case 'admin/content/forum/add/container': - return '

    '. 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.') .'

    '; + return '

    ' . 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.') . '

    '; case 'admin/content/forum/add/forum': - return '

    '. 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.') .'

    '; + return '

    ' . 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.') . '

    '; case 'admin/content/forum/settings': - return '

    '. 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 Content types on the forum vocabulary page.', array('@forum-vocabulary' => url('admin/content/taxonomy/edit/vocabulary/'. variable_get('forum_nav_vocabulary', '')))) .'

    '; + return '

    ' . 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 Content types on the forum vocabulary page.', array('@forum-vocabulary' => url('admin/content/taxonomy/edit/vocabulary/' . variable_get('forum_nav_vocabulary', '')))) . '

    '; } } @@ -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 7b70ce523fe8153cfd1e3bd4bf0391e220c02268..701f8fabc780ce9103aaff02c1a4196968329ad0 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 = '

    '. t('Help topics') .'

    '. t('Help is available on the following items:') .'

    '. help_links_as_list(); + drupal_add_css(drupal_get_path('module', 'help') . '/help.css', 'module', 'all', FALSE); + $output = '

    ' . t('Help topics') . '

    ' . t('Help is available on the following items:') . '

    ' . 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 = '
      '; $i = 0; foreach ($modules as $module => $name) { - $output .= '
    • '. l($name, 'admin/help/'. $module) .'
    • '; + $output .= '
    • ' . l($name, 'admin/help/' . $module) . '
    • '; if (($i + 1) % $break == 0 && ($i + 1) != $count) { - $output .= '
      '; + $output .= '
      '; } $i++; } diff --git a/modules/help/help.module b/modules/help/help.module index 2daff64b39f701ece9ec9c67947b8a13c9ff99be..0b7787089066f66b1811ae0088fbecd580ea768e 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 = '

      '. t('This guide provides context sensitive help on the use and configuration of Drupal and its modules, and is a supplement to the more extensive online Drupal handbook. 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')) .'

      '; + $output = '

      ' . t('This guide provides context sensitive help on the use and configuration of Drupal and its modules, and is a supplement to the more extensive online Drupal handbook. 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')) . '

      '; return $output; case 'admin/help#help': - $output = '

      '. t('The help module provides context sensitive help on the use and configuration of Drupal and its modules, and is a supplement to the more extensive online Drupal handbook. 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')) .'

      '; - $output .= '

      '. t('For more information, see the online handbook entry for Help module.', array('@help' => 'http://drupal.org/handbook/modules/help/')) .'

      '; + $output = '

      ' . t('The help module provides context sensitive help on the use and configuration of Drupal and its modules, and is a supplement to the more extensive online Drupal handbook. 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')) . '

      '; + $output .= '

      ' . t('For more information, see the online handbook entry for Help module.', array('@help' => 'http://drupal.org/handbook/modules/help/')) . '

      '; return $output; } } diff --git a/modules/locale/locale.install b/modules/locale/locale.install index 278fc33884b652b3d96fac1b1963dd58646b0864..3b3fdbab7002303525d14512d06828a5a6896308 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(''. $content_type->name ." 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('' . $content_type->name . " 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 f8de01ee1224576f278188d959a4ec87cc15a356..47c77204bd2c1ce9cdede8c7beddce717611ff09 100644 --- a/modules/locale/locale.module +++ b/modules/locale/locale.module @@ -32,44 +32,44 @@ function locale_help($path, $arg) { switch ($path) { case 'admin/help#locale': - $output = '

      '. 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.') .'

      '; - $output .= '

      '. 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 My account 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 content translation module to manage translated content.', array('@content-help' => url('admin/help/translation'))) .'

      '; - $output .= '

      '. t('Translations may be provided by:') .'

      '; - $output .= '
      • '. t("translating the original text via the locale module's integrated web interface, or") .'
      • '; - $output .= '
      • '. 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 (.po) format. Although not all languages are available for every version of Drupal, translation packages for many languages are available for download from the Drupal translation page.', array('@translations' => 'http://drupal.org/project/translations')) .'
      '; - $output .= '

      '. t('If an existing translation package does not meet your needs, the Gettext Portable Object (.po) files within a package may be modified, or new .po files may be created, using a desktop Gettext editor. The locale module\'s import feature allows the translated strings from a new or modified .po file to be added to your site. The locale module\'s export 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'))) .'

      '; - $output .= '

      '. t('For more information, see the online handbook entry for Locale module.', array('@locale' => 'http://drupal.org/handbook/modules/locale/')) .'

      '; + $output = '

      ' . 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.') . '

      '; + $output .= '

      ' . 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 My account 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 content translation module to manage translated content.', array('@content-help' => url('admin/help/translation'))) . '

      '; + $output .= '

      ' . t('Translations may be provided by:') . '

      '; + $output .= '
      • ' . t("translating the original text via the locale module's integrated web interface, or") . '
      • '; + $output .= '
      • ' . 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 (.po) format. Although not all languages are available for every version of Drupal, translation packages for many languages are available for download from the Drupal translation page.', array('@translations' => 'http://drupal.org/project/translations')) . '
      '; + $output .= '

      ' . t('If an existing translation package does not meet your needs, the Gettext Portable Object (.po) files within a package may be modified, or new .po files may be created, using a desktop Gettext editor. The locale module\'s import feature allows the translated strings from a new or modified .po file to be added to your site. The locale module\'s export 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'))) . '

      '; + $output .= '

      ' . t('For more information, see the online handbook entry for Locale module.', array('@locale' => 'http://drupal.org/handbook/modules/locale/')) . '

      '; return $output; case 'admin/settings/language': - $output = '

      '. 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 My account 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.") .'

      '; - $output .= '

      '. t('For each language available on the site, use the edit 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 Language selection when creating a post of a content type with multilingual support.') .'

      '; - $output .= '

      '. t('Use the add language page to enable additional languages (and automatically import files from a translation package, if available), the translate interface page to locate strings for manual translation, or the import page to add translations from individual .po files. A number of contributed translation packages containing .po files are available on the Drupal.org translations page.', 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')) .'

      '; + $output = '

      ' . 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 My account 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.") . '

      '; + $output .= '

      ' . t('For each language available on the site, use the edit 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 Language selection when creating a post of a content type with multilingual support.') . '

      '; + $output .= '

      ' . t('Use the add language page to enable additional languages (and automatically import files from a translation package, if available), the translate interface page to locate strings for manual translation, or the import page to add translations from individual .po files. A number of contributed translation packages containing .po files are available on the Drupal.org translations page.', 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')) . '

      '; return $output; case 'admin/settings/language/add': - return '

      '. t('Add all languages to be supported by your site. If your desired language is not available in the Language name drop-down, click Custom language 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.') .'

      '; + return '

      ' . t('Add all languages to be supported by your site. If your desired language is not available in the Language name drop-down, click Custom language 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.') . '

      '; case 'admin/settings/language/configure': - $output = '

      '. t("Language negotiation settings determine the site's presentation language. Available options include:") .'

      '; - $output .= '
      • '. t('None. The default language is used for site presentation, though users may (optionally) select a preferred language on the My Account page. (User language preferences will be used for site e-mails, if available.)') .'
      • '; - $output .= '
      • '. t('Path prefix only. 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. Example: "example.com/de/contact" sets presentation language to German based on the use of "de" within the path.') .'
      • '; - $output .= '
      • '. t("Path prefix with language fallback. 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 My Account page, or by the browser's language settings. If a presentation language cannot be determined, the default language is used.") .''; - $output .= '
      • '. t('Domain name only. 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. Example: "http://de.example.com/contact" sets presentation language to German based on the use of "http://de.example.com" in the domain.') .'
      '; - $output .= '

      '. t('The path prefix or domain name for a language may be set by editing the available languages. In the absence of an appropriate match, the site is displayed in the default language.', array('@languages' => url('admin/settings/language'))) .'

      '; + $output = '

      ' . t("Language negotiation settings determine the site's presentation language. Available options include:") . '

      '; + $output .= '
      • ' . t('None. The default language is used for site presentation, though users may (optionally) select a preferred language on the My Account page. (User language preferences will be used for site e-mails, if available.)') . '
      • '; + $output .= '
      • ' . t('Path prefix only. 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. Example: "example.com/de/contact" sets presentation language to German based on the use of "de" within the path.') . '
      • '; + $output .= '
      • ' . t("Path prefix with language fallback. 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 My Account page, or by the browser's language settings. If a presentation language cannot be determined, the default language is used.") . ''; + $output .= '
      • ' . t('Domain name only. 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. Example: "http://de.example.com/contact" sets presentation language to German based on the use of "http://de.example.com" in the domain.') . '
      '; + $output .= '

      ' . t('The path prefix or domain name for a language may be set by editing the available languages. In the absence of an appropriate match, the site is displayed in the default language.', array('@languages' => url('admin/settings/language'))) . '

      '; return $output; case 'admin/build/translate': - $output = '

      '. 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.') .'

      '; - $output .= '

      '. t('Review the languages page for more information on adding support for additional languages.', array('@languages' => url('admin/settings/language'))) .'

      '; + $output = '

      ' . 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.') . '

      '; + $output .= '

      ' . t('Review the languages page for more information on adding support for additional languages.', array('@languages' => url('admin/settings/language'))) . '

      '; return $output; case 'admin/build/translate/import': - $output = '

      '. t('This page imports the translated strings contained in an individual Gettext Portable Object (.po) file. Normally distributed as part of a translation package (each translation package may contain several .po files), a .po file may need to be imported after off-line editing in a Gettext translation editor. Importing an individual .po file may be a lengthy process.') .'

      '; - $output .= '

      '. t('Note that the .po 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 .po file at a time, it may be simpler to download and extract a translation package into your Drupal installation directory and add the language (which automatically imports all .po files within the package). Translation packages are available for download on the Drupal translation page.', array('@language-add' => url('admin/settings/language/add'), '@translations' => 'http://drupal.org/project/translations')) .'

      '; + $output = '

      ' . t('This page imports the translated strings contained in an individual Gettext Portable Object (.po) file. Normally distributed as part of a translation package (each translation package may contain several .po files), a .po file may need to be imported after off-line editing in a Gettext translation editor. Importing an individual .po file may be a lengthy process.') . '

      '; + $output .= '

      ' . t('Note that the .po 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 .po file at a time, it may be simpler to download and extract a translation package into your Drupal installation directory and add the language (which automatically imports all .po files within the package). Translation packages are available for download on the Drupal translation page.', array('@language-add' => url('admin/settings/language/add'), '@translations' => 'http://drupal.org/project/translations')) . '

      '; return $output; case 'admin/build/translate/export': - return '

      '. t('This page exports the translated strings used by your site. An export file may be in Gettext Portable Object (.po) form, which includes both the original string and the translation (used to share translations with others), or in Gettext Portable Object Template (.pot) form, which includes the original strings only (used to create new translations with a Gettext translation editor).') .'

      '; + return '

      ' . t('This page exports the translated strings used by your site. An export file may be in Gettext Portable Object (.po) form, which includes both the original string and the translation (used to share translations with others), or in Gettext Portable Object Template (.pot) form, which includes the original strings only (used to create new translations with a Gettext translation editor).') . '

      '; case 'admin/build/translate/search': - return '

      '. 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 export 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'))) .'

      '; + return '

      ' . 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 export 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'))) . '

      '; case 'admin/build/block/configure': if ($arg[4] == 'locale' && $arg[5] == 0) { - return '

      '. t('This block is only shown if at least two languages are enabled and language negotiation is set to something other than None.', array('@languages' => url('admin/settings/language'), '@configuration' => url('admin/settings/language/configure'))) .'

      '; + return '

      ' . t('This block is only shown if at least two languages are enabled and language negotiation is set to something other than None.', array('@languages' => url('admin/settings/language'), '@configuration' => url('admin/settings/language/configure'))) . '

      '; } 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 enabled languages. 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 d55d7515b870485825899ddf3f6a77d0cc4698e9..9d88dd7c76b8f57085d1ea5c41cdf00941bd03d9 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 .= '

      '. format_plural($num_links, 'Warning: There is currently 1 menu item in %title. It will be deleted (system-defined items will be reset).', 'Warning: There are currently @count menu items in %title. They will be deleted (system-defined items will be reset).', array('%title' => $menu['title'])) .'

      '; + $caption .= '

      ' . format_plural($num_links, 'Warning: There is currently 1 menu item in %title. It will be deleted (system-defined items will be reset).', 'Warning: There are currently @count menu items in %title. They will be deleted (system-defined items will be reset).', array('%title' => $menu['title'])) . '

      '; } - $caption .= '

      '. t('This action cannot be undone.') .'

      '; - 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 .= '

      ' . t('This action cannot be undone.') . '

      '; + 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 c09ad9495c964b9b991f379de2a3e135247b1084..a4fd8584d7ebd790659fd6ba6088d4b063792959 100644 --- a/modules/menu/menu.module +++ b/modules/menu/menu.module @@ -18,18 +18,18 @@ function menu_help($path, $arg) { switch ($path) { case 'admin/help#menu': - $output = '

      '. 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: Navigation, Primary links, and Secondary links. The Navigation 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 Primary links and Secondary links, by displaying them in either the header or footer of each page. By default, Primary links and Secondary links contain no menu items but may be configured to contain custom menu items specific to your site.") .'

      '; - $output .= '

      '. t('The menus page 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 add menu page (the block containing a new menu must also be enabled on the blocks administration page).', array('@menu' => url('admin/build/menu'), '@add-menu' => url('admin/build/menu/add'), '@blocks' => url('admin/build/block'))) .'

      '; - $output .= '

      '. t('For more information, see the online handbook entry for Menu module.', array('@menu' => 'http://drupal.org/handbook/modules/menu/')) .'

      '; + $output = '

      ' . 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: Navigation, Primary links, and Secondary links. The Navigation 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 Primary links and Secondary links, by displaying them in either the header or footer of each page. By default, Primary links and Secondary links contain no menu items but may be configured to contain custom menu items specific to your site.") . '

      '; + $output .= '

      ' . t('The menus page 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 add menu page (the block containing a new menu must also be enabled on the blocks administration page).', array('@menu' => url('admin/build/menu'), '@add-menu' => url('admin/build/menu/add'), '@blocks' => url('admin/build/block'))) . '

      '; + $output .= '

      ' . t('For more information, see the online handbook entry for Menu module.', array('@menu' => 'http://drupal.org/handbook/modules/menu/')) . '

      '; return $output; case 'admin/build/menu': - return '

      '. 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.') .'

      '; + return '

      ' . 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.') . '

      '; case 'admin/build/menu/add': - return '

      '. t('Enter the name for your new menu. Remember to enable the newly created block in the blocks administration page.', array('@blocks' => url('admin/build/block'))) .'

      '; + return '

      ' . t('Enter the name for your new menu. Remember to enable the newly created block in the blocks administration page.', array('@blocks' => url('admin/build/block'))) . '

      '; case 'admin/build/menu-customize/%': - return '

      '. t('To rearrange menu items, grab a drag-and-drop handle under the Menu item 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 Save configuration button at the bottom of the page.') .'

      '; + return '

      ' . t('To rearrange menu items, grab a drag-and-drop handle under the Menu item 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 Save configuration button at the bottom of the page.') . '

      '; case 'admin/build/menu/item/add': - return '

      '. t('Enter the title and path for your new menu item.') .'

      '; + return '

      ' . t('Enter the title and path for your new menu item.') . '

      '; } } @@ -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 a436336c455c381f815e623ffd840222ba878d02..328f67bb8ba75975066e4cab1dce768c3bc20414 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 .= '

      '. format_plural($num_nodes, 'Warning: 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.', 'Warning: 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)) .'

      '; + $caption .= '

      ' . format_plural($num_nodes, 'Warning: 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.', 'Warning: 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)) . '

      '; } - $caption .= '

      '. t('This action cannot be undone.') .'

      '; + $caption .= '

      ' . t('This action cannot be undone.') . '

      '; 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 0b1252d74b189b1d1ccad40c37fe9d744b1660c7..81160b1d61193471d21db143b366a2742e303e7a 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 = '

      '. 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.') .'

      '; - $status .= '

      '. 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.') .'

      '; + $status = '

      ' . 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.') . '

      '; + $status .= '

      ' . 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.') . '

      '; $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 .= '
        '; if (!empty($form['current'])) { foreach (element_children($form['current']) as $key) { - $output .= '
      • '. drupal_render($form['current'][$key]) .'
      • '; + $output .= '
      • ' . drupal_render($form['current'][$key]) . '
      • '; } } - $output .= '
      • '. (!empty($form['current']) ? '
        '. t('and') .' '. t('where') .'
        ' : '') .'
        '; + $output .= '
      • ' . (!empty($form['current']) ? '
        ' . t('and') . ' ' . t('where') . '
        ' : '') . '
        '; foreach (element_children($form['filter']) as $key) { $output .= drupal_render($form['filter'][$key]); } $output .= '
        '; - $output .= '
        '. t('is') .'
        '; + $output .= '
        ' . t('is') . '
        '; foreach (element_children($form['status']) as $key) { $output .= drupal_render($form['status'][$key]); @@ -306,7 +306,7 @@ function theme_node_filters($form) { $output .= '
        '; $output .= '
        '; - $output .= '
        '. drupal_render($form['buttons']) .'
        '; + $output .= '
        ' . drupal_render($form['buttons']) . '
        '; $output .= '
      '; 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' => '
    • ', - '#suffix' => check_plain($title) ."
    • \n", + '#suffix' => check_plain($title) . "\n", ); } $form['operation'] = array('#type' => 'hidden', '#value' => 'delete'); diff --git a/modules/node/node.module b/modules/node/node.module index fea24b56a3e64ea81157d392d389d660b58843fa..f46f2d050f76a457d7f24b1d53edf6f1a24296f6 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 = '

      '. 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.') .'

      '; - $output .= '

      '. t('Though each post on your site is a node, each post is also of a particular content type. Content types 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 Publishing options and other workflow controls. By default, the two content types in a standard Drupal installation are Page and Story. Use the content types page 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'))) .'

      '; - $output .= '

      '. t('The administrative content page allows you to review and manage your site content. The post settings page 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 permissions page.', array('@content' => url('admin/content/node'), '@post-settings' => url('admin/content/node-settings'), '@permissions' => url('admin/user/permissions'))) .'

      '; - $output .= '

      '. t('For more information, see the online handbook entry for Node module.', array('@node' => 'http://drupal.org/handbook/modules/node/')) .'

      '; + $output = '

      ' . 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.') . '

      '; + $output .= '

      ' . t('Though each post on your site is a node, each post is also of a particular content type. Content types 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 Publishing options and other workflow controls. By default, the two content types in a standard Drupal installation are Page and Story. Use the content types page 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'))) . '

      '; + $output .= '

      ' . t('The administrative content page allows you to review and manage your site content. The post settings page 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 permissions page.', array('@content' => url('admin/content/node'), '@post-settings' => url('admin/content/node-settings'), '@permissions' => url('admin/user/permissions'))) . '

      '; + $output .= '

      ' . t('For more information, see the online handbook entry for Node module.', array('@node' => 'http://drupal.org/handbook/modules/node/')) . '

      '; 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 '

      '. 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.') .'

      '; + return '

      ' . 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.') . '

      '; case 'admin/build/types/add': - return '

      '. 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.') .'

      '; + return '

      ' . 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.') . '

      '; case 'node/%/revisions': - return '

      '. t('The revisions let you track differences between multiple versions of a post.') .'

      '; + return '

      ' . t('The revisions let you track differences between multiple versions of a post.') . '

      '; case 'node/%/edit': $node = node_load($arg[1]); $type = node_get_types('type', $node->type); - return (!empty($type->help) ? '

      '. filter_xss_admin($type->help) .'

      ' : ''); + return (!empty($type->help) ? '

      ' . filter_xss_admin($type->help) . '

      ' : ''); } if ($arg[0] == 'node' && $arg[1] == 'add' && $arg[2]) { $type = node_get_types('type', str_replace('-', '_', $arg[2])); - return (!empty($type->help) ? '

      '. filter_xss_admin($type->help) .'

      ' : ''); + return (!empty($type->help) ? '

      ' . filter_xss_admin($type->help) . '

      ' : ''); } } @@ -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\r\n". trim($form_state['values']['body']); + $body = trim($form_state['values']['teaser_js']) . "\r\n\r\n" . trim($form_state['values']['body']); } else { // Empty teaser, no spaces. - $body = ''. $form_state['values']['body']; + $body = '' . $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 '
      '. t('Log') .':
      '. $log .'
      '; + return '
      ' . t('Log') . ':
      ' . $log . '
      '; } /** @@ -1164,7 +1164,7 @@ function node_search($op = 'search', $keys = NULL) { ); $form['content_ranking']['#theme'] = 'node_search_admin'; $form['content_ranking']['info'] = array( - '#value' => ''. 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.') .'' + '#value' => '' . 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.') . '' ); $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 .= '

      '. l(t('read more'), 'node/'. $item->nid, array('absolute' => TRUE, 'attributes' => array('target' => '_blank'))) .'

      '; + $item_text .= '

      ' . l(t('read more'), 'node/' . $item->nid, array('absolute' => TRUE, 'attributes' => array('target' => '_blank'))) . '

      '; } break; case 'title': @@ -1707,7 +1707,7 @@ function node_feed($nids = FALSE, $channel = array()) { $channel = array_merge($channel_defaults, $channel); $output = "\n"; - $output .= "\n"; + $output .= "\n"; $output .= format_rss_channel($channel['title'], $channel['link'], $channel['description'], $items, $channel['language']); $output .= "\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 = '

      '. t('Welcome to your new Drupal website!') .'

      '; - $default_message .= '

      '. t('Please follow these steps to set up and start using your website:') .'

      '; + $default_message = '

      ' . t('Welcome to your new Drupal website!') . '

      '; + $default_message .= '

      ' . t('Please follow these steps to set up and start using your website:') . '

      '; $default_message .= '
        '; - $default_message .= '
      1. '. t('Configure your website Once logged in, visit the administration section, where you can customize and configure all aspects of your website.', array('@admin' => url('admin'), '@config' => url('admin/settings'))) .'
      2. '; - $default_message .= '
      3. '. t('Enable additional functionality Next, visit the module list and enable features which suit your specific needs. You can find additional modules in the Drupal modules download section.', array('@modules' => url('admin/build/modules'), '@download_modules' => 'http://drupal.org/project/modules')) .'
      4. '; - $default_message .= '
      5. '. t('Customize your website design To change the "look and feel" of your website, visit the themes section. You may choose from one of the included themes or download additional themes from the Drupal themes download section.', array('@themes' => url('admin/build/themes'), '@download_themes' => 'http://drupal.org/project/themes')) .'
      6. '; - $default_message .= '
      7. '. t('Start posting content Finally, you can create content for your website. This message will disappear once you have promoted a post to the front page.', array('@content' => url('node/add'))) .'
      8. '; + $default_message .= '
      9. ' . t('Configure your website Once logged in, visit the administration section, where you can customize and configure all aspects of your website.', array('@admin' => url('admin'), '@config' => url('admin/settings'))) . '
      10. '; + $default_message .= '
      11. ' . t('Enable additional functionality Next, visit the module list and enable features which suit your specific needs. You can find additional modules in the Drupal modules download section.', array('@modules' => url('admin/build/modules'), '@download_modules' => 'http://drupal.org/project/modules')) . '
      12. '; + $default_message .= '
      13. ' . t('Customize your website design To change the "look and feel" of your website, visit the themes section. You may choose from one of the included themes or download additional themes from the Drupal themes download section.', array('@themes' => url('admin/build/themes'), '@download_themes' => 'http://drupal.org/project/themes')) . '
      14. '; + $default_message .= '
      15. ' . t('Start posting content Finally, you can create content for your website. This message will disappear once you have promoted a post to the front page.', array('@content' => url('node/add'))) . '
      16. '; $default_message .= '
      '; - $default_message .= '

      '. t('For more information, please refer to the help section, or the online Drupal handbooks. You may also post at the Drupal forum, or view the wide range of other support options available.', array('@help' => url('admin/help'), '@handbook' => 'http://drupal.org/handbooks', '@forum' => 'http://drupal.org/forum', '@support' => 'http://drupal.org/support')) .'

      '; + $default_message .= '

      ' . t('For more information, please refer to the help section, or the online Drupal handbooks. You may also post at the Drupal forum, or view the wide range of other support options available.', array('@help' => url('admin/help'), '@handbook' => 'http://drupal.org/handbooks', '@forum' => 'http://drupal.org/forum', '@support' => 'http://drupal.org/support')) . '

      '; - $output = '
      '. $default_message .'
      '; + $output = '
      ' . $default_message . '
      '; } 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 = '

      '. check_plain($node->title) .'

      '. $node->body; + $text = '

      ' . check_plain($node->title) . '

      ' . $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 dc3e529cbcc73ad2090c99f4f5b2d733fa2e3ba6..0f94a4ac24eabc029628a7f95b812d928ceef756 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 = '
      '; foreach ($content as $item) { - $output .= '
      '. l($item['title'], $item['href'], $item['options']) .'
      '; - $output .= '
      '. filter_xss_admin($item['description']) .'
      '; + $output .= '
      ' . l($item['title'], $item['href'], $item['options']) . '
      '; + $output .= '
      ' . filter_xss_admin($item['description']) . '
      '; } $output .= '
      '; } @@ -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. You can insert the delimiter "<!--break-->" (without the quotes) to fine-tune where your post gets split.')); - $output .= '

      '. t('Preview trimmed version') .'

      '; + $output .= '

      ' . t('Preview trimmed version') . '

      '; $output .= node_view(clone $node, 1, FALSE, 0); - $output .= '

      '. t('Preview full version') .'

      '; + $output .= '

      ' . t('Preview full version') . '

      '; $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 != '') ? '

      '. filter_xss($revision->log) .'

      ' : ''), + . (($revision->log != '') ? '

      ' . filter_xss($revision->log) . '

      ' : ''), '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 != '') ? '

      '. filter_xss($revision->log) .'

      ' : ''); + . (($revision->log != '') ? '

      ' . filter_xss($revision->log) . '

      ' : ''); 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 db979b67e0ac9f2291c43672b3657215bf3a18ca..c39cd8e40c15c3b9ff0f363265aca7987e4c6ff6 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 @@ 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 = ''. t('OpenID redirect') ."\n"; + $output = '' . t('OpenID redirect') . "\n"; $output .= drupal_get_form('openid_redirect_form', $url, $message); $output .= ''; $output .= "\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('||iUs', $html, $matches); + preg_match('||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('||iUs', $html, $matches); + preg_match('||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 3e456f2b9010041b47f2b8ea4788a74601c8fb0a..80f8ca655d9d872b527481c42ddaa0fa490cd101 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 = '

      '. t('This site supports OpenID, 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'))) .'

      '; - $output .= '

      '. 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 free public providers. You can find out more about OpenID at this website.', array('@openid-providers' => url('http://openid.net/wiki/index.php/OpenIDServers'), '@openid-net' => url('http://openid.net'))) .'

      '; - $output .= '

      '. 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.') .'

      '; + $output = '

      ' . t('This site supports OpenID, 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'))) . '

      '; + $output .= '

      ' . 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 free public providers. You can find out more about OpenID at this website.', array('@openid-providers' => url('http://openid.net/wiki/index.php/OpenIDServers'), '@openid-net' => url('http://openid.net'))) . '

      '; + $output .= '

      ' . 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.') . '

      '; return $output; case 'admin/help#openid': - $output = '

      '. 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.') .'

      '; - $output .= '

      '. 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.') .'

      '; - $output .= '

      '. 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.') .'

      '; - $output .= '

      '. t('More information on OpenID is available at OpenID.net.', array('@openid-net' => url('http://openid.net'))) .'

      '; - $output .= '

      '. t('For more information, see the online handbook entry for OpenID module.', array('@handbook' => 'http://drupal.org/handbook/modules/openid')) .'

      '; + $output = '

      ' . 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.') . '

      '; + $output .= '

      ' . 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.') . '

      '; + $output .= '

      ' . 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.') . '

      '; + $output .= '

      ' . t('More information on OpenID is available at OpenID.net.', array('@openid-net' => url('http://openid.net'))) . '

      '; + $output .= '

      ' . t('For more information, see the online handbook entry for OpenID module.', array('@handbook' => 'http://drupal.org/handbook/modules/openid')) . '

      '; 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 981a6d11ba6b6d5dff5ac44faf0a6383233f6ae6..57f2687f201d2b6196da426bfb8ae697c47a129b 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 95587688166ae13e1df21ce81c51e2cc0275ed1b..cd862cdec180ebcff6fccdf9a25b8c324f9d0be4 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 e5966b3dade14ca1ffd75590e3a24a63fb4de171..eab81760b8074a458fcda8b1d23b17b3899a2ea0 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 d1ef1b83dc859bb2a5854cf261f5adf7cb7a21ad..ac66faedd05d9c497c848a5882de762702c66ed1 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 = '

      '. 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.') .'

      '; - $output .= '

      '. t('Some examples of URL aliases are:') .'

      '; - $output .= '
      • '. t('%alias for the path %path', array('%alias' => 'login', '%path' => 'user/login')) .'
      • '; - $output .= '
      • '. t('%alias for the path %path', array('%alias' => 'store', '%path' => 'image/tid/16')) .'
      • '; - $output .= '
      • '. t('%alias for the path %path', array('%alias' => 'store/products/whirlygigs', '%path' => 'taxonomy/term/7+19+20+21')) .'
      • '; - $output .= '
      • '. t('%alias for the path %path', array('%alias' => 'contact', '%path' => 'node/3')) .'
      '; - $output .= '

      '. 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 administer url aliases and create url aliases. ') .'

      '; - $output .= '

      '. 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. ') .'

      '; - $output .= '

      '. t('For more information, see the online handbook entry for Path module.', array('@path' => 'http://drupal.org/handbook/modules/path/')) .'

      '; + $output = '

      ' . 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.') . '

      '; + $output .= '

      ' . t('Some examples of URL aliases are:') . '

      '; + $output .= '
      • ' . t('%alias for the path %path', array('%alias' => 'login', '%path' => 'user/login')) . '
      • '; + $output .= '
      • ' . t('%alias for the path %path', array('%alias' => 'store', '%path' => 'image/tid/16')) . '
      • '; + $output .= '
      • ' . t('%alias for the path %path', array('%alias' => 'store/products/whirlygigs', '%path' => 'taxonomy/term/7+19+20+21')) . '
      • '; + $output .= '
      • ' . t('%alias for the path %path', array('%alias' => 'contact', '%path' => 'node/3')) . '
      '; + $output .= '

      ' . 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 administer url aliases and create url aliases. ') . '

      '; + $output .= '

      ' . 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. ') . '

      '; + $output .= '

      ' . t('For more information, see the online handbook entry for Path module.', array('@path' => 'http://drupal.org/handbook/modules/path/')) . '

      '; return $output; case 'admin/build/path': - return '

      '. 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.") .'

      '; + return '

      ' . 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.") . '

      '; case 'admin/build/path/add': - return '

      '. t('Enter the path you wish to create the alias for, followed by the name of the new alias.') .'

      '; + return '

      ' . t('Enter the path you wish to create the alias for, followed by the name of the new alias.') . '

      '; } } @@ -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 d5ee4d8bd66f763d3a7b68faf251e385753a736c..04c11eef4c90135bfe2736db0a8cd6621b1d8177 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 c3f1d8ff304b7cc6dfa8d34554967eb53e680483..222e1cf405a85272d3da26387bcf7d238a9aeb45 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 = '

      '. 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.') .'

      '; - $output .= '

      '. 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.') .'

      '; - $output .= '

      '. t('Drupal.org offers some example PHP snippets, 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'))) .'

      '; - $output .= '

      '. t('For more information, see the online handbook entry for PHP module.', array('@php' => 'http://drupal.org/handbook/modules/php/')) .'

      '; + $output = '

      ' . 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.') . '

      '; + $output .= '

      ' . 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.') . '

      '; + $output .= '

      ' . t('Drupal.org offers some example PHP snippets, 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'))) . '

      '; + $output .= '

      ' . t('For more information, see the online handbook entry for PHP module.', array('@php' => 'http://drupal.org/handbook/modules/php/')) . '

      '; 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 <?php ?> tags.'); case 1: - $output = '

      '. t('Using custom PHP code') .'

      '; - $output .= '

      '. 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.') .'

      '; - $output .= '

      '. 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.') .'

      '; - $output .= '

      '. t('Notes:') .'

      '; - $output .= '
      • '. t('Remember to double-check each line for syntax and logic errors before saving.') .'
      • '; - $output .= '
      • '. t('Statements must be correctly terminated with semicolons.') .'
      • '; - $output .= '
      • '. t('Global variables used within your PHP code retain their values after your script executes.') .'
      • '; - $output .= '
      • '. t('register_globals is turned off. If you need to use forms, understand and use the functions in the Drupal Form API.', array('@formapi' => url('http://api.drupal.org/api/group/form_api/7'))) .'
      • '; - $output .= '
      • '. t('Use a print or return statement in your code to output content.') .'
      • '; - $output .= '
      • '. t('Develop and test your PHP code using a separate test script and sample database before deploying on a production site.') .'
      • '; - $output .= '
      • '. t('Consider including your custom PHP code within a site-specific module or template.php file rather than embedding it directly into a post or block.') .'
      • '; - $output .= '
      • '. 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.') .'
      '; - $output .= '

      '. t('A basic example: Creating a "Welcome" block that greets visitors with a simple message.') .'

      '; - $output .= '
      • '. t('

        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:

        + $output = '

        ' . t('Using custom PHP code') . '

        '; + $output .= '

        ' . 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.') . '

        '; + $output .= '

        ' . 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.') . '

        '; + $output .= '

        ' . t('Notes:') . '

        '; + $output .= '
        • ' . t('Remember to double-check each line for syntax and logic errors before saving.') . '
        • '; + $output .= '
        • ' . t('Statements must be correctly terminated with semicolons.') . '
        • '; + $output .= '
        • ' . t('Global variables used within your PHP code retain their values after your script executes.') . '
        • '; + $output .= '
        • ' . t('register_globals is turned off. If you need to use forms, understand and use the functions in the Drupal Form API.', array('@formapi' => url('http://api.drupal.org/api/group/form_api/7'))) . '
        • '; + $output .= '
        • ' . t('Use a print or return statement in your code to output content.') . '
        • '; + $output .= '
        • ' . t('Develop and test your PHP code using a separate test script and sample database before deploying on a production site.') . '
        • '; + $output .= '
        • ' . t('Consider including your custom PHP code within a site-specific module or template.php file rather than embedding it directly into a post or block.') . '
        • '; + $output .= '
        • ' . 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.') . '
        '; + $output .= '

        ' . t('A basic example: Creating a "Welcome" block that greets visitors with a simple message.') . '

        '; + $output .= '
        • ' . t('

          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:

           print t(\'Welcome visitor! Thank you for visiting.\');
          -
          ') .'
        • '; - $output .= '
        • '. t('

          To display the name of a registered user, use this instead:

          +') . '
        • '; + $output .= '
        • ' . t('

          To display the name of a registered user, use this instead:

           global $user;
           if ($user->uid) {
          @@ -57,8 +57,8 @@ function php_filter_tips($delta, $format, $long = false) {
           else {
             print t(\'Welcome visitor! Thank you for visiting.\');
           }
          -
          ') .'
        '; - $output .= '

        '. t('Drupal.org offers some example PHP snippets, 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'))) .'

        '; +') . '
      '; + $output .= '

      ' . t('Drupal.org offers some example PHP snippets, 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'))) . '

      '; return $output; } } diff --git a/modules/poll/poll.module b/modules/poll/poll.module index 615e0fd9f9e01bb3c6b07dc2191c5d95f800459f..c43fc61dd8833033ed67dcd6d3452a1b69141b4d 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 = '

      '. 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.') .'

      '; - $output .= '

      '. 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 poll 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'))) .'

      '; - $output .= '

      '. t('For more information, see the online handbook entry for Poll module.', array('@poll' => 'http://drupal.org/handbook/modules/poll/')) .'

      '; + $output = '

      ' . 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.') . '

      '; + $output .= '

      ' . 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 poll 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'))) . '

      '; + $output .= '

      ' . t('For more information, see the online handbook entry for Poll module.', array('@poll' => 'http://drupal.org/handbook/modules/poll/')) . '

      '; 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 5970735785593cdeaea45e7b530dfd90cbc7aa8a..c5895f902e88eb366e27760e95b43e5f7117715d 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 = '
        '; while ($node = db_fetch_object($result)) { - $output .= '
      • '. l($node->title, "node/$node->nid") .' - '. format_plural($node->votes, '1 vote', '@count votes') .' - '. ($node->active ? t('open') : t('closed')) .'
      • '; + $output .= '
      • ' . l($node->title, "node/$node->nid") . ' - ' . format_plural($node->votes, '1 vote', '@count votes') . ' - ' . ($node->active ? t('open') : t('closed')) . '
      • '; } $output .= '
      '; $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 490b48e91c5cc41b8438edbcb444b70e081829af..dd355c47bec1f6acd07a8dc2e6ea2409a61c9b71 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 = '

      '. t('Add new field') .'

      '; + $addnewfields = '

      ' . t('Add new field') . '

      '; $addnewfields .= '
        '; foreach (_profile_field_types() as $key => $value) { - $addnewfields .= '
      • '. l($value, "admin/user/profile/add/$key") .'
      • '; + $addnewfields .= '
      • ' . l($value, "admin/user/profile/add/$key") . '
      • '; } $addnewfields .= '
      '; $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' => ''. t('No fields in this category. If this category remains empty when saved, it will be removed.') .'', 'colspan' => 7)), 'class' => 'category-'. $category_number .'-message category-message category-populated'); + $rows[] = array('data' => array(array('data' => '' . t('No fields in this category. If this category remains empty when saved, it will be removed.') . '', '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 @@ function profile_field_form(&$form_state, $arg = NULL) { $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 %value 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 %value 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 edit this field 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 edit this field 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 6031afbb0f5e9fde7b8ee99561f98c7f29e7daf7..feecd0a79bcbcd5d27669f03a0e6bf25e8090a5f 100644 --- a/modules/profile/profile.module +++ b/modules/profile/profile.module @@ -32,19 +32,19 @@ function profile_help($path, $arg) { switch ($path) { case 'admin/help#profile': - $output = '

      '. t('The profile module allows custom fields (such as country, full name, or age) to be defined and displayed in the My Account section. This permits users of a site to share more information about themselves, and can help community-based sites organize users around specific information.') .'

      '; - $output .= '

      '. t('The following types of fields can be added to a user profile:') .'

      '; - $output .= '
      • '. t('single-line textfield') .'
      • '; - $output .= '
      • '. t('multi-line textfield') .'
      • '; - $output .= '
      • '. t('checkbox') .'
      • '; - $output .= '
      • '. t('list selection') .'
      • '; - $output .= '
      • '. t('freeform list') .'
      • '; - $output .= '
      • '. t('URL') .'
      • '; - $output .= '
      • '. t('date') .'
      '; - $output .= '

      '. t('For more information, see the online handbook entry for Profile module.', array('@profile' => 'http://drupal.org/handbook/modules/profile/')) .'

      '; + $output = '

      ' . t('The profile module allows custom fields (such as country, full name, or age) to be defined and displayed in the My Account section. This permits users of a site to share more information about themselves, and can help community-based sites organize users around specific information.') . '

      '; + $output .= '

      ' . t('The following types of fields can be added to a user profile:') . '

      '; + $output .= '
      • ' . t('single-line textfield') . '
      • '; + $output .= '
      • ' . t('multi-line textfield') . '
      • '; + $output .= '
      • ' . t('checkbox') . '
      • '; + $output .= '
      • ' . t('list selection') . '
      • '; + $output .= '
      • ' . t('freeform list') . '
      • '; + $output .= '
      • ' . t('URL') . '
      • '; + $output .= '
      • ' . t('date') . '
      '; + $output .= '

      ' . t('For more information, see the online handbook entry for Profile module.', array('@profile' => 'http://drupal.org/handbook/modules/profile/')) . '

      '; return $output; case 'admin/user/profile': - return '

      '. t("This page displays a list of the existing custom profile fields to be displayed on a user's My Account 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 Save configuration button at the bottom of the page.") .'

      '; + return '

      ' . t("This page displays a list of the existing custom profile fields to be displayed on a user's My Account 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 Save configuration button at the bottom of the page.") . '

      '; } } @@ -183,7 +183,7 @@ function profile_block($op = 'list', $delta = '', $edit = array()) { } if (isset($use_fields['user_profile']) && $use_fields['user_profile']) { - $output .= '
      '. l(t('View full user profile'), 'user/'. $account->uid) .'
      '; + $output .= '
      ' . l(t('View full user profile'), 'user/' . $account->uid) . '
      '; } } @@ -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 ''. check_plain($value) .''; + return '' . check_plain($value) . ''; 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 6e57c653e990676dea9da30ba97a96bc662c8ca7..97631eb7b7209468500d59f936dc95595d8a2ba7 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 = '

      '. t('%percentage of the site has been indexed.', array('%percentage' => $percentage)) .' '. $count .'

      '; + $percentage = ((int)min(100, 100 * ($total - $remaining) / max(1, $total))) . '%'; + $status = '

      ' . t('%percentage of the site has been indexed.', array('%percentage' => $percentage)) . ' ' . $count . '

      '; $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 052b1de636e527eaa75999be4f9a8955dfa83b19..76d5d98c67411e8ea1715df8ed3ef1f480e0f926 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 @@ * (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 @@ function search_help($path, $arg) { switch ($path) { case 'admin/help#search': - $output = '

      '. 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.') .'

      '; - $output .= '

      '. 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 cron maintenance task is required. Indexing behavior can be adjusted using the search settings page; for example, the Number of items to index per cron run sets the maximum number of items indexed in each pass of a cron maintenance task. If necessary, reduce this number to prevent timeouts and memory errors when indexing.', array('@cron' => url('admin/reports/status'), '@searchsettings' => url('admin/settings/search'))) .'

      '; - $output .= '

      '. t('For more information, see the online handbook entry for Search module.', array('@search' => 'http://drupal.org/handbook/modules/search/')) .'

      '; + $output = '

      ' . 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.') . '

      '; + $output .= '

      ' . 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 cron maintenance task is required. Indexing behavior can be adjusted using the search settings page; for example, the Number of items to index per cron run sets the maximum number of items indexed in each pass of a cron maintenance task. If necessary, reduce this number to prevent timeouts and memory errors when indexing.', array('@cron' => url('admin/reports/status'), '@searchsettings' => url('admin/settings/search'))) . '

      '; + $output .= '

      ' . t('For more information, see the online handbook entry for Search module.', array('@search' => 'http://drupal.org/handbook/modules/search/')) . '

      '; return $output; case 'admin/settings/search': - return '

      '. t('The search engine maintains an index of words found in your site\'s content. To build and maintain this index, a correctly configured cron maintenance task is required. Indexing behavior can be adjusted using the settings below.', array('@cron' => url('admin/reports/status'))) .'

      '; + return '

      ' . t('The search engine maintains an index of words found in your site\'s content. To build and maintain this index, a correctly configured cron maintenance task is required. Indexing behavior can be adjusted using the settings below.', array('@cron' => url('admin/reports/status'))) . '

      '; case 'search#noresults': return t('
      • Check if your spelling is correct.
      • @@ -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 '('. implode(', ', $output) .')'; + return '(' . implode(', ', $output) . ')'; // 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 ''). - $text = preg_replace('/'. $boundary .'('. implode('|', $keys) .')'. $boundary .'/iu', '\0', $text); + $text = preg_replace('/' . $boundary . '(' . implode('|', $keys) . ')' . $boundary . '/iu', '\0', $text); return $text; } diff --git a/modules/search/search.pages.inc b/modules/search/search.pages.inc index db1773fa7114f43c0deced1e58529d10c1528fe2..d4ef2bd40777ee97eb8d302ebe4440fbe6a063fa 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 e41403c59dc6ef13d7e7d8e5092cde02f60e94b9..9aad6f668aff916d1be299a17e9e08b1bd71178d 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 58a3ad47c99b4b328d94458ab3597b2aa4426cdc..3f43406b3400908845b11d2b28c4cd3180b660e4 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 = '

        '. 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.') .'

        '; - $output .= '

        '. t('The statistics module provides:') .'

        '; - $output .= '
        • '. t('a counter for each post on your site that increments each time the post is viewed. (Enable Count content views on the access log settings page, and determine if the post access counters should be visible to any user roles on the permissions page.)', array('@accesslog' => url('admin/reports/settings'), '@permissions' => url('admin/user/permissions'))) .'
        • '; - $output .= '
        • '. t('a recent hits 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'))) .'
        • '; - $output .= '
        • '. t('a top referrers log that displays the referring parties for your site visits (where your visitors came from).', array('@top-referrers' => url('admin/reports/referrers'))) .'
        • '; - $output .= '
        • '. t('a top pages log that displays site content in descending order by number of views.', array('@top-pages' => url('admin/reports/pages'))) .'
        • '; - $output .= '
        • '. t('a top visitors log that displays the most active users on your site.', array('@top-visitors' => url('admin/reports/visitors'))) .'
        • '; - $output .= '
        • '. t('a Popular content block that displays the day\'s most viewed content, the all-time most viewed content, and the last content viewed. (Enable the Popular content block on the blocks administration page.)', array('@blocks' => url('admin/build/block'))) .'
        '; - $output .= '

        '. t('Configuring the statistics module') .'

        '; - $output .= '
        • '. t('When the Enable access log setting on the access log settings page 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 recent hits, top referrers, top pages, and top visitors 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'))) .'
        • '; - $output .= '
        • '. t('The Discard access logs older than setting on the access log settings page 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 cron maintenance task.', array('@accesslog' => url('admin/reports/settings'), '@cron' => url('admin/reports/status'))) .'
        • '; - $output .= '
        • '. t('The Count content views setting on the access log settings page 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'))) .'
        '; - $output .= '

        '. t('For more information, see the online handbook entry for Statistics module.', array('@statistics' => 'http://drupal.org/handbook/modules/statistics/')) .'

        '; + $output = '

        ' . 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.') . '

        '; + $output .= '

        ' . t('The statistics module provides:') . '

        '; + $output .= '
        • ' . t('a counter for each post on your site that increments each time the post is viewed. (Enable Count content views on the access log settings page, and determine if the post access counters should be visible to any user roles on the permissions page.)', array('@accesslog' => url('admin/reports/settings'), '@permissions' => url('admin/user/permissions'))) . '
        • '; + $output .= '
        • ' . t('a recent hits 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'))) . '
        • '; + $output .= '
        • ' . t('a top referrers log that displays the referring parties for your site visits (where your visitors came from).', array('@top-referrers' => url('admin/reports/referrers'))) . '
        • '; + $output .= '
        • ' . t('a top pages log that displays site content in descending order by number of views.', array('@top-pages' => url('admin/reports/pages'))) . '
        • '; + $output .= '
        • ' . t('a top visitors log that displays the most active users on your site.', array('@top-visitors' => url('admin/reports/visitors'))) . '
        • '; + $output .= '
        • ' . t('a Popular content block that displays the day\'s most viewed content, the all-time most viewed content, and the last content viewed. (Enable the Popular content block on the blocks administration page.)', array('@blocks' => url('admin/build/block'))) . '
        '; + $output .= '

        ' . t('Configuring the statistics module') . '

        '; + $output .= '
        • ' . t('When the Enable access log setting on the access log settings page 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 recent hits, top referrers, top pages, and top visitors 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'))) . '
        • '; + $output .= '
        • ' . t('The Discard access logs older than setting on the access log settings page 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 cron maintenance task.', array('@accesslog' => url('admin/reports/settings'), '@cron' => url('admin/reports/status'))) . '
        • '; + $output .= '
        • ' . t('The Count content views setting on the access log settings page 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'))) . '
        '; + $output .= '

        ' . t('For more information, see the online handbook entry for Statistics module.', array('@statistics' => 'http://drupal.org/handbook/modules/statistics/')) . '

        '; return $output; case 'admin/reports/settings': - return '

        '. t('Settings for the statistical information that Drupal will keep about the site. See site statistics for the actual information.', array('@statistics' => url('admin/reports/hits'))) .'

        '; + return '

        ' . t('Settings for the statistical information that Drupal will keep about the site. See site statistics for the actual information.', array('@statistics' => url('admin/reports/hits'))) . '

        '; case 'admin/reports/hits': - return '

        '. t("This page displays the site's most recent hits.") .'

        '; + return '

        ' . t("This page displays the site's most recent hits.") . '

        '; case 'admin/reports/referrers': - return '

        '. t('This page displays all external referrers, or external references to your website.') .'

        '; + return '

        ' . t('This page displays all external referrers, or external references to your website.') . '

        '; case 'admin/reports/visitors': - return '

        '. 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.") .'

        '; + return '

        ' . 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.") . '

        '; } } @@ -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 84dca6d29f120d051a969788ed15deff8fbb6927..69286b515805e6d7b45a047e60532a77029b491e 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 b9810ea919a539d26e24638a858358b03fa965c5..66df76f0ffdc7187799d1c9368adb1d25e927196 100644 --- a/modules/syslog/syslog.module +++ b/modules/syslog/syslog.module @@ -19,9 +19,9 @@ function syslog_help($path, $arg) { switch ($path) { case 'admin/help#syslog': - $output = '

        '. t("The syslog module enables Drupal to send messages to the operating system's logging facility.") .'

        '; - $output .= '

        '. 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 UNIX/Linux syslog.conf and PHP\'s openlog and syslog 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'))) .'

        '; - $output .= '

        '. t('For more information, see the online handbook entry for Syslog module.', array('@syslog' => 'http://drupal.org/handbook/modules/syslog')) .'

        '; + $output = '

        ' . t("The syslog module enables Drupal to send messages to the operating system's logging facility.") . '

        '; + $output .= '

        ' . 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 UNIX/Linux syslog.conf and PHP\'s openlog and syslog 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'))) . '

        '; + $output .= '

        ' . t('For more information, see the online handbook entry for Syslog module.', array('@syslog' => 'http://drupal.org/handbook/modules/syslog')) . '

        '; 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 30f95b45805f6c0fc08d8848c40ce7c327f4dc81..8ca0f2ba4c2451c38533611fdc45a2994fbc9752 100644 --- a/modules/system/block.tpl.php +++ b/modules/system/block.tpl.php @@ -26,7 +26,7 @@ * @see template_preprocess_block() */ ?> -
        +
        subject): ?>

        subject ?>

        diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc index c144c15d6552d1dd6ec8857d9403cf552b3bf46c..8c9d0aa0ebffe8e2e271c3df8c0440a17193b5bf 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' => '

        '. t('The following modules will be completely uninstalled from your site, and all data from these modules will be lost!') .'

        '. theme('item_list', $uninstall)); + $form['modules'] = array('#value' => '

        ' . t('The following modules will be completely uninstalled from your site, and all data from these modules will be lost!') . '

        ' . theme('item_list', $uninstall)); $form = confirm_form( $form, t('Confirm uninstall'), @@ -1328,16 +1328,16 @@ function system_logging_overview() { */ function system_performance_settings() { - $description = '

        '. 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.") .'

        '; + $description = '

        ' . 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.") . '

        '; $problem_modules = array_unique(array_merge(module_implements('boot'), module_implements('exit'))); sort($problem_modules); if (count($problem_modules) > 0) { - $description .= '

        '. t('The following enabled modules are incompatible with aggressive mode caching and will not function properly: %modules', array('%modules' => implode(', ', $problem_modules))) .'.

        '; + $description .= '

        ' . t('The following enabled modules are incompatible with aggressive mode caching and will not function properly: %modules', array('%modules' => implode(', ', $problem_modules))) . '.

        '; } else { - $description .= '

        '. t('Currently, all enabled modules are compatible with the aggressive caching policy. Please note, if you use aggressive caching and enable new modules, you will need to check this page again to ensure compatibility.') .'

        '; + $description .= '

        ' . t('Currently, all enabled modules are compatible with the aggressive caching policy. Please note, if you use aggressive caching and enable new modules, you will need to check this page again to ensure compatibility.') . '

        '; } $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' => '

        '. 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.') .'

        '. t('These options are disabled if you have not set up your files directory, or if your download method is set to private.') .'

        ' + '#description' => '

        ' . 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.') . '

        ' . t('These options are disabled if you have not set up your files directory, or if your download method is set to private.') . '

        ' ); $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'] .= ' '. 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 handbook page on Clean URLs has additional troubleshooting information.', array('@handbook' => 'http://drupal.org/node/15365')) .''; + $form['clean_url']['#description'] .= ' ' . 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 handbook page on Clean URLs has additional troubleshooting information.', array('@handbook' => 'http://drupal.org/node/15365')) . ''; $form['clean_url']['#disabled'] = TRUE; $form['clean_url']['#prefix'] = '
        '; - $form['clean_url']['#suffix'] = '

        '. t('Run the clean url test.', array('@clean_url' => base_path() .'admin/settings/clean-urls')) .'

        '; + $form['clean_url']['#suffix'] = '

        ' . t('Run the clean url test.', array('@clean_url' => base_path() . 'admin/settings/clean-urls')) . '

        '; } else { - $form['clean_url']['#description'] .= '
        '. t('Your server has been successfully tested to support this feature.') .'
        '; + $form['clean_url']['#description'] .= '
        ' . t('Your server has been successfully tested to support this feature.') . '
        '; } } @@ -1839,7 +1839,7 @@ function system_sql() { $data[$entry->Variable_name] = $entry->Value; } - $output = '

        '. t('Command counters') .'

        '; + $output = '

        ' . t('Command counters') . '

        '; $output .= _system_sql($data, array( 'Com_select' => t('The number of SELECT-statements.'), 'Com_insert' => t('The number of INSERT-statements.'), @@ -1849,7 +1849,7 @@ function system_sql() { 'Com_unlock_tables' => t('The number of table unlocks.') )); - $output .= '

        '. t('Query performance') .'

        '; + $output .= '

        ' . t('Query performance') . '

        '; $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 .= '

        '. t('Query cache information') .'

        '; - $output .= '

        '. 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.') .'

        '; + $output .= '

        ' . t('Query cache information') . '

        '; + $output .= '

        ' . 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.') . '

        '; $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 = ''; } else { $output = '
        '; foreach ($content as $item) { - $output .= '
        '. l($item['title'], $item['href'], $item['localized_options']) .'
        '; - $output .= '
        '. $item['description'] .'
        '; + $output .= '
        ' . l($item['title'], $item['href'], $item['localized_options']) . '
        '; + $output .= '
        ' . $item['description'] . '
        '; } $output .= '
        '; } @@ -1978,7 +1978,7 @@ function theme_admin_page($blocks) { $output .= theme('system_compact_link'); foreach ($container as $id => $data) { - $output .= '
        '; + $output .= '
        '; $output .= $data; $output .= '
        '; } @@ -2024,7 +2024,7 @@ function theme_system_admin_by_module($menu_items) { $output = '
        '; foreach ($container as $id => $data) { - $output .= '
        '; + $output .= '
        '; $output .= $data; $output .= '
        '; } @@ -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 .= ''. $requirement['title'] .''. $requirement['value'] .''; - $output .= ''. $requirement['description'] .''; + $output .= '' . $requirement['title'] . '' . $requirement['value'] . ''; + $output .= '' . $requirement['description'] . ''; } else { - $output .= ''. $requirement['title'] .''. $requirement['value'] .''; + $output .= '' . $requirement['title'] . '' . $requirement['value'] . ''; } } } @@ -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 .= '
        '. t('This version is incompatible with the !core_version version of Drupal core.', array('!core_version' => VERSION)) .'
        '; + $description .= '
        ' . t('This version is incompatible with the !core_version version of Drupal core.', array('!core_version' => VERSION)) . '
        '; } 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 .= '
        '. t('This module requires PHP version @php_required and is incompatible with PHP version !php_version.', array('@php_required' => $php_required, '!php_version' => phpversion())) .'
        '; + $description .= '
        ' . t('This module requires PHP version @php_required and is incompatible with PHP version !php_version.', array('@php_required' => $php_required, '!php_version' => phpversion())) . '
        '; } 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[] = ''; + $row[] = ''; } else { - $row[] = ''. drupal_render($form['name'][$key]) .''; + $row[] = '' . drupal_render($form['name'][$key]) . ''; } $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'), - ''. drupal_render($form['modules'][$module]['name']) .'', + '' . drupal_render($form['modules'][$module]['name']) . '', 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 .= '
        '. t('This version is incompatible with the !core_version version of Drupal core.', array('!core_version' => VERSION)) .'
        '; + $description .= '
        ' . t('This version is incompatible with the !core_version version of Drupal core.', array('!core_version' => VERSION)) . '
        '; } 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 .= '
        '. t('This theme requires PHP version @php_required and is incompatible with PHP version !php_version.', array('@php_required' => $php_required, '!php_version' => phpversion())) .'
        '; + $description .= '
        ' . t('This theme requires PHP version @php_required and is incompatible with PHP version !php_version.', array('@php_required' => $php_required, '!php_version' => phpversion())) . '
        '; } else { $status = drupal_render($form['status'][$key]); } // Style theme info - $theme = '

        '. $info['name'] .'

        '. $description .'
        '; + $theme = '

        ' . $info['name'] . '

        ' . $description . '
        '; // Build rows $row = array(); diff --git a/modules/system/system.install b/modules/system/system.install index b4dcd1fd1b756d20c3aed824e1e122686afe4151..db804064e4c1bacabcaa7d1feaaff631668c32b6 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 Drupal requirements for more information.', array('@url' => 'http://drupal.org/requirements')); + $requirements['php_memory_limit']['description'] = $description . ' ' . $t('See the Drupal requirements 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 run cron manually.', array('@cron' => url('admin/reports/status/run-cron'))); - $description .= '
        '. $t('To run cron from outside the site, go to !cron', array('!cron' => url('cron.php', array('absolute' => true, 'query' => 'cron_key='. variable_get('cron_key', 'drupal'))))); + $description .= ' ' . $t('You can run cron manually.', array('@cron' => url('admin/reports/status/run-cron'))); + $description .= '
        ' . $t('To run cron from outside the site, go to !cron', 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 file system settings page 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 file system settings page 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 on-line handbook.', 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 on-line handbook.', 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 database update script immediately.', array('@update' => base_path() .'update.php')); + $requirements['update']['description'] = $t('Some modules have database schema updates to install. You should run the database update script 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 User settings 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 User settings 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 modules administration page. For more information please read the Update status handbook page.'); + 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 modules administration page. For more information please read the Update status handbook page.'); 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 removed 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 permissions page.'); + 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 removed 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 permissions page.'); 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 c864d80829e22b6a0bfab03a8648408bcac40134..432881ef98917e991ffe513ef854d278fe42b2d5 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 = '

        '. 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.') .'

        '; - $output .= '

        '. t('The system module provides:') .'

        '; - $output .= '
        • '. t('support for enabling and disabling modules. 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 Drupal.org module page.', array('@modules' => url('admin/build/modules'), '@drupal-modules' => 'http://drupal.org/project/modules')) .'
        • '; - $output .= '
        • '. t('support for enabling and disabling themes, which determine the design and presentation of your site. Drupal comes packaged with several core themes and additional contributed themes are available at the Drupal.org theme page.', array('@themes' => url('admin/build/themes'), '@drupal-themes' => 'http://drupal.org/project/themes')) .'
        • '; - $output .= '
        • '. t('a robust caching system 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'))) .'
        • '; - $output .= '
        • '. t('a set of routine administrative operations that rely on a correctly-configured cron maintenance task to run automatically. A number of other modules, including the feed aggregator, and search also rely on cron maintenance tasks. For more information, see the online handbook entry for configuring cron jobs.', array('@cron' => url('admin/reports/status'), '@handbook' => 'http://drupal.org/cron')) .'
        • '; - $output .= '
        • '. t('basic configuration options for your site, including date and time settings, file system settings, clean URL support, site name and other information, and a site maintenance 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'))) .'
        '; - $output .= '

        '. t('For more information, see the online handbook entry for System module.', array('@system' => 'http://drupal.org/handbook/modules/system/')) .'

        '; + $output = '

        ' . 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.') . '

        '; + $output .= '

        ' . t('The system module provides:') . '

        '; + $output .= '
        • ' . t('support for enabling and disabling modules. 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 Drupal.org module page.', array('@modules' => url('admin/build/modules'), '@drupal-modules' => 'http://drupal.org/project/modules')) . '
        • '; + $output .= '
        • ' . t('support for enabling and disabling themes, which determine the design and presentation of your site. Drupal comes packaged with several core themes and additional contributed themes are available at the Drupal.org theme page.', array('@themes' => url('admin/build/themes'), '@drupal-themes' => 'http://drupal.org/project/themes')) . '
        • '; + $output .= '
        • ' . t('a robust caching system 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'))) . '
        • '; + $output .= '
        • ' . t('a set of routine administrative operations that rely on a correctly-configured cron maintenance task to run automatically. A number of other modules, including the feed aggregator, and search also rely on cron maintenance tasks. For more information, see the online handbook entry for configuring cron jobs.', array('@cron' => url('admin/reports/status'), '@handbook' => 'http://drupal.org/cron')) . '
        • '; + $output .= '
        • ' . t('basic configuration options for your site, including date and time settings, file system settings, clean URL support, site name and other information, and a site maintenance 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'))) . '
        '; + $output .= '

        ' . t('For more information, see the online handbook entry for System module.', array('@system' => 'http://drupal.org/handbook/modules/system/')) . '

        '; return $output; case 'admin': - return '

        '. t('Welcome to the administration section. Here you may control how your site functions.') .'

        '; + return '

        ' . t('Welcome to the administration section. Here you may control how your site functions.') . '

        '; case 'admin/by-module': - return '

        '. t('This page shows you all available administration tasks for each module.') .'

        '; + return '

        ' . t('This page shows you all available administration tasks for each module.') . '

        '; case 'admin/build/themes': - $output = '

        '. 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.') .'

        '; - $output .= '

        '. t('To change the appearance of your site, a number of contributed themes are available.', array('@themes' => 'http://drupal.org/project/themes')) .'

        '; + $output = '

        ' . 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.') . '

        '; + $output .= '

        ' . t('To change the appearance of your site, a number of contributed themes are available.', array('@themes' => 'http://drupal.org/project/themes')) . '

        '; 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 '

        '. t('These options control the display settings for the %template 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 global settings for this theme.', array('%template' => $theme, '@global' => url('admin/build/themes/settings'))) .'

        '; + return '

        ' . t('These options control the display settings for the %template 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 global settings for this theme.', array('%template' => $theme, '@global' => url('admin/build/themes/settings'))) . '

        '; case 'admin/build/themes/settings': - return '

        '. 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.') .'

        '; + return '

        ' . 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.') . '

        '; case 'admin/build/modules': - $output = '

        '. t('Modules are plugins that extend Drupal\'s core functionality. Enable modules by selecting the Enabled checkboxes below and clicking the Save configuration button. Once a module is enabled, new permissions may be available. To reduce server load, modules with their Throttle checkbox selected are temporarily disabled when your site becomes extremely busy. (Note that the Throttle checkbox is only available if the Throttle module is enabled.)', array('@permissions' => url('admin/user/permissions'))); + $output = '

        ' . t('Modules are plugins that extend Drupal\'s core functionality. Enable modules by selecting the Enabled checkboxes below and clicking the Save configuration button. Once a module is enabled, new permissions may be available. To reduce server load, modules with their Throttle checkbox selected are temporarily disabled when your site becomes extremely busy. (Note that the Throttle 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 throttle configuration page after having enabled the throttle module.', array('@throttle' => url('admin/settings/throttle'))); + $output .= ' ' . t('The auto-throttle functionality must be enabled on the throttle configuration page after having enabled the throttle module.', array('@throttle' => url('admin/settings/throttle'))); } $output .= '

        '; - $output .= '

        '. t('It is important that update.php is run every time a module is updated to a newer version.', array('@update-php' => $base_url .'/update.php')) .'

        '; - $output .= '

        '. t('You can find all administration tasks belonging to a particular module on the administration by module page.', array('@by-module' => url('admin/by-module'))) .'

        '; - $output .= '

        '. t('To extend the functionality of your site, a number of contributed modules are available.', array('@modules' => 'http://drupal.org/project/modules')) .'

        '; + $output .= '

        ' . t('It is important that update.php is run every time a module is updated to a newer version.', array('@update-php' => $base_url . '/update.php')) . '

        '; + $output .= '

        ' . t('You can find all administration tasks belonging to a particular module on the administration by module page.', array('@by-module' => url('admin/by-module'))) . '

        '; + $output .= '

        ' . t('To extend the functionality of your site, a number of contributed modules are available.', array('@modules' => 'http://drupal.org/project/modules')) . '

        '; return $output; case 'admin/build/modules/uninstall': - return '

        '. 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.') .'

        '; + return '

        ' . 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.') . '

        '; case 'admin/build/block/configure': if ($arg[4] == 'system' && $arg[5] == 0) { - return '

        '. t('The Powered by Drupal 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.') .'

        '; + return '

        ' . t('The Powered by Drupal 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.') . '

        '; } break; case 'admin/settings/actions': case 'admin/settings/actions/manage': - $output = '

        '. 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.') .'

        '; - $output .= '

        '. 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 Create button.') .'

        '; + $output = '

        ' . 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.') . '

        '; + $output .= '

        ' . 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 Create button.') . '

        '; if (module_exists('trigger')) { - $output .= '

        '. t('You may proceed to the Triggers page to assign these actions to system events.', array('@url' => url('admin/build/trigger'))) .'

        '; + $output .= '

        ' . t('You may proceed to the Triggers page to assign these actions to system events.', array('@url' => url('admin/build/trigger'))) . '

        '; } return $output; case 'admin/settings/actions/configure': return t('An advanced action offers additional configuration options which may be filled out below. Changing the Description 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 '

        '. 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.') .'

        '; + return '

        ' . 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.') . '

        '; case 'admin/reports/status': - return '

        '. 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.") .'

        '; + return '

        ' . 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.") . '

        '; } } @@ -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') ? '
        '. t('(site default theme)') .'' : '')); + $form['themes'][$info->key]['description'] = array('#type' => 'item', '#title' => $info->name, '#value' => dirname($info->filename) . ($info->name == variable_get('theme_default', 'garland') ? '
        ' . t('(site default theme)') . '' : '')); $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 .= '

        '. t('Actions available to Drupal:') .'

        '; + $output .= '

        ' . t('Actions available to Drupal:') . '

        '; $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 90ff0168d7c296fd87493c13dc2c656b3ad90b0a..52c0aa938023ddd462ae18bb62dbd84b52ba9082 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 = '

        '. 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)) .'

        '; - $description .= '

        '. 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.") .'

        '; + $description = '

        ' . 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)) . '

        '; + $description .= '

        ' . 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.") . '

        '; 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 c1bc41c34630ef303bce0bcacf961bd874feb88b..5fc6dfb10a6df1f93d4eb3d554f1684f2402bbdd 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 .= '

        '. t('There are currently no posts in this category.') .'

        '; + $output .= '

        ' . t('There are currently no posts in this category.') . '

        '; } return $output; } @@ -1189,7 +1189,7 @@ function taxonomy_node_update_index(&$node) { $output[] = $term->name; } if (count($output)) { - return '('. implode(', ', $output) .')'; + return '(' . implode(', ', $output) . ')'; } } @@ -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 = '

        '. 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.') .'

        '; - $output .= '

        '. 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.') .'

        '; - $output .= '

        '. t('Type of Meal: Appetizer, Main Course, Salad, Dessert') .'

        '; - $output .= '

        '. t('Preparation Time: 0-30mins, 30-60mins, 1-2 hrs, 2hrs+') .'

        '; - $output .= '

        '. 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.") .'

        '; - $output .= '

        '. 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'.") .'

        '; - $output .= '

        '. 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.') .'

        '; - $output .= '

        '. t('For more information, see the online handbook entry for Taxonomy module.', array('@taxonomy' => 'http://drupal.org/handbook/modules/taxonomy/')) .'

        '; + $output = '

        ' . 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.') . '

        '; + $output .= '

        ' . 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.') . '

        '; + $output .= '

        ' . t('Type of Meal: Appetizer, Main Course, Salad, Dessert') . '

        '; + $output .= '

        ' . t('Preparation Time: 0-30mins, 30-60mins, 1-2 hrs, 2hrs+') . '

        '; + $output .= '

        ' . 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.") . '

        '; + $output .= '

        ' . 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'.") . '

        '; + $output .= '

        ' . 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.') . '

        '; + $output .= '

        ' . t('For more information, see the online handbook entry for Taxonomy module.', array('@taxonomy' => 'http://drupal.org/handbook/modules/taxonomy/')) . '

        '; return $output; case 'admin/content/taxonomy': - $output = '

        '. 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'.") .'

        '; - $output .= '

        '. 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 Type 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 Name 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 Save button at the bottom of the page.') .'

        '; + $output = '

        ' . 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'.") . '

        '; + $output .= '

        ' . 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 Type 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 Name 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 Save button at the bottom of the page.') . '

        '; return $output; case 'admin/content/taxonomy/%': $vocabulary = taxonomy_vocabulary_load($arg[3]); if ($vocabulary->tags) { - return '

        '. t('%capital_name is a free-tagging vocabulary. To change the name or description of a term, click the edit link next to the term.', array('%capital_name' => drupal_ucfirst($vocabulary->name))) .'

        '; + return '

        ' . t('%capital_name is a free-tagging vocabulary. To change the name or description of a term, click the edit link next to the term.', array('%capital_name' => drupal_ucfirst($vocabulary->name))) . '

        '; } switch ($vocabulary->hierarchy) { case 0: - return '

        '. 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 edit link next to the term.', array('%capital_name' => drupal_ucfirst($vocabulary->name), '%name' => $vocabulary->name)) .'

        '; + return '

        ' . 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 edit link next to the term.', array('%capital_name' => drupal_ucfirst($vocabulary->name), '%name' => $vocabulary->name)) . '

        '; case 1: - return '

        '. 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 edit link next to the term.', array('%capital_name' => drupal_ucfirst($vocabulary->name), '%name' => $vocabulary->name)) .'

        '; + return '

        ' . 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 edit link next to the term.', array('%capital_name' => drupal_ucfirst($vocabulary->name), '%name' => $vocabulary->name)) . '

        '; case 2: - return '

        '. t('%capital_name is a multiple hierarchy vocabulary. To change the name or description of a term, click the edit 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))) .'

        '; + return '

        ' . t('%capital_name is a multiple hierarchy vocabulary. To change the name or description of a term, click the edit 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))) . '

        '; } case 'admin/content/taxonomy/add/vocabulary': - return '

        '. 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.') .'

        '; + return '

        ' . 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.') . '

        '; } } @@ -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 b3e088c6a3a578d0a56a9967d51b4f7f5ca7126d..d0557dc59a9d81af619585cee51f8666c48b3e06 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 43d0903612f37be78ed5f2d42c7bd82274dbfee0..17f6bbb27c243efd37b7857f25612812a188ceec 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 = '

        '. 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.') .'

        '; - $output .= '

        '. 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.') .'

        '; - $output .= '

        '. t('For more information, see the online handbook entry for Throttle module.', array('@throttle' => 'http://drupal.org/handbook/modules/throttle/')) .'

        '; + $output = '

        ' . 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.') . '

        '; + $output .= '

        ' . 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.') . '

        '; + $output .= '

        ' . t('For more information, see the online handbook entry for Throttle module.', array('@throttle' => 'http://drupal.org/handbook/modules/throttle/')) . '

        '; return $output; case 'admin/settings/throttle': - return '

        '. 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.') .'

        '; + return '

        ' . 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.') . '

        '; } } diff --git a/modules/tracker/tracker.module b/modules/tracker/tracker.module index c3e4cd1a3904084eae01fb7b6c359b830d8855da..489160f96d580af7af0689827597bdec44cba193 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 = '

        '. 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.') .'

        '; - $output .= '

        '. t("The Recent posts 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 Track tab from the user's profile page.") .'

        '; - $output .= '

        '. t('For more information, see the online handbook entry for Tracker module.', array('@tracker' => 'http://drupal.org/handbook/modules/tracker/')) .'

        '; + $output = '

        ' . 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.') . '

        '; + $output .= '

        ' . t("The Recent posts 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 Track tab from the user's profile page.") . '

        '; + $output .= '

        ' . t('For more information, see the online handbook entry for Tracker module.', array('@tracker' => 'http://drupal.org/handbook/modules/tracker/')) . '

        '; return $output; } } diff --git a/modules/tracker/tracker.pages.inc b/modules/tracker/tracker.pages.inc index c82fed67f3a476d76be4ead8c8f9766e8d8bcdf6..8b596497ec5d373e7a2ef83cfcf4ec72c8ed6608 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 e532f68447f94095d7ae681823ca5f44cc5db416..9467440184eb544a082b7cc9761a0d180a07ecfe 100644 --- a/modules/translation/translation.module +++ b/modules/translation/translation.module @@ -31,21 +31,21 @@ function translation_help($path, $arg) { switch ($path) { case 'admin/help#translation': - $output = '

        '. t('The content translation module allows content to be translated into different languages. Working with the locale module (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'))) .'

        '; - $output .= '

        '. t('Configuring content translation and translation-enabled content types:') .'

        '; - $output .= '
        • '. t('Assign the translate content permission to the appropriate user roles at the Permissions configuration page.', array('@permissions' => url('admin/user/permissions'))) .'
        • '; - $output .= '
        • '. t('Add and enable desired languages at the Languages configuration page.', array('@languages' => url('admin/settings/language'))) .'
        • '; - $output .= '
        • '. t('Determine which content types should support translation features. To enable translation support for a content type, edit the type and at the Multilingual support drop down, select Enabled, with translation. (Multilingual support is located within Workflow settings.) Be sure to save each content type after enabling multilingual support.', array('@content-types' => url('admin/build/types'))) .'
        '; - $output .= '

        '. t('Working with translation-enabled content types:') .'

        '; - $output .= '
        • '. t('Use the Language drop down to select the appropriate language when creating or editing posts.') .'
        • '; - $output .= '
        • '. t('Provide new or edit current translations for existing posts via the Translation tab. Only visible while viewing a post as a user with the translate content permission, this tab allows translations to be added or edited using a specialized editing form that also displays the content being translated.') .'
        • '; - $output .= '
        • '. 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 Flag translations as outdated 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 This translation needs to be updated check box on the translation editing form.') .'
        • '; - $output .= '
        • '. t('The Content management administration page displays the language of each post, and also allows filtering by language or translation status.', array('@content-node' => url('admin/content/node'))) .'
        '; - $output .= '

        '. t('Use the language switcher block 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'))) .'

        '; - $output .= '

        '. t('For more information, see the online handbook entry for Translation module.', array('@translation' => 'http://drupal.org/handbook/modules/translation/')) .'

        '; + $output = '

        ' . t('The content translation module allows content to be translated into different languages. Working with the locale module (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'))) . '

        '; + $output .= '

        ' . t('Configuring content translation and translation-enabled content types:') . '

        '; + $output .= '
        • ' . t('Assign the translate content permission to the appropriate user roles at the Permissions configuration page.', array('@permissions' => url('admin/user/permissions'))) . '
        • '; + $output .= '
        • ' . t('Add and enable desired languages at the Languages configuration page.', array('@languages' => url('admin/settings/language'))) . '
        • '; + $output .= '
        • ' . t('Determine which content types should support translation features. To enable translation support for a content type, edit the type and at the Multilingual support drop down, select Enabled, with translation. (Multilingual support is located within Workflow settings.) Be sure to save each content type after enabling multilingual support.', array('@content-types' => url('admin/build/types'))) . '
        '; + $output .= '

        ' . t('Working with translation-enabled content types:') . '

        '; + $output .= '
        • ' . t('Use the Language drop down to select the appropriate language when creating or editing posts.') . '
        • '; + $output .= '
        • ' . t('Provide new or edit current translations for existing posts via the Translation tab. Only visible while viewing a post as a user with the translate content permission, this tab allows translations to be added or edited using a specialized editing form that also displays the content being translated.') . '
        • '; + $output .= '
        • ' . 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 Flag translations as outdated 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 This translation needs to be updated check box on the translation editing form.') . '
        • '; + $output .= '
        • ' . t('The Content management administration page displays the language of each post, and also allows filtering by language or translation status.', array('@content-node' => url('admin/content/node'))) . '
        '; + $output .= '

        ' . t('Use the language switcher block 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'))) . '

        '; + $output .= '

        ' . t('For more information, see the online handbook entry for Translation module.', array('@translation' => 'http://drupal.org/handbook/modules/translation/')) . '

        '; return $output; case 'node/%/translate': - $output = '

        '. 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 enabled languages. 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'))) .'

        '; + $output = '

        ' . 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 enabled languages. 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'))) . '

        '; 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 d82d3da89c9e068a1e52fd87c8e56a464a3395a8..3bbedcfafe32a019485924055416c31d3a26974e 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 ? ' - '. t('outdated') .'' : ''; + $status .= $translation_node->translate ? ' - ' . t('outdated') . '' : ''; if ($translation_node->nid == $tnid) { - $language_name = ''. $language_name .' (source)'; + $language_name = '' . $language_name . ' (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 217bfd5c3c92cc5512fa358b62aba9d024a0017b..798afb7fe28f465a993273e05cc2544819f515c1 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 61544246e2df9147b9290287912563955daf49f7..4db55dd96fd51de70aeebd488cc12e67280807d9 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 = '

        '. 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 Actions settings page contains a list of existing actions and provides the ability to create and configure additional actions.', array('@url' => url('admin/settings/actions'))) .'

        '; + $explanation = '

        ' . 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 Actions settings page contains a list of existing actions and provides the ability to create and configure additional actions.', array('@url' => url('admin/settings/actions'))) . '

        '; switch ($path) { case 'admin/build/trigger/comment': - return $explanation .'

        '. 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.') .'

        '; + return $explanation . '

        ' . 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.') . '

        '; case 'admin/build/trigger/node': - return $explanation .'

        '. 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.') .'

        '; + return $explanation . '

        ' . 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.') . '

        '; case 'admin/build/trigger/cron': - return $explanation .'

        '. t('Below you can assign actions to run during each pass of a cron maintenance task.', array('@cron' => url('admin/reports/status'))) .'

        '; + return $explanation . '

        ' . t('Below you can assign actions to run during each pass of a cron maintenance task.', array('@cron' => url('admin/reports/status'))) . '

        '; case 'admin/build/trigger/taxonomy': - return $explanation .'

        '. 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.') .'

        '; + return $explanation . '

        ' . 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.') . '

        '; case 'admin/build/trigger/user': - return $explanation .'

        '. 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.") .'

        '; + return $explanation . '

        ' . 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.") . '

        '; case 'admin/help#trigger': - $output = '

        '. t('The Trigger module provides the ability to trigger actions upon system events, such as when new content is added or when a user logs in.', array('@actions' => url('admin/settings/actions'))) .'

        '; - $output .= '

        '. 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.') .'

        '; - $output .= '

        '. t('For more information, see the online handbook entry for Trigger module.', array('@trigger' => 'http://drupal.org/handbook/modules/trigger/')) .'

        '; + $output = '

        ' . t('The Trigger module provides the ability to trigger actions upon system events, such as when new content is added or when a user logs in.', array('@actions' => url('admin/settings/actions'))) . '

        '; + $output .= '

        ' . 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.') . '

        '; + $output .= '

        ' . t('For more information, see the online handbook entry for Trigger module.', array('@trigger' => 'http://drupal.org/handbook/modules/trigger/')) . '

        '; 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 a0cf66c3f762a15c716eaafdd237d40d3e8da5fb..826f36a65c8b5d33748b14b86791220d56aa4965 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 3edda9cd1cc4ba84cb97b42fa9d756ab51dfa853..17cf06f4894829839e64295d7e2627e3135ed0ef 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 855f73704cdbe45ac2351aaf7a855103ec663773..92a8ca586f754366cd73e0c7efab738ff1bbadbd 100644 --- a/modules/update/update.module +++ b/modules/update/update.module @@ -58,15 +58,15 @@ function update_help($path, $arg) { switch ($path) { case 'admin/reports/updates': - $output = '

        '. 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.') .'

        '; - $output .= '

        '. t('To extend the functionality or to change the look of your site, a number of contributed modules and themes are available.', array('@modules' => 'http://drupal.org/project/modules', '@themes' => 'http://drupal.org/project/themes')) .'

        '; + $output = '

        ' . 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.') . '

        '; + $output .= '

        ' . t('To extend the functionality or to change the look of your site, a number of contributed modules and themes are available.', array('@modules' => 'http://drupal.org/project/modules', '@themes' => 'http://drupal.org/project/themes')) . '

        '; 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 '

        '. t('See the available updates page for information on installed modules and themes with new versions released.', array('@available_updates' => url('admin/reports/updates'))) .'

        '; + return '

        ' . t('See the available updates page for information on installed modules and themes with new versions released.', array('@available_updates' => url('admin/reports/updates'))) . '

        '; case 'admin/reports/updates/settings': case 'admin/reports/status': @@ -84,10 +84,10 @@ function update_help($path, $arg) { break; case 'admin/help#update': - $output = '

        '. 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.") .'

        '; - $output .= '

        '. t('The report of available updates will alert you when new releases are available for download. You may configure options for update checking frequency and notifications at the Update status module settings page.', array('@update-report' => url('admin/reports/updates'), '@update-settings' => url('admin/reports/updates/settings'))) .'

        '; - $output .= '

        '. 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 module administration page.', array('@modules' => url('admin/build/modules'))) .'

        '; - $output .= '

        '. t('For more information, see the online handbook entry for Update status module.', array('@update' => 'http://drupal.org/handbook/modules/update')) .'

        '; + $output = '

        ' . 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.") . '

        '; + $output .= '

        ' . t('The report of available updates will alert you when new releases are available for download. You may configure options for update checking frequency and notifications at the Update status module settings page.', array('@update-report' => url('admin/reports/updates'), '@update-settings' => url('admin/reports/updates/settings'))) . '

        '; + $output .= '

        ' . 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 module administration page.', array('@modules' => url('admin/build/modules'))) . '

        '; + $output .= '

        ' . t('For more information, see the online handbook entry for Update status module.', array('@update' => 'http://drupal.org/handbook/modules/update')) . '

        '; 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 available updates page for more information.', array('@available_updates' => url('admin/reports/updates', array('language' => $language))), $langcode); + $text .= ' ' . t('See the available updates 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 77e9c2c68f6e724f8a7b20694e4b0464f3e1c61b..6bc2ff1cdb53793cf6433ef3f61031857f1ed865 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 = '
        '. ($last ? t('Last checked: @time ago', array('@time' => format_interval(time() - $last))) : t('Last checked: never')); - $output .= ' ('. l(t('Check manually'), 'admin/reports/updates/check') .')'; + $output = '
        ' . ($last ? t('Last checked: @time ago', array('@time' => format_interval(time() - $last))) : t('Last checked: never')); + $output .= ' (' . l(t('Check manually'), 'admin/reports/updates/check') . ')'; $output .= "
        \n"; if (!is_array($data)) { - $output .= '

        '. $data .'

        '; + $output .= '

        ' . $data . '

        '; return $output; } @@ -67,25 +67,25 @@ function theme_update_report($data) { $row = '
        '; switch ($project['status']) { case UPDATE_NOT_SECURE: - $row .= ''. t('Security update required!') .''; + $row .= '' . t('Security update required!') . ''; break; case UPDATE_REVOKED: - $row .= ''. t('Revoked!') .''; + $row .= '' . t('Revoked!') . ''; break; case UPDATE_NOT_SUPPORTED: - $row .= ''. t('Not supported!') .''; + $row .= '' . t('Not supported!') . ''; break; case UPDATE_NOT_CURRENT: - $row .= ''. t('Update available') .''; + $row .= '' . t('Update available') . ''; break; case UPDATE_CURRENT: - $row .= ''. t('Up to date') .''; + $row .= '' . t('Up to date') . ''; break; default: $row .= check_plain($project['reason']); break; } - $row .= ''. $icon .''; + $row .= '' . $icon . ''; $row .= "
        \n"; $row .= '
        '; @@ -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 .= ' ('. format_date($project['datestamp'], 'custom', 'Y-M-d') .')'; + $row .= ' (' . format_date($project['datestamp'], 'custom', 'Y-M-d') . ')'; } $row .= "
        \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 .= "
        \n"; if (!empty($project['extra'])) { - $row .= '
        '."\n"; + $row .= '
        ' . "\n"; foreach ($project['extra'] as $key => $value) { - $row .= '
        '; - $row .= check_plain($value['label']) .': '; + $row .= '
        '; + $row .= check_plain($value['label']) . ': '; $row .= theme('placeholder', $value['data']); $row .= "
        \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

        ". $type_label ."

        \n"; + $output .= "\n

        " . $type_label . "

        \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 .= ''; + $output .= '
        '; $output .= ''; - $output .= '\n"; + $output .= '\n"; $output .= '\n"; $output .= '
        '. $tag ."' . $tag . "'; $output .= l($version['version'], $version['release_link']); - $output .= ' ('. format_date($version['date'], 'custom', 'Y-M-d') .')'; + $output .= ' (' . format_date($version['date'], 'custom', 'Y-M-d') . ')'; $output .= "