@@ -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 |
@@ -280,8 +280,7 @@ discard block |
||
280 | 280 | 'href' => 'account/prefs/privacy/ignore_user/remove/'. $author->uid, |
281 | 281 | 'query' => 'destination=messages/view/' . $thread_id, |
282 | 282 | ); |
283 | - } |
|
284 | - else { |
|
283 | + } else { |
|
285 | 284 | $vars['message_actions']['ignore_user'] = array( |
286 | 285 | 'title' => bts('Ignore User', array(), NULL, 'boinc:ignore-user-add'), |
287 | 286 | 'href' => 'account/prefs/privacy/ignore_user/add/'. $author->uid, |
@@ -400,8 +399,7 @@ discard block |
||
400 | 399 | } |
401 | 400 | if (!$special) { |
402 | 401 | $output .= "<td>{$value} {$pref_setting['#field_suffix']}</td>"; |
403 | - } |
|
404 | - else { |
|
402 | + } else { |
|
405 | 403 | // The "very special" case where we merge two prefs |
406 | 404 | $second_pref = $special_map[$name]; |
407 | 405 | $second_pref_setting = $prefs[$pref_set]['prefs']['advanced'][$category][$second_pref]; |
@@ -409,8 +407,7 @@ discard block |
||
409 | 407 | $output .= "<td>{$value} {$pref_setting['#field_suffix']} {$special_delimiter[$name]}" . |
410 | 408 | " {$second_value} {$second_pref_setting['#field_suffix']} </td>"; |
411 | 409 | } |
412 | - } |
|
413 | - else { |
|
410 | + } else { |
|
414 | 411 | $output .= '<td>---</td>'; |
415 | 412 | } |
416 | 413 | } |
@@ -936,22 +933,19 @@ discard block |
||
936 | 933 | drupal_set_message(t('Host @id has been removed from your account.', |
937 | 934 | array('@id' => $host_id))); |
938 | 935 | drupal_goto('account/computers'); |
939 | - } |
|
940 | - else { |
|
936 | + } else { |
|
941 | 937 | drupal_set_message(t('Host @id could not be deleted. Not sure why...', |
942 | 938 | array('@id' => $host_id)), 'error' |
943 | 939 | ); |
944 | 940 | } |
945 | - } |
|
946 | - else { |
|
941 | + } else { |
|
947 | 942 | drupal_set_message(t('Host @id cannot be deleted because it still has |
948 | 943 | tasks associated with it. These tasks should be processed within the |
949 | 944 | next few days, after which the host can be deleted.', |
950 | 945 | array('@id' => $host_id)), 'warning' |
951 | 946 | ); |
952 | 947 | } |
953 | - } |
|
954 | - else { |
|
948 | + } else { |
|
955 | 949 | drupal_set_message(t('You are not the owner of host @id, so you cannot |
956 | 950 | delete it.', |
957 | 951 | array('@id' => $host_id)), 'error' |
@@ -999,15 +993,13 @@ discard block |
||
999 | 993 | bts('The location for this host has been updated.', array(), NULL, 'boinc:account-host-details') |
1000 | 994 | . bts('This will take effect next time the host contacts the project.', array(), NULL, 'boinc:account-host-details') |
1001 | 995 | ); |
1002 | - } |
|
1003 | - else { |
|
996 | + } else { |
|
1004 | 997 | drupal_set_message( |
1005 | 998 | bts('Unable to save changes to this host for some reason!', array(), NULL, 'boinc:account-host-details'), |
1006 | 999 | 'error' |
1007 | 1000 | ); |
1008 | 1001 | } |
1009 | - } |
|
1010 | - else { |
|
1002 | + } else { |
|
1011 | 1003 | drupal_set_message( |
1012 | 1004 | bts('You are not allowed to make changes to this host.', array(), NULL, 'boinc:account-host-details'), |
1013 | 1005 | 'warning' |
@@ -1164,8 +1156,7 @@ discard block |
||
1164 | 1156 | $venue = $active_venue; |
1165 | 1157 | //unset($_SESSION['prefs venue']); |
1166 | 1158 | } |
1167 | - } |
|
1168 | - else { |
|
1159 | + } else { |
|
1169 | 1160 | // Set the active venue to keep it selected between computing and project |
1170 | 1161 | // preference pages |
1171 | 1162 | $_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) { |
@@ -32,42 +32,42 @@ |
||
32 | 32 | * existing BOINC web interface. |
33 | 33 | */ |
34 | 34 | function boincuser_admin_environment(&$form_state) { |
35 | - global $base_url; |
|
36 | - $form = array(); |
|
37 | - $default = array( |
|
38 | - 'boinc_root_dir' => variable_get('boinc_root_dir', ''), |
|
39 | - 'boinc_config_xml_dir' => variable_get('boinc_config_xml_dir', ''), |
|
40 | - 'boinc_html_inc_dir' => variable_get('boinc_html_inc_dir', ''), |
|
41 | - 'boinc_project_config_dir' => variable_get('boinc_project_config_dir', ''), |
|
42 | - 'boinc_user_image_dir' => variable_get('boinc_user_image_dir', ''), |
|
43 | - 'boinc_host_sched_logs_dir' => variable_get('boinc_host_sched_logs_dir', ''), |
|
44 | - 'boinc_server_status_url' => variable_get('boinc_server_status_url', ''), |
|
45 | - 'boinc_app_list_url' => variable_get('boinc_app_list_url', ''), |
|
46 | - 'boinc_admin_mailing_list' => variable_get('boinc_admin_mailing_list', ''), |
|
47 | - 'boinc_admin_mailing_list_subject_tag' => variable_get('boinc_admin_mailing_list_subject_tag', ''), |
|
48 | - 'boinc_debug_mode' => variable_get('boinc_debug_mode', 0), |
|
49 | - 'boinc_project_config_keywords' => variable_get('boinc_project_config_keywords', ''), |
|
50 | - ); |
|
51 | - //drupal_set_message(print_r($default, true)); |
|
52 | - //drupal_set_message(print_r($form_state, true)); |
|
53 | - // Show overrides if the root dir is set and others have not been detected |
|
54 | - $show_overrides = FALSE; |
|
55 | - if ($default['boinc_root_dir']) { |
|
56 | - foreach ($default as $key => $dir) { |
|
57 | - switch ($key) { |
|
58 | - case 'boinc_config_xml_dir': |
|
59 | - case 'boinc_html_inc_dir': |
|
60 | - case 'boinc_project_config_dir': |
|
61 | - case 'boinc_user_image_dir': |
|
62 | - // If any of these values are not set, show the overrides section |
|
63 | - if (!$dir) { |
|
64 | - $default[$key] = $form_state['values'][$key]; |
|
65 | - $show_overrides = TRUE; |
|
66 | - break; |
|
67 | - } |
|
68 | - break; |
|
69 | - default: |
|
70 | - } |
|
35 | +global $base_url; |
|
36 | +$form = array(); |
|
37 | +$default = array( |
|
38 | +'boinc_root_dir' => variable_get('boinc_root_dir', ''), |
|
39 | +'boinc_config_xml_dir' => variable_get('boinc_config_xml_dir', ''), |
|
40 | +'boinc_html_inc_dir' => variable_get('boinc_html_inc_dir', ''), |
|
41 | +'boinc_project_config_dir' => variable_get('boinc_project_config_dir', ''), |
|
42 | +'boinc_user_image_dir' => variable_get('boinc_user_image_dir', ''), |
|
43 | +'boinc_host_sched_logs_dir' => variable_get('boinc_host_sched_logs_dir', ''), |
|
44 | +'boinc_server_status_url' => variable_get('boinc_server_status_url', ''), |
|
45 | +'boinc_app_list_url' => variable_get('boinc_app_list_url', ''), |
|
46 | +'boinc_admin_mailing_list' => variable_get('boinc_admin_mailing_list', ''), |
|
47 | +'boinc_admin_mailing_list_subject_tag' => variable_get('boinc_admin_mailing_list_subject_tag', ''), |
|
48 | +'boinc_debug_mode' => variable_get('boinc_debug_mode', 0), |
|
49 | +'boinc_project_config_keywords' => variable_get('boinc_project_config_keywords', ''), |
|
50 | +); |
|
51 | +//drupal_set_message(print_r($default, true)); |
|
52 | +//drupal_set_message(print_r($form_state, true)); |
|
53 | +// Show overrides if the root dir is set and others have not been detected |
|
54 | +$show_overrides = FALSE; |
|
55 | +if ($default['boinc_root_dir']) { |
|
56 | +foreach ($default as $key => $dir) { |
|
57 | + switch ($key) { |
|
58 | + case 'boinc_config_xml_dir': |
|
59 | + case 'boinc_html_inc_dir': |
|
60 | + case 'boinc_project_config_dir': |
|
61 | + case 'boinc_user_image_dir': |
|
62 | + // If any of these values are not set, show the overrides section |
|
63 | + if (!$dir) { |
|
64 | + $default[$key] = $form_state['values'][$key]; |
|
65 | + $show_overrides = TRUE; |
|
66 | + break; |
|
67 | + } |
|
68 | + break; |
|
69 | + default: |
|
70 | + } |
|
71 | 71 | if ($show_overrides) { |
72 | 72 | break; |
73 | 73 | } |
@@ -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,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 | } |
@@ -26,8 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | if (isset($roles[$rid]) AND $roles[$rid] == $better_name) { |
28 | 28 | // Life is good |
29 | - } |
|
30 | - else { |
|
29 | + } else { |
|
31 | 30 | $better_rid = array_search($better_name, $roles); |
32 | 31 | $old_rid = array_search('Forum Moderator', $roles); |
33 | 32 | if (!$better_rid) { |
@@ -36,8 +35,7 @@ discard block |
||
36 | 35 | $better_name, $old_rid); |
37 | 36 | $better_rid = $old_rid; |
38 | 37 | $old_rid = NULL; |
39 | - } |
|
40 | - else { |
|
38 | + } else { |
|
41 | 39 | drupal_set_message(t('The Forum Access module is not set up right. Try disabling the Discussion Forums feature and then manually uninstall the Forum Access module before enabling Discussion Forums again.', 'error')); |
42 | 40 | } |
43 | 41 | } |