@@ -42,8 +42,7 @@ |
||
| 42 | 42 | if (is_array($element)) { |
| 43 | 43 | show($element); |
| 44 | 44 | return drupal_render($element); |
| 45 | - } |
|
| 46 | - else { |
|
| 45 | + } else { |
|
| 47 | 46 | // Safe-guard for inappropriate use of render() on flat variables: return |
| 48 | 47 | // the variable as-is. |
| 49 | 48 | return $element; |
@@ -280,12 +280,12 @@ discard block |
||
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | switch ($op) { |
| 283 | - case 'delete': |
|
| 284 | - // Only call delete function on certain node types |
|
| 285 | - if (in_array( $node->type, $node_types)) { |
|
| 286 | - boinc_solr_comments_delete($node); |
|
| 287 | - } |
|
| 288 | - break; |
|
| 283 | + case 'delete': |
|
| 284 | + // Only call delete function on certain node types |
|
| 285 | + if (in_array( $node->type, $node_types)) { |
|
| 286 | + boinc_solr_comments_delete($node); |
|
| 287 | + } |
|
| 288 | + break; |
|
| 289 | 289 | } //switch |
| 290 | 290 | } |
| 291 | 291 | |
@@ -335,13 +335,13 @@ discard block |
||
| 335 | 335 | */ |
| 336 | 336 | function boinc_solr_comments_comment(&$a1, $op) { |
| 337 | 337 | switch ($op) { |
| 338 | - case 'view': |
|
| 339 | - case 'update': |
|
| 340 | - break; |
|
| 341 | - case 'delete': |
|
| 342 | - // $a1 should be a comment object |
|
| 343 | - boinc_solr_comments_deletecomment($a1); |
|
| 344 | - break; |
|
| 338 | + case 'view': |
|
| 339 | + case 'update': |
|
| 340 | + break; |
|
| 341 | + case 'delete': |
|
| 342 | + // $a1 should be a comment object |
|
| 343 | + boinc_solr_comments_deletecomment($a1); |
|
| 344 | + break; |
|
| 345 | 345 | }// switch |
| 346 | 346 | } |
| 347 | 347 | |
@@ -131,8 +131,7 @@ discard block |
||
| 131 | 131 | if ($comment->uid == 0 || strlen($comment->name) == 0) { |
| 132 | 132 | // @see user_validate_name(). !'0' === TRUE. |
| 133 | 133 | $comment_document->ss_name = '0'; |
| 134 | - } |
|
| 135 | - else { |
|
| 134 | + } else { |
|
| 136 | 135 | $comment_document->ss_name = $comment->name; |
| 137 | 136 | // We want the name to be searchable for keywords. |
| 138 | 137 | $comment_document->tos_name = $comment->name; |
@@ -318,8 +317,7 @@ discard block |
||
| 318 | 317 | $solr->deleteByQuery($query); |
| 319 | 318 | // Log the query used for deletion. |
| 320 | 319 | watchdog('Apache Solr', 'Deleted documents from index with query @query', array('@query' => $query), WATCHDOG_INFO); |
| 321 | - } |
|
| 322 | - catch (Exception $e) { |
|
| 320 | + } catch (Exception $e) { |
|
| 323 | 321 | watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR); |
| 324 | 322 | return FALSE; |
| 325 | 323 | }// try |
@@ -376,8 +374,7 @@ discard block |
||
| 376 | 374 | $solr->deleteByQuery($query); |
| 377 | 375 | // Log the query used for deletion. |
| 378 | 376 | watchdog('Apache Solr', 'Deleted documents from index with query @query', array('@query' => $query), WATCHDOG_INFO); |
| 379 | - } |
|
| 380 | - catch (Exception $e) { |
|
| 377 | + } catch (Exception $e) { |
|
| 381 | 378 | watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR); |
| 382 | 379 | return FALSE; |
| 383 | 380 | }// try |
@@ -19,10 +19,10 @@ |
||
| 19 | 19 | foreach (content_types() as $key => $info) { |
| 20 | 20 | // Exclude node types profile, team, and panel |
| 21 | 21 | switch ($key) { |
| 22 | - case 'profile': |
|
| 23 | - case 'team': |
|
| 24 | - case 'panel': |
|
| 25 | - continue 2; |
|
| 22 | + case 'profile': |
|
| 23 | + case 'team': |
|
| 24 | + case 'panel': |
|
| 25 | + continue 2; |
|
| 26 | 26 | }// switch key |
| 27 | 27 | $options[$key] = $info['name']; |
| 28 | 28 | } |
@@ -180,12 +180,12 @@ |
||
| 180 | 180 | */ |
| 181 | 181 | function boincwork_locale($op = 'groups', $group = NULL) { |
| 182 | 182 | switch ($op) { |
| 183 | - case 'groups': |
|
| 184 | - return array('project' => bts('Project')); |
|
| 185 | - case 'info': |
|
| 186 | - $info['project']['refresh callback'] = 'boincwork_locale_refresh'; |
|
| 187 | - $info['project']['format'] = FALSE; |
|
| 188 | - return $info; |
|
| 183 | + case 'groups': |
|
| 184 | + return array('project' => bts('Project')); |
|
| 185 | + case 'info': |
|
| 186 | + $info['project']['refresh callback'] = 'boincwork_locale_refresh'; |
|
| 187 | + $info['project']['format'] = FALSE; |
|
| 188 | + return $info; |
|
| 189 | 189 | } |
| 190 | 190 | } |
| 191 | 191 | |
@@ -279,8 +279,7 @@ discard block |
||
| 279 | 279 | 'href' => 'account/prefs/privacy/ignore_user/remove/'. $author->uid, |
| 280 | 280 | 'query' => 'destination=messages/view/' . $thread_id, |
| 281 | 281 | ); |
| 282 | - } |
|
| 283 | - else { |
|
| 282 | + } else { |
|
| 284 | 283 | $vars['message_actions']['ignore_user'] = array( |
| 285 | 284 | 'title' => bts('Ignore User', array(), NULL, 'boinc:ignore-user-add'), |
| 286 | 285 | 'href' => 'account/prefs/privacy/ignore_user/add/'. $author->uid, |
@@ -387,8 +386,7 @@ discard block |
||
| 387 | 386 | } |
| 388 | 387 | if (!$special) { |
| 389 | 388 | $output .= "<td>{$value} {$pref_setting['#field_suffix']}</td>"; |
| 390 | - } |
|
| 391 | - else { |
|
| 389 | + } else { |
|
| 392 | 390 | // The "very special" case where we merge two prefs |
| 393 | 391 | $second_pref = $special_map[$name]; |
| 394 | 392 | $second_pref_setting = $prefs[$pref_set]['prefs']['advanced'][$category][$second_pref]; |
@@ -396,8 +394,7 @@ discard block |
||
| 396 | 394 | $output .= "<td>{$value} {$pref_setting['#field_suffix']} {$special_delimiter[$name]}" . |
| 397 | 395 | " {$second_value} {$second_pref_setting['#field_suffix']} </td>"; |
| 398 | 396 | } |
| 399 | - } |
|
| 400 | - else { |
|
| 397 | + } else { |
|
| 401 | 398 | $output .= '<td>---</td>'; |
| 402 | 399 | } |
| 403 | 400 | } |
@@ -923,22 +920,19 @@ discard block |
||
| 923 | 920 | drupal_set_message(t('Host @id has been removed from your account.', |
| 924 | 921 | array('@id' => $host_id))); |
| 925 | 922 | drupal_goto('account/computers'); |
| 926 | - } |
|
| 927 | - else { |
|
| 923 | + } else { |
|
| 928 | 924 | drupal_set_message(t('Host @id could not be deleted. Not sure why...', |
| 929 | 925 | array('@id' => $host_id)), 'error' |
| 930 | 926 | ); |
| 931 | 927 | } |
| 932 | - } |
|
| 933 | - else { |
|
| 928 | + } else { |
|
| 934 | 929 | drupal_set_message(t('Host @id cannot be deleted because it still has |
| 935 | 930 | tasks associated with it. These tasks should be processed within the |
| 936 | 931 | next few days, after which the host can be deleted.', |
| 937 | 932 | array('@id' => $host_id)), 'warning' |
| 938 | 933 | ); |
| 939 | 934 | } |
| 940 | - } |
|
| 941 | - else { |
|
| 935 | + } else { |
|
| 942 | 936 | drupal_set_message(t('You are not the owner of host @id, so you cannot |
| 943 | 937 | delete it.', |
| 944 | 938 | array('@id' => $host_id)), 'error' |
@@ -986,15 +980,13 @@ discard block |
||
| 986 | 980 | bts('The location for this host has been updated.', array(), NULL, 'boinc:account-host-details') |
| 987 | 981 | . bts('This will take effect next time the host contacts the project.', array(), NULL, 'boinc:account-host-details') |
| 988 | 982 | ); |
| 989 | - } |
|
| 990 | - else { |
|
| 983 | + } else { |
|
| 991 | 984 | drupal_set_message( |
| 992 | 985 | bts('Unable to save changes to this host for some reason!', array(), NULL, 'boinc:account-host-details'), |
| 993 | 986 | 'error' |
| 994 | 987 | ); |
| 995 | 988 | } |
| 996 | - } |
|
| 997 | - else { |
|
| 989 | + } else { |
|
| 998 | 990 | drupal_set_message( |
| 999 | 991 | bts('You are not allowed to make changes to this host.', array(), NULL, 'boinc:account-host-details'), |
| 1000 | 992 | 'warning' |
@@ -1129,8 +1121,7 @@ discard block |
||
| 1129 | 1121 | $venue = $active_venue; |
| 1130 | 1122 | //unset($_SESSION['prefs venue']); |
| 1131 | 1123 | } |
| 1132 | - } |
|
| 1133 | - else { |
|
| 1124 | + } else { |
|
| 1134 | 1125 | // Set the active venue to keep it selected between computing and project |
| 1135 | 1126 | // preference pages |
| 1136 | 1127 | $_SESSION['prefs venue'] = $venue; |
@@ -220,8 +220,7 @@ discard block |
||
| 220 | 220 | if (!$values['boinc_translate_transifex_pass']) { |
| 221 | 221 | if (!variable_get('boinc_translate_transifex_pass', '')) { |
| 222 | 222 | form_set_error('boinc_translate_transifex_pass', t('Password is required.')); |
| 223 | - } |
|
| 224 | - else { |
|
| 223 | + } else { |
|
| 225 | 224 | unset($form_state['values']['boinc_translate_transifex_pass']); |
| 226 | 225 | } |
| 227 | 226 | } |
@@ -260,8 +259,7 @@ discard block |
||
| 260 | 259 | 'boinc_translate_transifex_pass', |
| 261 | 260 | t('Transifex authentication failed.') |
| 262 | 261 | ); |
| 263 | - } |
|
| 264 | - else { |
|
| 262 | + } else { |
|
| 265 | 263 | $authenticated = TRUE; |
| 266 | 264 | } |
| 267 | 265 | } |
@@ -278,14 +276,12 @@ discard block |
||
| 278 | 276 | ); |
| 279 | 277 | if ($project_name AND $project_resources) { |
| 280 | 278 | $transifex_resources[$project_name] = $project_resources; |
| 281 | - } |
|
| 282 | - elseif ($project_name AND !$project_resources) { |
|
| 279 | + } elseif ($project_name AND !$project_resources) { |
|
| 283 | 280 | drupal_set_message( |
| 284 | 281 | t('No project-specific resources were provided'), |
| 285 | 282 | 'warning' |
| 286 | 283 | ); |
| 287 | - } |
|
| 288 | - elseif ($project_resources AND !$project_name) { |
|
| 284 | + } elseif ($project_resources AND !$project_name) { |
|
| 289 | 285 | drupal_set_message( |
| 290 | 286 | t('No project-specific Transifex project name was provided'), |
| 291 | 287 | 'warning' |
@@ -157,13 +157,11 @@ discard block |
||
| 157 | 157 | if (!$values['boinc_root_dir']) { |
| 158 | 158 | form_set_error('boinc_root_dir', t('BOINC project root directory must be |
| 159 | 159 | defined!')); |
| 160 | - } |
|
| 161 | - elseif (!is_dir($values['boinc_root_dir'])) { |
|
| 160 | + } elseif (!is_dir($values['boinc_root_dir'])) { |
|
| 162 | 161 | form_set_error('boinc_root_dir', t('BOINC project root not found at %directory', |
| 163 | 162 | array('%directory' => $values['boinc_root_dir']) |
| 164 | 163 | )); |
| 165 | - } |
|
| 166 | - else { |
|
| 164 | + } else { |
|
| 167 | 165 | // By default, try to automatically set specific directories from the root |
| 168 | 166 | if (!$values['boinc_config_xml_dir']) { |
| 169 | 167 | $values['boinc_config_xml_dir'] = $values['boinc_root_dir']; |
@@ -285,8 +283,7 @@ discard block |
||
| 285 | 283 | if (!$values['boinc_scheduler_urls']) { |
| 286 | 284 | form_set_error('boinc_scheduler_urls', t('At least one scheduling server |
| 287 | 285 | URL must be specified.')); |
| 288 | - } |
|
| 289 | - else { |
|
| 286 | + } else { |
|
| 290 | 287 | $urls = explode("\r\n", $values['boinc_scheduler_urls']); |
| 291 | 288 | foreach ($urls as $key => $url) { |
| 292 | 289 | if (!$url) { |
@@ -7,11 +7,9 @@ |
||
| 7 | 7 | list($module, $api) = func_get_args(); |
| 8 | 8 | if ($module == "apachesolr" && $api == "apachesolr_environments") { |
| 9 | 9 | return array("version" => 1); |
| 10 | - } |
|
| 11 | - elseif ($module == "apachesolr_search" && $api == "apachesolr_search_defaults") { |
|
| 10 | + } elseif ($module == "apachesolr_search" && $api == "apachesolr_search_defaults") { |
|
| 12 | 11 | return array("version" => 3); |
| 13 | - } |
|
| 14 | - elseif ($module == "facetapi" && $api == "facetapi_defaults") { |
|
| 12 | + } elseif ($module == "facetapi" && $api == "facetapi_defaults") { |
|
| 15 | 13 | return array("version" => 1); |
| 16 | 14 | } |
| 17 | 15 | } |
@@ -7,17 +7,13 @@ |
||
| 7 | 7 | list($module, $api) = func_get_args(); |
| 8 | 8 | if ($module == "input_formats" && $api == "input_formats") { |
| 9 | 9 | return array("version" => 1); |
| 10 | - } |
|
| 11 | - elseif ($module == "page_manager" && $api == "pages_default") { |
|
| 10 | + } elseif ($module == "page_manager" && $api == "pages_default") { |
|
| 12 | 11 | return array("version" => 1); |
| 13 | - } |
|
| 14 | - elseif ($module == "panels_mini" && $api == "panels_default") { |
|
| 12 | + } elseif ($module == "panels_mini" && $api == "panels_default") { |
|
| 15 | 13 | return array("version" => 1); |
| 16 | - } |
|
| 17 | - elseif ($module == "strongarm" && $api == "strongarm") { |
|
| 14 | + } elseif ($module == "strongarm" && $api == "strongarm") { |
|
| 18 | 15 | return array("version" => 1); |
| 19 | - } |
|
| 20 | - elseif ($module == "wysiwyg" && $api == "wysiwyg") { |
|
| 16 | + } elseif ($module == "wysiwyg" && $api == "wysiwyg") { |
|
| 21 | 17 | return array("version" => 2); |
| 22 | 18 | } |
| 23 | 19 | } |
@@ -7,8 +7,7 @@ |
||
| 7 | 7 | list($module, $api) = func_get_args(); |
| 8 | 8 | if ($module == "context" && $api == "context") { |
| 9 | 9 | return array("version" => 3); |
| 10 | - } |
|
| 11 | - elseif ($module == "strongarm" && $api == "strongarm") { |
|
| 10 | + } elseif ($module == "strongarm" && $api == "strongarm") { |
|
| 12 | 11 | return array("version" => 1); |
| 13 | 12 | } |
| 14 | 13 | } |