Commit dfd86399 authored by drumm's avatar drumm

#106232 by chx. Add spaces for code style.

parent 7172ab6b
......@@ -731,7 +731,7 @@ function t($string, $args = 0) {
}
else {
// Transform arguments before inserting them
foreach($args as $key => $value) {
foreach ($args as $key => $value) {
switch ($key[0]) {
// Escaped only
case '@':
......
......@@ -276,14 +276,14 @@ function drupal_verify_profile($profile, $locale) {
// Get a list of modules that exist in Drupal's assorted subdirectories.
$present_modules = array();
foreach(drupal_system_listing('\.module$', 'modules', 'name', 0) as $present_module) {
foreach (drupal_system_listing('\.module$', 'modules', 'name', 0) as $present_module) {
$present_modules[] = $present_module->name;
}
// Verify that all of the profile's required modules are present.
$missing_modules = array_diff($module_list, $present_modules);
if (count($missing_modules)) {
foreach($missing_modules as $module) {
foreach ($missing_modules as $module) {
drupal_set_message(st('The %module module is required but was not found. Please move it into the <em>modules</em> subdirectory.', array('%module' => $module)), 'error');
}
}
......@@ -596,7 +596,7 @@ function st($string, $args = array()) {
require_once './includes/theme.inc';
$GLOBALS['theme'] = 'theme';
// Transform arguments before inserting them
foreach($args as $key => $value) {
foreach ($args as $key => $value) {
switch ($key[0]) {
// Escaped only
case '@':
......
......@@ -103,7 +103,7 @@ function theme_locale_admin_manage_screen($form) {
function _locale_admin_manage_screen_submit($form_id, $form_values) {
// Save changes to existing languages.
$languages = locale_supported_languages(FALSE, TRUE);
foreach($languages['name'] as $key => $value) {
foreach ($languages['name'] as $key => $value) {
if ($form_values['site_default'] == $key) {
$form_values['enabled'][$key] = 1; // autoenable the default language
}
......@@ -978,7 +978,7 @@ function _locale_import_tokenize_formula($formula) {
if (is_numeric($formula[$i])) {
$num = $formula[$i];
$j = $i + 1;
while($j < strlen($formula) && is_numeric($formula[$j])) {
while ($j < strlen($formula) && is_numeric($formula[$j])) {
$num .= $formula[$j];
$j++;
}
......
......@@ -609,7 +609,7 @@ function menu_rebuild() {
// Save the new items updating the pids in each iteration
while (($c = count($new_items)) && ($c != $old_count)) {
$old_count = count($new_items);
foreach($new_items as $mid => $item) {
foreach ($new_items as $mid => $item) {
// If the item has a valid parent, save it
if ($item['pid'] >= 0) {
// The new menu ID gets passed back by reference as $item['mid']
......
......@@ -504,7 +504,7 @@ function theme_status_messages($display = NULL) {
$output .= "<div class=\"messages $type\">\n";
if (count($messages) > 1) {
$output .= " <ul>\n";
foreach($messages as $message) {
foreach ($messages as $message) {
$output .= ' <li>'. $message ."</li>\n";
}
$output .= " </ul>\n";
......
......@@ -210,7 +210,7 @@ function contact_admin_edit_validate($form_id, $form_values) {
}
else {
$recipients = explode(',', $form_values['recipients']);
foreach($recipients as $recipient) {
foreach ($recipients as $recipient) {
if (!valid_email_address(trim($recipient))) {
form_set_error('recipients', t('%recipient is an invalid e-mail address.', array('%recipient' => $recipient)));
}
......@@ -227,7 +227,7 @@ function contact_admin_edit_submit($form_id, $form_values) {
db_query('UPDATE {contact} SET selected = 0');
}
$recipients = explode(',', $form_values['recipients']);
foreach($recipients as $key=>$recipient) {
foreach ($recipients as $key=>$recipient) {
// E-mail address validation has already been done in _validate.
$recipients[$key] = trim($recipient);
}
......
......@@ -2357,7 +2357,7 @@ function system_update_159() {
function system_update_160() {
$types = module_invoke('node', 'get_types');
if (is_array($types)) {
foreach($types as $type) {
foreach ($types as $type) {
if (!is_array(variable_get("node_options_$type", array()))) {
variable_set("node_options_$type", array());
}
......
......@@ -1050,7 +1050,7 @@ function system_initialize_theme_blocks($theme) {
$default_theme = variable_get('theme_default', 'garland');
$regions = system_region_list($theme);
$result = db_query("SELECT * FROM {blocks} WHERE theme = '%s'", $default_theme);
while($block = db_fetch_array($result)) {
while ($block = db_fetch_array($result)) {
// If the region isn't supported by the theme, assign the block to the theme's default region.
if (!array_key_exists($block['region'], $regions)) {
$block['region'] = system_default_region($theme);
......
......@@ -293,7 +293,7 @@ function _upload_prepare(&$node) {
// i.e. the user left the edit page, because they didn't want to upload anything.
if(count($_POST) == 0) {
if (is_array($_SESSION['file_previews']) && count($_SESSION['file_previews'])) {
foreach($_SESSION['file_previews'] as $fid => $file) {
foreach ($_SESSION['file_previews'] as $fid => $file) {
file_delete($file->filepath);
}
unset($_SESSION['file_previews']);
......@@ -329,7 +329,7 @@ function _upload_prepare(&$node) {
// Attach file previews to node object.
if (is_array($_SESSION['file_previews']) && count($_SESSION['file_previews'])) {
foreach($_SESSION['file_previews'] as $fid => $file) {
foreach ($_SESSION['file_previews'] as $fid => $file) {
if ($user->uid != 1) {
// Here something.php.pps becomes something.php_.pps
$file->filename = upload_munge_filename($file->filename, NULL, 0);
......@@ -404,7 +404,7 @@ function _upload_validate(&$node) {
// Check if node->files exists, and if it contains something.
if (is_array($node->files)) {
// Update existing files with form data.
foreach($node->files as $fid => $file) {
foreach ($node->files as $fid => $file) {
// Convert file to object for compatibility
$file = (object)$file;
......@@ -653,7 +653,7 @@ function upload_munge_filename($filename, $extensions = NULL, $alerts = 1) {
$new_filename = array_shift($filename_parts); // Remove file basename.
$final_extension = array_pop($filename_parts); // Remove final extension.
foreach($filename_parts as $filename_part) {
foreach ($filename_parts as $filename_part) {
$new_filename .= ".$filename_part";
if (!in_array($filename_part, $whitelist) && preg_match("/^[a-zA-Z]{2,5}\d?$/", $filename_part)) {
$new_filename .= '_';
......
......@@ -2591,7 +2591,7 @@ function theme_user_filters($form) {
}
$output .= '<li><dl class="multiselect">' . (sizeof($form['current']) ? '<dt><em>'. t('and') .'</em> '. t('where') .'</dt>' : '') . '<dd class="a">';
foreach(element_children($form['filter']) as $key) {
foreach (element_children($form['filter']) as $key) {
$output .= drupal_render($form['filter'][$key]);
}
$output .= '</dd>';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment