@@ -378,8 +378,7 @@ discard block |
||
378 | 378 | $user_info .= ' <div class="picture">'; |
379 | 379 | if (is_array($user_image) AND $user_image['image']['filepath']) { |
380 | 380 | $user_info .= theme('imagefield_image', $user_image['image'], $user_image['alt'], $user_image['alt'], array(), false); |
381 | - } |
|
382 | - elseif (is_string($user_image)) { |
|
381 | + } elseif (is_string($user_image)) { |
|
383 | 382 | $user_info .= '<img src="' . $user_image . '"/>'; |
384 | 383 | } |
385 | 384 | $user_info .= ' </div>'; |
@@ -421,8 +420,7 @@ discard block |
||
421 | 420 | // If a specific comment is being referenced, go back to it on cancel |
422 | 421 | if ($comment_ref = $form['pid']['#value']) { |
423 | 422 | $cancel_url = "goto/comment/{$comment_ref}"; |
424 | - } |
|
425 | - else { |
|
423 | + } else { |
|
426 | 424 | $cancel_url = "node/{$form['nid']['#value']}"; |
427 | 425 | } |
428 | 426 | |
@@ -525,8 +523,7 @@ discard block |
||
525 | 523 | 'title' => bts('Reply to this topic with a quote') |
526 | 524 | ); |
527 | 525 | } |
528 | - } |
|
529 | - else { |
|
526 | + } else { |
|
530 | 527 | // Standard EDIT, DELETE, and REPLY links are created by Drupal, but we want to alter them |
531 | 528 | if (isset($links['comment_delete'])) { |
532 | 529 | $links['comment_delete']['attributes'] = array( |
@@ -580,8 +577,7 @@ discard block |
||
580 | 577 | 'title' => bts('Remove sticky status from this topic') |
581 | 578 | ) |
582 | 579 | ); |
583 | - } |
|
584 | - else { |
|
580 | + } else { |
|
585 | 581 | $links['make_sticky'] = array( |
586 | 582 | 'title' => bts('Make sticky'), |
587 | 583 | 'href' => "{$node_control}/sticky", |
@@ -598,8 +594,7 @@ discard block |
||
598 | 594 | 'title' => bts('Lock this thread for comments') |
599 | 595 | ) |
600 | 596 | ); |
601 | - } |
|
602 | - else { |
|
597 | + } else { |
|
603 | 598 | $links['unlock'] = array( |
604 | 599 | 'title' => bts('Unlock'), |
605 | 600 | 'href' => "{$node_control}/unlock", |
@@ -616,8 +611,7 @@ discard block |
||
616 | 611 | 'title' => bts('Hide this topic') |
617 | 612 | ) |
618 | 613 | ); |
619 | - } |
|
620 | - else { |
|
614 | + } else { |
|
621 | 615 | $links['unhide'] = array( |
622 | 616 | 'title' => bts('Unhide'), |
623 | 617 | 'href' => "{$node_control}/unhide", |
@@ -628,8 +622,7 @@ discard block |
||
628 | 622 | } |
629 | 623 | }// if user_access('edit any forum topic') |
630 | 624 | } |
631 | - } |
|
632 | - else if ($type=='comment') { |
|
625 | + } else if ($type=='comment') { |
|
633 | 626 | $node = node_load($object->nid); |
634 | 627 | $nid = $object->nid; |
635 | 628 | $cid = $object->cid; |
@@ -670,8 +663,7 @@ discard block |
||
670 | 663 | 'title' => bts('Hide this comment') |
671 | 664 | ) |
672 | 665 | ); |
673 | - } |
|
674 | - else { |
|
666 | + } else { |
|
675 | 667 | $links['unhide'] = array( |
676 | 668 | 'title' => bts('Unhide'), |
677 | 669 | 'href' => "{$comment_control}/unhide", |
@@ -853,8 +845,7 @@ discard block |
||
853 | 845 | watchdog('am_set_info', "XML validation error in global_prefs: {$errors[0]->message} at line {$errors[0]->line}" . |
854 | 846 | ': <br/>' . htmlentities($lines[$errors[0]->line - 1]), array(), WATCHDOG_ERROR); |
855 | 847 | } |
856 | - } |
|
857 | - elseif ($project_prefs) { |
|
848 | + } elseif ($project_prefs) { |
|
858 | 849 | $xml->loadXML($project_prefs, LIBXML_NOBLANKS); |
859 | 850 | if ($errors = libxml_get_errors($xml)) { |
860 | 851 | $lines = explode("\r", $project_prefs); |
@@ -897,8 +888,7 @@ discard block |
||
897 | 888 | node_save($content_profile); |
898 | 889 | } |
899 | 890 | } |
900 | - } |
|
901 | - else { |
|
891 | + } else { |
|
902 | 892 | $xml = array( |
903 | 893 | 'error' => array( |
904 | 894 | 'error_num' => -112, |
@@ -1033,8 +1023,7 @@ discard block |
||
1033 | 1023 | node_save($node); |
1034 | 1024 | // Save the team IDs to a BOINC <--> Drupal reference table. |
1035 | 1025 | db_query('INSERT INTO {boincteam} (team_id, nid) VALUES (%d, %d)', $boincteam_id, $node->nid); |
1036 | - } |
|
1037 | - else { |
|
1026 | + } else { |
|
1038 | 1027 | $xml['create_team_reply']['warning'] = t( |
1039 | 1028 | 'There was a problem integrating this team into Drupal. Please |
1040 | 1029 | contact @project administrators!', array('@project' => PROJECT) |
@@ -1049,8 +1038,7 @@ discard block |
||
1049 | 1038 | // Delete from the BOINC DB if we can't sync with Drupal |
1050 | 1039 | $boincteam::delete(); |
1051 | 1040 | } |
1052 | - } |
|
1053 | - else { |
|
1041 | + } else { |
|
1054 | 1042 | $xml['create_team_reply']['warning'] = t( |
1055 | 1043 | 'There was a problem integrating this team into Drupal. Please |
1056 | 1044 | contact @project administrators!', array('@project' => PROJECT) |
@@ -1064,8 +1052,7 @@ discard block |
||
1064 | 1052 | ); |
1065 | 1053 | } |
1066 | 1054 | } |
1067 | - } |
|
1068 | - else { |
|
1055 | + } else { |
|
1069 | 1056 | $xml = array( |
1070 | 1057 | 'error' => array( |
1071 | 1058 | 'error_num' => -1, |
@@ -1152,8 +1139,7 @@ discard block |
||
1152 | 1139 | ); |
1153 | 1140 | $xml['users']['user'][] = $team_member; |
1154 | 1141 | } |
1155 | - } |
|
1156 | - else { |
|
1142 | + } else { |
|
1157 | 1143 | $members = array(); |
1158 | 1144 | db_set_active('boinc'); |
1159 | 1145 | $result = db_query(" |
@@ -1191,8 +1177,7 @@ discard block |
||
1191 | 1177 | $xml['users']['user'][] = $team_member; |
1192 | 1178 | } |
1193 | 1179 | } |
1194 | - } |
|
1195 | - else { |
|
1180 | + } else { |
|
1196 | 1181 | $xml = array( |
1197 | 1182 | 'error' => array( |
1198 | 1183 | 'error_num' => -136, |
@@ -1241,24 +1226,19 @@ discard block |
||
1241 | 1226 | if ($avatar_image) { |
1242 | 1227 | $profile_node->field_image[0] = $avatar_image; |
1243 | 1228 | node_save($profile_node); |
1244 | - } |
|
1245 | - else { |
|
1229 | + } else { |
|
1246 | 1230 | $error = 'Error saving avatar to profile'; |
1247 | 1231 | } |
1248 | - } |
|
1249 | - else { |
|
1232 | + } else { |
|
1250 | 1233 | $error = 'Unable to load user profile'; |
1251 | 1234 | } |
1252 | - } |
|
1253 | - else { |
|
1235 | + } else { |
|
1254 | 1236 | $error = 'User has no profile, so avatar could not be added'; |
1255 | 1237 | } |
1256 | - } |
|
1257 | - else { |
|
1238 | + } else { |
|
1258 | 1239 | $error = 'Unable to save remote image'; |
1259 | 1240 | } |
1260 | - } |
|
1261 | - else { |
|
1241 | + } else { |
|
1262 | 1242 | $error = 'Could not find avatar image at URL'; |
1263 | 1243 | } |
1264 | 1244 | } |
@@ -1285,8 +1265,7 @@ discard block |
||
1285 | 1265 | 'success' => NULL, |
1286 | 1266 | ), |
1287 | 1267 | ); |
1288 | - } |
|
1289 | - else { |
|
1268 | + } else { |
|
1290 | 1269 | // Failure |
1291 | 1270 | $xml = array( |
1292 | 1271 | 'error' => array( |
@@ -1295,8 +1274,7 @@ discard block |
||
1295 | 1274 | ), |
1296 | 1275 | ); |
1297 | 1276 | } |
1298 | - } |
|
1299 | - else { |
|
1277 | + } else { |
|
1300 | 1278 | // Drupal user not found |
1301 | 1279 | $xml = array( |
1302 | 1280 | 'error' => array( |
@@ -1305,8 +1283,7 @@ discard block |
||
1305 | 1283 | ), |
1306 | 1284 | ); |
1307 | 1285 | } |
1308 | - } |
|
1309 | - else { |
|
1286 | + } else { |
|
1310 | 1287 | // BOINC user not found |
1311 | 1288 | $xml = array( |
1312 | 1289 | 'error' => array( |
@@ -1424,8 +1401,7 @@ discard block |
||
1424 | 1401 | ), |
1425 | 1402 | ); |
1426 | 1403 | } |
1427 | - } |
|
1428 | - else { |
|
1404 | + } else { |
|
1429 | 1405 | $xml = array( |
1430 | 1406 | 'error' => array( |
1431 | 1407 | 'error_num' => -136, |
@@ -1549,8 +1525,7 @@ discard block |
||
1549 | 1525 | // Get the number of comments per page |
1550 | 1526 | if ($user->comments_per_page) { |
1551 | 1527 | $comments_per_page = $user->comments_per_page; |
1552 | - } |
|
1553 | - else { |
|
1528 | + } else { |
|
1554 | 1529 | $node = node_load($object->nid); |
1555 | 1530 | $comments_per_page = variable_get( |
1556 | 1531 | "comment_default_per_page_{$node->type}", 50 |
@@ -1571,8 +1546,7 @@ discard block |
||
1571 | 1546 | // Check for a login, then redirect to the user's friend requests page |
1572 | 1547 | if ($user->uid) { |
1573 | 1548 | drupal_goto("account/{$user->uid}/friends/pending"); |
1574 | - } |
|
1575 | - else { |
|
1549 | + } else { |
|
1576 | 1550 | drupal_goto('user/login', array( |
1577 | 1551 | 'destination' => 'goto/friend-requests' |
1578 | 1552 | )); |
@@ -1848,8 +1822,7 @@ discard block |
||
1848 | 1822 | if ($moderator_rid !== FALSE) { |
1849 | 1823 | $settings['recipients'] = array($moderator_rid); |
1850 | 1824 | rules_action_mail_to_users_of_role($settings); |
1851 | - } |
|
1852 | - else { |
|
1825 | + } else { |
|
1853 | 1826 | watchdog( |
1854 | 1827 | 'boinccore', |
1855 | 1828 | 'Unable to identify members of the moderator role to send moderator notifications!', |
@@ -1880,8 +1853,7 @@ discard block |
||
1880 | 1853 | } |
1881 | 1854 | if (empty($args)) { |
1882 | 1855 | return $string; |
1883 | - } |
|
1884 | - else { |
|
1856 | + } else { |
|
1885 | 1857 | // Transform arguments before inserting them. |
1886 | 1858 | foreach ($args as $key => $value) { |
1887 | 1859 | switch ($key [0]) { |