diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2008-10-12 04:30:09 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2008-10-12 04:30:09 +0000 |
commit | f76acb2d9d421ff705be6fd2713b8cc2c007e1df (patch) | |
tree | 9fe17e06724737f1a6579cf1a889a1222885412f /includes | |
parent | a765e882ebf89969e81335a6df4fddb23d27095f (diff) | |
download | brdo-f76acb2d9d421ff705be6fd2713b8cc2c007e1df.tar.gz brdo-f76acb2d9d421ff705be6fd2713b8cc2c007e1df.tar.bz2 |
#282405 by Damien Tournoud, lilou, Dave Reid: Enforce coding standard on elseif.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/cache.inc | 2 | ||||
-rw-r--r-- | includes/common.inc | 16 | ||||
-rw-r--r-- | includes/file.inc | 4 | ||||
-rw-r--r-- | includes/form.inc | 8 | ||||
-rw-r--r-- | includes/locale.inc | 2 | ||||
-rw-r--r-- | includes/module.inc | 2 | ||||
-rw-r--r-- | includes/pager.inc | 2 | ||||
-rw-r--r-- | includes/theme.inc | 6 | ||||
-rw-r--r-- | includes/unicode.inc | 16 |
9 files changed, 29 insertions, 29 deletions
diff --git a/includes/cache.inc b/includes/cache.inc index 83cd23e47..a7ad16214 100644 --- a/includes/cache.inc +++ b/includes/cache.inc @@ -168,7 +168,7 @@ function cache_clear_all($cid = NULL, $table = NULL, $wildcard = FALSE) { // This is the first request to clear the cache, start a timer. variable_set('cache_flush', REQUEST_TIME); } - else if (REQUEST_TIME > ($cache_flush + variable_get('cache_lifetime', 0))) { + elseif (REQUEST_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_delete($table) diff --git a/includes/common.inc b/includes/common.inc index 4c03bce7b..7830e4015 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1247,25 +1247,25 @@ function format_date($timestamp, $type = 'medium', $format = '', $timezone = NUL if (strpos('AaDlM', $c) !== FALSE) { $date .= t(gmdate($c, $timestamp), array(), $langcode); } - else if ($c == 'F') { + elseif ($c == 'F') { // 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)); } - else if (strpos('BdgGhHiIjLmnsStTUwWYyz', $c) !== FALSE) { + elseif (strpos('BdgGhHiIjLmnsStTUwWYyz', $c) !== FALSE) { $date .= gmdate($c, $timestamp); } - else if ($c == 'r') { + elseif ($c == 'r') { $date .= format_date($timestamp - $timezone, 'custom', 'D, d M Y H:i:s O', $timezone, $langcode); } - else if ($c == 'O') { + elseif ($c == 'O') { $date .= sprintf('%s%02d%02d', ($timezone < 0 ? '-' : '+'), abs($timezone / 3600), abs($timezone % 3600) / 60); } - else if ($c == 'Z') { + elseif ($c == 'Z') { $date .= $timezone; } - else if ($c == '\\') { + elseif ($c == '\\') { $date .= $format[++$i]; } else { @@ -1789,7 +1789,7 @@ function drupal_get_css($css = NULL) { } // 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') { + elseif (!$preprocess && $type == 'theme') { $no_theme_preprocess .= '<link type="text/css" rel="stylesheet" media="' . $media . '" href="' . base_path() . $file . $query_string . '" />' . "\n"; } else { @@ -2559,7 +2559,7 @@ function page_set_cache() { if (zlib_get_coding_type() == 'deflate') { $cache = FALSE; } - else if (zlib_get_coding_type() == FALSE) { + elseif (zlib_get_coding_type() == FALSE) { $data = gzencode($data, 9, FORCE_GZIP); } // The remaining case is 'gzip' which means the data is diff --git a/includes/file.inc b/includes/file.inc index ac8549cfd..ecf2edb93 100644 --- a/includes/file.inc +++ b/includes/file.inc @@ -128,11 +128,11 @@ function file_create_path($destination = NULL) { } // Check if the destination is instead inside the Drupal temporary files // directory. - else if (file_check_location($destination, file_directory_temp())) { + elseif (file_check_location($destination, file_directory_temp())) { return $destination; } // Not found, try again with prefixed directory path. - else if (file_check_location($file_path . '/' . $destination, $file_path)) { + elseif (file_check_location($file_path . '/' . $destination, $file_path)) { return $file_path . '/' . $destination; } // File not found. diff --git a/includes/form.inc b/includes/form.inc index 229338931..037bb9ee6 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -488,7 +488,7 @@ function drupal_prepare_form($form_id, &$form, &$form_state) { $form['form_token'] = array('#type' => 'token', '#default_value' => drupal_get_token($form['#token'])); } } - else if (isset($user->uid) && $user->uid && !$form['#programmed']) { + elseif (isset($user->uid) && $user->uid && !$form['#programmed']) { $form['#token'] = $form_id; $form['form_token'] = array( '#id' => form_clean_id('edit-' . $form_id . '-form-token'), @@ -1375,7 +1375,7 @@ function form_options_flatten($array, $reset = TRUE) { if (is_object($value)) { form_options_flatten($value->option, FALSE); } - else if (is_array($value)) { + elseif (is_array($value)) { form_options_flatten($value, FALSE); } else { @@ -1479,12 +1479,12 @@ function form_get_options($element, $key) { if (is_array($choice)) { return FALSE; } - else if (is_object($choice)) { + elseif (is_object($choice)) { if (isset($choice->option[$key])) { $keys[] = $index; } } - else if ($index == $key) { + elseif ($index == $key) { $keys[] = $index; } } diff --git a/includes/locale.inc b/includes/locale.inc index 3d87909d4..37b634c02 100644 --- a/includes/locale.inc +++ b/includes/locale.inc @@ -1320,7 +1320,7 @@ function _locale_import_one_string_db(&$report, $langcode, $source, $translation db_query("INSERT INTO {locales_target} (lid, language, translation, plid, plural) VALUES (%d, '%s', '%s', %d, %d)", $lid, $langcode, $translation, $plid, $plural); $report[0]++; } - else if ($mode == LOCALE_IMPORT_OVERWRITE) { + elseif ($mode == LOCALE_IMPORT_OVERWRITE) { // Translation exists, only overwrite if instructed. db_query("UPDATE {locales_target} SET translation = '%s', plid = %d, plural = %d WHERE language = '%s' AND lid = %d", $translation, $plid, $plural, $langcode, $lid); $report[1]++; diff --git a/includes/module.inc b/includes/module.inc index 20ea806ed..9df64a66f 100644 --- a/includes/module.inc +++ b/includes/module.inc @@ -476,7 +476,7 @@ function module_invoke_all() { if (isset($result) && is_array($result)) { $return = array_merge_recursive($return, $result); } - else if (isset($result)) { + elseif (isset($result)) { $return[] = $result; } } diff --git a/includes/pager.inc b/includes/pager.inc index 68e453ac7..4b219a8ca 100644 --- a/includes/pager.inc +++ b/includes/pager.inc @@ -401,7 +401,7 @@ function theme_pager_link($text, $page_new, $element, $parameters = array(), $at if (isset($titles[$text])) { $attributes['title'] = $titles[$text]; } - else if (is_numeric($text)) { + elseif (is_numeric($text)) { $attributes['title'] = t('Go to page @number', array('@number' => $text)); } } diff --git a/includes/theme.inc b/includes/theme.inc index 3b76c070c..61a0bbf65 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -1128,7 +1128,7 @@ function theme_links($links, $attributes = array('class' => 'links')) { // Pass in $link as $options, they share the same keys. $output .= l($link['title'], $link['href'], $link); } - else if (!empty($link['title'])) { + elseif (!empty($link['title'])) { // Some links are actually not links, but we wrap these in <span> for adding title and class attributes if (empty($link['html'])) { $link['title'] = check_plain($link['title']); @@ -1457,7 +1457,7 @@ function theme_mark($type = MARK_NEW) { if ($type == MARK_NEW) { return ' <span class="marker">' . t('new') . '</span>'; } - else if ($type == MARK_UPDATED) { + elseif ($type == MARK_UPDATED) { return ' <span class="marker">' . t('updated') . '</span>'; } } @@ -1639,7 +1639,7 @@ function theme_username($object) { $output = check_plain($name); } } - else if ($object->name) { + elseif ($object->name) { // Sometimes modules display content composed by people who are // not registered members of the site (e.g. mailing list or news // aggregator modules). This clause enables modules to display diff --git a/includes/unicode.inc b/includes/unicode.inc index b01e3bcfd..96611d14d 100644 --- a/includes/unicode.inc +++ b/includes/unicode.inc @@ -174,10 +174,10 @@ function drupal_convert_to_utf8($data, $encoding) { if (function_exists('iconv')) { $out = @iconv($encoding, 'utf-8', $data); } - else if (function_exists('mb_convert_encoding')) { + elseif (function_exists('mb_convert_encoding')) { $out = @mb_convert_encoding($data, 'utf-8', $encoding); } - else if (function_exists('recode_string')) { + elseif (function_exists('recode_string')) { $out = @recode_string($encoding . '..utf-8', $data); } else { @@ -370,16 +370,16 @@ function _decode_entities($prefix, $codepoint, $original, &$table, &$exclude) { if ($codepoint < 0x80) { $str = chr($codepoint); } - else if ($codepoint < 0x800) { + elseif ($codepoint < 0x800) { $str = chr(0xC0 | ($codepoint >> 6)) . chr(0x80 | ($codepoint & 0x3F)); } - else if ($codepoint < 0x10000) { + elseif ($codepoint < 0x10000) { $str = chr(0xE0 | ( $codepoint >> 12)) . chr(0x80 | (($codepoint >> 6) & 0x3F)) . chr(0x80 | ( $codepoint & 0x3F)); } - else if ($codepoint < 0x200000) { + elseif ($codepoint < 0x200000) { $str = chr(0xF0 | ( $codepoint >> 18)) . chr(0x80 | (($codepoint >> 12) & 0x3F)) . chr(0x80 | (($codepoint >> 6) & 0x3F)) @@ -488,7 +488,7 @@ function drupal_substr($text, $start, $length = NULL) { } } } - else if ($start < 0) { + elseif ($start < 0) { // Count all the continuation bytes from the end until we have found // abs($start) characters $start = abs($start); @@ -507,7 +507,7 @@ function drupal_substr($text, $start, $length = NULL) { if ($length === NULL) { $bytes = $strlen - 1; } - else if ($length > 0) { + elseif ($length > 0) { // Count all the continuation bytes from the starting index until we have // found $length + 1 characters. Then backtrack one byte. $bytes = $istart; $chars = 0; @@ -520,7 +520,7 @@ function drupal_substr($text, $start, $length = NULL) { } $bytes--; } - else if ($length < 0) { + elseif ($length < 0) { // Count all the continuation bytes from the end until we have found // abs($length) characters $length = abs($length); |