Commit e6759790 authored by Dries's avatar Dries

- Patch #134493 by douggreen: getting the Drupal coding standards right in core. Woot. Woot.

parent be47ac09
......@@ -267,7 +267,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']));
}
......@@ -513,7 +513,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);
}
......@@ -530,7 +530,7 @@ 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).'"';
$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;
......@@ -840,7 +840,7 @@ function _drupal_bootstrap($phase) {
// Deny access to hosts which were banned - t() is not yet available.
if (drupal_is_denied('host', $_SERVER['REMOTE_ADDR'])) {
header('HTTP/1.1 403 Forbidden');
print 'Sorry, '. $_SERVER['REMOTE_ADDR']. ' has been banned.';
print 'Sorry, '. $_SERVER['REMOTE_ADDR'] .' has been banned.';
exit();
}
break;
......@@ -933,7 +933,7 @@ function drupal_maintenance_theme() {
$themes = drupal_common_themes();
foreach ($themes as $hook => $info) {
if (!isset($info['file']) && !isset($info['function'])) {
$themes[$hook]['function'] = 'theme_' . $hook;
$themes[$hook]['function'] = 'theme_'. $hook;
}
}
_theme_set_registry($themes);
......@@ -993,7 +993,7 @@ function language_list($field = 'language', $reset = FALSE) {
// Return the array indexed by the right field
if (!isset($languages[$field])) {
$languages[$field] = array();
foreach($languages['language'] as $lang) {
foreach ($languages['language'] as $lang) {
// Some values should be collected into an array
if (in_array($field, array('enabled', 'weight'))) {
$languages[$field][$lang->$field][$lang->language] = $lang;
......
......@@ -1199,7 +1199,7 @@ function url($path = NULL, $options = array()) {
$clean_url = (bool)variable_get('clean_url', '0');
}
$base = $options['absolute'] ? $base_url . '/' : base_path();
$base = $options['absolute'] ? $base_url .'/' : base_path();
// The special path '<front>' links to the default front page.
if (!empty($path) && $path != '<front>') {
......
......@@ -64,13 +64,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('{' => '', '}' => ''));
}
......
......@@ -72,7 +72,7 @@ function db_connect($url) {
// Decode url-encoded information in the db connection string
$url['user'] = urldecode($url['user']);
// Test if database url has a password.
if(isset($url['pass'])) {
if (isset($url['pass'])) {
$url['pass'] = urldecode($url['pass']);
}
else {
......@@ -154,7 +154,7 @@ function _db_query($query, $debug = 0) {
if (variable_get('dev_query', 0)) {
$bt = debug_backtrace();
$query = $bt[2]['function'] . "\n" . $query;
$query = $bt[2]['function'] ."\n". $query;
list($usec, $sec) = explode(' ', microtime());
$stop = (float)$usec + (float)$sec;
$diff = $stop - $timer;
......@@ -377,7 +377,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) ."'";
}
/**
......@@ -418,7 +418,7 @@ function db_unlock_tables() {
* Check if a table exists.
*/
function db_table_exists($table) {
return db_num_rows(db_query("SHOW TABLES LIKE '{" . db_escape_table($table) . "}'"));
return db_num_rows(db_query("SHOW TABLES LIKE '{". db_escape_table($table) ."}'"));
}
/**
......
......@@ -67,7 +67,7 @@ function db_connect($url) {
// Decode url-encoded information in the db connection string
$url['user'] = urldecode($url['user']);
// Test if database url has a password.
if(isset($url['pass'])) {
if (isset($url['pass'])) {
$url['pass'] = urldecode($url['pass']);
}
else {
......@@ -133,7 +133,7 @@ function _db_query($query, $debug = 0) {
if (variable_get('dev_query', 0)) {
$bt = debug_backtrace();
$query = $bt[2]['function'] . "\n" . $query;
$query = $bt[2]['function'] ."\n". $query;
list($usec, $sec) = explode(' ', microtime());
$stop = (float)$usec + (float)$sec;
$diff = $stop - $timer;
......@@ -357,7 +357,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) ."'";
}
/**
......@@ -398,7 +398,7 @@ function db_unlock_tables() {
* Check if a table exists.
*/
function db_table_exists($table) {
return db_num_rows(db_query("SHOW TABLES LIKE '{" . db_escape_table($table) . "}'"));
return db_num_rows(db_query("SHOW TABLES LIKE '{". db_escape_table($table) ."}'"));
}
/**
......
......@@ -65,19 +65,19 @@ function db_connect($url) {
// Decode url-encoded information in the db connection string
if (isset($url['user'])) {
$conn_string .= ' user=' . urldecode($url['user']);
$conn_string .= ' user='. urldecode($url['user']);
}
if (isset($url['pass'])) {
$conn_string .= ' password=' . urldecode($url['pass']);
$conn_string .= ' password='. urldecode($url['pass']);
}
if (isset($url['host'])) {
$conn_string .= ' host=' . urldecode($url['host']);
$conn_string .= ' host='. urldecode($url['host']);
}
if (isset($url['path'])) {
$conn_string .= ' dbname=' . substr(urldecode($url['path']), 1);
$conn_string .= ' dbname='. substr(urldecode($url['path']), 1);
}
if (isset($url['port'])) {
$conn_string .= ' port=' . urldecode($url['port']);
$conn_string .= ' port='. urldecode($url['port']);
}
// pg_last_error() does not return a useful error message for database
......@@ -126,7 +126,7 @@ function _db_query($query, $debug = 0) {
if (variable_get('dev_query', 0)) {
$bt = debug_backtrace();
$query = $bt[2]['function'] . "\n" . $query;
$query = $bt[2]['function'] ."\n". $query;
list($usec, $sec) = explode(' ', microtime());
$stop = (float)$usec + (float)$sec;
$diff = $stop - $timer;
......@@ -391,7 +391,7 @@ function db_unlock_tables() {
* Check if a table exists.
*/
function db_table_exists($table) {
return db_num_rows(db_query("SELECT relname FROM pg_class WHERE relname = '{" . db_escape_table($table) . "}'"));
return db_num_rows(db_query("SELECT relname FROM pg_class WHERE relname = '{". db_escape_table($table) ."}'"));
}
/**
......@@ -421,7 +421,7 @@ function db_distinct_field($table, $field, $query) {
$field_to_select = 'DISTINCT ON ('. $table .'.'. $field .") $table.$field";
// (?<!text) is a negative look-behind (no need to rewrite queries that already use DISTINCT).
$query = preg_replace('/(SELECT.*)(?:'. $table .'\.|\s)(?<!DISTINCT\()(?<!DISTINCT\('. $table .'\.)'. $field .'(.*FROM )/AUsi', '\1 '. $field_to_select .'\2', $query);
$query = preg_replace('/(ORDER BY )(?!'.$table.'\.'.$field.')/', '\1'."$table.$field, ", $query);
$query = preg_replace('/(ORDER BY )(?!'. $table .'\.'. $field .')/', '\1'."$table.$field, ", $query);
return $query;
}
......
......@@ -28,7 +28,7 @@
*/
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)) {
......@@ -63,8 +63,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;
......@@ -215,7 +215,7 @@ function file_check_upload($source = 'upload') {
// Unknown error
default:
drupal_set_message(t('The file %file could not be saved. An unknown error has occurred.', array('%file' => $source)),'error');
drupal_set_message(t('The file %file could not be saved. An unknown error has occurred.', array('%file' => $source)), 'error');
return 0;
}
......@@ -699,7 +699,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);
}
......
......@@ -728,7 +728,7 @@ function form_builder($form_id, $form) {
}
}
if (!isset($form['#value'])) {
$function = $form['#type'] . '_value';
$function = $form['#type'] .'_value';
if (function_exists($function)) {
$function($form);
}
......@@ -928,7 +928,7 @@ function form_options_flatten($array, $reset = TRUE) {
*/
function theme_select($element) {
$select = '';
$size = $element['#size'] ? ' size="' . $element['#size'] . '"' : '';
$size = $element['#size'] ? ' size="'. $element['#size'] .'"' : '';
_form_set_class($element, array('form-select'));
$multiple = $element['#multiple'];
return theme('form_element', $element, '<select name="'. $element['#name'] .''. ($multiple ? '[]' : '') .'"'. ($multiple ? ' multiple="multiple" ' : '') . drupal_attributes($element['#attributes']) .' id="'. $element['#id'] .'" '. $size .'>'. form_select_options($element) .'</select>');
......@@ -1039,7 +1039,7 @@ function theme_fieldset($element) {
}
}
return '<fieldset' . drupal_attributes($element['#attributes']) .'>' . ($element['#title'] ? '<legend>'. $element['#title'] .'</legend>' : '') . (isset($element['#description']) && $element['#description'] ? '<div class="description">'. $element['#description'] .'</div>' : '') . (!empty($element['#children']) ? $element['#children'] : '') . $element['#value'] . "</fieldset>\n";
return '<fieldset'. drupal_attributes($element['#attributes']) .'>'. ($element['#title'] ? '<legend>'. $element['#title'] .'</legend>' : '') . (isset($element['#description']) && $element['#description'] ? '<div class="description">'. $element['#description'] .'</div>' : '') . (!empty($element['#children']) ? $element['#children'] : '') . $element['#value'] ."</fieldset>\n";
}
/**
......@@ -1054,7 +1054,7 @@ function theme_fieldset($element) {
function theme_radio($element) {
_form_set_class($element, array('form-radio'));
$output = '<input type="radio" ';
$output .= 'name="' . $element['#name'] .'" ';
$output .= 'name="'. $element['#name'] .'" ';
$output .= 'value="'. $element['#return_value'] .'" ';
$output .= ($element['#value'] == $element['#return_value']) ? ' checked="checked" ' : ' ';
$output .= drupal_attributes($element['#attributes']) .' />';
......@@ -1306,10 +1306,10 @@ function theme_checkbox($element) {
$checkbox = '<input ';
$checkbox .= 'type="checkbox" ';
$checkbox .= 'name="'. $element['#name'] .'" ';
$checkbox .= 'id="'. $element['#id'].'" ' ;
$checkbox .= 'id="'. $element['#id'] .'" ' ;
$checkbox .= 'value="'. $element['#return_value'] .'" ';
$checkbox .= $element['#value'] ? ' checked="checked" ' : ' ';
$checkbox .= drupal_attributes($element['#attributes']) . ' />';
$checkbox .= drupal_attributes($element['#attributes']) .' />';
if (!is_null($element['#title'])) {
$checkbox = '<label class="option">'. $checkbox .' '. $element['#title'] .'</label>';
......@@ -1371,7 +1371,7 @@ function theme_button($element) {
$element['#attributes']['class'] = 'form-'. $element['#button_type'];
}
return '<input type="submit" '. (empty($element['#name']) ? '' : 'name="'. $element['#name'] .'" ') .'id="'. $element['#id'].'" value="'. check_plain($element['#value']) .'" '. drupal_attributes($element['#attributes']) ." />\n";
return '<input type="submit" '. (empty($element['#name']) ? '' : 'name="'. $element['#name'] .'" ') .'id="'. $element['#id'] .'" value="'. check_plain($element['#value']) .'" '. drupal_attributes($element['#attributes']) ." />\n";
}
/**
......@@ -1384,7 +1384,7 @@ function theme_button($element) {
* A themed HTML string representing the hidden form field.
*/
function theme_hidden($element) {
return '<input type="hidden" name="'. $element['#name'] . '" id="'. $element['#id'] . '" value="'. check_plain($element['#value']) ."\" " . drupal_attributes($element['#attributes']) ." />\n";
return '<input type="hidden" name="'. $element['#name'] .'" id="'. $element['#id'] .'" value="'. check_plain($element['#value']) ."\" ". drupal_attributes($element['#attributes']) ." />\n";
}
function theme_token($element) {
......@@ -1401,7 +1401,7 @@ function theme_token($element) {
* A themed HTML string representing the textfield.
*/
function theme_textfield($element) {
$size = $element['#size'] ? ' size="' . $element['#size'] . '"' : '';
$size = $element['#size'] ? ' size="'. $element['#size'] .'"' : '';
$class = array('form-text');
$extra = '';
$output = '';
......@@ -1423,7 +1423,7 @@ function theme_textfield($element) {
$output .= ' <span class="field-suffix">'. $element['#field_suffix'] .'</span>';
}
return theme('form_element', $element, $output). $extra;
return theme('form_element', $element, $output) . $extra;
}
/**
......@@ -1437,8 +1437,8 @@ function theme_textfield($element) {
*/
function theme_form($element) {
// Anonymous div to satisfy XHTML compliance.
$action = $element['#action'] ? 'action="' . check_url($element['#action']) . '" ' : '';
return '<form '. $action . ' method="'. $element['#method'] .'" '. 'id="'. $element['#id'] .'"'. drupal_attributes($element['#attributes']) .">\n<div>". $element['#children'] ."\n</div></form>\n";
$action = $element['#action'] ? 'action="'. check_url($element['#action']) .'" ' : '';
return '<form '. $action .' method="'. $element['#method'] .'" id="'. $element['#id'] .'"'. drupal_attributes($element['#attributes']) .">\n<div>". $element['#children'] ."\n</div></form>\n";
}
/**
......@@ -1600,7 +1600,7 @@ function _form_set_class(&$element, $class = array()) {
if ($element['#required']) {
$class[] = 'required';
}
if (form_get_error($element)){
if (form_get_error($element)) {
$class[] = 'error';
}
if (isset($element['#attributes']['class'])) {
......
......@@ -31,7 +31,7 @@ function image_get_toolkit() {
static $toolkit;
if (!$toolkit) {
$toolkit = variable_get('image_toolkit', 'gd');
$toolkit_file = './includes/image.'.$toolkit.'.inc';
$toolkit_file = './includes/image.'. $toolkit .'.inc';
if ($toolkit != 'gd' && file_exists($toolkit_file)) {
include_once $toolkit_file;
}
......
......@@ -307,11 +307,11 @@ function drupal_install_profile($profile, $module_list) {
$module_list = array_diff($module_list, array('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, description, status, throttle, bootstrap, schema_version) VALUES('%s', '%s', 'module', '', 1, 0, 0, %d)", $system_path . '/system.module', 'system', $system_version);
db_query("INSERT INTO {system} (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES('%s', '%s', 'module', '', 1, 0, 0, %d)", $system_path .'/system.module', 'system', $system_version);
// Now that we've installed things properly, bootstrap the full Drupal environment
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
......@@ -564,7 +564,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);
exit();
}
......@@ -578,7 +578,7 @@ function st($string, $args = array()) {
if (!isset($locale_strings)) {
$locale_strings = array();
$filename = './profiles/' . $profile . '/' . $install_locale . '.po';
$filename = './profiles/'. $profile .'/'. $install_locale .'.po';
if (file_exists($filename)) {
require_once './includes/locale.inc';
$file = (object) array('filepath' => $filename);
......
......@@ -34,8 +34,8 @@ function drupal_test_pgsql($url, &$success) {
$url['path'] = urldecode($url['path']);
// Build pgsql connection string and allow for non-standard PostgreSQL port.
$conn_string = ' user='. $url['user'] .' dbname='. substr($url['path'], 1) .' password='. $url['pass'] . ' host=' . $url['host'];
$conn_string .= isset($url['port']) ? ' port=' . $url['port'] : '';
$conn_string = ' user='. $url['user'] .' dbname='. substr($url['path'], 1) .' password='. $url['pass'] .' host='. $url['host'];
$conn_string .= isset($url['port']) ? ' port='. $url['port'] : '';
// Test connecting to the database.
$connection = @pg_connect($conn_string);
......
......@@ -13,13 +13,13 @@ function language_initialize() {
global $user;
$mode = variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE);
switch($mode) {
switch ($mode) {
case LANGUAGE_NEGOTIATION_NONE:
return language_default();
case LANGUAGE_NEGOTIATION_DOMAIN:
$languages = language_list();
foreach($languages as $language) {
foreach ($languages as $language) {
$parts = parse_url($language->domain);
if ($_SERVER['SERVER_NAME'] == $parts['host']) {
return $language;
......@@ -101,7 +101,7 @@ function language_url_rewrite(&$path, &$options) {
// Language can be passed as an option, or we go for current language.
$path_language = isset($options['language']) ? $options['language'] : $language;
switch(variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE)) {
switch (variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE)) {
case LANGUAGE_NEGOTIATION_NONE:
break;
......
......@@ -351,7 +351,7 @@ function locale_edit_language_form_submit($form_id, $form_values) {
$default = language_default();
if ($default->language == $form_values['langcode']) {
$properties = array('name', 'native', 'direction', 'enabled', 'plurals', 'formula', 'domain', 'prefix', 'weight');
foreach($properties as $keyname) {
foreach ($properties as $keyname) {
$default->$keyname = $form_values[$keyname];
}
variable_set('language_default', $default);
......@@ -595,7 +595,7 @@ function _locale_string_edit($lid) {
}
// Handle erroneous lid.
if (!isset($orig)){
if (!isset($orig)) {
drupal_set_message(t('String not found.'));
drupal_goto('admin/build/locale/string/search');
}
......@@ -1409,8 +1409,8 @@ function _locale_export_po($language = NULL) {
}
}
else {
print 'msgstr[0] ""'. "\n";
print 'msgstr[1] ""'. "\n";
print 'msgstr[0] ""'."\n";
print 'msgstr[1] ""'."\n";
}
}
else {
......@@ -1418,7 +1418,7 @@ function _locale_export_po($language = NULL) {
print 'msgstr '. _locale_export_print($message['translation']);
}
else {
print 'msgstr ""'. "\n";
print 'msgstr ""'."\n";
}
}
print "\n";
......@@ -1479,7 +1479,7 @@ function _locale_export_wrap($str, $len) {
$nstr = 0;
}
elseif (strlen("$cur $word") > $len) {
$ret[] = $cur . " ";
$ret[] = $cur ." ";
$cur = $word;
}
else {
......
......@@ -533,11 +533,11 @@ function theme_menu_tree($tree) {
* Generate the HTML output for a menu item and submenu.
*/
function theme_menu_item($link, $has_children, $menu = '') {
return '<li class="'. ($menu ? 'expanded' : ($has_children ? 'collapsed' : 'leaf')) .'">'. $link . $menu .'</li>' . "\n";
return '<li class="'. ($menu ? 'expanded' : ($has_children ? 'collapsed' : 'leaf')) .'">'. $link . $menu .'</li>'."\n";
}
function theme_menu_local_task($link, $active = FALSE) {
return '<li '. ($active ? 'class="active" ' : ''). '>'. $link .'</li>';
return '<li '. ($active ? 'class="active" ' : '') .'>'. $link .'</li>';
}
/**
......@@ -603,7 +603,7 @@ function menu_rebuild() {
}
else {
if (function_exists($matches[1] .'_to_arg')) {
$to_arg_functions[$k] = $matches[1].'_to_arg';
$to_arg_functions[$k] = $matches[1] .'_to_arg';
$load_functions[$k] = NULL;
$match = TRUE;
}
......
......@@ -71,12 +71,12 @@ function init_theme() {
if (strpos($themes[$theme]->filename, '.theme')) {
// file is a theme; include it
include_once './' . $themes[$theme]->filename;
include_once './'. $themes[$theme]->filename;
_theme_load_registry($theme);
}
elseif (strpos($themes[$theme]->description, '.engine')) {
// file is a template; include its engine
include_once './' . $themes[$theme]->description;
include_once './'. $themes[$theme]->description;
$theme_engine = basename($themes[$theme]->description, '.engine');
if (function_exists($theme_engine .'_init')) {
call_user_func($theme_engine .'_init', $themes[$theme]);
......@@ -483,7 +483,7 @@ 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()));
......@@ -549,7 +549,7 @@ function theme_get_setting($setting_name, $refresh = FALSE) {
$settings['favicon'] = base_path() . $favicon;
}
else {
$settings['favicon'] = base_path() . 'misc/favicon.ico';
$settings['favicon'] = base_path() .'misc/favicon.ico';
}
}
elseif ($settings['favicon_path']) {
......@@ -680,7 +680,7 @@ function theme_page($content) {
$output .= '</td><td style="vertical-align: top;">';
$output .= theme('breadcrumb', drupal_get_breadcrumb());
$output .= '<h1>' . drupal_get_title() . '</h1>';
$output .= '<h1>'. drupal_get_title() .'</h1>';
if ($tabs = theme('menu_local_tasks')) {
$output .= $tabs;
......@@ -864,7 +864,7 @@ function theme_links($links, $attributes = array('class' => 'links')) {
// Automatically add a class to each link and also to each LI
if (isset($link['attributes']) && isset($link['attributes']['class'])) {
$link['attributes']['class'] .= ' ' . $key;
$link['attributes']['class'] .= ' '. $key;
$class = $key;
}
else {
......@@ -1155,7 +1155,7 @@ function theme_table_select_header_cell() {
* A themed sort icon.
*/
function theme_tablesort_indicator($style) {
if ($style == "asc"){
if ($style == "asc") {
return theme('image', 'misc/arrow-asc.png', t('sort icon'), t('sort ascending'));
}
else {
......@@ -1250,7 +1250,7 @@ function theme_item_list($items = array(), $title = NULL, $type = 'ul', $attribu
}
if (!empty($items)) {
$output .= "<$type" . drupal_attributes($attributes) . '>';
$output .= "<$type". drupal_attributes($attributes) .'>';
foreach ($items as $item) {
$attributes = array();
$children = array();
......@@ -1273,7 +1273,7 @@ function theme_item_list($items = array(), $title = NULL, $type = 'ul', $attribu
if (count($children) > 0) {
$data .= theme_item_list($children, NULL, $type, $attributes); // Render nested list
}
$output .= '<li' . drupal_attributes($attributes) . '>'. $data .'</li>';
$output .= '<li'. drupal_attributes($attributes) .'>'. $data .'</li>';
}
$output .= "</$type>";
}
......@@ -1285,7 +1285,7 @@ function theme_item_list($items = array(), $title = NULL, $type = 'ul', $attribu
* Returns code that emits the 'more help'-link.
*/
function theme_more_help_link($url) {
return '<div class="more-help-link">' . t('[<a href="@link">more help...</a>]', array('@link' => check_url($url))) . '</div>';
return '<div class="more-help-link">'. t('[<a href="@link">more help...</a>]', array('@link' => check_url($url))) .'</div>';
}
/**
......@@ -1293,7 +1293,7 @@ function theme_more_help_link($url) {
*/
function theme_xml_icon($url) {
if ($image = theme('image', 'misc/xml.png', t('XML feed'), t('XML feed'))) {
return '<a href="'. check_url($url) .'" class="xml-icon">'. $image. '</a>';
return '<a href="'. check_url($url) .'" class="xml-icon">'. $image .'</a>';
}
}
......@@ -1302,7 +1302,7 @@ function theme_xml_icon($url) {
*/
function theme_feed_icon($url) {
if ($image = theme('image', 'misc/feed.png', t('Syndicate content'), t('Syndicate content'))) {
return '<a href="'. check_url($url) .'" class="feed-icon">'. $image. '</a>';
return '<a href="'. check_url($url) .'" class="feed-icon">'. $image .'</a>';
}
}
......
......@@ -114,7 +114,7 @@ function xmlrpc_value_get_xml($xmlrpc_value) {
$return = '<struct>'."\n";
foreach ($xmlrpc_value->data as $name => $value) {
$return .= " <member><name>". check_plain($name) ."</name><value>";
$return .= xmlrpc_value_get_xml($value)."</value></member>\n";
$return .= xmlrpc_value_get_xml($value) ."</value></member>\n";
}
$return .= '</struct>';
return $return;
......@@ -207,7 +207,7 @@ function xmlrpc_message_tag_open($parser, $tag, $attr) {
$xmlrpc_message = xmlrpc_message_get();
$xmlrpc_message->current_tag_contents = '';
$xmlrpc_message->last_open = $tag;
switch($tag) {
switch ($tag) {
case 'methodCall':
case 'methodResponse':
case 'fault':
......@@ -235,7 +235,7 @@ function xmlrpc_message_cdata($parser, $cdata) {
function xmlrpc_message_tag_close($parser, $tag) {
$xmlrpc_message = xmlrpc_message_get();
$value_flag = FALSE;
switch($tag) {
switch ($tag) {
case 'int':
case 'i4':
$value = (int)trim($xmlrpc_message->current_tag_contents);
......@@ -355,7 +355,7 @@ function xmlrpc_error($code = NULL, $message = NULL) {
}