@@ -551,12 +551,12 @@ discard block |
||
| 551 | 551 | */ |
| 552 | 552 | function boinccore_locale($op = 'groups', $group = NULL) { |
| 553 | 553 | switch ($op) { |
| 554 | - case 'groups': |
|
| 555 | - return array('boinc' => 'BOINC'); |
|
| 556 | - case 'info': |
|
| 557 | - //$info['boinc']['refresh callback'] = 'boinccore_locale_refresh'; |
|
| 558 | - $info['boinc']['format'] = FALSE; |
|
| 559 | - return $info; |
|
| 554 | + case 'groups': |
|
| 555 | + return array('boinc' => 'BOINC'); |
|
| 556 | + case 'info': |
|
| 557 | + //$info['boinc']['refresh callback'] = 'boinccore_locale_refresh'; |
|
| 558 | + $info['boinc']['format'] = FALSE; |
|
| 559 | + return $info; |
|
| 560 | 560 | } |
| 561 | 561 | } |
| 562 | 562 | |
@@ -1885,19 +1885,19 @@ discard block |
||
| 1885 | 1885 | // Transform arguments before inserting them. |
| 1886 | 1886 | foreach ($args as $key => $value) { |
| 1887 | 1887 | switch ($key [0]) { |
| 1888 | - case '@': |
|
| 1889 | - // Escaped only. |
|
| 1890 | - $args [$key] = check_plain($value); |
|
| 1891 | - break; |
|
| 1892 | - |
|
| 1893 | - case '%': |
|
| 1894 | - default: |
|
| 1895 | - // Escaped and placeholder. |
|
| 1896 | - $args [$key] = theme('placeholder', $value); |
|
| 1897 | - break; |
|
| 1898 | - |
|
| 1899 | - case '!': |
|
| 1900 | - // Pass-through. |
|
| 1888 | + case '@': |
|
| 1889 | + // Escaped only. |
|
| 1890 | + $args [$key] = check_plain($value); |
|
| 1891 | + break; |
|
| 1892 | + |
|
| 1893 | + case '%': |
|
| 1894 | + default: |
|
| 1895 | + // Escaped and placeholder. |
|
| 1896 | + $args [$key] = theme('placeholder', $value); |
|
| 1897 | + break; |
|
| 1898 | + |
|
| 1899 | + case '!': |
|
| 1900 | + // Pass-through. |
|
| 1901 | 1901 | } |
| 1902 | 1902 | } |
| 1903 | 1903 | return strtr($string, $args); |
@@ -430,8 +430,7 @@ discard block |
||
| 430 | 430 | $user_info .= ' <div class="picture">'; |
| 431 | 431 | if (is_array($user_image) AND $user_image['image']['filepath']) { |
| 432 | 432 | $user_info .= theme('imagefield_image', $user_image['image'], $user_image['alt'], $user_image['alt'], array(), false); |
| 433 | - } |
|
| 434 | - elseif (is_string($user_image)) { |
|
| 433 | + } elseif (is_string($user_image)) { |
|
| 435 | 434 | $user_info .= '<img src="' . $user_image . '"/>'; |
| 436 | 435 | } |
| 437 | 436 | $user_info .= ' </div>'; |
@@ -473,8 +472,7 @@ discard block |
||
| 473 | 472 | // If a specific comment is being referenced, go back to it on cancel |
| 474 | 473 | if ($comment_ref = $form['pid']['#value']) { |
| 475 | 474 | $cancel_url = "goto/comment/{$comment_ref}"; |
| 476 | - } |
|
| 477 | - else { |
|
| 475 | + } else { |
|
| 478 | 476 | $cancel_url = "node/{$form['nid']['#value']}"; |
| 479 | 477 | } |
| 480 | 478 | |
@@ -528,8 +526,7 @@ discard block |
||
| 528 | 526 | '#weight' => 1000, |
| 529 | 527 | ); |
| 530 | 528 | } |
| 531 | - } |
|
| 532 | - else { |
|
| 529 | + } else { |
|
| 533 | 530 | $form = NULL; |
| 534 | 531 | $form['from'] = array( |
| 535 | 532 | '#type' => 'item', |
@@ -626,8 +623,7 @@ discard block |
||
| 626 | 623 | 'title' => bts('Reply to this topic with a quote', array(), NULL, 'boinc:forum-reply-to-comment') |
| 627 | 624 | ); |
| 628 | 625 | } |
| 629 | - } |
|
| 630 | - else { |
|
| 626 | + } else { |
|
| 631 | 627 | // Standard EDIT, DELETE, and REPLY links are created by Drupal, but we want to alter them |
| 632 | 628 | if (isset($links['comment_delete'])) { |
| 633 | 629 | $links['comment_delete']['attributes'] = array( |
@@ -681,8 +677,7 @@ discard block |
||
| 681 | 677 | 'title' => bts('Remove sticky status from this topic', array(), NULL, 'boinc:forum-unsticky-comment') |
| 682 | 678 | ) |
| 683 | 679 | ); |
| 684 | - } |
|
| 685 | - else { |
|
| 680 | + } else { |
|
| 686 | 681 | $links['make_sticky'] = array( |
| 687 | 682 | 'title' => bts('Make sticky', array(), NULL, 'boinc:forum-sticky-comment'), |
| 688 | 683 | 'href' => "{$node_control}/sticky", |
@@ -699,8 +694,7 @@ discard block |
||
| 699 | 694 | 'title' => bts('Lock this thread for comments', array(), NULL, 'boinc:forum-lock-comment') |
| 700 | 695 | ) |
| 701 | 696 | ); |
| 702 | - } |
|
| 703 | - else { |
|
| 697 | + } else { |
|
| 704 | 698 | $links['unlock'] = array( |
| 705 | 699 | 'title' => bts('Unlock', array(), NULL, 'boinc:forum-unlock-comment'), |
| 706 | 700 | 'href' => "{$node_control}/unlock", |
@@ -717,8 +711,7 @@ discard block |
||
| 717 | 711 | 'title' => bts('Hide this topic', array(), NULL, 'boinc:forum-hide-comment') |
| 718 | 712 | ) |
| 719 | 713 | ); |
| 720 | - } |
|
| 721 | - else { |
|
| 714 | + } else { |
|
| 722 | 715 | $links['unhide'] = array( |
| 723 | 716 | 'title' => bts('Unhide', array(), NULL, 'boinc:forum-unhide-comment'), |
| 724 | 717 | 'href' => "{$node_control}/unhide", |
@@ -729,8 +722,7 @@ discard block |
||
| 729 | 722 | } |
| 730 | 723 | }// if user_access('edit any forum topic') |
| 731 | 724 | } |
| 732 | - } |
|
| 733 | - else if ($type=='comment') { |
|
| 725 | + } else if ($type=='comment') { |
|
| 734 | 726 | $node = node_load($object->nid); |
| 735 | 727 | $nid = $object->nid; |
| 736 | 728 | $cid = $object->cid; |
@@ -771,8 +763,7 @@ discard block |
||
| 771 | 763 | 'title' => bts('Hide this comment', array(), NULL, 'boinc:forum-hide-comment') |
| 772 | 764 | ) |
| 773 | 765 | ); |
| 774 | - } |
|
| 775 | - else { |
|
| 766 | + } else { |
|
| 776 | 767 | $links['unhide'] = array( |
| 777 | 768 | 'title' => bts('Unhide', array(), NULL, 'boinc:forum-unhide-comment'), |
| 778 | 769 | 'href' => "{$comment_control}/unhide", |
@@ -958,8 +949,7 @@ discard block |
||
| 958 | 949 | watchdog('am_set_info', "XML validation error in global_prefs: {$errors[0]->message} at line {$errors[0]->line}" . |
| 959 | 950 | ': <br/>' . htmlentities($lines[$errors[0]->line - 1]), array(), WATCHDOG_ERROR); |
| 960 | 951 | } |
| 961 | - } |
|
| 962 | - elseif ($project_prefs) { |
|
| 952 | + } elseif ($project_prefs) { |
|
| 963 | 953 | $xml->loadXML($project_prefs, LIBXML_NOBLANKS); |
| 964 | 954 | if ($errors = libxml_get_errors($xml)) { |
| 965 | 955 | $lines = explode("\r", $project_prefs); |
@@ -1002,8 +992,7 @@ discard block |
||
| 1002 | 992 | node_save($content_profile); |
| 1003 | 993 | } |
| 1004 | 994 | } |
| 1005 | - } |
|
| 1006 | - else { |
|
| 995 | + } else { |
|
| 1007 | 996 | $xml = array( |
| 1008 | 997 | 'error' => array( |
| 1009 | 998 | 'error_num' => -112, |
@@ -1138,8 +1127,7 @@ discard block |
||
| 1138 | 1127 | node_save($node); |
| 1139 | 1128 | // Save the team IDs to a BOINC <--> Drupal reference table. |
| 1140 | 1129 | db_query('INSERT INTO {boincteam} (team_id, nid) VALUES (%d, %d)', $boincteam_id, $node->nid); |
| 1141 | - } |
|
| 1142 | - else { |
|
| 1130 | + } else { |
|
| 1143 | 1131 | $xml['create_team_reply']['warning'] = t( |
| 1144 | 1132 | 'There was a problem integrating this team into Drupal. Please |
| 1145 | 1133 | contact @project administrators!', array('@project' => PROJECT) |
@@ -1154,8 +1142,7 @@ discard block |
||
| 1154 | 1142 | // Delete from the BOINC DB if we can't sync with Drupal |
| 1155 | 1143 | $boincteam::delete(); |
| 1156 | 1144 | } |
| 1157 | - } |
|
| 1158 | - else { |
|
| 1145 | + } else { |
|
| 1159 | 1146 | $xml['create_team_reply']['warning'] = t( |
| 1160 | 1147 | 'There was a problem integrating this team into Drupal. Please |
| 1161 | 1148 | contact @project administrators!', array('@project' => PROJECT) |
@@ -1169,8 +1156,7 @@ discard block |
||
| 1169 | 1156 | ); |
| 1170 | 1157 | } |
| 1171 | 1158 | } |
| 1172 | - } |
|
| 1173 | - else { |
|
| 1159 | + } else { |
|
| 1174 | 1160 | $xml = array( |
| 1175 | 1161 | 'error' => array( |
| 1176 | 1162 | 'error_num' => -1, |
@@ -1239,8 +1225,7 @@ discard block |
||
| 1239 | 1225 | ); |
| 1240 | 1226 | $xml['users']['user'][] = $team_member; |
| 1241 | 1227 | } |
| 1242 | - } |
|
| 1243 | - else { |
|
| 1228 | + } else { |
|
| 1244 | 1229 | // Query BOINC database user table |
| 1245 | 1230 | db_set_active('boinc_rw'); |
| 1246 | 1231 | $result = db_query(" |
@@ -1293,8 +1278,7 @@ discard block |
||
| 1293 | 1278 | $xml['users']['user'][] = $team_members[$member->boinc_id]; |
| 1294 | 1279 | } |
| 1295 | 1280 | } // end if credit_only |
| 1296 | - } |
|
| 1297 | - else { |
|
| 1281 | + } else { |
|
| 1298 | 1282 | $xml = array( |
| 1299 | 1283 | 'error' => array( |
| 1300 | 1284 | 'error_num' => -136, |
@@ -1343,24 +1327,19 @@ discard block |
||
| 1343 | 1327 | if ($avatar_image) { |
| 1344 | 1328 | $profile_node->field_image[0] = $avatar_image; |
| 1345 | 1329 | node_save($profile_node); |
| 1346 | - } |
|
| 1347 | - else { |
|
| 1330 | + } else { |
|
| 1348 | 1331 | $error = 'Error saving avatar to profile'; |
| 1349 | 1332 | } |
| 1350 | - } |
|
| 1351 | - else { |
|
| 1333 | + } else { |
|
| 1352 | 1334 | $error = 'Unable to load user profile'; |
| 1353 | 1335 | } |
| 1354 | - } |
|
| 1355 | - else { |
|
| 1336 | + } else { |
|
| 1356 | 1337 | $error = 'User has no profile, so avatar could not be added'; |
| 1357 | 1338 | } |
| 1358 | - } |
|
| 1359 | - else { |
|
| 1339 | + } else { |
|
| 1360 | 1340 | $error = 'Unable to save remote image'; |
| 1361 | 1341 | } |
| 1362 | - } |
|
| 1363 | - else { |
|
| 1342 | + } else { |
|
| 1364 | 1343 | $error = 'Could not find avatar image at URL'; |
| 1365 | 1344 | } |
| 1366 | 1345 | } |
@@ -1387,8 +1366,7 @@ discard block |
||
| 1387 | 1366 | 'success' => NULL, |
| 1388 | 1367 | ), |
| 1389 | 1368 | ); |
| 1390 | - } |
|
| 1391 | - else { |
|
| 1369 | + } else { |
|
| 1392 | 1370 | // Failure |
| 1393 | 1371 | $xml = array( |
| 1394 | 1372 | 'error' => array( |
@@ -1397,8 +1375,7 @@ discard block |
||
| 1397 | 1375 | ), |
| 1398 | 1376 | ); |
| 1399 | 1377 | } |
| 1400 | - } |
|
| 1401 | - else { |
|
| 1378 | + } else { |
|
| 1402 | 1379 | // Drupal user not found |
| 1403 | 1380 | $xml = array( |
| 1404 | 1381 | 'error' => array( |
@@ -1407,8 +1384,7 @@ discard block |
||
| 1407 | 1384 | ), |
| 1408 | 1385 | ); |
| 1409 | 1386 | } |
| 1410 | - } |
|
| 1411 | - else { |
|
| 1387 | + } else { |
|
| 1412 | 1388 | // BOINC user not found |
| 1413 | 1389 | $xml = array( |
| 1414 | 1390 | 'error' => array( |
@@ -1526,8 +1502,7 @@ discard block |
||
| 1526 | 1502 | ), |
| 1527 | 1503 | ); |
| 1528 | 1504 | } |
| 1529 | - } |
|
| 1530 | - else { |
|
| 1505 | + } else { |
|
| 1531 | 1506 | $xml = array( |
| 1532 | 1507 | 'error' => array( |
| 1533 | 1508 | 'error_num' => -136, |
@@ -1651,8 +1626,7 @@ discard block |
||
| 1651 | 1626 | // Get the number of comments per page |
| 1652 | 1627 | if ($user->comments_per_page) { |
| 1653 | 1628 | $comments_per_page = $user->comments_per_page; |
| 1654 | - } |
|
| 1655 | - else { |
|
| 1629 | + } else { |
|
| 1656 | 1630 | $node = node_load($object->nid); |
| 1657 | 1631 | $comments_per_page = variable_get( |
| 1658 | 1632 | "comment_default_per_page_{$node->type}", 50 |
@@ -1673,8 +1647,7 @@ discard block |
||
| 1673 | 1647 | // Check for a login, then redirect to the user's friend requests page |
| 1674 | 1648 | if ($user->uid) { |
| 1675 | 1649 | drupal_goto("account/{$user->uid}/friends/pending"); |
| 1676 | - } |
|
| 1677 | - else { |
|
| 1650 | + } else { |
|
| 1678 | 1651 | drupal_goto('user/login', array( |
| 1679 | 1652 | 'destination' => 'goto/friend-requests' |
| 1680 | 1653 | )); |
@@ -1950,8 +1923,7 @@ discard block |
||
| 1950 | 1923 | if ($moderator_rid !== FALSE) { |
| 1951 | 1924 | $settings['recipients'] = array($moderator_rid); |
| 1952 | 1925 | rules_action_mail_to_users_of_role($settings); |
| 1953 | - } |
|
| 1954 | - else { |
|
| 1926 | + } else { |
|
| 1955 | 1927 | watchdog( |
| 1956 | 1928 | 'boinccore', |
| 1957 | 1929 | 'Unable to identify members of the moderator role to send moderator notifications!', |
@@ -1982,8 +1954,7 @@ discard block |
||
| 1982 | 1954 | } |
| 1983 | 1955 | if (empty($args)) { |
| 1984 | 1956 | return $string; |
| 1985 | - } |
|
| 1986 | - else { |
|
| 1957 | + } else { |
|
| 1987 | 1958 | // Transform arguments before inserting them. |
| 1988 | 1959 | foreach ($args as $key => $value) { |
| 1989 | 1960 | switch ($key [0]) { |
@@ -311,8 +311,8 @@ discard block |
||
| 311 | 311 | // RFC2616 mandates that the decimal part is no more than three digits, |
| 312 | 312 | // so we multiply the qvalue by 1000 to avoid floating point comparisons. |
| 313 | 313 | $langcode = strtolower($match[1]); |
| 314 | - $qvalue = isset($match[2]) ? (float) $match[2] : 1; |
|
| 315 | - $browser_langcodes[$langcode] = (int) ($qvalue * 1000); |
|
| 314 | + $qvalue = isset($match[2]) ? (float)$match[2] : 1; |
|
| 315 | + $browser_langcodes[$langcode] = (int)($qvalue*1000); |
|
| 316 | 316 | } |
| 317 | 317 | } |
| 318 | 318 | |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | global $base_url; |
| 378 | 378 | global $base_path; |
| 379 | 379 | $site_name = variable_get('site_name', 'Drupal-BOINC'); |
| 380 | - $site_url = $base_url . $base_path; |
|
| 380 | + $site_url = $base_url.$base_path; |
|
| 381 | 381 | $settings = array( |
| 382 | 382 | 'from' => '', |
| 383 | 383 | 'subject' => "Content at {$site_name} is awaiting moderation", |
@@ -432,11 +432,11 @@ discard block |
||
| 432 | 432 | $user_info .= theme('imagefield_image', $user_image['image'], $user_image['alt'], $user_image['alt'], array(), false); |
| 433 | 433 | } |
| 434 | 434 | elseif (is_string($user_image)) { |
| 435 | - $user_info .= '<img src="' . $user_image . '"/>'; |
|
| 435 | + $user_info .= '<img src="'.$user_image.'"/>'; |
|
| 436 | 436 | } |
| 437 | 437 | $user_info .= ' </div>'; |
| 438 | 438 | } |
| 439 | - $user_info .= ' <div class="name">' . theme('username', $account) . '</div>'; |
|
| 439 | + $user_info .= ' <div class="name">'.theme('username', $account).'</div>'; |
|
| 440 | 440 | if ($account->uid) { |
| 441 | 441 | //$user_info .= ' <div class="join-date">Joined: ' . date('j M y', $account->created) . '</div>'; |
| 442 | 442 | //$user_info .= ' <div class="post-count">Posts: ' . $account->post_count . '</div>'; |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | $form['buttons']['preview']['#suffix'] = '</li>'; |
| 501 | 501 | $form['buttons']['preview']['#weight'] = 1003; |
| 502 | 502 | $form['buttons']['cancel'] = array( |
| 503 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $cancel_url) . '</li>', |
|
| 503 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $cancel_url).'</li>', |
|
| 504 | 504 | '#weight' => 1004, |
| 505 | 505 | ); |
| 506 | 506 | $form['buttons']['form control tabs suffix'] = array( |
@@ -520,7 +520,7 @@ discard block |
||
| 520 | 520 | $node = node_load($form['nid']['#value']); |
| 521 | 521 | $community_role = array_search('community member', user_roles(true)); |
| 522 | 522 | $unrestricted_role = array_search('verified contributor', user_roles(true)); |
| 523 | - if ( (isset($account->roles[$community_role])) and (!isset($account->roles[$unrestricted_role])) ) { |
|
| 523 | + if ((isset($account->roles[$community_role])) and (!isset($account->roles[$unrestricted_role]))) { |
|
| 524 | 524 | if ($node->type == 'forum') { |
| 525 | 525 | if (module_exists('captcha')) { |
| 526 | 526 | $form['comment_captcha'] = array( |
@@ -565,7 +565,7 @@ discard block |
||
| 565 | 565 | $form['buttons']['preview_changes']['#suffix'] = '</li>'; |
| 566 | 566 | $form['buttons']['preview_changes']['#weight'] = 1004; |
| 567 | 567 | $form['buttons']['cancel'] = array( |
| 568 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "community/forum/{$forum_id}") . '</li>', |
|
| 568 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "community/forum/{$forum_id}").'</li>', |
|
| 569 | 569 | '#weight' => 1005, |
| 570 | 570 | ); |
| 571 | 571 | $form['buttons']['form control tabs suffix'] = array( |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | // Add captcha for role='community member' |
| 577 | 577 | $community_role = array_search('community member', user_roles(true)); |
| 578 | 578 | $unrestricted_role = array_search('verified contributor', user_roles(true)); |
| 579 | - if ( (isset($account->roles[$community_role])) and (!isset($account->roles[$unrestricted_role])) ) { |
|
| 579 | + if ((isset($account->roles[$community_role])) and (!isset($account->roles[$unrestricted_role]))) { |
|
| 580 | 580 | if (module_exists('captcha')) { |
| 581 | 581 | $form['comment_captcha'] = array( |
| 582 | 582 | '#type' => 'captcha', |
@@ -668,8 +668,8 @@ discard block |
||
| 668 | 668 | function boinccore_link($type, $object, $teaser = FALSE) { |
| 669 | 669 | // Add custom links with this hook |
| 670 | 670 | |
| 671 | - if ($type=='node') { |
|
| 672 | - if ( ($object->type=='forum') OR ($object->type=='team_forum') ) { |
|
| 671 | + if ($type == 'node') { |
|
| 672 | + if (($object->type == 'forum') OR ($object->type == 'team_forum')) { |
|
| 673 | 673 | // Add topic moderator controls |
| 674 | 674 | if (user_access('edit any forum topic')) { |
| 675 | 675 | $node_control = "node_control/{$object->nid}"; |
@@ -730,7 +730,7 @@ discard block |
||
| 730 | 730 | }// if user_access('edit any forum topic') |
| 731 | 731 | } |
| 732 | 732 | } |
| 733 | - else if ($type=='comment') { |
|
| 733 | + else if ($type == 'comment') { |
|
| 734 | 734 | $node = node_load($object->nid); |
| 735 | 735 | $nid = $object->nid; |
| 736 | 736 | $cid = $object->cid; |
@@ -752,7 +752,7 @@ discard block |
||
| 752 | 752 | if (user_access('administer comments')) { |
| 753 | 753 | $comment_control = "comment_control/{$cid}"; |
| 754 | 754 | // Add link to convert comment into a new topic |
| 755 | - $reply_count = db_result(db_query(' SELECT COUNT(*) FROM comments WHERE pid = %d', $cid )); |
|
| 755 | + $reply_count = db_result(db_query(' SELECT COUNT(*) FROM comments WHERE pid = %d', $cid)); |
|
| 756 | 756 | if ($reply_count == 0) { |
| 757 | 757 | $links['convert'] = array( |
| 758 | 758 | 'title' => bts('Convert', array(), NULL, 'boinc:forum-convert-comment-to-topic'), |
@@ -797,7 +797,7 @@ discard block |
||
| 797 | 797 | */ |
| 798 | 798 | $message['headers']['Content-Transfer-Encoding'] = 'Quoted-Printable'; |
| 799 | 799 | if (is_array($message['body'])) { |
| 800 | - $message['body'] = array_map( "quoted_printable_encode", $message['body'] ); |
|
| 800 | + $message['body'] = array_map("quoted_printable_encode", $message['body']); |
|
| 801 | 801 | } else { |
| 802 | 802 | $message['body'] = quoted_printable_encode($message['body']); |
| 803 | 803 | } |
@@ -848,7 +848,7 @@ discard block |
||
| 848 | 848 | // If hiding a forum topic (node) and not an administrator, go to |
| 849 | 849 | // the forum page. Otherwise the user will reach an access-denied |
| 850 | 850 | // page. |
| 851 | - if (($action=="hide") and (!user_access('administer forums'))) { |
|
| 851 | + if (($action == "hide") and (!user_access('administer forums'))) { |
|
| 852 | 852 | drupal_goto("community/forum/{$node->tid}"); |
| 853 | 853 | } |
| 854 | 854 | drupal_goto("node/{$nid}"); |
@@ -890,8 +890,8 @@ discard block |
||
| 890 | 890 | $node->created = $comment->timestamp; |
| 891 | 891 | $node->changed = $node->created; |
| 892 | 892 | $node->promote = 0; // Display on front page? |
| 893 | - $node->sticky = 0; // Display top of page? |
|
| 894 | - $node->status = 1; // Published? |
|
| 893 | + $node->sticky = 0; // Display top of page? |
|
| 894 | + $node->status = 1; // Published? |
|
| 895 | 895 | $node->comment = 2; |
| 896 | 896 | //$node->language = 'en'; |
| 897 | 897 | $node->uid = $comment->uid; |
@@ -976,16 +976,16 @@ discard block |
||
| 976 | 976 | $xml->loadXML($global_prefs, LIBXML_NOBLANKS); |
| 977 | 977 | if ($errors = libxml_get_errors($xml)) { |
| 978 | 978 | $lines = explode("\r", $global_prefs); |
| 979 | - watchdog('am_set_info', "XML validation error in global_prefs: {$errors[0]->message} at line {$errors[0]->line}" . |
|
| 980 | - ': <br/>' . htmlentities($lines[$errors[0]->line - 1]), array(), WATCHDOG_ERROR); |
|
| 979 | + watchdog('am_set_info', "XML validation error in global_prefs: {$errors[0]->message} at line {$errors[0]->line}". |
|
| 980 | + ': <br/>'.htmlentities($lines[$errors[0]->line - 1]), array(), WATCHDOG_ERROR); |
|
| 981 | 981 | } |
| 982 | 982 | } |
| 983 | 983 | elseif ($project_prefs) { |
| 984 | 984 | $xml->loadXML($project_prefs, LIBXML_NOBLANKS); |
| 985 | 985 | if ($errors = libxml_get_errors($xml)) { |
| 986 | 986 | $lines = explode("\r", $project_prefs); |
| 987 | - watchdog('am_set_info', "XML validation error in project_prefs: {$errors[0]->message} at line {$errors[0]->line}" . |
|
| 988 | - ': <br/>' . htmlentities($lines[$errors[0]->line - 1]), array(), WATCHDOG_ERROR); |
|
| 987 | + watchdog('am_set_info', "XML validation error in project_prefs: {$errors[0]->message} at line {$errors[0]->line}". |
|
| 988 | + ': <br/>'.htmlentities($lines[$errors[0]->line - 1]), array(), WATCHDOG_ERROR); |
|
| 989 | 989 | } |
| 990 | 990 | } |
| 991 | 991 | if (!$errors) { |
@@ -1028,8 +1028,8 @@ discard block |
||
| 1028 | 1028 | $xml = array( |
| 1029 | 1029 | 'error' => array( |
| 1030 | 1030 | 'error_num' => -112, |
| 1031 | - 'error_msg' => "{$errors[0]->message} at line {$errors[0]->line}" . |
|
| 1032 | - ': <br/>' . htmlentities($lines[$errors[0]->line - 1]) |
|
| 1031 | + 'error_msg' => "{$errors[0]->message} at line {$errors[0]->line}". |
|
| 1032 | + ': <br/>'.htmlentities($lines[$errors[0]->line - 1]) |
|
| 1033 | 1033 | ), |
| 1034 | 1034 | ); |
| 1035 | 1035 | } |
@@ -1137,10 +1137,10 @@ discard block |
||
| 1137 | 1137 | 'teaser' => $teaser, |
| 1138 | 1138 | 'uid' => $team_owner_uid, |
| 1139 | 1139 | 'path' => null, |
| 1140 | - 'status' => 1, // published or not - always publish |
|
| 1140 | + 'status' => 1, // published or not - always publish |
|
| 1141 | 1141 | 'promote' => 0, |
| 1142 | 1142 | 'created' => $created_time, |
| 1143 | - 'comment' => 0, // comments disabled |
|
| 1143 | + 'comment' => 0, // comments disabled |
|
| 1144 | 1144 | 'moderate' => 0, |
| 1145 | 1145 | 'sticky' => 0, |
| 1146 | 1146 | 'format' => $input_format |
@@ -1151,7 +1151,7 @@ discard block |
||
| 1151 | 1151 | module_load_include('inc', 'pathauto', 'pathauto'); |
| 1152 | 1152 | $node['path'] = pathauto_cleanstring($values['name']); |
| 1153 | 1153 | |
| 1154 | - $node = (object) $node; // node_save requires an object form |
|
| 1154 | + $node = (object)$node; // node_save requires an object form |
|
| 1155 | 1155 | $team_categories = taxonomy_get_term_by_name($values['type']); |
| 1156 | 1156 | $node->taxonomy[] = $team_categories[0]; |
| 1157 | 1157 | |
@@ -1310,7 +1310,7 @@ discard block |
||
| 1310 | 1310 | while ($member = db_fetch_object($result)) { |
| 1311 | 1311 | $team_members[$member->boinc_id]['country'] = $member->field_country_value; |
| 1312 | 1312 | $team_members[$member->boinc_id]['url'] = $member->field_url_value; |
| 1313 | - $team_members[$member->boinc_id]['has_profile'] = isset($member->nid) ? 1: 0; |
|
| 1313 | + $team_members[$member->boinc_id]['has_profile'] = isset($member->nid) ? 1 : 0; |
|
| 1314 | 1314 | $xml['users']['user'][] = $team_members[$member->boinc_id]; |
| 1315 | 1315 | } |
| 1316 | 1316 | } // end if credit_only |
@@ -1360,7 +1360,7 @@ discard block |
||
| 1360 | 1360 | if ($profile_nid = content_profile_profile_exists($profile, $account->uid)) { |
| 1361 | 1361 | $profile_node = node_load($profile_nid); |
| 1362 | 1362 | if ($profile_node) { |
| 1363 | - $avatar_image = get_cck_image_object(file_directory_path() . '/' . $image_path, 'field_image', 'profile', TRUE); |
|
| 1363 | + $avatar_image = get_cck_image_object(file_directory_path().'/'.$image_path, 'field_image', 'profile', TRUE); |
|
| 1364 | 1364 | if ($avatar_image) { |
| 1365 | 1365 | $profile_node->field_image[0] = $avatar_image; |
| 1366 | 1366 | node_save($profile_node); |
@@ -1474,7 +1474,7 @@ discard block |
||
| 1474 | 1474 | WHERE (n.status = 1) AND (c.uid = '%d') |
| 1475 | 1475 | ORDER BY timestamp DESC |
| 1476 | 1476 | LIMIT %d", |
| 1477 | - $uid, (int) $count |
|
| 1477 | + $uid, (int)$count |
|
| 1478 | 1478 | ); |
| 1479 | 1479 | $xml = array( |
| 1480 | 1480 | 'rpc_response' => array( |
@@ -1517,7 +1517,7 @@ discard block |
||
| 1517 | 1517 | WHERE (n.status = 1) AND (n.uid = '%d') |
| 1518 | 1518 | ORDER BY changed DESC |
| 1519 | 1519 | LIMIT %d", |
| 1520 | - $uid, (int) $count |
|
| 1520 | + $uid, (int)$count |
|
| 1521 | 1521 | ); |
| 1522 | 1522 | $xml = array( |
| 1523 | 1523 | 'rpc_response' => array( |
@@ -1680,7 +1680,7 @@ discard block |
||
| 1680 | 1680 | ); |
| 1681 | 1681 | } |
| 1682 | 1682 | // Determine which page to display in order to show the given comment |
| 1683 | - $page = floor($comment_offset / $comments_per_page); |
|
| 1683 | + $page = floor($comment_offset/$comments_per_page); |
|
| 1684 | 1684 | if ($page) { |
| 1685 | 1685 | $params = array('page' => $page); |
| 1686 | 1686 | } |
@@ -2036,7 +2036,7 @@ discard block |
||
| 2036 | 2036 | * Overview of moderation queues |
| 2037 | 2037 | */ |
| 2038 | 2038 | function boinccore_moderation_overview_panel() { |
| 2039 | - $output = '<h2 class="pane-title">' . bts('Moderation', array(), NULL, 'boinc:moderate-profiles') . '</h2>'; |
|
| 2039 | + $output = '<h2 class="pane-title">'.bts('Moderation', array(), NULL, 'boinc:moderate-profiles').'</h2>'; |
|
| 2040 | 2040 | $output .= '<ul class="tab-list action-list">'; |
| 2041 | 2041 | if (module_exists('user_profiles')) { |
| 2042 | 2042 | $profile_count = db_result(db_query(" |
@@ -2047,7 +2047,7 @@ discard block |
||
| 2047 | 2047 | $output .= '<li class="tab primary">'; |
| 2048 | 2048 | $output .= l(bts('Unvetted profiles', array(), NULL, 'boinc:moderate-profiles'), 'moderate/profiles'); |
| 2049 | 2049 | $output .= '<div class="item-count-wrapper">'; |
| 2050 | - $output .= '<span class="item-count">' . $profile_count . '</span>'; |
|
| 2050 | + $output .= '<span class="item-count">'.$profile_count.'</span>'; |
|
| 2051 | 2051 | $output .= '</div>'; |
| 2052 | 2052 | $output .= '</li>'; |
| 2053 | 2053 | } |
@@ -2065,7 +2065,7 @@ discard block |
||
| 2065 | 2065 | require_boinc('boinc_db'); |
| 2066 | 2066 | |
| 2067 | 2067 | $num_deleted = BoincToken::delete_expired(); |
| 2068 | - if ($num_deleted>0) { |
|
| 2068 | + if ($num_deleted > 0) { |
|
| 2069 | 2069 | watchdog('boinccore', "Deleted ${num_deleted} tokens from table token", WATCHDOG_NOTICE); |
| 2070 | 2070 | } |
| 2071 | 2071 | } |
@@ -69,84 +69,84 @@ discard block |
||
| 69 | 69 | 'title' => 'Look up account RPC', |
| 70 | 70 | 'description' => 'RPC for getting the authenticator for a user account.', |
| 71 | 71 | 'page callback' => 'boinccore_lookup_account', |
| 72 | - 'access callback' => TRUE, |
|
| 72 | + 'access callback' => true, |
|
| 73 | 73 | 'type' => MENU_CALLBACK |
| 74 | 74 | ); |
| 75 | 75 | $items['am_get_info.php'] = array( |
| 76 | 76 | 'title' => 'Account manager get info RPC', |
| 77 | 77 | 'description' => 'RPC for getting assorted details of a user account.', |
| 78 | 78 | 'page callback' => 'boinccore_am_get_info', |
| 79 | - 'access callback' => TRUE, |
|
| 79 | + 'access callback' => true, |
|
| 80 | 80 | 'type' => MENU_CALLBACK |
| 81 | 81 | ); |
| 82 | 82 | $items['am_set_info.php'] = array( |
| 83 | 83 | 'title' => 'Account manager set info RPC', |
| 84 | 84 | 'description' => 'RPC for updating assorted details of a user account.', |
| 85 | 85 | 'page callback' => 'boinccore_am_set_info', |
| 86 | - 'access callback' => TRUE, |
|
| 86 | + 'access callback' => true, |
|
| 87 | 87 | 'type' => MENU_CALLBACK |
| 88 | 88 | ); |
| 89 | 89 | $items['am_set_host_info.php'] = array( |
| 90 | 90 | 'title' => 'Account manager set host info RPC', |
| 91 | 91 | 'description' => 'RPC for updating the venue for a given host.', |
| 92 | 92 | 'page callback' => 'boinccore_am_set_host_info', |
| 93 | - 'access callback' => TRUE, |
|
| 93 | + 'access callback' => true, |
|
| 94 | 94 | 'type' => MENU_CALLBACK |
| 95 | 95 | ); |
| 96 | 96 | $items['show_user.php'] = array( |
| 97 | 97 | 'title' => 'Show user RPC', |
| 98 | 98 | 'description' => 'RPC for getting assorted details of a user account.', |
| 99 | 99 | 'page callback' => 'boinccore_show_user', |
| 100 | - 'access callback' => TRUE, |
|
| 100 | + 'access callback' => true, |
|
| 101 | 101 | 'type' => MENU_CALLBACK |
| 102 | 102 | ); |
| 103 | 103 | $items['pending.php'] = array( |
| 104 | 104 | 'title' => 'Pending credit RPC', |
| 105 | 105 | 'description' => 'RPC for getting pending credit for a given account.', |
| 106 | 106 | 'page callback' => 'boinccore_pending_credit', |
| 107 | - 'access callback' => TRUE, |
|
| 107 | + 'access callback' => true, |
|
| 108 | 108 | 'type' => MENU_CALLBACK |
| 109 | 109 | ); |
| 110 | 110 | $items['create_team.php'] = array( |
| 111 | 111 | 'title' => 'Create team RPC', |
| 112 | 112 | 'description' => 'RPC for creating a new team.', |
| 113 | 113 | 'page callback' => 'boinccore_create_team', |
| 114 | - 'access callback' => TRUE, |
|
| 114 | + 'access callback' => true, |
|
| 115 | 115 | 'type' => MENU_CALLBACK |
| 116 | 116 | ); |
| 117 | 117 | $items['team_lookup.php'] = array( |
| 118 | 118 | 'title' => 'Team lookup RPC', |
| 119 | 119 | 'description' => 'RPC for getting info on a team or matching teams.', |
| 120 | 120 | 'page callback' => 'boinccore_team_lookup', |
| 121 | - 'access callback' => TRUE, |
|
| 121 | + 'access callback' => true, |
|
| 122 | 122 | 'type' => MENU_CALLBACK |
| 123 | 123 | ); |
| 124 | 124 | $items['team_email_list.php'] = array( |
| 125 | 125 | 'title' => 'Get team member list RPC', |
| 126 | 126 | 'description' => 'RPC for getting a list of members of a given team.', |
| 127 | 127 | 'page callback' => 'boinccore_team_email_list', |
| 128 | - 'access callback' => TRUE, |
|
| 128 | + 'access callback' => true, |
|
| 129 | 129 | 'type' => MENU_CALLBACK |
| 130 | 130 | ); |
| 131 | 131 | $items['edit_forum_preferences_action.php'] = array( |
| 132 | 132 | 'title' => 'Forum preferences RPC', |
| 133 | 133 | 'description' => 'RPC for setting forum preferences for a given user.', |
| 134 | 134 | 'page callback' => 'boinccore_edit_forum_preferences', |
| 135 | - 'access callback' => TRUE, |
|
| 135 | + 'access callback' => true, |
|
| 136 | 136 | 'type' => MENU_CALLBACK |
| 137 | 137 | ); |
| 138 | 138 | $items['forum_get_data.php'] = array( |
| 139 | 139 | 'title' => 'Forum get data RPC', |
| 140 | 140 | 'description' => 'RPC for getting recent forum activity for a given user.', |
| 141 | 141 | 'page callback' => 'boinccore_forum_get_data', |
| 142 | - 'access callback' => TRUE, |
|
| 142 | + 'access callback' => true, |
|
| 143 | 143 | 'type' => MENU_CALLBACK |
| 144 | 144 | ); |
| 145 | 145 | $items['apps.php'] = array( |
| 146 | 146 | 'title' => 'Apps RPC', |
| 147 | 147 | 'description' => 'RPC for getting the applications in the system.', |
| 148 | 148 | 'page callback' => 'boinccore_apps', |
| 149 | - 'access callback' => TRUE, |
|
| 149 | + 'access callback' => true, |
|
| 150 | 150 | 'type' => MENU_CALLBACK |
| 151 | 151 | ); |
| 152 | 152 | |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | */ |
| 159 | 159 | function boinccore_menu_alter(&$items) { |
| 160 | 160 | // If using Solr search and not core Drupal search, disable core search! |
| 161 | - if (module_exists('global_search_solr') AND !module_exists('global_search')) { |
|
| 161 | + if (module_exists('global_search_solr') and !module_exists('global_search')) { |
|
| 162 | 162 | // Add permission to user search. |
| 163 | 163 | $check = array( |
| 164 | 164 | 'search/node/%menu_tail', |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | ); |
| 168 | 168 | foreach ($check as $path) { |
| 169 | 169 | if (isset($items[$path])) { |
| 170 | - $items[$path]['access callback'] = FALSE; |
|
| 170 | + $items[$path]['access callback'] = false; |
|
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | 173 | } |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | ); |
| 198 | 198 | foreach ($check as $path) { |
| 199 | 199 | if (isset($items[$path])) { |
| 200 | - $items[$path]['access callback'] = FALSE; |
|
| 200 | + $items[$path]['access callback'] = false; |
|
| 201 | 201 | } |
| 202 | 202 | } |
| 203 | 203 | |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | ); |
| 216 | 216 | foreach ($check as $path) { |
| 217 | 217 | if (isset($items[$path])) { |
| 218 | - $items[$path]['access callback'] = FALSE; |
|
| 218 | + $items[$path]['access callback'] = false; |
|
| 219 | 219 | } |
| 220 | 220 | } |
| 221 | 221 | } |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | // Since we are in a hook_boot() implementation cache mode is normal, so |
| 274 | 274 | // we can safely call hook_exit(). |
| 275 | 275 | bootstrap_invoke_all('exit'); |
| 276 | - header("Location: $url", TRUE, $code); |
|
| 276 | + header("Location: $url", true, $code); |
|
| 277 | 277 | exit; |
| 278 | 278 | } |
| 279 | 279 | } |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | */ |
| 292 | 292 | function locale_language_from_browser() { |
| 293 | 293 | if (empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { |
| 294 | - return FALSE; |
|
| 294 | + return false; |
|
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | $languages = language_list('enabled'); |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | // Find the enabled language with the greatest qvalue, following the rules |
| 335 | 335 | // of RFC 2616 (section 14.4). If several languages have the same qvalue, |
| 336 | 336 | // prefer the one with the greatest weight. |
| 337 | - $best_match_language = FALSE; |
|
| 337 | + $best_match_language = false; |
|
| 338 | 338 | $max_qvalue = 0; |
| 339 | 339 | foreach ($languages as $langcode => $language) { |
| 340 | 340 | // Language tags are case insensitive (RFC2616, sec 3.10). |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | // Notify moderators if there is site content that requires moderator action |
| 374 | 374 | $items_in_queue = boincuser_moderation_queue_count('cron'); |
| 375 | 375 | $last_notification = variable_get('boinccore_last_content_moderation_reminder', 0); |
| 376 | - if ($items_in_queue AND $last_notification < time() - 24*60*60) { |
|
| 376 | + if ($items_in_queue and $last_notification < time() - 24*60*60) { |
|
| 377 | 377 | global $base_url; |
| 378 | 378 | global $base_path; |
| 379 | 379 | $site_name = variable_get('site_name', 'Drupal-BOINC'); |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | $user_info = '<div class="user">'; |
| 434 | 434 | if ($user_image) { |
| 435 | 435 | $user_info .= ' <div class="picture">'; |
| 436 | - if (is_array($user_image) AND $user_image['image']['filepath']) { |
|
| 436 | + if (is_array($user_image) and $user_image['image']['filepath']) { |
|
| 437 | 437 | $user_info .= theme('imagefield_image', $user_image['image'], $user_image['alt'], $user_image['alt'], array(), false); |
| 438 | 438 | } |
| 439 | 439 | elseif (is_string($user_image)) { |
@@ -463,13 +463,13 @@ discard block |
||
| 463 | 463 | |
| 464 | 464 | module_load_include('inc', 'bbcode', 'bbcode-help'); |
| 465 | 465 | $form['bbcode_help'] = array( |
| 466 | - '#title' => bts('BBcode help', array(), NULL, 'boinc:help-with-user-input-with-BBCode'), |
|
| 466 | + '#title' => bts('BBcode help', array(), null, 'boinc:help-with-user-input-with-BBCode'), |
|
| 467 | 467 | '#type' => 'fieldset', |
| 468 | 468 | '#attributes' => array( |
| 469 | 469 | 'class' => 'bbcode_help', |
| 470 | 470 | ), |
| 471 | - '#collapsible' => TRUE, |
|
| 472 | - '#collapsed' => TRUE, |
|
| 471 | + '#collapsible' => true, |
|
| 472 | + '#collapsed' => true, |
|
| 473 | 473 | 'content' => array( |
| 474 | 474 | '#value' => _bbcode_filter_tip(), |
| 475 | 475 | ), |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | $form['buttons']['submit'] = $form['submit']; |
| 492 | 492 | unset($form['submit']); |
| 493 | 493 | $form['buttons']['submit']['#prefix'] = '<li class="first tab">'; |
| 494 | - $form['buttons']['submit']['#value'] = bts('Post comment', array(), NULL, 'boinc:post-forum-comment'); |
|
| 494 | + $form['buttons']['submit']['#value'] = bts('Post comment', array(), null, 'boinc:post-forum-comment'); |
|
| 495 | 495 | $form['buttons']['submit']['#suffix'] = '</li>'; |
| 496 | 496 | $form['buttons']['submit']['#weight'] = 1002; |
| 497 | 497 | // We want all these buttons together under the "buttons" array, but the |
@@ -505,7 +505,7 @@ discard block |
||
| 505 | 505 | $form['buttons']['preview']['#suffix'] = '</li>'; |
| 506 | 506 | $form['buttons']['preview']['#weight'] = 1003; |
| 507 | 507 | $form['buttons']['cancel'] = array( |
| 508 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $cancel_url) . '</li>', |
|
| 508 | + '#value' => '<li class="tab">' . l(bts('Cancel', array(), null, 'boinc:form-cancel'), $cancel_url) . '</li>', |
|
| 509 | 509 | '#weight' => 1004, |
| 510 | 510 | ); |
| 511 | 511 | $form['buttons']['form control tabs suffix'] = array( |
@@ -535,7 +535,7 @@ discard block |
||
| 535 | 535 | } |
| 536 | 536 | } |
| 537 | 537 | else { |
| 538 | - $form = NULL; |
|
| 538 | + $form = null; |
|
| 539 | 539 | $form['from'] = array( |
| 540 | 540 | '#type' => 'item', |
| 541 | 541 | '#value' => 'You do not have permission to post comments in this forum.', |
@@ -560,7 +560,7 @@ discard block |
||
| 560 | 560 | '#weight' => 1001, |
| 561 | 561 | ); |
| 562 | 562 | $form['buttons']['submit']['#prefix'] = '<li class="first tab">'; |
| 563 | - $form['buttons']['submit']['#value'] = bts('Post topic', array(), NULL, 'boinc:post-forum-comment'); |
|
| 563 | + $form['buttons']['submit']['#value'] = bts('Post topic', array(), null, 'boinc:post-forum-comment'); |
|
| 564 | 564 | $form['buttons']['submit']['#suffix'] = '</li>'; |
| 565 | 565 | $form['buttons']['submit']['#weight'] = 1002; |
| 566 | 566 | $form['buttons']['preview']['#prefix'] = '<li class="tab">'; |
@@ -570,7 +570,7 @@ discard block |
||
| 570 | 570 | $form['buttons']['preview_changes']['#suffix'] = '</li>'; |
| 571 | 571 | $form['buttons']['preview_changes']['#weight'] = 1004; |
| 572 | 572 | $form['buttons']['cancel'] = array( |
| 573 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "community/forum/{$forum_id}") . '</li>', |
|
| 573 | + '#value' => '<li class="tab">' . l(bts('Cancel', array(), null, 'boinc:form-cancel'), "community/forum/{$forum_id}") . '</li>', |
|
| 574 | 574 | '#weight' => 1005, |
| 575 | 575 | ); |
| 576 | 576 | $form['buttons']['form control tabs suffix'] = array( |
@@ -608,7 +608,7 @@ discard block |
||
| 608 | 608 | /** |
| 609 | 609 | * Implementation of hook_link_alter() |
| 610 | 610 | */ |
| 611 | -function boinccore_link_alter(&$links, $node, $comment = NULL) { |
|
| 611 | +function boinccore_link_alter(&$links, $node, $comment = null) { |
|
| 612 | 612 | //echo '<pre>' . print_r($links, true) . '</pre>'; |
| 613 | 613 | foreach ($links as $module => $link) { |
| 614 | 614 | // Remove the ignore user link |
@@ -620,15 +620,15 @@ discard block |
||
| 620 | 620 | if (!($comment)) { |
| 621 | 621 | // modify the comment_add link |
| 622 | 622 | if (isset($links['comment_add'])) { |
| 623 | - $links['comment_add']['title'] = bts('reply', array(), NULL, 'boinc:forum-reply-to-comment'); |
|
| 623 | + $links['comment_add']['title'] = bts('reply', array(), null, 'boinc:forum-reply-to-comment'); |
|
| 624 | 624 | $links['comment_add']['attributes'] = array( |
| 625 | - 'title' => bts('Reply to this comment', array(), NULL, 'boinc:forum-reply-to-comment') |
|
| 625 | + 'title' => bts('Reply to this comment', array(), null, 'boinc:forum-reply-to-comment') |
|
| 626 | 626 | ); |
| 627 | 627 | } |
| 628 | 628 | // modify quote link |
| 629 | 629 | if (isset($links['quote'])) { |
| 630 | 630 | $links['quote']['attributes'] = array( |
| 631 | - 'title' => bts('Reply to this topic with a quote', array(), NULL, 'boinc:forum-reply-to-comment') |
|
| 631 | + 'title' => bts('Reply to this topic with a quote', array(), null, 'boinc:forum-reply-to-comment') |
|
| 632 | 632 | ); |
| 633 | 633 | } |
| 634 | 634 | } |
@@ -636,17 +636,17 @@ discard block |
||
| 636 | 636 | // Standard EDIT, DELETE, and REPLY links are created by Drupal, but we want to alter them |
| 637 | 637 | if (isset($links['comment_delete'])) { |
| 638 | 638 | $links['comment_delete']['attributes'] = array( |
| 639 | - 'title' => bts('Delete this comment', array(), NULL, 'boinc:forum-delete-comment') |
|
| 639 | + 'title' => bts('Delete this comment', array(), null, 'boinc:forum-delete-comment') |
|
| 640 | 640 | ); |
| 641 | 641 | } |
| 642 | 642 | if (isset($links['comment_edit'])) { |
| 643 | 643 | $links['comment_edit']['attributes'] = array( |
| 644 | - 'title' => bts('Edit this comment', array(), NULL, 'boinc:forum-edit-comment') |
|
| 644 | + 'title' => bts('Edit this comment', array(), null, 'boinc:forum-edit-comment') |
|
| 645 | 645 | ); |
| 646 | 646 | } |
| 647 | 647 | if (isset($links['comment_reply'])) { |
| 648 | 648 | $links['comment_reply']['attributes'] = array( |
| 649 | - 'title' => bts('Reply to this comment', array(), NULL, 'boinc:forum-reply-to-comment') |
|
| 649 | + 'title' => bts('Reply to this comment', array(), null, 'boinc:forum-reply-to-comment') |
|
| 650 | 650 | ); |
| 651 | 651 | } |
| 652 | 652 | }// if !$comment |
@@ -655,13 +655,13 @@ discard block |
||
| 655 | 655 | /** |
| 656 | 656 | * Implementation of hook_locale(). |
| 657 | 657 | */ |
| 658 | -function boinccore_locale($op = 'groups', $group = NULL) { |
|
| 658 | +function boinccore_locale($op = 'groups', $group = null) { |
|
| 659 | 659 | switch ($op) { |
| 660 | 660 | case 'groups': |
| 661 | 661 | return array('boinc' => 'BOINC'); |
| 662 | 662 | case 'info': |
| 663 | 663 | //$info['boinc']['refresh callback'] = 'boinccore_locale_refresh'; |
| 664 | - $info['boinc']['format'] = FALSE; |
|
| 664 | + $info['boinc']['format'] = false; |
|
| 665 | 665 | return $info; |
| 666 | 666 | } |
| 667 | 667 | } |
@@ -670,65 +670,65 @@ discard block |
||
| 670 | 670 | /** |
| 671 | 671 | * Implementation of hook_link() |
| 672 | 672 | */ |
| 673 | -function boinccore_link($type, $object, $teaser = FALSE) { |
|
| 673 | +function boinccore_link($type, $object, $teaser = false) { |
|
| 674 | 674 | // Add custom links with this hook |
| 675 | 675 | |
| 676 | 676 | if ($type=='node') { |
| 677 | - if ( ($object->type=='forum') OR ($object->type=='team_forum') ) { |
|
| 677 | + if ( ($object->type=='forum') or ($object->type=='team_forum') ) { |
|
| 678 | 678 | // Add topic moderator controls |
| 679 | 679 | if (user_access('edit any forum topic')) { |
| 680 | 680 | $node_control = "node_control/{$object->nid}"; |
| 681 | 681 | if ($object->sticky) { |
| 682 | 682 | $links['make_unsticky'] = array( |
| 683 | - 'title' => bts('Make unsticky', array(), NULL, 'boinc:forum-unsticky-comment'), |
|
| 683 | + 'title' => bts('Make unsticky', array(), null, 'boinc:forum-unsticky-comment'), |
|
| 684 | 684 | 'href' => "{$node_control}/unsticky", |
| 685 | 685 | 'attributes' => array( |
| 686 | - 'title' => bts('Remove sticky status from this topic', array(), NULL, 'boinc:forum-unsticky-comment') |
|
| 686 | + 'title' => bts('Remove sticky status from this topic', array(), null, 'boinc:forum-unsticky-comment') |
|
| 687 | 687 | ) |
| 688 | 688 | ); |
| 689 | 689 | } |
| 690 | 690 | else { |
| 691 | 691 | $links['make_sticky'] = array( |
| 692 | - 'title' => bts('Make sticky', array(), NULL, 'boinc:forum-sticky-comment'), |
|
| 692 | + 'title' => bts('Make sticky', array(), null, 'boinc:forum-sticky-comment'), |
|
| 693 | 693 | 'href' => "{$node_control}/sticky", |
| 694 | 694 | 'attributes' => array( |
| 695 | - 'title' => bts('Make this topic sticky', array(), NULL, 'boinc:forum-sticky-comment') |
|
| 695 | + 'title' => bts('Make this topic sticky', array(), null, 'boinc:forum-sticky-comment') |
|
| 696 | 696 | ) |
| 697 | 697 | ); |
| 698 | 698 | } |
| 699 | 699 | if ($object->comment == COMMENT_NODE_READ_WRITE) { |
| 700 | 700 | $links['lock'] = array( |
| 701 | - 'title' => bts('Lock', array(), NULL, 'boinc:forum-lock-comment'), |
|
| 701 | + 'title' => bts('Lock', array(), null, 'boinc:forum-lock-comment'), |
|
| 702 | 702 | 'href' => "{$node_control}/lock", |
| 703 | 703 | 'attributes' => array( |
| 704 | - 'title' => bts('Lock this thread for comments', array(), NULL, 'boinc:forum-lock-comment') |
|
| 704 | + 'title' => bts('Lock this thread for comments', array(), null, 'boinc:forum-lock-comment') |
|
| 705 | 705 | ) |
| 706 | 706 | ); |
| 707 | 707 | } |
| 708 | 708 | else { |
| 709 | 709 | $links['unlock'] = array( |
| 710 | - 'title' => bts('Unlock', array(), NULL, 'boinc:forum-unlock-comment'), |
|
| 710 | + 'title' => bts('Unlock', array(), null, 'boinc:forum-unlock-comment'), |
|
| 711 | 711 | 'href' => "{$node_control}/unlock", |
| 712 | 712 | 'attributes' => array( |
| 713 | - 'title' => bts('Unlock this thread for comments', array(), NULL, 'boinc:forum-unlock-comment') |
|
| 713 | + 'title' => bts('Unlock this thread for comments', array(), null, 'boinc:forum-unlock-comment') |
|
| 714 | 714 | ) |
| 715 | 715 | ); |
| 716 | 716 | } |
| 717 | 717 | if ($object->status) { |
| 718 | 718 | $links['hide'] = array( |
| 719 | - 'title' => bts('Hide', array(), NULL, 'boinc:forum-hide-comment'), |
|
| 719 | + 'title' => bts('Hide', array(), null, 'boinc:forum-hide-comment'), |
|
| 720 | 720 | 'href' => "{$node_control}/hide", |
| 721 | 721 | 'attributes' => array( |
| 722 | - 'title' => bts('Hide this topic', array(), NULL, 'boinc:forum-hide-comment') |
|
| 722 | + 'title' => bts('Hide this topic', array(), null, 'boinc:forum-hide-comment') |
|
| 723 | 723 | ) |
| 724 | 724 | ); |
| 725 | 725 | } |
| 726 | 726 | else { |
| 727 | 727 | $links['unhide'] = array( |
| 728 | - 'title' => bts('Unhide', array(), NULL, 'boinc:forum-unhide-comment'), |
|
| 728 | + 'title' => bts('Unhide', array(), null, 'boinc:forum-unhide-comment'), |
|
| 729 | 729 | 'href' => "{$node_control}/unhide", |
| 730 | 730 | 'attributes' => array( |
| 731 | - 'title' => bts('Unhide this topic', array(), NULL, 'boinc:forum-unhide-comment') |
|
| 731 | + 'title' => bts('Unhide this topic', array(), null, 'boinc:forum-unhide-comment') |
|
| 732 | 732 | ) |
| 733 | 733 | ); |
| 734 | 734 | } |
@@ -743,10 +743,10 @@ discard block |
||
| 743 | 743 | // QUOTE |
| 744 | 744 | if ($node->comment == COMMENT_NODE_READ_WRITE) { |
| 745 | 745 | $links['quote'] = array( |
| 746 | - 'title' => bts('Quote', array(), NULL, 'boinc:forum-reply-to-comment-with-quote'), |
|
| 746 | + 'title' => bts('Quote', array(), null, 'boinc:forum-reply-to-comment-with-quote'), |
|
| 747 | 747 | 'href' => "comment/reply/{$nid}/{$cid}", |
| 748 | 748 | 'attributes' => array( |
| 749 | - 'title' => bts('Reply to this comment with a quote', array(), NULL, 'boinc:forum-reply-to-comment') |
|
| 749 | + 'title' => bts('Reply to this comment with a quote', array(), null, 'boinc:forum-reply-to-comment') |
|
| 750 | 750 | ), |
| 751 | 751 | 'fragment' => 'comment-form', |
| 752 | 752 | 'query' => 'quote=1', |
@@ -760,29 +760,29 @@ discard block |
||
| 760 | 760 | $reply_count = db_result(db_query(' SELECT COUNT(*) FROM comments WHERE pid = %d', $cid )); |
| 761 | 761 | if ($reply_count == 0) { |
| 762 | 762 | $links['convert'] = array( |
| 763 | - 'title' => bts('Convert', array(), NULL, 'boinc:forum-convert-comment-to-topic'), |
|
| 763 | + 'title' => bts('Convert', array(), null, 'boinc:forum-convert-comment-to-topic'), |
|
| 764 | 764 | 'href' => "{$comment_control}/convert", |
| 765 | 765 | 'attributes' => array( |
| 766 | - 'title' => bts('Convert this comment to a new topic', array(), NULL, 'boinc:forum-convert-comment-to-topic') |
|
| 766 | + 'title' => bts('Convert this comment to a new topic', array(), null, 'boinc:forum-convert-comment-to-topic') |
|
| 767 | 767 | ) |
| 768 | 768 | ); |
| 769 | 769 | } |
| 770 | 770 | // Add hide link |
| 771 | 771 | if ($object->status == 0) { |
| 772 | 772 | $links['hide'] = array( |
| 773 | - 'title' => bts('Hide', array(), NULL, 'boinc:forum-hide-comment'), |
|
| 773 | + 'title' => bts('Hide', array(), null, 'boinc:forum-hide-comment'), |
|
| 774 | 774 | 'href' => "{$comment_control}/hide", |
| 775 | 775 | 'attributes' => array( |
| 776 | - 'title' => bts('Hide this comment', array(), NULL, 'boinc:forum-hide-comment') |
|
| 776 | + 'title' => bts('Hide this comment', array(), null, 'boinc:forum-hide-comment') |
|
| 777 | 777 | ) |
| 778 | 778 | ); |
| 779 | 779 | } |
| 780 | 780 | else { |
| 781 | 781 | $links['unhide'] = array( |
| 782 | - 'title' => bts('Unhide', array(), NULL, 'boinc:forum-unhide-comment'), |
|
| 782 | + 'title' => bts('Unhide', array(), null, 'boinc:forum-unhide-comment'), |
|
| 783 | 783 | 'href' => "{$comment_control}/unhide", |
| 784 | 784 | 'attributes' => array( |
| 785 | - 'title' => bts('Unhide this comment', array(), NULL, 'boinc:forum-unhide-comment') |
|
| 785 | + 'title' => bts('Unhide this comment', array(), null, 'boinc:forum-unhide-comment') |
|
| 786 | 786 | ) |
| 787 | 787 | ); |
| 788 | 788 | } |
@@ -817,12 +817,12 @@ discard block |
||
| 817 | 817 | * Allow published, sticky, and comment status to be set on nodes by direct |
| 818 | 818 | * link rather than through the node form. |
| 819 | 819 | */ |
| 820 | -function boinccore_node_control($nid = NULL, $action = NULL) { |
|
| 821 | - if ((!$nid OR !$node = node_load($nid)) OR |
|
| 822 | - ($node->type == 'forum' AND !user_access('edit any forum topic')) OR |
|
| 823 | - ($node->type != 'forum' AND !user_access('administer nodes'))) { |
|
| 820 | +function boinccore_node_control($nid = null, $action = null) { |
|
| 821 | + if ((!$nid or !$node = node_load($nid)) or |
|
| 822 | + ($node->type == 'forum' and !user_access('edit any forum topic')) or |
|
| 823 | + ($node->type != 'forum' and !user_access('administer nodes'))) { |
|
| 824 | 824 | // What are you even doing here... |
| 825 | - return FALSE; |
|
| 825 | + return false; |
|
| 826 | 826 | } |
| 827 | 827 | switch ($action) { |
| 828 | 828 | case 'unhide': |
@@ -864,10 +864,10 @@ discard block |
||
| 864 | 864 | * Allow published status to be set on comments by direct link rather than |
| 865 | 865 | * through the comment edit form. |
| 866 | 866 | */ |
| 867 | -function boinccore_comment_control($cid = NULL, $action = NULL) { |
|
| 868 | - if (!$cid OR !$comment = _comment_load($cid)) { |
|
| 867 | +function boinccore_comment_control($cid = null, $action = null) { |
|
| 868 | + if (!$cid or !$comment = _comment_load($cid)) { |
|
| 869 | 869 | // What are you even doing here... |
| 870 | - return FALSE; |
|
| 870 | + return false; |
|
| 871 | 871 | } |
| 872 | 872 | $return_path = "node/{$comment->nid}"; |
| 873 | 873 | $return_anchor = "comment-{$cid}"; |
@@ -920,11 +920,11 @@ discard block |
||
| 920 | 920 | rules_invoke_event('boinccore_comment_convert', $comment); |
| 921 | 921 | |
| 922 | 922 | $return_path = "node/{$node->nid}"; |
| 923 | - $return_anchor = NULL; |
|
| 923 | + $return_anchor = null; |
|
| 924 | 924 | break; |
| 925 | 925 | default: |
| 926 | 926 | } |
| 927 | - drupal_goto($return_path, NULL, $return_anchor); |
|
| 927 | + drupal_goto($return_path, null, $return_anchor); |
|
| 928 | 928 | } |
| 929 | 929 | |
| 930 | 930 | /** |
@@ -951,7 +951,7 @@ discard block |
||
| 951 | 951 | $uid = !empty($xml['am_get_info_reply']['id']) ? boincuser_lookup_uid($xml['am_get_info_reply']['id']) : 0; |
| 952 | 952 | if ($uid) { |
| 953 | 953 | $content_profile = content_profile_load('profile', $uid); |
| 954 | - $profile_is_approved = ($content_profile->status AND !$content_profile->moderate); |
|
| 954 | + $profile_is_approved = ($content_profile->status and !$content_profile->moderate); |
|
| 955 | 955 | $country = check_plain($content_profile->field_country[0]['value']); |
| 956 | 956 | $website = ''; |
| 957 | 957 | if ($profile_is_approved) { |
@@ -973,8 +973,8 @@ discard block |
||
| 973 | 973 | // Remove q from the GET request or BOINC will panic |
| 974 | 974 | unset($_GET['q']); |
| 975 | 975 | // Validate the XML prefs (in case BOINC does not) |
| 976 | - $global_prefs = !empty($_POST['global_prefs']) ? $_POST['global_prefs'] : (!empty($_GET['global_prefs']) ? $_GET['global_prefs'] : NULL); |
|
| 977 | - $project_prefs = !empty($_POST['project_prefs']) ? $_POST['project_prefs'] : (!empty($_GET['project_prefs']) ? $_GET['project_prefs'] : NULL); |
|
| 976 | + $global_prefs = !empty($_POST['global_prefs']) ? $_POST['global_prefs'] : (!empty($_GET['global_prefs']) ? $_GET['global_prefs'] : null); |
|
| 977 | + $project_prefs = !empty($_POST['project_prefs']) ? $_POST['project_prefs'] : (!empty($_GET['project_prefs']) ? $_GET['project_prefs'] : null); |
|
| 978 | 978 | libxml_use_internal_errors(true); |
| 979 | 979 | $xml = new DomDocument(); |
| 980 | 980 | if ($global_prefs) { |
@@ -1013,15 +1013,15 @@ discard block |
||
| 1013 | 1013 | $uid = boincuser_lookup_uid($boinc_id); |
| 1014 | 1014 | |
| 1015 | 1015 | // Apply any relevant updates to the Drupal account, also |
| 1016 | - $country = !empty($_POST['country']) ? $_POST['country'] : (!empty($_GET['country']) ? $_GET['country'] : NULL); |
|
| 1017 | - $url = !empty($_POST['url']) ? $_POST['url'] : (!empty($_GET['url']) ? $_GET['url'] : NULL); |
|
| 1018 | - $email_addr = !empty($_POST['email_addr']) ? $_POST['email_addr'] : (!empty($_GET['email_addr']) ? $_GET['email_addr'] : NULL); |
|
| 1016 | + $country = !empty($_POST['country']) ? $_POST['country'] : (!empty($_GET['country']) ? $_GET['country'] : null); |
|
| 1017 | + $url = !empty($_POST['url']) ? $_POST['url'] : (!empty($_GET['url']) ? $_GET['url'] : null); |
|
| 1018 | + $email_addr = !empty($_POST['email_addr']) ? $_POST['email_addr'] : (!empty($_GET['email_addr']) ? $_GET['email_addr'] : null); |
|
| 1019 | 1019 | |
| 1020 | 1020 | if ($email_addr) { |
| 1021 | 1021 | $account = user_load($uid); |
| 1022 | 1022 | user_save($account, array('mail' => $email_addr)); |
| 1023 | 1023 | } |
| 1024 | - if ($country OR $url) { |
|
| 1024 | + if ($country or $url) { |
|
| 1025 | 1025 | $content_profile = content_profile_load('profile', $uid); |
| 1026 | 1026 | if ($country) $content_profile->field_country[0]['value'] = $country; |
| 1027 | 1027 | if ($url) $content_profile->field_url[0]['value'] = $url; |
@@ -1075,7 +1075,7 @@ discard block |
||
| 1075 | 1075 | $uid = !empty($xml['user']['id']) ? boincuser_lookup_uid($xml['user']['id']) : 0; |
| 1076 | 1076 | if ($uid) { |
| 1077 | 1077 | $content_profile = content_profile_load('profile', $uid); |
| 1078 | - $profile_is_approved = ($content_profile->status AND !$content_profile->moderate); |
|
| 1078 | + $profile_is_approved = ($content_profile->status and !$content_profile->moderate); |
|
| 1079 | 1079 | $country = check_plain($content_profile->field_country[0]['value']); |
| 1080 | 1080 | $website = ''; |
| 1081 | 1081 | if ($profile_is_approved) { |
@@ -1237,7 +1237,7 @@ discard block |
||
| 1237 | 1237 | $show_xml = !empty($_POST['xml']) ? $_POST['xml'] : $_GET['xml']; |
| 1238 | 1238 | if (!$show_xml) { |
| 1239 | 1239 | // creditonly does not affect non xml output in BOINC |
| 1240 | - $credit_only = FALSE; |
|
| 1240 | + $credit_only = false; |
|
| 1241 | 1241 | } |
| 1242 | 1242 | $xml = array(); |
| 1243 | 1243 | |
@@ -1286,11 +1286,11 @@ discard block |
||
| 1286 | 1286 | 'cpid' => md5($member->cross_project_id.$member->email_addr), |
| 1287 | 1287 | 'create_time' => $member->create_time, |
| 1288 | 1288 | 'name' => htmlspecialchars($member->name), |
| 1289 | - 'country' => NULL, |
|
| 1289 | + 'country' => null, |
|
| 1290 | 1290 | 'total_credit' => round($member->total_credit), |
| 1291 | 1291 | 'expavg_credit' => round($member->expavg_credit), |
| 1292 | 1292 | 'expavg_time' => round($member->expavg_time), |
| 1293 | - 'url' => NULL, |
|
| 1293 | + 'url' => null, |
|
| 1294 | 1294 | 'has_profile' => 0, |
| 1295 | 1295 | ); |
| 1296 | 1296 | } |
@@ -1328,7 +1328,7 @@ discard block |
||
| 1328 | 1328 | ), |
| 1329 | 1329 | ); |
| 1330 | 1330 | } // end if boincteam_id |
| 1331 | - print xml_to_text(array_to_xml($xml), TRUE, TRUE); |
|
| 1331 | + print xml_to_text(array_to_xml($xml), true, true); |
|
| 1332 | 1332 | } |
| 1333 | 1333 | |
| 1334 | 1334 | /** |
@@ -1339,18 +1339,18 @@ discard block |
||
| 1339 | 1339 | // Do not pass through to BOINC in this case as BOINC forums are no longer |
| 1340 | 1340 | // relevant -- use Drupal data only |
| 1341 | 1341 | |
| 1342 | - $account_key = !empty($_POST['account_key']) ? $_POST['account_key'] : (!empty($_GET['account_key']) ? $_GET['account_key'] : NULL); |
|
| 1342 | + $account_key = !empty($_POST['account_key']) ? $_POST['account_key'] : (!empty($_GET['account_key']) ? $_GET['account_key'] : null); |
|
| 1343 | 1343 | |
| 1344 | 1344 | require_boinc('boinc_db'); |
| 1345 | 1345 | $boincuser = BoincUser::lookup_auth($account_key); |
| 1346 | 1346 | if ($boincuser) { |
| 1347 | 1347 | $uid = boincuser_lookup_uid($boincuser->id); |
| 1348 | - if ($uid AND $account = user_load($uid)) { |
|
| 1348 | + if ($uid and $account = user_load($uid)) { |
|
| 1349 | 1349 | // Currently supported preferences |
| 1350 | - $avatar_url = isset($_POST['avatar_url']) ? $_POST['avatar_url'] : (isset($_GET['avatar_url']) ? $_GET['avatar_url'] : NULL); |
|
| 1351 | - $hide_signatures = isset($_POST['forum_hide_signatures']) ? $_POST['forum_hide_signatures'] : (isset($_GET['forum_hide_signatures']) ? $_GET['forum_hide_signatures'] : NULL); |
|
| 1352 | - $signature = isset($_POST['signature']) ? $_POST['signature'] : (isset($_GET['signature']) ? $_GET['signature'] : NULL); |
|
| 1353 | - $post_order = isset($_POST['thread_sort']) ? $_POST['thread_sort'] : (isset($_GET['thread_sort']) ? $_GET['thread_sort'] : NULL); |
|
| 1350 | + $avatar_url = isset($_POST['avatar_url']) ? $_POST['avatar_url'] : (isset($_GET['avatar_url']) ? $_GET['avatar_url'] : null); |
|
| 1351 | + $hide_signatures = isset($_POST['forum_hide_signatures']) ? $_POST['forum_hide_signatures'] : (isset($_GET['forum_hide_signatures']) ? $_GET['forum_hide_signatures'] : null); |
|
| 1352 | + $signature = isset($_POST['signature']) ? $_POST['signature'] : (isset($_GET['signature']) ? $_GET['signature'] : null); |
|
| 1353 | + $post_order = isset($_POST['thread_sort']) ? $_POST['thread_sort'] : (isset($_GET['thread_sort']) ? $_GET['thread_sort'] : null); |
|
| 1354 | 1354 | // Update preferences as needed |
| 1355 | 1355 | if ($avatar_url) { |
| 1356 | 1356 | $avatar_image = file_get_contents($avatar_url); |
@@ -1361,11 +1361,11 @@ discard block |
||
| 1361 | 1361 | if ($file) { |
| 1362 | 1362 | $profile = new stdClass(); |
| 1363 | 1363 | $profile->type = 'profile'; |
| 1364 | - $profile->language = NULL; |
|
| 1364 | + $profile->language = null; |
|
| 1365 | 1365 | if ($profile_nid = content_profile_profile_exists($profile, $account->uid)) { |
| 1366 | 1366 | $profile_node = node_load($profile_nid); |
| 1367 | 1367 | if ($profile_node) { |
| 1368 | - $avatar_image = get_cck_image_object(file_directory_path() . '/' . $image_path, 'field_image', 'profile', TRUE); |
|
| 1368 | + $avatar_image = get_cck_image_object(file_directory_path() . '/' . $image_path, 'field_image', 'profile', true); |
|
| 1369 | 1369 | if ($avatar_image) { |
| 1370 | 1370 | $profile_node->field_image[0] = $avatar_image; |
| 1371 | 1371 | node_save($profile_node); |
@@ -1390,10 +1390,10 @@ discard block |
||
| 1390 | 1390 | $error = 'Could not find avatar image at URL'; |
| 1391 | 1391 | } |
| 1392 | 1392 | } |
| 1393 | - if ($hide_signatures !== NULL) { |
|
| 1393 | + if ($hide_signatures !== null) { |
|
| 1394 | 1394 | user_save($account, array('hide_signatures' => ($hide_signatures ? 1 : 0))); |
| 1395 | 1395 | } |
| 1396 | - if ($signature !== NULL) { |
|
| 1396 | + if ($signature !== null) { |
|
| 1397 | 1397 | $signature = check_markup($signature); |
| 1398 | 1398 | user_save($account, array('signature' => $signature)); |
| 1399 | 1399 | } |
@@ -1410,7 +1410,7 @@ discard block |
||
| 1410 | 1410 | // Success |
| 1411 | 1411 | $xml = array( |
| 1412 | 1412 | 'edit_forum_preferences' => array( |
| 1413 | - 'success' => NULL, |
|
| 1413 | + 'success' => null, |
|
| 1414 | 1414 | ), |
| 1415 | 1415 | ); |
| 1416 | 1416 | } |
@@ -1443,7 +1443,7 @@ discard block |
||
| 1443 | 1443 | ), |
| 1444 | 1444 | ); |
| 1445 | 1445 | } |
| 1446 | - print xml_to_text(array_to_xml($xml), TRUE, TRUE); |
|
| 1446 | + print xml_to_text(array_to_xml($xml), true, true); |
|
| 1447 | 1447 | } |
| 1448 | 1448 | |
| 1449 | 1449 | /** |
@@ -1455,17 +1455,17 @@ discard block |
||
| 1455 | 1455 | // relevant -- use Drupal data only |
| 1456 | 1456 | |
| 1457 | 1457 | $xml = array(); |
| 1458 | - $boinc_id = !empty($_POST['userid']) ? $_POST['userid'] : (!empty($_GET['userid']) ? $_GET['userid'] : NULL); |
|
| 1458 | + $boinc_id = !empty($_POST['userid']) ? $_POST['userid'] : (!empty($_GET['userid']) ? $_GET['userid'] : null); |
|
| 1459 | 1459 | $uid = boincuser_lookup_uid($boinc_id); |
| 1460 | 1460 | |
| 1461 | 1461 | if ($uid) { |
| 1462 | - $method = !empty($_POST['method']) ? $_POST['method'] : (!empty($_GET['method']) ? $_GET['method'] : NULL); |
|
| 1463 | - $count = !empty($_POST['count']) ? $_POST['count'] : (!empty($_GET['count']) ? $_GET['count'] : NULL); |
|
| 1462 | + $method = !empty($_POST['method']) ? $_POST['method'] : (!empty($_GET['method']) ? $_GET['method'] : null); |
|
| 1463 | + $count = !empty($_POST['count']) ? $_POST['count'] : (!empty($_GET['count']) ? $_GET['count'] : null); |
|
| 1464 | 1464 | if (!$count) $count = 10; |
| 1465 | 1465 | |
| 1466 | 1466 | switch ($method) { |
| 1467 | 1467 | case 'user_posts': |
| 1468 | - $content_length = !empty($_POST['content_length']) ? $_POST['content_length'] : (!empty($_GET['content_length']) ? $_GET['content_length'] : NULL); |
|
| 1468 | + $content_length = !empty($_POST['content_length']) ? $_POST['content_length'] : (!empty($_GET['content_length']) ? $_GET['content_length'] : null); |
|
| 1469 | 1469 | $posts = db_query(" |
| 1470 | 1470 | SELECT |
| 1471 | 1471 | c.cid, |
@@ -1561,7 +1561,7 @@ discard block |
||
| 1561 | 1561 | ), |
| 1562 | 1562 | ); |
| 1563 | 1563 | } |
| 1564 | - print xml_to_text(array_to_xml($xml), TRUE, TRUE); |
|
| 1564 | + print xml_to_text(array_to_xml($xml), true, true); |
|
| 1565 | 1565 | } |
| 1566 | 1566 | |
| 1567 | 1567 | /** |
@@ -1580,9 +1580,9 @@ discard block |
||
| 1580 | 1580 | * in advance on which page a given comment will appear. Link instead to this |
| 1581 | 1581 | * controller function, which can compute the page based on the user's settings |
| 1582 | 1582 | */ |
| 1583 | -function boinccore_url_pagination_handler($type, $object_id = NULL) { |
|
| 1583 | +function boinccore_url_pagination_handler($type, $object_id = null) { |
|
| 1584 | 1584 | global $user; |
| 1585 | - $path = NULL; |
|
| 1585 | + $path = null; |
|
| 1586 | 1586 | $params = array(); |
| 1587 | 1587 | switch ($type) { |
| 1588 | 1588 | case 'boinc-forum': |
@@ -1973,11 +1973,11 @@ discard block |
||
| 1973 | 1973 | $mailing_list = variable_get('boinc_moderator_mailing_list', ''); |
| 1974 | 1974 | $force_individual_notifications = variable_get('boinc_moderator_force_individual_notifications', 0); |
| 1975 | 1975 | |
| 1976 | - if (!$mailing_list OR $force_individual_notifications) { |
|
| 1976 | + if (!$mailing_list or $force_individual_notifications) { |
|
| 1977 | 1977 | // Send individual emails to all moderators |
| 1978 | 1978 | $roles = user_roles(); |
| 1979 | 1979 | $moderator_rid = array_search('moderator', $roles); |
| 1980 | - if ($moderator_rid !== FALSE) { |
|
| 1980 | + if ($moderator_rid !== false) { |
|
| 1981 | 1981 | $settings['recipients'] = array($moderator_rid); |
| 1982 | 1982 | rules_action_mail_to_users_of_role($settings); |
| 1983 | 1983 | } |
@@ -2017,7 +2017,7 @@ discard block |
||
| 2017 | 2017 | 'Attempting to email administrators, but there is no admin email list or site email to send to.', array(), |
| 2018 | 2018 | WATCHDOG_ERROR |
| 2019 | 2019 | ); |
| 2020 | - return FALSE; |
|
| 2020 | + return false; |
|
| 2021 | 2021 | } |
| 2022 | 2022 | } |
| 2023 | 2023 | $settings['to'] = $mailing_list; |
@@ -2038,7 +2038,7 @@ discard block |
||
| 2038 | 2038 | /* |
| 2039 | 2039 | * BOINC wrapper for string translation |
| 2040 | 2040 | */ |
| 2041 | -function bts($string, $args = array(), $langcode = NULL, $context = 'boinc: ', $update = TRUE) { |
|
| 2041 | +function bts($string, $args = array(), $langcode = null, $context = 'boinc: ', $update = true) { |
|
| 2042 | 2042 | if (function_exists('i18nstrings_ts')) { |
| 2043 | 2043 | $string = i18nstrings_ts($context, $string, $langcode, $update); |
| 2044 | 2044 | } |
@@ -2077,7 +2077,7 @@ discard block |
||
| 2077 | 2077 | * Overview of moderation queues |
| 2078 | 2078 | */ |
| 2079 | 2079 | function boinccore_moderation_overview_panel() { |
| 2080 | - $output = '<h2 class="pane-title">' . bts('Moderation', array(), NULL, 'boinc:moderate-profiles') . '</h2>'; |
|
| 2080 | + $output = '<h2 class="pane-title">' . bts('Moderation', array(), null, 'boinc:moderate-profiles') . '</h2>'; |
|
| 2081 | 2081 | $output .= '<ul class="tab-list action-list">'; |
| 2082 | 2082 | if (module_exists('user_profiles')) { |
| 2083 | 2083 | $profile_count = db_result(db_query(" |
@@ -2086,7 +2086,7 @@ discard block |
||
| 2086 | 2086 | WHERE n.type = 'profile' AND n.moderate = 1" |
| 2087 | 2087 | )); |
| 2088 | 2088 | $output .= '<li class="tab primary">'; |
| 2089 | - $output .= l(bts('Unvetted profiles', array(), NULL, 'boinc:moderate-profiles'), 'moderate/profiles'); |
|
| 2089 | + $output .= l(bts('Unvetted profiles', array(), null, 'boinc:moderate-profiles'), 'moderate/profiles'); |
|
| 2090 | 2090 | $output .= '<div class="item-count-wrapper">'; |
| 2091 | 2091 | $output .= '<span class="item-count">' . $profile_count . '</span>'; |
| 2092 | 2092 | $output .= '</div>'; |
@@ -2107,6 +2107,6 @@ discard block |
||
| 2107 | 2107 | |
| 2108 | 2108 | $num_deleted = BoincToken::delete_expired(); |
| 2109 | 2109 | if ($num_deleted>0) { |
| 2110 | - watchdog('boinccore', "Deleted ${num_deleted} tokens from table token", WATCHDOG_NOTICE); |
|
| 2110 | + watchdog('boinccore', "deleted ${num_deleted} tokens from table token", WATCHDOG_NOTICE); |
|
| 2111 | 2111 | } |
| 2112 | 2112 | } |
@@ -29,22 +29,22 @@ discard block |
||
| 29 | 29 | * with defined URL paths |
| 30 | 30 | */ |
| 31 | 31 | function boinccore_menu() { |
| 32 | - $items['node_control'] = array( |
|
| 32 | + $items['node_control'] = array( |
|
| 33 | 33 | 'page callback' => 'boinccore_node_control', |
| 34 | 34 | 'access arguments' => array('access content'), |
| 35 | 35 | 'type' => MENU_CALLBACK |
| 36 | - ); |
|
| 37 | - $items['comment_control'] = array( |
|
| 36 | + ); |
|
| 37 | + $items['comment_control'] = array( |
|
| 38 | 38 | 'page callback' => 'boinccore_comment_control', |
| 39 | 39 | 'access arguments' => array('administer comments'), |
| 40 | 40 | 'type' => MENU_CALLBACK |
| 41 | - ); |
|
| 42 | - $items['goto'] = array( |
|
| 41 | + ); |
|
| 42 | + $items['goto'] = array( |
|
| 43 | 43 | 'page callback' => 'boinccore_url_pagination_handler', |
| 44 | 44 | 'access arguments' => array('access content'), |
| 45 | 45 | 'type' => MENU_CALLBACK |
| 46 | - ); |
|
| 47 | - $items['admin/boinc/community'] = array( |
|
| 46 | + ); |
|
| 47 | + $items['admin/boinc/community'] = array( |
|
| 48 | 48 | 'title' => 'Community', |
| 49 | 49 | 'description' => 'Global settings for community interaction.', |
| 50 | 50 | 'page callback' => 'drupal_get_form', |
@@ -52,8 +52,8 @@ discard block |
||
| 52 | 52 | 'access arguments' => array('administer site configuration'), |
| 53 | 53 | 'type' => MENU_NORMAL_ITEM, |
| 54 | 54 | 'file' => 'boinccore.admin.inc' |
| 55 | - ); |
|
| 56 | - $items['admin/boinc/standard-content-generator'] = array( |
|
| 55 | + ); |
|
| 56 | + $items['admin/boinc/standard-content-generator'] = array( |
|
| 57 | 57 | 'title' => 'Standard page generator', |
| 58 | 58 | 'description' => 'Regenerate standard site content (e.g. Help and About Us |
| 59 | 59 | pages).', |
@@ -62,172 +62,172 @@ discard block |
||
| 62 | 62 | 'access arguments' => array('administer site configuration'), |
| 63 | 63 | 'type' => MENU_NORMAL_ITEM, |
| 64 | 64 | 'file' => 'boinccore.admin.inc' |
| 65 | - ); |
|
| 65 | + ); |
|
| 66 | 66 | |
| 67 | - // BOINC RPC wrappers |
|
| 68 | - $items['lookup_account.php'] = array( |
|
| 67 | + // BOINC RPC wrappers |
|
| 68 | + $items['lookup_account.php'] = array( |
|
| 69 | 69 | 'title' => 'Look up account RPC', |
| 70 | 70 | 'description' => 'RPC for getting the authenticator for a user account.', |
| 71 | 71 | 'page callback' => 'boinccore_lookup_account', |
| 72 | 72 | 'access callback' => TRUE, |
| 73 | 73 | 'type' => MENU_CALLBACK |
| 74 | - ); |
|
| 75 | - $items['am_get_info.php'] = array( |
|
| 74 | + ); |
|
| 75 | + $items['am_get_info.php'] = array( |
|
| 76 | 76 | 'title' => 'Account manager get info RPC', |
| 77 | 77 | 'description' => 'RPC for getting assorted details of a user account.', |
| 78 | 78 | 'page callback' => 'boinccore_am_get_info', |
| 79 | 79 | 'access callback' => TRUE, |
| 80 | 80 | 'type' => MENU_CALLBACK |
| 81 | - ); |
|
| 82 | - $items['am_set_info.php'] = array( |
|
| 81 | + ); |
|
| 82 | + $items['am_set_info.php'] = array( |
|
| 83 | 83 | 'title' => 'Account manager set info RPC', |
| 84 | 84 | 'description' => 'RPC for updating assorted details of a user account.', |
| 85 | 85 | 'page callback' => 'boinccore_am_set_info', |
| 86 | 86 | 'access callback' => TRUE, |
| 87 | 87 | 'type' => MENU_CALLBACK |
| 88 | - ); |
|
| 89 | - $items['am_set_host_info.php'] = array( |
|
| 88 | + ); |
|
| 89 | + $items['am_set_host_info.php'] = array( |
|
| 90 | 90 | 'title' => 'Account manager set host info RPC', |
| 91 | 91 | 'description' => 'RPC for updating the venue for a given host.', |
| 92 | 92 | 'page callback' => 'boinccore_am_set_host_info', |
| 93 | 93 | 'access callback' => TRUE, |
| 94 | 94 | 'type' => MENU_CALLBACK |
| 95 | - ); |
|
| 96 | - $items['show_user.php'] = array( |
|
| 95 | + ); |
|
| 96 | + $items['show_user.php'] = array( |
|
| 97 | 97 | 'title' => 'Show user RPC', |
| 98 | 98 | 'description' => 'RPC for getting assorted details of a user account.', |
| 99 | 99 | 'page callback' => 'boinccore_show_user', |
| 100 | 100 | 'access callback' => TRUE, |
| 101 | 101 | 'type' => MENU_CALLBACK |
| 102 | - ); |
|
| 103 | - $items['pending.php'] = array( |
|
| 102 | + ); |
|
| 103 | + $items['pending.php'] = array( |
|
| 104 | 104 | 'title' => 'Pending credit RPC', |
| 105 | 105 | 'description' => 'RPC for getting pending credit for a given account.', |
| 106 | 106 | 'page callback' => 'boinccore_pending_credit', |
| 107 | 107 | 'access callback' => TRUE, |
| 108 | 108 | 'type' => MENU_CALLBACK |
| 109 | - ); |
|
| 110 | - $items['create_team.php'] = array( |
|
| 109 | + ); |
|
| 110 | + $items['create_team.php'] = array( |
|
| 111 | 111 | 'title' => 'Create team RPC', |
| 112 | 112 | 'description' => 'RPC for creating a new team.', |
| 113 | 113 | 'page callback' => 'boinccore_create_team', |
| 114 | 114 | 'access callback' => TRUE, |
| 115 | 115 | 'type' => MENU_CALLBACK |
| 116 | - ); |
|
| 117 | - $items['team_lookup.php'] = array( |
|
| 116 | + ); |
|
| 117 | + $items['team_lookup.php'] = array( |
|
| 118 | 118 | 'title' => 'Team lookup RPC', |
| 119 | 119 | 'description' => 'RPC for getting info on a team or matching teams.', |
| 120 | 120 | 'page callback' => 'boinccore_team_lookup', |
| 121 | 121 | 'access callback' => TRUE, |
| 122 | 122 | 'type' => MENU_CALLBACK |
| 123 | - ); |
|
| 124 | - $items['team_email_list.php'] = array( |
|
| 123 | + ); |
|
| 124 | + $items['team_email_list.php'] = array( |
|
| 125 | 125 | 'title' => 'Get team member list RPC', |
| 126 | 126 | 'description' => 'RPC for getting a list of members of a given team.', |
| 127 | 127 | 'page callback' => 'boinccore_team_email_list', |
| 128 | 128 | 'access callback' => TRUE, |
| 129 | 129 | 'type' => MENU_CALLBACK |
| 130 | - ); |
|
| 131 | - $items['edit_forum_preferences_action.php'] = array( |
|
| 130 | + ); |
|
| 131 | + $items['edit_forum_preferences_action.php'] = array( |
|
| 132 | 132 | 'title' => 'Forum preferences RPC', |
| 133 | 133 | 'description' => 'RPC for setting forum preferences for a given user.', |
| 134 | 134 | 'page callback' => 'boinccore_edit_forum_preferences', |
| 135 | 135 | 'access callback' => TRUE, |
| 136 | 136 | 'type' => MENU_CALLBACK |
| 137 | - ); |
|
| 138 | - $items['forum_get_data.php'] = array( |
|
| 137 | + ); |
|
| 138 | + $items['forum_get_data.php'] = array( |
|
| 139 | 139 | 'title' => 'Forum get data RPC', |
| 140 | 140 | 'description' => 'RPC for getting recent forum activity for a given user.', |
| 141 | 141 | 'page callback' => 'boinccore_forum_get_data', |
| 142 | 142 | 'access callback' => TRUE, |
| 143 | 143 | 'type' => MENU_CALLBACK |
| 144 | - ); |
|
| 145 | - $items['apps.php'] = array( |
|
| 144 | + ); |
|
| 145 | + $items['apps.php'] = array( |
|
| 146 | 146 | 'title' => 'Apps RPC', |
| 147 | 147 | 'description' => 'RPC for getting the applications in the system.', |
| 148 | 148 | 'page callback' => 'boinccore_apps', |
| 149 | 149 | 'access callback' => TRUE, |
| 150 | 150 | 'type' => MENU_CALLBACK |
| 151 | - ); |
|
| 151 | + ); |
|
| 152 | 152 | |
| 153 | - return $items; |
|
| 153 | + return $items; |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | /** |
| 157 | 157 | * Implementation of hook_menu_alter() |
| 158 | 158 | */ |
| 159 | 159 | function boinccore_menu_alter(&$items) { |
| 160 | - // If using Solr search and not core Drupal search, disable core search! |
|
| 161 | - if (module_exists('global_search_solr') AND !module_exists('global_search')) { |
|
| 160 | + // If using Solr search and not core Drupal search, disable core search! |
|
| 161 | + if (module_exists('global_search_solr') AND !module_exists('global_search')) { |
|
| 162 | 162 | // Add permission to user search. |
| 163 | 163 | $check = array( |
| 164 | - 'search/node/%menu_tail', |
|
| 165 | - 'search/user/%menu_tail', |
|
| 166 | - 'user/autocomplete' |
|
| 164 | + 'search/node/%menu_tail', |
|
| 165 | + 'search/user/%menu_tail', |
|
| 166 | + 'user/autocomplete' |
|
| 167 | 167 | ); |
| 168 | 168 | foreach ($check as $path) { |
| 169 | - if (isset($items[$path])) { |
|
| 169 | + if (isset($items[$path])) { |
|
| 170 | 170 | $items[$path]['access callback'] = FALSE; |
| 171 | - } |
|
| 171 | + } |
|
| 172 | 172 | } |
| 173 | - } |
|
| 174 | - // If using content profile module (for user profiles) setup special |
|
| 175 | - // delete page. |
|
| 176 | - if (module_exists('content_profile')) { |
|
| 173 | + } |
|
| 174 | + // If using content profile module (for user profiles) setup special |
|
| 175 | + // delete page. |
|
| 176 | + if (module_exists('content_profile')) { |
|
| 177 | 177 | $items['node/%node/delete'] = array( |
| 178 | - 'title' => 'Delete', |
|
| 179 | - 'page callback' => 'drupal_get_form', |
|
| 180 | - 'page arguments' => array('boinccore_delete_confirm', 1), |
|
| 181 | - 'access callback' => 'node_access', |
|
| 182 | - 'access arguments' => array('delete', 1), |
|
| 183 | - 'module' => 'boinccore', |
|
| 184 | - 'file' => 'includes/boinccore.forms.inc', |
|
| 185 | - 'weight' => 1, |
|
| 186 | - 'type' => MENU_CALLBACK, |
|
| 178 | + 'title' => 'Delete', |
|
| 179 | + 'page callback' => 'drupal_get_form', |
|
| 180 | + 'page arguments' => array('boinccore_delete_confirm', 1), |
|
| 181 | + 'access callback' => 'node_access', |
|
| 182 | + 'access arguments' => array('delete', 1), |
|
| 183 | + 'module' => 'boinccore', |
|
| 184 | + 'file' => 'includes/boinccore.forms.inc', |
|
| 185 | + 'weight' => 1, |
|
| 186 | + 'type' => MENU_CALLBACK, |
|
| 187 | 187 | ); |
| 188 | - } |
|
| 188 | + } |
|
| 189 | 189 | |
| 190 | - // 'Remove' menu paths for ignore_user and privatemsg |
|
| 191 | - // (pm_block_user) module which we have 'overridden' with |
|
| 192 | - // boincwork's own functions. |
|
| 193 | - if (module_exists('ignore_user')) { |
|
| 190 | + // 'Remove' menu paths for ignore_user and privatemsg |
|
| 191 | + // (pm_block_user) module which we have 'overridden' with |
|
| 192 | + // boincwork's own functions. |
|
| 193 | + if (module_exists('ignore_user')) { |
|
| 194 | 194 | $check = array( |
| 195 | - 'ignore_user/add', |
|
| 196 | - 'ignore_user/remove', |
|
| 195 | + 'ignore_user/add', |
|
| 196 | + 'ignore_user/remove', |
|
| 197 | 197 | ); |
| 198 | 198 | foreach ($check as $path) { |
| 199 | - if (isset($items[$path])) { |
|
| 199 | + if (isset($items[$path])) { |
|
| 200 | 200 | $items[$path]['access callback'] = FALSE; |
| 201 | - } |
|
| 201 | + } |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | // Redirect user to privacy prefs page. |
| 205 | 205 | $path1 = 'ignore_user/list'; |
| 206 | 206 | if (isset($items[$path1])) { |
| 207 | - $items[$path1]['page callback'] = 'drupal_goto'; |
|
| 208 | - $items[$path1]['page arguments'] = array('account/prefs/privacy'); |
|
| 207 | + $items[$path1]['page callback'] = 'drupal_goto'; |
|
| 208 | + $items[$path1]['page arguments'] = array('account/prefs/privacy'); |
|
| 209 | + } |
|
| 209 | 210 | } |
| 210 | - } |
|
| 211 | 211 | |
| 212 | - if (module_exists('pm_block_user')) { |
|
| 212 | + if (module_exists('pm_block_user')) { |
|
| 213 | 213 | $check = array( |
| 214 | - 'messages/block/%user', |
|
| 214 | + 'messages/block/%user', |
|
| 215 | 215 | ); |
| 216 | 216 | foreach ($check as $path) { |
| 217 | - if (isset($items[$path])) { |
|
| 217 | + if (isset($items[$path])) { |
|
| 218 | 218 | $items[$path]['access callback'] = FALSE; |
| 219 | - } |
|
| 219 | + } |
|
| 220 | + } |
|
| 220 | 221 | } |
| 221 | - } |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | /** |
| 225 | 225 | * Implementation of hook_enable() |
| 226 | 226 | */ |
| 227 | 227 | function boinccore_enable() { |
| 228 | - // Automatically try to establish standard site content when this module is |
|
| 229 | - // enabled (e.g. Help and About Us pages) |
|
| 230 | - boinccore_admin_default_content_generate(); |
|
| 228 | + // Automatically try to establish standard site content when this module is |
|
| 229 | + // enabled (e.g. Help and About Us pages) |
|
| 230 | + boinccore_admin_default_content_generate(); |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | /** |
@@ -240,14 +240,14 @@ discard block |
||
| 240 | 240 | * See: https://www.drupal.org/node/339958#comment-3012662 |
| 241 | 241 | */ |
| 242 | 242 | function boinccore_boot() { |
| 243 | - global $user, $language; |
|
| 244 | - $cache = variable_get('cache', CACHE_DISABLED); |
|
| 245 | - $language_negotiation = variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE); |
|
| 246 | - |
|
| 247 | - // If we have an anonymous user, page cache is enabled, the URL has no prefix |
|
| 248 | - // and browser language negotiation is set, we perform a redirect to the |
|
| 249 | - // prefixed URL. |
|
| 250 | - if (empty($user->uid) && $cache != CACHE_DISABLED && $language_negotiation == LANGUAGE_NEGOTIATION_PATH) { |
|
| 243 | + global $user, $language; |
|
| 244 | + $cache = variable_get('cache', CACHE_DISABLED); |
|
| 245 | + $language_negotiation = variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE); |
|
| 246 | + |
|
| 247 | + // If we have an anonymous user, page cache is enabled, the URL has no prefix |
|
| 248 | + // and browser language negotiation is set, we perform a redirect to the |
|
| 249 | + // prefixed URL. |
|
| 250 | + if (empty($user->uid) && $cache != CACHE_DISABLED && $language_negotiation == LANGUAGE_NEGOTIATION_PATH) { |
|
| 251 | 251 | $args = isset($_GET['q']) ? explode('/', $_GET['q']) : array(); |
| 252 | 252 | $prefix = array_shift($args); |
| 253 | 253 | |
@@ -259,24 +259,24 @@ discard block |
||
| 259 | 259 | // so call this backported Drupal 7 language negotation function, which |
| 260 | 260 | // does both case insensitive and longest prefix matching |
| 261 | 261 | if (function_exists('locale_language_from_browser')) { |
| 262 | - $language = locale_language_from_browser(); |
|
| 262 | + $language = locale_language_from_browser(); |
|
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | if (!empty($language->prefix) && $prefix != $language->prefix) { |
| 266 | - // We need full path support to perform the redirect. |
|
| 267 | - drupal_bootstrap(DRUPAL_BOOTSTRAP_PATH); |
|
| 268 | - |
|
| 269 | - require_once './includes/common.inc'; |
|
| 270 | - $url = url($_GET['q'], array('query' => drupal_query_string_encode($_GET, array('q')))); |
|
| 271 | - $code = variable_get('locale_redirect_http_code', 302); |
|
| 272 | - |
|
| 273 | - // Since we are in a hook_boot() implementation cache mode is normal, so |
|
| 274 | - // we can safely call hook_exit(). |
|
| 275 | - bootstrap_invoke_all('exit'); |
|
| 276 | - header("Location: $url", TRUE, $code); |
|
| 277 | - exit; |
|
| 266 | + // We need full path support to perform the redirect. |
|
| 267 | + drupal_bootstrap(DRUPAL_BOOTSTRAP_PATH); |
|
| 268 | + |
|
| 269 | + require_once './includes/common.inc'; |
|
| 270 | + $url = url($_GET['q'], array('query' => drupal_query_string_encode($_GET, array('q')))); |
|
| 271 | + $code = variable_get('locale_redirect_http_code', 302); |
|
| 272 | + |
|
| 273 | + // Since we are in a hook_boot() implementation cache mode is normal, so |
|
| 274 | + // we can safely call hook_exit(). |
|
| 275 | + bootstrap_invoke_all('exit'); |
|
| 276 | + header("Location: $url", TRUE, $code); |
|
| 277 | + exit; |
|
| 278 | + } |
|
| 278 | 279 | } |
| 279 | - } |
|
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | |
@@ -289,9 +289,9 @@ discard block |
||
| 289 | 289 | * |
| 290 | 290 | * Obsolete in Drupal 7... |
| 291 | 291 | */ |
| 292 | - function locale_language_from_browser() { |
|
| 292 | + function locale_language_from_browser() { |
|
| 293 | 293 | if (empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { |
| 294 | - return FALSE; |
|
| 294 | + return FALSE; |
|
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | $languages = language_list('enabled'); |
@@ -306,14 +306,14 @@ discard block |
||
| 306 | 306 | // Samples: "hu, en-us;q=0.66, en;q=0.33", "hu,en-us;q=0.5" |
| 307 | 307 | $browser_langcodes = array(); |
| 308 | 308 | if (preg_match_all('@(?<=[, ]|^)([a-zA-Z-]+|\*)(?:;q=([0-9.]+))?(?:$|\s*,\s*)@', trim($_SERVER['HTTP_ACCEPT_LANGUAGE']), $matches, PREG_SET_ORDER)) { |
| 309 | - foreach ($matches as $match) { |
|
| 309 | + foreach ($matches as $match) { |
|
| 310 | 310 | // We can safely use strtolower() here, tags are ASCII. |
| 311 | 311 | // RFC2616 mandates that the decimal part is no more than three digits, |
| 312 | 312 | // so we multiply the qvalue by 1000 to avoid floating point comparisons. |
| 313 | 313 | $langcode = strtolower($match[1]); |
| 314 | 314 | $qvalue = isset($match[2]) ? (float) $match[2] : 1; |
| 315 | 315 | $browser_langcodes[$langcode] = (int) ($qvalue * 1000); |
| 316 | - } |
|
| 316 | + } |
|
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | // We should take pristine values from the HTTP headers, but Internet Explorer |
@@ -325,10 +325,10 @@ discard block |
||
| 325 | 325 | // http://blogs.msdn.com/b/ie/archive/2006/10/17/accept-language-header-for-internet-explorer-7.aspx |
| 326 | 326 | asort($browser_langcodes); |
| 327 | 327 | foreach ($browser_langcodes as $langcode => $qvalue) { |
| 328 | - $generic_tag = strtok($langcode, '-'); |
|
| 329 | - if (!isset($browser_langcodes[$generic_tag])) { |
|
| 328 | + $generic_tag = strtok($langcode, '-'); |
|
| 329 | + if (!isset($browser_langcodes[$generic_tag])) { |
|
| 330 | 330 | $browser_langcodes[$generic_tag] = $qvalue; |
| 331 | - } |
|
| 331 | + } |
|
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | // Find the enabled language with the greatest qvalue, following the rules |
@@ -337,156 +337,156 @@ discard block |
||
| 337 | 337 | $best_match_language = FALSE; |
| 338 | 338 | $max_qvalue = 0; |
| 339 | 339 | foreach ($languages as $langcode => $language) { |
| 340 | - // Language tags are case insensitive (RFC2616, sec 3.10). |
|
| 341 | - $langcode = strtolower($langcode); |
|
| 340 | + // Language tags are case insensitive (RFC2616, sec 3.10). |
|
| 341 | + $langcode = strtolower($langcode); |
|
| 342 | 342 | |
| 343 | - // If nothing matches below, the default qvalue is the one of the wildcard |
|
| 344 | - // language, if set, or is 0 (which will never match). |
|
| 345 | - $qvalue = isset($browser_langcodes['*']) ? $browser_langcodes['*'] : 0; |
|
| 343 | + // If nothing matches below, the default qvalue is the one of the wildcard |
|
| 344 | + // language, if set, or is 0 (which will never match). |
|
| 345 | + $qvalue = isset($browser_langcodes['*']) ? $browser_langcodes['*'] : 0; |
|
| 346 | 346 | |
| 347 | - // Find the longest possible prefix of the browser-supplied language |
|
| 348 | - // ('the language-range') that matches this site language ('the language tag'). |
|
| 349 | - $prefix = $langcode; |
|
| 350 | - do { |
|
| 347 | + // Find the longest possible prefix of the browser-supplied language |
|
| 348 | + // ('the language-range') that matches this site language ('the language tag'). |
|
| 349 | + $prefix = $langcode; |
|
| 350 | + do { |
|
| 351 | 351 | if (isset($browser_langcodes[$prefix])) { |
| 352 | - $qvalue = $browser_langcodes[$prefix]; |
|
| 353 | - break; |
|
| 352 | + $qvalue = $browser_langcodes[$prefix]; |
|
| 353 | + break; |
|
| 354 | 354 | } |
| 355 | - } |
|
| 356 | - while ($prefix = substr($prefix, 0, strrpos($prefix, '-'))); |
|
| 355 | + } |
|
| 356 | + while ($prefix = substr($prefix, 0, strrpos($prefix, '-'))); |
|
| 357 | 357 | |
| 358 | - // Find the best match. |
|
| 359 | - if ($qvalue > $max_qvalue) { |
|
| 358 | + // Find the best match. |
|
| 359 | + if ($qvalue > $max_qvalue) { |
|
| 360 | 360 | $best_match_language = $language; |
| 361 | 361 | $max_qvalue = $qvalue; |
| 362 | - } |
|
| 362 | + } |
|
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | return $best_match_language; |
| 366 | - } |
|
| 366 | + } |
|
| 367 | 367 | } |
| 368 | 368 | |
| 369 | 369 | /** |
| 370 | 370 | * Implementation of hook_cron() |
| 371 | 371 | */ |
| 372 | 372 | function boinccore_cron() { |
| 373 | - // Notify moderators if there is site content that requires moderator action |
|
| 374 | - $items_in_queue = boincuser_moderation_queue_count('cron'); |
|
| 375 | - $last_notification = variable_get('boinccore_last_content_moderation_reminder', 0); |
|
| 376 | - if ($items_in_queue AND $last_notification < time() - 24*60*60) { |
|
| 373 | + // Notify moderators if there is site content that requires moderator action |
|
| 374 | + $items_in_queue = boincuser_moderation_queue_count('cron'); |
|
| 375 | + $last_notification = variable_get('boinccore_last_content_moderation_reminder', 0); |
|
| 376 | + if ($items_in_queue AND $last_notification < time() - 24*60*60) { |
|
| 377 | 377 | global $base_url; |
| 378 | 378 | global $base_path; |
| 379 | 379 | $site_name = variable_get('site_name', 'Drupal-BOINC'); |
| 380 | 380 | $site_url = $base_url . $base_path; |
| 381 | 381 | $settings = array( |
| 382 | - 'from' => '', |
|
| 383 | - 'subject' => "Content at {$site_name} is awaiting moderation", |
|
| 384 | - 'message' => '' |
|
| 385 | - . "Please visit the moderation queue page to review content that " |
|
| 386 | - . "requires moderator action: \n" |
|
| 387 | - . "\n" |
|
| 388 | - . "{$site_url}moderate", |
|
| 382 | + 'from' => '', |
|
| 383 | + 'subject' => "Content at {$site_name} is awaiting moderation", |
|
| 384 | + 'message' => '' |
|
| 385 | + . "Please visit the moderation queue page to review content that " |
|
| 386 | + . "requires moderator action: \n" |
|
| 387 | + . "\n" |
|
| 388 | + . "{$site_url}moderate", |
|
| 389 | 389 | ); |
| 390 | 390 | boinccore_rules_action_mail_to_moderators($settings); |
| 391 | 391 | variable_set('boinccore_last_content_moderation_reminder', time()); |
| 392 | - } |
|
| 392 | + } |
|
| 393 | 393 | |
| 394 | - // Delete expired tokens in BOINC DB |
|
| 395 | - _boinccore_delete_expired_tokens(); |
|
| 394 | + // Delete expired tokens in BOINC DB |
|
| 395 | + _boinccore_delete_expired_tokens(); |
|
| 396 | 396 | } |
| 397 | 397 | |
| 398 | 398 | /** |
| 399 | 399 | * Implementation of hook_rules_action_info(). |
| 400 | 400 | */ |
| 401 | 401 | function boinccore_rules_action_info() { |
| 402 | - return array( |
|
| 402 | + return array( |
|
| 403 | 403 | 'boinccore_rules_action_mail_to_moderators' => array( |
| 404 | - 'label' => t('Notify moderators via email'), |
|
| 405 | - 'module' => 'BOINC core', |
|
| 406 | - 'eval input' => array('subject', 'message', 'from'), |
|
| 404 | + 'label' => t('Notify moderators via email'), |
|
| 405 | + 'module' => 'BOINC core', |
|
| 406 | + 'eval input' => array('subject', 'message', 'from'), |
|
| 407 | 407 | ), |
| 408 | 408 | 'boinccore_rules_action_mark_content_for_moderation' => array( |
| 409 | - 'label' => t('Mark content for moderation'), |
|
| 410 | - 'arguments' => array( |
|
| 409 | + 'label' => t('Mark content for moderation'), |
|
| 410 | + 'arguments' => array( |
|
| 411 | 411 | 'node' => array('type' => 'node', 'label' => t('Content')), |
| 412 | - ), |
|
| 413 | - 'module' => 'BOINC core', |
|
| 412 | + ), |
|
| 413 | + 'module' => 'BOINC core', |
|
| 414 | 414 | ), |
| 415 | 415 | 'boinccore_rules_action_mail_to_admins' => array( |
| 416 | - 'label' => t('Notify admins via email'), |
|
| 417 | - 'module' => 'BOINC core', |
|
| 418 | - 'eval input' => array('subject', 'message', 'from'), |
|
| 416 | + 'label' => t('Notify admins via email'), |
|
| 417 | + 'module' => 'BOINC core', |
|
| 418 | + 'eval input' => array('subject', 'message', 'from'), |
|
| 419 | 419 | ), |
| 420 | - ); |
|
| 420 | + ); |
|
| 421 | 421 | } |
| 422 | 422 | |
| 423 | 423 | /** |
| 424 | 424 | * Implementation of hook_form_alter() |
| 425 | 425 | */ |
| 426 | 426 | function boinccore_form_alter(&$form, $form_state, $form_id) { |
| 427 | - global $user; |
|
| 428 | - $account = user_load($user->uid); |
|
| 429 | - switch ($form_id) { |
|
| 430 | - // Comment form |
|
| 431 | - case 'comment_form': |
|
| 427 | + global $user; |
|
| 428 | + $account = user_load($user->uid); |
|
| 429 | + switch ($form_id) { |
|
| 430 | + // Comment form |
|
| 431 | + case 'comment_form': |
|
| 432 | 432 | $user_image = boincuser_get_user_profile_image($user->uid); |
| 433 | 433 | $user_info = '<div class="user">'; |
| 434 | 434 | if ($user_image) { |
| 435 | - $user_info .= ' <div class="picture">'; |
|
| 436 | - if (is_array($user_image) AND $user_image['image']['filepath']) { |
|
| 435 | + $user_info .= ' <div class="picture">'; |
|
| 436 | + if (is_array($user_image) AND $user_image['image']['filepath']) { |
|
| 437 | 437 | $user_info .= theme('imagefield_image', $user_image['image'], $user_image['alt'], $user_image['alt'], array(), false); |
| 438 | - } |
|
| 439 | - elseif (is_string($user_image)) { |
|
| 438 | + } |
|
| 439 | + elseif (is_string($user_image)) { |
|
| 440 | 440 | $user_info .= '<img src="' . $user_image . '"/>'; |
| 441 | - } |
|
| 442 | - $user_info .= ' </div>'; |
|
| 441 | + } |
|
| 442 | + $user_info .= ' </div>'; |
|
| 443 | 443 | } |
| 444 | 444 | $user_info .= ' <div class="name">' . theme('username', $account) . '</div>'; |
| 445 | 445 | if ($account->uid) { |
| 446 | - //$user_info .= ' <div class="join-date">Joined: ' . date('j M y', $account->created) . '</div>'; |
|
| 447 | - //$user_info .= ' <div class="post-count">Posts: ' . $account->post_count . '</div>'; |
|
| 448 | - //$user_info .= ' <div class="credit">Credit: ' . $account->boincuser_total_credit . '</div>'; |
|
| 449 | - //$user_info .= ' <div class="rac">RAC: ' . $account->boincuser_expavg_credit . '</div>'; |
|
| 446 | + //$user_info .= ' <div class="join-date">Joined: ' . date('j M y', $account->created) . '</div>'; |
|
| 447 | + //$user_info .= ' <div class="post-count">Posts: ' . $account->post_count . '</div>'; |
|
| 448 | + //$user_info .= ' <div class="credit">Credit: ' . $account->boincuser_total_credit . '</div>'; |
|
| 449 | + //$user_info .= ' <div class="rac">RAC: ' . $account->boincuser_expavg_credit . '</div>'; |
|
| 450 | 450 | } |
| 451 | 451 | $user_info .= '</div>'; |
| 452 | 452 | array_unshift($form, array( |
| 453 | - 'user_info' => array( |
|
| 453 | + 'user_info' => array( |
|
| 454 | 454 | '#value' => $user_info, |
| 455 | - ), |
|
| 456 | - 'comment_form_prefix' => array( |
|
| 455 | + ), |
|
| 456 | + 'comment_form_prefix' => array( |
|
| 457 | 457 | '#value' => '<div class="form-body">', |
| 458 | - ), |
|
| 458 | + ), |
|
| 459 | 459 | )); |
| 460 | 460 | $form['comment_form_suffix'] = array( |
| 461 | - '#value' => '</div>', |
|
| 461 | + '#value' => '</div>', |
|
| 462 | 462 | ); |
| 463 | 463 | |
| 464 | 464 | module_load_include('inc', 'bbcode', 'bbcode-help'); |
| 465 | 465 | $form['bbcode_help'] = array( |
| 466 | - '#title' => bts('BBcode help', array(), NULL, 'boinc:help-with-user-input-with-BBCode'), |
|
| 467 | - '#type' => 'fieldset', |
|
| 468 | - '#attributes' => array( |
|
| 466 | + '#title' => bts('BBcode help', array(), NULL, 'boinc:help-with-user-input-with-BBCode'), |
|
| 467 | + '#type' => 'fieldset', |
|
| 468 | + '#attributes' => array( |
|
| 469 | 469 | 'class' => 'bbcode_help', |
| 470 | - ), |
|
| 471 | - '#collapsible' => TRUE, |
|
| 472 | - '#collapsed' => TRUE, |
|
| 473 | - 'content' => array( |
|
| 470 | + ), |
|
| 471 | + '#collapsible' => TRUE, |
|
| 472 | + '#collapsed' => TRUE, |
|
| 473 | + 'content' => array( |
|
| 474 | 474 | '#value' => _bbcode_filter_tip(), |
| 475 | - ), |
|
| 475 | + ), |
|
| 476 | 476 | ); |
| 477 | 477 | |
| 478 | 478 | // If a specific comment is being referenced, go back to it on cancel |
| 479 | 479 | if ($comment_ref = $form['pid']['#value']) { |
| 480 | - $cancel_url = "goto/comment/{$comment_ref}"; |
|
| 480 | + $cancel_url = "goto/comment/{$comment_ref}"; |
|
| 481 | 481 | } |
| 482 | 482 | else { |
| 483 | - $cancel_url = "node/{$form['nid']['#value']}"; |
|
| 483 | + $cancel_url = "node/{$form['nid']['#value']}"; |
|
| 484 | 484 | } |
| 485 | 485 | |
| 486 | 486 | // Wrap action buttons for styling consistency |
| 487 | 487 | $form['buttons']['form control tabs prefix'] = array( |
| 488 | - '#value' => '<ul class="form-control tab-list">', |
|
| 489 | - '#weight' => 1001, |
|
| 488 | + '#value' => '<ul class="form-control tab-list">', |
|
| 489 | + '#weight' => 1001, |
|
| 490 | 490 | ); |
| 491 | 491 | $form['buttons']['submit'] = $form['submit']; |
| 492 | 492 | unset($form['submit']); |
@@ -505,12 +505,12 @@ discard block |
||
| 505 | 505 | $form['buttons']['preview']['#suffix'] = '</li>'; |
| 506 | 506 | $form['buttons']['preview']['#weight'] = 1003; |
| 507 | 507 | $form['buttons']['cancel'] = array( |
| 508 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $cancel_url) . '</li>', |
|
| 509 | - '#weight' => 1004, |
|
| 508 | + '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $cancel_url) . '</li>', |
|
| 509 | + '#weight' => 1004, |
|
| 510 | 510 | ); |
| 511 | 511 | $form['buttons']['form control tabs suffix'] = array( |
| 512 | - '#value' => '</ul>', |
|
| 513 | - '#weight' => 1010, |
|
| 512 | + '#value' => '</ul>', |
|
| 513 | + '#weight' => 1010, |
|
| 514 | 514 | ); |
| 515 | 515 | |
| 516 | 516 | // Remove redundant name field |
@@ -526,38 +526,38 @@ discard block |
||
| 526 | 526 | $community_role = array_search('community member', user_roles(true)); |
| 527 | 527 | $unrestricted_role = array_search('verified contributor', user_roles(true)); |
| 528 | 528 | if ( (isset($account->roles[$community_role])) and (!isset($account->roles[$unrestricted_role])) ) { |
| 529 | - if ($node->type == 'forum') { |
|
| 529 | + if ($node->type == 'forum') { |
|
| 530 | 530 | if (module_exists('captcha')) { |
| 531 | - $form['comment_captcha'] = array( |
|
| 531 | + $form['comment_captcha'] = array( |
|
| 532 | 532 | '#type' => 'captcha', |
| 533 | 533 | '#weight' => 1000, |
| 534 | - ); |
|
| 534 | + ); |
|
| 535 | 535 | } |
| 536 | - } |
|
| 537 | - else { |
|
| 536 | + } |
|
| 537 | + else { |
|
| 538 | 538 | $form = NULL; |
| 539 | 539 | $form['from'] = array( |
| 540 | - '#type' => 'item', |
|
| 541 | - '#value' => 'You do not have permission to post comments in this forum.', |
|
| 540 | + '#type' => 'item', |
|
| 541 | + '#value' => 'You do not have permission to post comments in this forum.', |
|
| 542 | 542 | ); |
| 543 | - } |
|
| 543 | + } |
|
| 544 | 544 | } |
| 545 | 545 | |
| 546 | 546 | break; |
| 547 | 547 | |
| 548 | - // Forum node form |
|
| 549 | - case 'forum_node_form': |
|
| 548 | + // Forum node form |
|
| 549 | + case 'forum_node_form': |
|
| 550 | 550 | case 'team_forum_node_form': |
| 551 | 551 | $forum_id = key($form['#node']->taxonomy); |
| 552 | 552 | $form['buttons']['separator_bottom'] = array( |
| 553 | - '#value' => '<div class="separator buttons"></div>', |
|
| 554 | - '#weight' => 999, |
|
| 553 | + '#value' => '<div class="separator buttons"></div>', |
|
| 554 | + '#weight' => 999, |
|
| 555 | 555 | ); |
| 556 | 556 | |
| 557 | 557 | // Wrap action buttons for styling consistency |
| 558 | 558 | $form['buttons']['form control tabs prefix'] = array( |
| 559 | - '#value' => '<ul class="form-control tab-list">', |
|
| 560 | - '#weight' => 1001, |
|
| 559 | + '#value' => '<ul class="form-control tab-list">', |
|
| 560 | + '#weight' => 1001, |
|
| 561 | 561 | ); |
| 562 | 562 | $form['buttons']['submit']['#prefix'] = '<li class="first tab">'; |
| 563 | 563 | $form['buttons']['submit']['#value'] = bts('Post topic', array(), NULL, 'boinc:post-forum-comment'); |
@@ -570,28 +570,28 @@ discard block |
||
| 570 | 570 | $form['buttons']['preview_changes']['#suffix'] = '</li>'; |
| 571 | 571 | $form['buttons']['preview_changes']['#weight'] = 1004; |
| 572 | 572 | $form['buttons']['cancel'] = array( |
| 573 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "community/forum/{$forum_id}") . '</li>', |
|
| 574 | - '#weight' => 1005, |
|
| 573 | + '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "community/forum/{$forum_id}") . '</li>', |
|
| 574 | + '#weight' => 1005, |
|
| 575 | 575 | ); |
| 576 | 576 | $form['buttons']['form control tabs suffix'] = array( |
| 577 | - '#value' => '</ul>', |
|
| 578 | - '#weight' => 1010, |
|
| 577 | + '#value' => '</ul>', |
|
| 578 | + '#weight' => 1010, |
|
| 579 | 579 | ); |
| 580 | 580 | |
| 581 | 581 | // Add captcha for role='community member' |
| 582 | 582 | $community_role = array_search('community member', user_roles(true)); |
| 583 | 583 | $unrestricted_role = array_search('verified contributor', user_roles(true)); |
| 584 | 584 | if ( (isset($account->roles[$community_role])) and (!isset($account->roles[$unrestricted_role])) ) { |
| 585 | - if (module_exists('captcha')) { |
|
| 585 | + if (module_exists('captcha')) { |
|
| 586 | 586 | $form['comment_captcha'] = array( |
| 587 | - '#type' => 'captcha', |
|
| 588 | - '#weight' => 1000, |
|
| 587 | + '#type' => 'captcha', |
|
| 588 | + '#weight' => 1000, |
|
| 589 | 589 | ); |
| 590 | - } |
|
| 590 | + } |
|
| 591 | 591 | } |
| 592 | 592 | |
| 593 | 593 | break; |
| 594 | - case 'boinccore_delete_confirm': |
|
| 594 | + case 'boinccore_delete_confirm': |
|
| 595 | 595 | // Wrap action buttons for styling consistency |
| 596 | 596 | $form['actions']['#prefix'] = '<ul class="form-control tab-list">'; |
| 597 | 597 | $form['actions']['#suffix'] = '</ul>'; |
@@ -601,7 +601,7 @@ discard block |
||
| 601 | 601 | $form['actions']['cancel']['#prefix'] = '<li class="tab">'; |
| 602 | 602 | $form['actions']['cancel']['#suffix'] = '</li>'; |
| 603 | 603 | break; |
| 604 | - default: |
|
| 604 | + default: |
|
| 605 | 605 | } |
| 606 | 606 | } |
| 607 | 607 | |
@@ -609,61 +609,61 @@ discard block |
||
| 609 | 609 | * Implementation of hook_link_alter() |
| 610 | 610 | */ |
| 611 | 611 | function boinccore_link_alter(&$links, $node, $comment = NULL) { |
| 612 | - //echo '<pre>' . print_r($links, true) . '</pre>'; |
|
| 613 | - foreach ($links as $module => $link) { |
|
| 612 | + //echo '<pre>' . print_r($links, true) . '</pre>'; |
|
| 613 | + foreach ($links as $module => $link) { |
|
| 614 | 614 | // Remove the ignore user link |
| 615 | 615 | if (strstr($module, 'ignore_user')) { |
| 616 | - unset($links[$module]); |
|
| 616 | + unset($links[$module]); |
|
| 617 | 617 | } |
| 618 | - } |
|
| 619 | - // Node first, then comment: to be consistent with boinccore_link() function |
|
| 620 | - if (!($comment)) { |
|
| 618 | + } |
|
| 619 | + // Node first, then comment: to be consistent with boinccore_link() function |
|
| 620 | + if (!($comment)) { |
|
| 621 | 621 | // modify the comment_add link |
| 622 | 622 | if (isset($links['comment_add'])) { |
| 623 | - $links['comment_add']['title'] = bts('reply', array(), NULL, 'boinc:forum-reply-to-comment'); |
|
| 624 | - $links['comment_add']['attributes'] = array( |
|
| 625 | - 'title' => bts('Reply to this comment', array(), NULL, 'boinc:forum-reply-to-comment') |
|
| 626 | - ); |
|
| 623 | + $links['comment_add']['title'] = bts('reply', array(), NULL, 'boinc:forum-reply-to-comment'); |
|
| 624 | + $links['comment_add']['attributes'] = array( |
|
| 625 | + 'title' => bts('Reply to this comment', array(), NULL, 'boinc:forum-reply-to-comment') |
|
| 626 | + ); |
|
| 627 | 627 | } |
| 628 | 628 | // modify quote link |
| 629 | 629 | if (isset($links['quote'])) { |
| 630 | - $links['quote']['attributes'] = array( |
|
| 631 | - 'title' => bts('Reply to this topic with a quote', array(), NULL, 'boinc:forum-reply-to-comment') |
|
| 632 | - ); |
|
| 630 | + $links['quote']['attributes'] = array( |
|
| 631 | + 'title' => bts('Reply to this topic with a quote', array(), NULL, 'boinc:forum-reply-to-comment') |
|
| 632 | + ); |
|
| 633 | 633 | } |
| 634 | - } |
|
| 635 | - else { |
|
| 634 | + } |
|
| 635 | + else { |
|
| 636 | 636 | // Standard EDIT, DELETE, and REPLY links are created by Drupal, but we want to alter them |
| 637 | 637 | if (isset($links['comment_delete'])) { |
| 638 | - $links['comment_delete']['attributes'] = array( |
|
| 639 | - 'title' => bts('Delete this comment', array(), NULL, 'boinc:forum-delete-comment') |
|
| 640 | - ); |
|
| 638 | + $links['comment_delete']['attributes'] = array( |
|
| 639 | + 'title' => bts('Delete this comment', array(), NULL, 'boinc:forum-delete-comment') |
|
| 640 | + ); |
|
| 641 | 641 | } |
| 642 | 642 | if (isset($links['comment_edit'])) { |
| 643 | - $links['comment_edit']['attributes'] = array( |
|
| 644 | - 'title' => bts('Edit this comment', array(), NULL, 'boinc:forum-edit-comment') |
|
| 645 | - ); |
|
| 643 | + $links['comment_edit']['attributes'] = array( |
|
| 644 | + 'title' => bts('Edit this comment', array(), NULL, 'boinc:forum-edit-comment') |
|
| 645 | + ); |
|
| 646 | 646 | } |
| 647 | 647 | if (isset($links['comment_reply'])) { |
| 648 | - $links['comment_reply']['attributes'] = array( |
|
| 649 | - 'title' => bts('Reply to this comment', array(), NULL, 'boinc:forum-reply-to-comment') |
|
| 650 | - ); |
|
| 648 | + $links['comment_reply']['attributes'] = array( |
|
| 649 | + 'title' => bts('Reply to this comment', array(), NULL, 'boinc:forum-reply-to-comment') |
|
| 650 | + ); |
|
| 651 | 651 | } |
| 652 | - }// if !$comment |
|
| 652 | + }// if !$comment |
|
| 653 | 653 | } |
| 654 | 654 | |
| 655 | 655 | /** |
| 656 | 656 | * Implementation of hook_locale(). |
| 657 | 657 | */ |
| 658 | 658 | function boinccore_locale($op = 'groups', $group = NULL) { |
| 659 | - switch ($op) { |
|
| 659 | + switch ($op) { |
|
| 660 | 660 | case 'groups': |
| 661 | 661 | return array('boinc' => 'BOINC'); |
| 662 | 662 | case 'info': |
| 663 | 663 | //$info['boinc']['refresh callback'] = 'boinccore_locale_refresh'; |
| 664 | 664 | $info['boinc']['format'] = FALSE; |
| 665 | - return $info; |
|
| 666 | - } |
|
| 665 | + return $info; |
|
| 666 | + } |
|
| 667 | 667 | } |
| 668 | 668 | |
| 669 | 669 | |
@@ -671,71 +671,71 @@ discard block |
||
| 671 | 671 | * Implementation of hook_link() |
| 672 | 672 | */ |
| 673 | 673 | function boinccore_link($type, $object, $teaser = FALSE) { |
| 674 | - // Add custom links with this hook |
|
| 674 | + // Add custom links with this hook |
|
| 675 | 675 | |
| 676 | - if ($type=='node') { |
|
| 676 | + if ($type=='node') { |
|
| 677 | 677 | if ( ($object->type=='forum') OR ($object->type=='team_forum') ) { |
| 678 | - // Add topic moderator controls |
|
| 679 | - if (user_access('edit any forum topic')) { |
|
| 678 | + // Add topic moderator controls |
|
| 679 | + if (user_access('edit any forum topic')) { |
|
| 680 | 680 | $node_control = "node_control/{$object->nid}"; |
| 681 | 681 | if ($object->sticky) { |
| 682 | - $links['make_unsticky'] = array( |
|
| 683 | - 'title' => bts('Make unsticky', array(), NULL, 'boinc:forum-unsticky-comment'), |
|
| 684 | - 'href' => "{$node_control}/unsticky", |
|
| 685 | - 'attributes' => array( |
|
| 686 | - 'title' => bts('Remove sticky status from this topic', array(), NULL, 'boinc:forum-unsticky-comment') |
|
| 687 | - ) |
|
| 688 | - ); |
|
| 682 | + $links['make_unsticky'] = array( |
|
| 683 | + 'title' => bts('Make unsticky', array(), NULL, 'boinc:forum-unsticky-comment'), |
|
| 684 | + 'href' => "{$node_control}/unsticky", |
|
| 685 | + 'attributes' => array( |
|
| 686 | + 'title' => bts('Remove sticky status from this topic', array(), NULL, 'boinc:forum-unsticky-comment') |
|
| 687 | + ) |
|
| 688 | + ); |
|
| 689 | 689 | } |
| 690 | 690 | else { |
| 691 | - $links['make_sticky'] = array( |
|
| 692 | - 'title' => bts('Make sticky', array(), NULL, 'boinc:forum-sticky-comment'), |
|
| 693 | - 'href' => "{$node_control}/sticky", |
|
| 694 | - 'attributes' => array( |
|
| 695 | - 'title' => bts('Make this topic sticky', array(), NULL, 'boinc:forum-sticky-comment') |
|
| 696 | - ) |
|
| 697 | - ); |
|
| 691 | + $links['make_sticky'] = array( |
|
| 692 | + 'title' => bts('Make sticky', array(), NULL, 'boinc:forum-sticky-comment'), |
|
| 693 | + 'href' => "{$node_control}/sticky", |
|
| 694 | + 'attributes' => array( |
|
| 695 | + 'title' => bts('Make this topic sticky', array(), NULL, 'boinc:forum-sticky-comment') |
|
| 696 | + ) |
|
| 697 | + ); |
|
| 698 | 698 | } |
| 699 | 699 | if ($object->comment == COMMENT_NODE_READ_WRITE) { |
| 700 | - $links['lock'] = array( |
|
| 701 | - 'title' => bts('Lock', array(), NULL, 'boinc:forum-lock-comment'), |
|
| 702 | - 'href' => "{$node_control}/lock", |
|
| 703 | - 'attributes' => array( |
|
| 704 | - 'title' => bts('Lock this thread for comments', array(), NULL, 'boinc:forum-lock-comment') |
|
| 705 | - ) |
|
| 706 | - ); |
|
| 700 | + $links['lock'] = array( |
|
| 701 | + 'title' => bts('Lock', array(), NULL, 'boinc:forum-lock-comment'), |
|
| 702 | + 'href' => "{$node_control}/lock", |
|
| 703 | + 'attributes' => array( |
|
| 704 | + 'title' => bts('Lock this thread for comments', array(), NULL, 'boinc:forum-lock-comment') |
|
| 705 | + ) |
|
| 706 | + ); |
|
| 707 | 707 | } |
| 708 | 708 | else { |
| 709 | - $links['unlock'] = array( |
|
| 710 | - 'title' => bts('Unlock', array(), NULL, 'boinc:forum-unlock-comment'), |
|
| 711 | - 'href' => "{$node_control}/unlock", |
|
| 712 | - 'attributes' => array( |
|
| 713 | - 'title' => bts('Unlock this thread for comments', array(), NULL, 'boinc:forum-unlock-comment') |
|
| 714 | - ) |
|
| 715 | - ); |
|
| 709 | + $links['unlock'] = array( |
|
| 710 | + 'title' => bts('Unlock', array(), NULL, 'boinc:forum-unlock-comment'), |
|
| 711 | + 'href' => "{$node_control}/unlock", |
|
| 712 | + 'attributes' => array( |
|
| 713 | + 'title' => bts('Unlock this thread for comments', array(), NULL, 'boinc:forum-unlock-comment') |
|
| 714 | + ) |
|
| 715 | + ); |
|
| 716 | 716 | } |
| 717 | 717 | if ($object->status) { |
| 718 | - $links['hide'] = array( |
|
| 719 | - 'title' => bts('Hide', array(), NULL, 'boinc:forum-hide-comment'), |
|
| 720 | - 'href' => "{$node_control}/hide", |
|
| 721 | - 'attributes' => array( |
|
| 722 | - 'title' => bts('Hide this topic', array(), NULL, 'boinc:forum-hide-comment') |
|
| 723 | - ) |
|
| 724 | - ); |
|
| 718 | + $links['hide'] = array( |
|
| 719 | + 'title' => bts('Hide', array(), NULL, 'boinc:forum-hide-comment'), |
|
| 720 | + 'href' => "{$node_control}/hide", |
|
| 721 | + 'attributes' => array( |
|
| 722 | + 'title' => bts('Hide this topic', array(), NULL, 'boinc:forum-hide-comment') |
|
| 723 | + ) |
|
| 724 | + ); |
|
| 725 | 725 | } |
| 726 | 726 | else { |
| 727 | - $links['unhide'] = array( |
|
| 728 | - 'title' => bts('Unhide', array(), NULL, 'boinc:forum-unhide-comment'), |
|
| 729 | - 'href' => "{$node_control}/unhide", |
|
| 730 | - 'attributes' => array( |
|
| 731 | - 'title' => bts('Unhide this topic', array(), NULL, 'boinc:forum-unhide-comment') |
|
| 732 | - ) |
|
| 733 | - ); |
|
| 727 | + $links['unhide'] = array( |
|
| 728 | + 'title' => bts('Unhide', array(), NULL, 'boinc:forum-unhide-comment'), |
|
| 729 | + 'href' => "{$node_control}/unhide", |
|
| 730 | + 'attributes' => array( |
|
| 731 | + 'title' => bts('Unhide this topic', array(), NULL, 'boinc:forum-unhide-comment') |
|
| 732 | + ) |
|
| 733 | + ); |
|
| 734 | 734 | } |
| 735 | - }// if user_access('edit any forum topic') |
|
| 735 | + }// if user_access('edit any forum topic') |
|
| 736 | 736 | } |
| 737 | - } |
|
| 738 | - else if ($type=='comment') { |
|
| 737 | + } |
|
| 738 | + else if ($type=='comment') { |
|
| 739 | 739 | $node = node_load($object->nid); |
| 740 | 740 | $nid = $object->nid; |
| 741 | 741 | $cid = $object->cid; |
@@ -755,10 +755,10 @@ discard block |
||
| 755 | 755 | // HIDE and COVERT comment |
| 756 | 756 | // The following are moderator only links |
| 757 | 757 | if (user_access('administer comments')) { |
| 758 | - $comment_control = "comment_control/{$cid}"; |
|
| 759 | - // Add link to convert comment into a new topic |
|
| 760 | - $reply_count = db_result(db_query(' SELECT COUNT(*) FROM comments WHERE pid = %d', $cid )); |
|
| 761 | - if ($reply_count == 0) { |
|
| 758 | + $comment_control = "comment_control/{$cid}"; |
|
| 759 | + // Add link to convert comment into a new topic |
|
| 760 | + $reply_count = db_result(db_query(' SELECT COUNT(*) FROM comments WHERE pid = %d', $cid )); |
|
| 761 | + if ($reply_count == 0) { |
|
| 762 | 762 | $links['convert'] = array( |
| 763 | 763 | 'title' => bts('Convert', array(), NULL, 'boinc:forum-convert-comment-to-topic'), |
| 764 | 764 | 'href' => "{$comment_control}/convert", |
@@ -766,9 +766,9 @@ discard block |
||
| 766 | 766 | 'title' => bts('Convert this comment to a new topic', array(), NULL, 'boinc:forum-convert-comment-to-topic') |
| 767 | 767 | ) |
| 768 | 768 | ); |
| 769 | - } |
|
| 770 | - // Add hide link |
|
| 771 | - if ($object->status == 0) { |
|
| 769 | + } |
|
| 770 | + // Add hide link |
|
| 771 | + if ($object->status == 0) { |
|
| 772 | 772 | $links['hide'] = array( |
| 773 | 773 | 'title' => bts('Hide', array(), NULL, 'boinc:forum-hide-comment'), |
| 774 | 774 | 'href' => "{$comment_control}/hide", |
@@ -776,8 +776,8 @@ discard block |
||
| 776 | 776 | 'title' => bts('Hide this comment', array(), NULL, 'boinc:forum-hide-comment') |
| 777 | 777 | ) |
| 778 | 778 | ); |
| 779 | - } |
|
| 780 | - else { |
|
| 779 | + } |
|
| 780 | + else { |
|
| 781 | 781 | $links['unhide'] = array( |
| 782 | 782 | 'title' => bts('Unhide', array(), NULL, 'boinc:forum-unhide-comment'), |
| 783 | 783 | 'href' => "{$comment_control}/unhide", |
@@ -785,27 +785,27 @@ discard block |
||
| 785 | 785 | 'title' => bts('Unhide this comment', array(), NULL, 'boinc:forum-unhide-comment') |
| 786 | 786 | ) |
| 787 | 787 | ); |
| 788 | - } |
|
| 788 | + } |
|
| 789 | 789 | }// if user_access('administer comments') |
| 790 | - }//if $type |
|
| 790 | + }//if $type |
|
| 791 | 791 | |
| 792 | - return $links; |
|
| 792 | + return $links; |
|
| 793 | 793 | } |
| 794 | 794 | |
| 795 | 795 | /** |
| 796 | 796 | * Implementation of hook_mail_alter() |
| 797 | 797 | */ |
| 798 | 798 | function boinccore_mail_alter(&$message) { |
| 799 | - /* This code alters the headers for all emails sent by the Drupal Web site to use |
|
| 799 | + /* This code alters the headers for all emails sent by the Drupal Web site to use |
|
| 800 | 800 | 'Quote-Printable' as the encoding, both altering the header and modifies the body to the |
| 801 | 801 | new encoding. |
| 802 | 802 | */ |
| 803 | - $message['headers']['Content-Transfer-Encoding'] = 'Quoted-Printable'; |
|
| 804 | - if (is_array($message['body'])) { |
|
| 803 | + $message['headers']['Content-Transfer-Encoding'] = 'Quoted-Printable'; |
|
| 804 | + if (is_array($message['body'])) { |
|
| 805 | 805 | $message['body'] = array_map( "quoted_printable_encode", $message['body'] ); |
| 806 | - } else { |
|
| 806 | + } else { |
|
| 807 | 807 | $message['body'] = quoted_printable_encode($message['body']); |
| 808 | - } |
|
| 808 | + } |
|
| 809 | 809 | } |
| 810 | 810 | |
| 811 | 811 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * |
@@ -818,45 +818,45 @@ discard block |
||
| 818 | 818 | * link rather than through the node form. |
| 819 | 819 | */ |
| 820 | 820 | function boinccore_node_control($nid = NULL, $action = NULL) { |
| 821 | - if ((!$nid OR !$node = node_load($nid)) OR |
|
| 821 | + if ((!$nid OR !$node = node_load($nid)) OR |
|
| 822 | 822 | ($node->type == 'forum' AND !user_access('edit any forum topic')) OR |
| 823 | 823 | ($node->type != 'forum' AND !user_access('administer nodes'))) { |
| 824 | 824 | // What are you even doing here... |
| 825 | 825 | return FALSE; |
| 826 | - } |
|
| 827 | - switch ($action) { |
|
| 828 | - case 'unhide': |
|
| 826 | + } |
|
| 827 | + switch ($action) { |
|
| 828 | + case 'unhide': |
|
| 829 | 829 | node_publish_action($node); |
| 830 | 830 | break; |
| 831 | - case 'hide': |
|
| 831 | + case 'hide': |
|
| 832 | 832 | node_unpublish_action($node); |
| 833 | 833 | break; |
| 834 | - case 'sticky': |
|
| 834 | + case 'sticky': |
|
| 835 | 835 | node_make_sticky_action($node); |
| 836 | 836 | break; |
| 837 | - case 'unsticky': |
|
| 837 | + case 'unsticky': |
|
| 838 | 838 | node_make_unsticky_action($node); |
| 839 | 839 | break; |
| 840 | - case 'lock': |
|
| 840 | + case 'lock': |
|
| 841 | 841 | $node->comment = 1; |
| 842 | 842 | watchdog('action', 'Locked comments on @type %title.', array( |
| 843 | - '@type' => node_get_types('name', $node), '%title' => $node->title)); |
|
| 843 | + '@type' => node_get_types('name', $node), '%title' => $node->title)); |
|
| 844 | 844 | break; |
| 845 | - case 'unlock': |
|
| 845 | + case 'unlock': |
|
| 846 | 846 | $node->comment = 2; |
| 847 | 847 | watchdog('action', 'Unlocked comments on @type %title.', array( |
| 848 | - '@type' => node_get_types('name', $node), '%title' => $node->title)); |
|
| 848 | + '@type' => node_get_types('name', $node), '%title' => $node->title)); |
|
| 849 | 849 | break; |
| 850 | - default: |
|
| 850 | + default: |
|
| 851 | 851 | } |
| 852 | - node_save($node); |
|
| 853 | - // If hiding a forum topic (node) and not an administrator, go to |
|
| 854 | - // the forum page. Otherwise the user will reach an access-denied |
|
| 855 | - // page. |
|
| 856 | - if (($action=="hide") and (!user_access('administer forums'))) { |
|
| 852 | + node_save($node); |
|
| 853 | + // If hiding a forum topic (node) and not an administrator, go to |
|
| 854 | + // the forum page. Otherwise the user will reach an access-denied |
|
| 855 | + // page. |
|
| 856 | + if (($action=="hide") and (!user_access('administer forums'))) { |
|
| 857 | 857 | drupal_goto("community/forum/{$node->tid}"); |
| 858 | - } |
|
| 859 | - drupal_goto("node/{$nid}"); |
|
| 858 | + } |
|
| 859 | + drupal_goto("node/{$nid}"); |
|
| 860 | 860 | } |
| 861 | 861 | |
| 862 | 862 | /** |
@@ -865,28 +865,28 @@ discard block |
||
| 865 | 865 | * through the comment edit form. |
| 866 | 866 | */ |
| 867 | 867 | function boinccore_comment_control($cid = NULL, $action = NULL) { |
| 868 | - if (!$cid OR !$comment = _comment_load($cid)) { |
|
| 868 | + if (!$cid OR !$comment = _comment_load($cid)) { |
|
| 869 | 869 | // What are you even doing here... |
| 870 | 870 | return FALSE; |
| 871 | - } |
|
| 872 | - $return_path = "node/{$comment->nid}"; |
|
| 873 | - $return_anchor = "comment-{$cid}"; |
|
| 874 | - switch ($action) { |
|
| 875 | - case 'unhide': |
|
| 871 | + } |
|
| 872 | + $return_path = "node/{$comment->nid}"; |
|
| 873 | + $return_anchor = "comment-{$cid}"; |
|
| 874 | + switch ($action) { |
|
| 875 | + case 'unhide': |
|
| 876 | 876 | comment_publish_action($comment); |
| 877 | 877 | rules_invoke_event('boinccore_comment_unhidden', $comment); |
| 878 | 878 | if (module_exists("boinc_solr_comments")) { |
| 879 | - boinc_solr_comments_publish($comment); |
|
| 879 | + boinc_solr_comments_publish($comment); |
|
| 880 | 880 | } |
| 881 | 881 | break; |
| 882 | - case 'hide': |
|
| 882 | + case 'hide': |
|
| 883 | 883 | comment_unpublish_action($comment); |
| 884 | 884 | rules_invoke_event('comment_unpublish', $comment); |
| 885 | 885 | if (module_exists("boinc_solr_comments")) { |
| 886 | - boinc_solr_comments_unpublish($comment); |
|
| 886 | + boinc_solr_comments_unpublish($comment); |
|
| 887 | 887 | } |
| 888 | 888 | break; |
| 889 | - case 'convert': |
|
| 889 | + case 'convert': |
|
| 890 | 890 | $node = new stdClass(); |
| 891 | 891 | $node->name = $comment->subject; |
| 892 | 892 | $node->title = $node->name; |
@@ -906,7 +906,7 @@ discard block |
||
| 906 | 906 | $node->tid = $parent_node->tid; |
| 907 | 907 | |
| 908 | 908 | if (filter_access($comment->format)) { |
| 909 | - $node->format = $comment->format; |
|
| 909 | + $node->format = $comment->format; |
|
| 910 | 910 | } |
| 911 | 911 | |
| 912 | 912 | // Save the new node |
@@ -922,9 +922,9 @@ discard block |
||
| 922 | 922 | $return_path = "node/{$node->nid}"; |
| 923 | 923 | $return_anchor = NULL; |
| 924 | 924 | break; |
| 925 | - default: |
|
| 925 | + default: |
|
| 926 | 926 | } |
| 927 | - drupal_goto($return_path, NULL, $return_anchor); |
|
| 927 | + drupal_goto($return_path, NULL, $return_anchor); |
|
| 928 | 928 | } |
| 929 | 929 | |
| 930 | 930 | /** |
@@ -932,7 +932,7 @@ discard block |
||
| 932 | 932 | * Get the authenticator for a given account |
| 933 | 933 | */ |
| 934 | 934 | function boinccore_lookup_account() { |
| 935 | - include_boinc('user/lookup_account.php'); |
|
| 935 | + include_boinc('user/lookup_account.php'); |
|
| 936 | 936 | } |
| 937 | 937 | |
| 938 | 938 | /** |
@@ -940,29 +940,29 @@ discard block |
||
| 940 | 940 | * Get assorted details for a given account |
| 941 | 941 | */ |
| 942 | 942 | function boinccore_am_get_info() { |
| 943 | - // Remove q from the GET request or BOINC will panic |
|
| 944 | - unset($_GET['q']); |
|
| 945 | - // Capture the XML output of the RPC so we can override things |
|
| 946 | - ob_start(); |
|
| 947 | - include_boinc('user/am_get_info.php'); |
|
| 948 | - $xml = ob_get_clean(); |
|
| 949 | - $xml = load_configuration($xml); |
|
| 950 | - // See if the account has an approved profile in Drupal |
|
| 951 | - $uid = !empty($xml['am_get_info_reply']['id']) ? boincuser_lookup_uid($xml['am_get_info_reply']['id']) : 0; |
|
| 952 | - if ($uid) { |
|
| 943 | + // Remove q from the GET request or BOINC will panic |
|
| 944 | + unset($_GET['q']); |
|
| 945 | + // Capture the XML output of the RPC so we can override things |
|
| 946 | + ob_start(); |
|
| 947 | + include_boinc('user/am_get_info.php'); |
|
| 948 | + $xml = ob_get_clean(); |
|
| 949 | + $xml = load_configuration($xml); |
|
| 950 | + // See if the account has an approved profile in Drupal |
|
| 951 | + $uid = !empty($xml['am_get_info_reply']['id']) ? boincuser_lookup_uid($xml['am_get_info_reply']['id']) : 0; |
|
| 952 | + if ($uid) { |
|
| 953 | 953 | $content_profile = content_profile_load('profile', $uid); |
| 954 | 954 | $profile_is_approved = ($content_profile->status AND !$content_profile->moderate); |
| 955 | 955 | $country = check_plain($content_profile->field_country[0]['value']); |
| 956 | 956 | $website = ''; |
| 957 | 957 | if ($profile_is_approved) { |
| 958 | - $website = check_plain($content_profile->field_url[0]['value']); |
|
| 958 | + $website = check_plain($content_profile->field_url[0]['value']); |
|
| 959 | 959 | } |
| 960 | 960 | // Override BOINC values with Drupal values as needed |
| 961 | 961 | $xml['am_get_info_reply']['has_profile']['@value'] = ($profile_is_approved) ? 1 : 0; |
| 962 | 962 | $xml['am_get_info_reply']['country']['@value'] = $country; |
| 963 | 963 | $xml['am_get_info_reply']['url']['@value'] = $website; |
| 964 | - } |
|
| 965 | - print save_configuration($xml); |
|
| 964 | + } |
|
| 965 | + print save_configuration($xml); |
|
| 966 | 966 | } |
| 967 | 967 | |
| 968 | 968 | /** |
@@ -970,75 +970,75 @@ discard block |
||
| 970 | 970 | * Update assorted details for a given account |
| 971 | 971 | */ |
| 972 | 972 | function boinccore_am_set_info() { |
| 973 | - // Remove q from the GET request or BOINC will panic |
|
| 974 | - unset($_GET['q']); |
|
| 975 | - // Validate the XML prefs (in case BOINC does not) |
|
| 976 | - $global_prefs = !empty($_POST['global_prefs']) ? $_POST['global_prefs'] : (!empty($_GET['global_prefs']) ? $_GET['global_prefs'] : NULL); |
|
| 977 | - $project_prefs = !empty($_POST['project_prefs']) ? $_POST['project_prefs'] : (!empty($_GET['project_prefs']) ? $_GET['project_prefs'] : NULL); |
|
| 978 | - libxml_use_internal_errors(true); |
|
| 979 | - $xml = new DomDocument(); |
|
| 980 | - if ($global_prefs) { |
|
| 973 | + // Remove q from the GET request or BOINC will panic |
|
| 974 | + unset($_GET['q']); |
|
| 975 | + // Validate the XML prefs (in case BOINC does not) |
|
| 976 | + $global_prefs = !empty($_POST['global_prefs']) ? $_POST['global_prefs'] : (!empty($_GET['global_prefs']) ? $_GET['global_prefs'] : NULL); |
|
| 977 | + $project_prefs = !empty($_POST['project_prefs']) ? $_POST['project_prefs'] : (!empty($_GET['project_prefs']) ? $_GET['project_prefs'] : NULL); |
|
| 978 | + libxml_use_internal_errors(true); |
|
| 979 | + $xml = new DomDocument(); |
|
| 980 | + if ($global_prefs) { |
|
| 981 | 981 | $xml->loadXML($global_prefs, LIBXML_NOBLANKS); |
| 982 | 982 | if ($errors = libxml_get_errors($xml)) { |
| 983 | - $lines = explode("\r", $global_prefs); |
|
| 984 | - watchdog('am_set_info', "XML validation error in global_prefs: {$errors[0]->message} at line {$errors[0]->line}" . |
|
| 983 | + $lines = explode("\r", $global_prefs); |
|
| 984 | + watchdog('am_set_info', "XML validation error in global_prefs: {$errors[0]->message} at line {$errors[0]->line}" . |
|
| 985 | 985 | ': <br/>' . htmlentities($lines[$errors[0]->line - 1]), array(), WATCHDOG_ERROR); |
| 986 | 986 | } |
| 987 | - } |
|
| 988 | - elseif ($project_prefs) { |
|
| 987 | + } |
|
| 988 | + elseif ($project_prefs) { |
|
| 989 | 989 | $xml->loadXML($project_prefs, LIBXML_NOBLANKS); |
| 990 | 990 | if ($errors = libxml_get_errors($xml)) { |
| 991 | - $lines = explode("\r", $project_prefs); |
|
| 992 | - watchdog('am_set_info', "XML validation error in project_prefs: {$errors[0]->message} at line {$errors[0]->line}" . |
|
| 991 | + $lines = explode("\r", $project_prefs); |
|
| 992 | + watchdog('am_set_info', "XML validation error in project_prefs: {$errors[0]->message} at line {$errors[0]->line}" . |
|
| 993 | 993 | ': <br/>' . htmlentities($lines[$errors[0]->line - 1]), array(), WATCHDOG_ERROR); |
| 994 | 994 | } |
| 995 | - } |
|
| 996 | - if (!$errors) { |
|
| 995 | + } |
|
| 996 | + if (!$errors) { |
|
| 997 | 997 | // Capture the XML output of the RPC so we can override things |
| 998 | 998 | ob_start(); |
| 999 | 999 | include_boinc('user/am_set_info.php'); |
| 1000 | 1000 | $xml = ob_get_clean(); |
| 1001 | 1001 | $xml = load_configuration($xml); |
| 1002 | 1002 | if (isset($xml['am_set_info_reply']['success'])) { |
| 1003 | - // Find the account in Drupal |
|
| 1004 | - $boinc_auth = !empty($_POST['account_key']) ? $_POST['account_key'] : $_GET['account_key']; |
|
| 1005 | - db_set_active('boinc_rw'); |
|
| 1006 | - $boinc_id = db_result(db_query(" |
|
| 1003 | + // Find the account in Drupal |
|
| 1004 | + $boinc_auth = !empty($_POST['account_key']) ? $_POST['account_key'] : $_GET['account_key']; |
|
| 1005 | + db_set_active('boinc_rw'); |
|
| 1006 | + $boinc_id = db_result(db_query(" |
|
| 1007 | 1007 | SELECT id |
| 1008 | 1008 | FROM {user} |
| 1009 | 1009 | WHERE authenticator = '%s'", |
| 1010 | 1010 | $boinc_auth |
| 1011 | - )); |
|
| 1012 | - db_set_active('default'); |
|
| 1013 | - $uid = boincuser_lookup_uid($boinc_id); |
|
| 1011 | + )); |
|
| 1012 | + db_set_active('default'); |
|
| 1013 | + $uid = boincuser_lookup_uid($boinc_id); |
|
| 1014 | 1014 | |
| 1015 | - // Apply any relevant updates to the Drupal account, also |
|
| 1016 | - $country = !empty($_POST['country']) ? $_POST['country'] : (!empty($_GET['country']) ? $_GET['country'] : NULL); |
|
| 1017 | - $url = !empty($_POST['url']) ? $_POST['url'] : (!empty($_GET['url']) ? $_GET['url'] : NULL); |
|
| 1018 | - $email_addr = !empty($_POST['email_addr']) ? $_POST['email_addr'] : (!empty($_GET['email_addr']) ? $_GET['email_addr'] : NULL); |
|
| 1015 | + // Apply any relevant updates to the Drupal account, also |
|
| 1016 | + $country = !empty($_POST['country']) ? $_POST['country'] : (!empty($_GET['country']) ? $_GET['country'] : NULL); |
|
| 1017 | + $url = !empty($_POST['url']) ? $_POST['url'] : (!empty($_GET['url']) ? $_GET['url'] : NULL); |
|
| 1018 | + $email_addr = !empty($_POST['email_addr']) ? $_POST['email_addr'] : (!empty($_GET['email_addr']) ? $_GET['email_addr'] : NULL); |
|
| 1019 | 1019 | |
| 1020 | - if ($email_addr) { |
|
| 1020 | + if ($email_addr) { |
|
| 1021 | 1021 | $account = user_load($uid); |
| 1022 | 1022 | user_save($account, array('mail' => $email_addr)); |
| 1023 | - } |
|
| 1024 | - if ($country OR $url) { |
|
| 1023 | + } |
|
| 1024 | + if ($country OR $url) { |
|
| 1025 | 1025 | $content_profile = content_profile_load('profile', $uid); |
| 1026 | 1026 | if ($country) $content_profile->field_country[0]['value'] = $country; |
| 1027 | 1027 | if ($url) $content_profile->field_url[0]['value'] = $url; |
| 1028 | 1028 | node_save($content_profile); |
| 1029 | - } |
|
| 1029 | + } |
|
| 1030 | 1030 | } |
| 1031 | - } |
|
| 1032 | - else { |
|
| 1031 | + } |
|
| 1032 | + else { |
|
| 1033 | 1033 | $xml = array( |
| 1034 | - 'error' => array( |
|
| 1034 | + 'error' => array( |
|
| 1035 | 1035 | 'error_num' => -112, |
| 1036 | 1036 | 'error_msg' => "{$errors[0]->message} at line {$errors[0]->line}" . |
| 1037 | 1037 | ': <br/>' . htmlentities($lines[$errors[0]->line - 1]) |
| 1038 | - ), |
|
| 1038 | + ), |
|
| 1039 | 1039 | ); |
| 1040 | - } |
|
| 1041 | - print save_configuration($xml); |
|
| 1040 | + } |
|
| 1041 | + print save_configuration($xml); |
|
| 1042 | 1042 | } |
| 1043 | 1043 | |
| 1044 | 1044 | /** |
@@ -1046,17 +1046,17 @@ discard block |
||
| 1046 | 1046 | * Update the venue for the given host |
| 1047 | 1047 | */ |
| 1048 | 1048 | function boinccore_am_set_host_info() { |
| 1049 | - // Remove q from the GET request or BOINC will panic |
|
| 1050 | - unset($_GET['q']); |
|
| 1051 | - // Capture the XML output of the RPC so we can override things |
|
| 1052 | - ob_start(); |
|
| 1053 | - include_boinc('user/am_set_host_info.php'); |
|
| 1054 | - $xml = ob_get_clean(); |
|
| 1055 | - $xml = load_configuration($xml); |
|
| 1056 | - if (isset($xml['am_set_host_info_reply']['success'])) { |
|
| 1049 | + // Remove q from the GET request or BOINC will panic |
|
| 1050 | + unset($_GET['q']); |
|
| 1051 | + // Capture the XML output of the RPC so we can override things |
|
| 1052 | + ob_start(); |
|
| 1053 | + include_boinc('user/am_set_host_info.php'); |
|
| 1054 | + $xml = ob_get_clean(); |
|
| 1055 | + $xml = load_configuration($xml); |
|
| 1056 | + if (isset($xml['am_set_host_info_reply']['success'])) { |
|
| 1057 | 1057 | // Override anything that needs overriding |
| 1058 | - } |
|
| 1059 | - print save_configuration($xml); |
|
| 1058 | + } |
|
| 1059 | + print save_configuration($xml); |
|
| 1060 | 1060 | } |
| 1061 | 1061 | |
| 1062 | 1062 | /** |
@@ -1064,29 +1064,29 @@ discard block |
||
| 1064 | 1064 | * Get assorted details for a given account |
| 1065 | 1065 | */ |
| 1066 | 1066 | function boinccore_show_user() { |
| 1067 | - // Remove q from the GET request or BOINC will panic |
|
| 1068 | - unset($_GET['q']); |
|
| 1069 | - // Capture the XML output of the RPC so we can override things |
|
| 1070 | - ob_start(); |
|
| 1071 | - include_boinc('user/show_user.php'); |
|
| 1072 | - $xml = ob_get_clean(); |
|
| 1073 | - $xml = load_configuration($xml); |
|
| 1074 | - // See if the account has an approved profile in Drupal |
|
| 1075 | - $uid = !empty($xml['user']['id']) ? boincuser_lookup_uid($xml['user']['id']) : 0; |
|
| 1076 | - if ($uid) { |
|
| 1067 | + // Remove q from the GET request or BOINC will panic |
|
| 1068 | + unset($_GET['q']); |
|
| 1069 | + // Capture the XML output of the RPC so we can override things |
|
| 1070 | + ob_start(); |
|
| 1071 | + include_boinc('user/show_user.php'); |
|
| 1072 | + $xml = ob_get_clean(); |
|
| 1073 | + $xml = load_configuration($xml); |
|
| 1074 | + // See if the account has an approved profile in Drupal |
|
| 1075 | + $uid = !empty($xml['user']['id']) ? boincuser_lookup_uid($xml['user']['id']) : 0; |
|
| 1076 | + if ($uid) { |
|
| 1077 | 1077 | $content_profile = content_profile_load('profile', $uid); |
| 1078 | 1078 | $profile_is_approved = ($content_profile->status AND !$content_profile->moderate); |
| 1079 | 1079 | $country = check_plain($content_profile->field_country[0]['value']); |
| 1080 | 1080 | $website = ''; |
| 1081 | 1081 | if ($profile_is_approved) { |
| 1082 | - $website = check_plain($content_profile->field_url[0]['value']); |
|
| 1082 | + $website = check_plain($content_profile->field_url[0]['value']); |
|
| 1083 | 1083 | } |
| 1084 | 1084 | // Override BOINC values with Drupal values as needed |
| 1085 | 1085 | $xml['user']['has_profile']['@value'] = ($profile_is_approved) ? 1 : 0; |
| 1086 | 1086 | $xml['user']['country']['@value'] = $country; |
| 1087 | 1087 | $xml['user']['url']['@value'] = $website; |
| 1088 | - } |
|
| 1089 | - print save_configuration($xml); |
|
| 1088 | + } |
|
| 1089 | + print save_configuration($xml); |
|
| 1090 | 1090 | } |
| 1091 | 1091 | |
| 1092 | 1092 | /** |
@@ -1094,9 +1094,9 @@ discard block |
||
| 1094 | 1094 | * Get pending credit information for a given account |
| 1095 | 1095 | */ |
| 1096 | 1096 | function boinccore_pending_credit() { |
| 1097 | - // Remove q from the GET request or BOINC will panic |
|
| 1098 | - unset($_GET['q']); |
|
| 1099 | - include_boinc('user/pending.php'); |
|
| 1097 | + // Remove q from the GET request or BOINC will panic |
|
| 1098 | + unset($_GET['q']); |
|
| 1099 | + include_boinc('user/pending.php'); |
|
| 1100 | 1100 | } |
| 1101 | 1101 | |
| 1102 | 1102 | /** |
@@ -1105,7 +1105,7 @@ discard block |
||
| 1105 | 1105 | */ |
| 1106 | 1106 | function boinccore_create_team() { |
| 1107 | 1107 | |
| 1108 | - if (module_exists('boincteam')) { |
|
| 1108 | + if (module_exists('boincteam')) { |
|
| 1109 | 1109 | module_load_include('module', 'boincteam', 'boincteam'); |
| 1110 | 1110 | |
| 1111 | 1111 | $input_format = !empty($values['format']) ? $values['format'] : 4; |
@@ -1118,9 +1118,9 @@ discard block |
||
| 1118 | 1118 | $xml = load_configuration($xml); |
| 1119 | 1119 | |
| 1120 | 1120 | if (isset($xml['create_team_reply']['success'])) { |
| 1121 | - $boincteam_id = isset($xml['create_team_reply']['team_id']['@value']) ? $xml['create_team_reply']['team_id']['@value'] : 0; |
|
| 1121 | + $boincteam_id = isset($xml['create_team_reply']['team_id']['@value']) ? $xml['create_team_reply']['team_id']['@value'] : 0; |
|
| 1122 | 1122 | |
| 1123 | - if ($boincteam_id) { |
|
| 1123 | + if ($boincteam_id) { |
|
| 1124 | 1124 | |
| 1125 | 1125 | $boincteam = boincteam_load($boincteam_id); |
| 1126 | 1126 | $team_owner_uid = boincuser_lookup_uid($boincteam->userid); |
@@ -1128,92 +1128,92 @@ discard block |
||
| 1128 | 1128 | // Create the team node in Drupal |
| 1129 | 1129 | |
| 1130 | 1130 | $values = array( |
| 1131 | - 'name' => isset($_GET['name']) ? $_GET['name'] : '', |
|
| 1132 | - 'description' => isset($_GET['description']) ? $_GET['description'] : '', |
|
| 1133 | - 'type' => isset($_GET['type']) ? $_GET['type'] : '', |
|
| 1131 | + 'name' => isset($_GET['name']) ? $_GET['name'] : '', |
|
| 1132 | + 'description' => isset($_GET['description']) ? $_GET['description'] : '', |
|
| 1133 | + 'type' => isset($_GET['type']) ? $_GET['type'] : '', |
|
| 1134 | 1134 | ); |
| 1135 | 1135 | $teaser = node_teaser($values['description']); |
| 1136 | 1136 | $created_time = time(); |
| 1137 | 1137 | |
| 1138 | 1138 | $node = array( |
| 1139 | - 'type' => 'team', |
|
| 1140 | - 'title' => $values['name'], |
|
| 1141 | - 'body' => $values['description'], |
|
| 1142 | - 'teaser' => $teaser, |
|
| 1143 | - 'uid' => $team_owner_uid, |
|
| 1144 | - 'path' => null, |
|
| 1145 | - 'status' => 1, // published or not - always publish |
|
| 1146 | - 'promote' => 0, |
|
| 1147 | - 'created' => $created_time, |
|
| 1148 | - 'comment' => 0, // comments disabled |
|
| 1149 | - 'moderate' => 0, |
|
| 1150 | - 'sticky' => 0, |
|
| 1151 | - 'format' => $input_format |
|
| 1139 | + 'type' => 'team', |
|
| 1140 | + 'title' => $values['name'], |
|
| 1141 | + 'body' => $values['description'], |
|
| 1142 | + 'teaser' => $teaser, |
|
| 1143 | + 'uid' => $team_owner_uid, |
|
| 1144 | + 'path' => null, |
|
| 1145 | + 'status' => 1, // published or not - always publish |
|
| 1146 | + 'promote' => 0, |
|
| 1147 | + 'created' => $created_time, |
|
| 1148 | + 'comment' => 0, // comments disabled |
|
| 1149 | + 'moderate' => 0, |
|
| 1150 | + 'sticky' => 0, |
|
| 1151 | + 'format' => $input_format |
|
| 1152 | 1152 | ); |
| 1153 | 1153 | |
| 1154 | 1154 | // Use pathauto function, if available, to clean up the path |
| 1155 | 1155 | if (module_exists('pathauto')) { |
| 1156 | - module_load_include('inc', 'pathauto', 'pathauto'); |
|
| 1157 | - $node['path'] = pathauto_cleanstring($values['name']); |
|
| 1156 | + module_load_include('inc', 'pathauto', 'pathauto'); |
|
| 1157 | + $node['path'] = pathauto_cleanstring($values['name']); |
|
| 1158 | 1158 | |
| 1159 | - $node = (object) $node; // node_save requires an object form |
|
| 1160 | - $team_categories = taxonomy_get_term_by_name($values['type']); |
|
| 1161 | - $node->taxonomy[] = $team_categories[0]; |
|
| 1159 | + $node = (object) $node; // node_save requires an object form |
|
| 1160 | + $team_categories = taxonomy_get_term_by_name($values['type']); |
|
| 1161 | + $node->taxonomy[] = $team_categories[0]; |
|
| 1162 | 1162 | |
| 1163 | - // Save the team node |
|
| 1164 | - node_save($node); |
|
| 1165 | - // Save the team IDs to a BOINC <--> Drupal reference table. |
|
| 1166 | - db_query('INSERT INTO {boincteam} (team_id, nid) VALUES (%d, %d)', $boincteam_id, $node->nid); |
|
| 1163 | + // Save the team node |
|
| 1164 | + node_save($node); |
|
| 1165 | + // Save the team IDs to a BOINC <--> Drupal reference table. |
|
| 1166 | + db_query('INSERT INTO {boincteam} (team_id, nid) VALUES (%d, %d)', $boincteam_id, $node->nid); |
|
| 1167 | 1167 | } |
| 1168 | 1168 | else { |
| 1169 | - $xml['create_team_reply']['warning'] = t( |
|
| 1169 | + $xml['create_team_reply']['warning'] = t( |
|
| 1170 | 1170 | 'There was a problem integrating this team into Drupal. Please |
| 1171 | 1171 | contact @project administrators!', array('@project' => PROJECT) |
| 1172 | - ); |
|
| 1173 | - watchdog( |
|
| 1172 | + ); |
|
| 1173 | + watchdog( |
|
| 1174 | 1174 | 'BOINC team', |
| 1175 | 1175 | 'BOINC teams require the Pathauto module. Team cannot be created in |
| 1176 | 1176 | Drupal via create_team.php RPC.', |
| 1177 | 1177 | array(), |
| 1178 | 1178 | WATCHDOG_ERROR |
| 1179 | - ); |
|
| 1180 | - // Delete from the BOINC DB if we can't sync with Drupal |
|
| 1181 | - $boincteam::delete(); |
|
| 1179 | + ); |
|
| 1180 | + // Delete from the BOINC DB if we can't sync with Drupal |
|
| 1181 | + $boincteam::delete(); |
|
| 1182 | 1182 | } |
| 1183 | - } |
|
| 1184 | - else { |
|
| 1183 | + } |
|
| 1184 | + else { |
|
| 1185 | 1185 | $xml['create_team_reply']['warning'] = t( |
| 1186 | - 'There was a problem integrating this team into Drupal. Please |
|
| 1186 | + 'There was a problem integrating this team into Drupal. Please |
|
| 1187 | 1187 | contact @project administrators!', array('@project' => PROJECT) |
| 1188 | 1188 | ); |
| 1189 | 1189 | watchdog( |
| 1190 | - 'BOINC team', |
|
| 1191 | - 'Team cannot be created in Drupal via create_team.php RPC because no |
|
| 1190 | + 'BOINC team', |
|
| 1191 | + 'Team cannot be created in Drupal via create_team.php RPC because no |
|
| 1192 | 1192 | BOINC team ID was returned in the XML.', |
| 1193 | - array(), |
|
| 1194 | - WATCHDOG_ERROR |
|
| 1193 | + array(), |
|
| 1194 | + WATCHDOG_ERROR |
|
| 1195 | 1195 | ); |
| 1196 | - } |
|
| 1196 | + } |
|
| 1197 | 1197 | } |
| 1198 | - } |
|
| 1199 | - else { |
|
| 1198 | + } |
|
| 1199 | + else { |
|
| 1200 | 1200 | $xml = array( |
| 1201 | - 'error' => array( |
|
| 1201 | + 'error' => array( |
|
| 1202 | 1202 | 'error_num' => -1, |
| 1203 | 1203 | 'error_msg' => t( |
| 1204 | - 'Teams are not enabled for this project' |
|
| 1204 | + 'Teams are not enabled for this project' |
|
| 1205 | + ), |
|
| 1205 | 1206 | ), |
| 1206 | - ), |
|
| 1207 | 1207 | ); |
| 1208 | 1208 | watchdog( |
| 1209 | - 'BOINC team', |
|
| 1210 | - 'Team cannot be created in Drupal via create_team.php RPC because the |
|
| 1209 | + 'BOINC team', |
|
| 1210 | + 'Team cannot be created in Drupal via create_team.php RPC because the |
|
| 1211 | 1211 | BOINC team module is not enabled.', |
| 1212 | - array(), |
|
| 1213 | - WATCHDOG_ERROR |
|
| 1212 | + array(), |
|
| 1213 | + WATCHDOG_ERROR |
|
| 1214 | 1214 | ); |
| 1215 | - } |
|
| 1216 | - print save_configuration($xml); |
|
| 1215 | + } |
|
| 1216 | + print save_configuration($xml); |
|
| 1217 | 1217 | } |
| 1218 | 1218 | |
| 1219 | 1219 | /** |
@@ -1221,9 +1221,9 @@ discard block |
||
| 1221 | 1221 | * Get info on a team by ID or a list of teams that match a given name |
| 1222 | 1222 | */ |
| 1223 | 1223 | function boinccore_team_lookup() { |
| 1224 | - // Remove q from the GET request or BOINC will panic |
|
| 1225 | - unset($_GET['q']); |
|
| 1226 | - include_boinc('user/team_lookup.php'); |
|
| 1224 | + // Remove q from the GET request or BOINC will panic |
|
| 1225 | + unset($_GET['q']); |
|
| 1226 | + include_boinc('user/team_lookup.php'); |
|
| 1227 | 1227 | } |
| 1228 | 1228 | |
| 1229 | 1229 | /** |
@@ -1231,72 +1231,72 @@ discard block |
||
| 1231 | 1231 | * Get members of a given team |
| 1232 | 1232 | */ |
| 1233 | 1233 | function boinccore_team_email_list() { |
| 1234 | - // See if the account has an approved profile in Drupal |
|
| 1235 | - $boincteam_id = !empty($_POST['teamid']) ? $_POST['teamid'] : $_GET['teamid']; |
|
| 1236 | - $credit_only = !empty($_POST['creditonly']) ? $_POST['creditonly'] : $_GET['creditonly']; |
|
| 1237 | - $show_xml = !empty($_POST['xml']) ? $_POST['xml'] : $_GET['xml']; |
|
| 1238 | - if (!$show_xml) { |
|
| 1239 | - // creditonly does not affect non xml output in BOINC |
|
| 1240 | - $credit_only = FALSE; |
|
| 1241 | - } |
|
| 1242 | - $xml = array(); |
|
| 1234 | + // See if the account has an approved profile in Drupal |
|
| 1235 | + $boincteam_id = !empty($_POST['teamid']) ? $_POST['teamid'] : $_GET['teamid']; |
|
| 1236 | + $credit_only = !empty($_POST['creditonly']) ? $_POST['creditonly'] : $_GET['creditonly']; |
|
| 1237 | + $show_xml = !empty($_POST['xml']) ? $_POST['xml'] : $_GET['xml']; |
|
| 1238 | + if (!$show_xml) { |
|
| 1239 | + // creditonly does not affect non xml output in BOINC |
|
| 1240 | + $credit_only = FALSE; |
|
| 1241 | + } |
|
| 1242 | + $xml = array(); |
|
| 1243 | 1243 | |
| 1244 | - if ($boincteam_id && is_numeric($boincteam_id)) { |
|
| 1244 | + if ($boincteam_id && is_numeric($boincteam_id)) { |
|
| 1245 | 1245 | if ($credit_only) { |
| 1246 | - db_set_active('boinc_rw'); |
|
| 1247 | - $result = db_query(" |
|
| 1246 | + db_set_active('boinc_rw'); |
|
| 1247 | + $result = db_query(" |
|
| 1248 | 1248 | SELECT |
| 1249 | 1249 | u.id, u.name, u.cross_project_id, u.email_addr, u.total_credit, u.expavg_credit, u.expavg_time |
| 1250 | 1250 | FROM {user} u |
| 1251 | 1251 | WHERE u.teamid = %d and u.total_credit > 0", |
| 1252 | 1252 | $boincteam_id |
| 1253 | - ); |
|
| 1254 | - db_set_active('default'); |
|
| 1253 | + ); |
|
| 1254 | + db_set_active('default'); |
|
| 1255 | 1255 | |
| 1256 | - $xml = array('users' => array()); |
|
| 1257 | - while ($member = db_fetch_object($result)) { |
|
| 1256 | + $xml = array('users' => array()); |
|
| 1257 | + while ($member = db_fetch_object($result)) { |
|
| 1258 | 1258 | $team_member = array( |
| 1259 | - 'id' => $member->id, |
|
| 1260 | - 'cpid' => md5($member->cross_project_id.$member->email_addr), |
|
| 1261 | - 'name' => htmlspecialchars($member->name), |
|
| 1262 | - 'total_credit' => round($member->total_credit), |
|
| 1263 | - 'expavg_credit' => round($member->expavg_credit), |
|
| 1264 | - 'expavg_time' => round($member->expavg_time), |
|
| 1259 | + 'id' => $member->id, |
|
| 1260 | + 'cpid' => md5($member->cross_project_id.$member->email_addr), |
|
| 1261 | + 'name' => htmlspecialchars($member->name), |
|
| 1262 | + 'total_credit' => round($member->total_credit), |
|
| 1263 | + 'expavg_credit' => round($member->expavg_credit), |
|
| 1264 | + 'expavg_time' => round($member->expavg_time), |
|
| 1265 | 1265 | ); |
| 1266 | 1266 | $xml['users']['user'][] = $team_member; |
| 1267 | - } |
|
| 1267 | + } |
|
| 1268 | 1268 | } |
| 1269 | 1269 | else { |
| 1270 | - // Query BOINC database user table |
|
| 1271 | - db_set_active('boinc_rw'); |
|
| 1272 | - $result = db_query(" |
|
| 1270 | + // Query BOINC database user table |
|
| 1271 | + db_set_active('boinc_rw'); |
|
| 1272 | + $result = db_query(" |
|
| 1273 | 1273 | SELECT |
| 1274 | 1274 | u.id, u.name, u.cross_project_id, u.create_time, u.email_addr, u.total_credit, u.expavg_credit, u.expavg_time |
| 1275 | 1275 | FROM {user} u |
| 1276 | 1276 | WHERE u.teamid = %d ORDER BY u.email_addr ASC", |
| 1277 | 1277 | $boincteam_id |
| 1278 | - ); |
|
| 1279 | - db_set_active('default'); |
|
| 1278 | + ); |
|
| 1279 | + db_set_active('default'); |
|
| 1280 | 1280 | |
| 1281 | - // Extract information from BOINC database for team members. |
|
| 1282 | - $team_members = array(); |
|
| 1283 | - while ($member = db_fetch_object($result)) { |
|
| 1281 | + // Extract information from BOINC database for team members. |
|
| 1282 | + $team_members = array(); |
|
| 1283 | + while ($member = db_fetch_object($result)) { |
|
| 1284 | 1284 | $team_members[$member->id] = array( |
| 1285 | - 'id' => $member->id, |
|
| 1286 | - 'cpid' => md5($member->cross_project_id.$member->email_addr), |
|
| 1287 | - 'create_time' => $member->create_time, |
|
| 1288 | - 'name' => htmlspecialchars($member->name), |
|
| 1289 | - 'country' => NULL, |
|
| 1290 | - 'total_credit' => round($member->total_credit), |
|
| 1291 | - 'expavg_credit' => round($member->expavg_credit), |
|
| 1292 | - 'expavg_time' => round($member->expavg_time), |
|
| 1293 | - 'url' => NULL, |
|
| 1294 | - 'has_profile' => 0, |
|
| 1285 | + 'id' => $member->id, |
|
| 1286 | + 'cpid' => md5($member->cross_project_id.$member->email_addr), |
|
| 1287 | + 'create_time' => $member->create_time, |
|
| 1288 | + 'name' => htmlspecialchars($member->name), |
|
| 1289 | + 'country' => NULL, |
|
| 1290 | + 'total_credit' => round($member->total_credit), |
|
| 1291 | + 'expavg_credit' => round($member->expavg_credit), |
|
| 1292 | + 'expavg_time' => round($member->expavg_time), |
|
| 1293 | + 'url' => NULL, |
|
| 1294 | + 'has_profile' => 0, |
|
| 1295 | 1295 | ); |
| 1296 | - } |
|
| 1296 | + } |
|
| 1297 | 1297 | |
| 1298 | - // Query Drupal database, multiple tables |
|
| 1299 | - $sql1 = " |
|
| 1298 | + // Query Drupal database, multiple tables |
|
| 1299 | + $sql1 = " |
|
| 1300 | 1300 | SELECT |
| 1301 | 1301 | bu.boinc_id, du.uid, du.name, n.nid, n.type, n.field_country_value, n.field_url_value |
| 1302 | 1302 | FROM {boincuser} AS bu |
@@ -1307,28 +1307,28 @@ discard block |
||
| 1307 | 1307 | INNER JOIN {content_type_profile} AS p ON node.nid=p.nid |
| 1308 | 1308 | WHERE node.type='profile' ) n ON du.uid=n.uid |
| 1309 | 1309 | WHERE bu.boinc_id IN (%s)"; |
| 1310 | - $member_id_list = implode(',', array_keys($team_members)); |
|
| 1311 | - if (!$member_id_list) { |
|
| 1310 | + $member_id_list = implode(',', array_keys($team_members)); |
|
| 1311 | + if (!$member_id_list) { |
|
| 1312 | 1312 | $member_id_list = '-1'; |
| 1313 | - } |
|
| 1314 | - $result = db_query($sql1, $member_id_list); |
|
| 1315 | - while ($member = db_fetch_object($result)) { |
|
| 1313 | + } |
|
| 1314 | + $result = db_query($sql1, $member_id_list); |
|
| 1315 | + while ($member = db_fetch_object($result)) { |
|
| 1316 | 1316 | $team_members[$member->boinc_id]['country'] = $member->field_country_value; |
| 1317 | 1317 | $team_members[$member->boinc_id]['url'] = $member->field_url_value; |
| 1318 | 1318 | $team_members[$member->boinc_id]['has_profile'] = isset($member->nid) ? 1: 0; |
| 1319 | 1319 | $xml['users']['user'][] = $team_members[$member->boinc_id]; |
| 1320 | - } |
|
| 1320 | + } |
|
| 1321 | 1321 | } // end if credit_only |
| 1322 | - } |
|
| 1323 | - else { |
|
| 1322 | + } |
|
| 1323 | + else { |
|
| 1324 | 1324 | $xml = array( |
| 1325 | - 'error' => array( |
|
| 1325 | + 'error' => array( |
|
| 1326 | 1326 | 'error_num' => -136, |
| 1327 | 1327 | 'error_msg' => 'Not found', |
| 1328 | - ), |
|
| 1328 | + ), |
|
| 1329 | 1329 | ); |
| 1330 | - } // end if boincteam_id |
|
| 1331 | - print xml_to_text(array_to_xml($xml), TRUE, TRUE); |
|
| 1330 | + } // end if boincteam_id |
|
| 1331 | + print xml_to_text(array_to_xml($xml), TRUE, TRUE); |
|
| 1332 | 1332 | } |
| 1333 | 1333 | |
| 1334 | 1334 | /** |
@@ -1336,114 +1336,114 @@ discard block |
||
| 1336 | 1336 | * Edit the forum preferences for a given user |
| 1337 | 1337 | */ |
| 1338 | 1338 | function boinccore_edit_forum_preferences() { |
| 1339 | - // Do not pass through to BOINC in this case as BOINC forums are no longer |
|
| 1340 | - // relevant -- use Drupal data only |
|
| 1339 | + // Do not pass through to BOINC in this case as BOINC forums are no longer |
|
| 1340 | + // relevant -- use Drupal data only |
|
| 1341 | 1341 | |
| 1342 | - $account_key = !empty($_POST['account_key']) ? $_POST['account_key'] : (!empty($_GET['account_key']) ? $_GET['account_key'] : NULL); |
|
| 1342 | + $account_key = !empty($_POST['account_key']) ? $_POST['account_key'] : (!empty($_GET['account_key']) ? $_GET['account_key'] : NULL); |
|
| 1343 | 1343 | |
| 1344 | - require_boinc('boinc_db'); |
|
| 1345 | - $boincuser = BoincUser::lookup_auth($account_key); |
|
| 1346 | - if ($boincuser) { |
|
| 1344 | + require_boinc('boinc_db'); |
|
| 1345 | + $boincuser = BoincUser::lookup_auth($account_key); |
|
| 1346 | + if ($boincuser) { |
|
| 1347 | 1347 | $uid = boincuser_lookup_uid($boincuser->id); |
| 1348 | 1348 | if ($uid AND $account = user_load($uid)) { |
| 1349 | - // Currently supported preferences |
|
| 1350 | - $avatar_url = isset($_POST['avatar_url']) ? $_POST['avatar_url'] : (isset($_GET['avatar_url']) ? $_GET['avatar_url'] : NULL); |
|
| 1351 | - $hide_signatures = isset($_POST['forum_hide_signatures']) ? $_POST['forum_hide_signatures'] : (isset($_GET['forum_hide_signatures']) ? $_GET['forum_hide_signatures'] : NULL); |
|
| 1352 | - $signature = isset($_POST['signature']) ? $_POST['signature'] : (isset($_GET['signature']) ? $_GET['signature'] : NULL); |
|
| 1353 | - $post_order = isset($_POST['thread_sort']) ? $_POST['thread_sort'] : (isset($_GET['thread_sort']) ? $_GET['thread_sort'] : NULL); |
|
| 1354 | - // Update preferences as needed |
|
| 1355 | - if ($avatar_url) { |
|
| 1349 | + // Currently supported preferences |
|
| 1350 | + $avatar_url = isset($_POST['avatar_url']) ? $_POST['avatar_url'] : (isset($_GET['avatar_url']) ? $_GET['avatar_url'] : NULL); |
|
| 1351 | + $hide_signatures = isset($_POST['forum_hide_signatures']) ? $_POST['forum_hide_signatures'] : (isset($_GET['forum_hide_signatures']) ? $_GET['forum_hide_signatures'] : NULL); |
|
| 1352 | + $signature = isset($_POST['signature']) ? $_POST['signature'] : (isset($_GET['signature']) ? $_GET['signature'] : NULL); |
|
| 1353 | + $post_order = isset($_POST['thread_sort']) ? $_POST['thread_sort'] : (isset($_GET['thread_sort']) ? $_GET['thread_sort'] : NULL); |
|
| 1354 | + // Update preferences as needed |
|
| 1355 | + if ($avatar_url) { |
|
| 1356 | 1356 | $avatar_image = file_get_contents($avatar_url); |
| 1357 | 1357 | if ($avatar_image) { |
| 1358 | - $image_dir = 'profiles'; |
|
| 1359 | - $image_path = "{$image_dir}/{$boincuser->id}_avatar.jpg"; |
|
| 1360 | - $file = file_save_data($avatar_image, $image_path, FILE_EXISTS_REPLACE); |
|
| 1361 | - if ($file) { |
|
| 1358 | + $image_dir = 'profiles'; |
|
| 1359 | + $image_path = "{$image_dir}/{$boincuser->id}_avatar.jpg"; |
|
| 1360 | + $file = file_save_data($avatar_image, $image_path, FILE_EXISTS_REPLACE); |
|
| 1361 | + if ($file) { |
|
| 1362 | 1362 | $profile = new stdClass(); |
| 1363 | 1363 | $profile->type = 'profile'; |
| 1364 | 1364 | $profile->language = NULL; |
| 1365 | 1365 | if ($profile_nid = content_profile_profile_exists($profile, $account->uid)) { |
| 1366 | - $profile_node = node_load($profile_nid); |
|
| 1367 | - if ($profile_node) { |
|
| 1366 | + $profile_node = node_load($profile_nid); |
|
| 1367 | + if ($profile_node) { |
|
| 1368 | 1368 | $avatar_image = get_cck_image_object(file_directory_path() . '/' . $image_path, 'field_image', 'profile', TRUE); |
| 1369 | 1369 | if ($avatar_image) { |
| 1370 | - $profile_node->field_image[0] = $avatar_image; |
|
| 1371 | - node_save($profile_node); |
|
| 1370 | + $profile_node->field_image[0] = $avatar_image; |
|
| 1371 | + node_save($profile_node); |
|
| 1372 | 1372 | } |
| 1373 | 1373 | else { |
| 1374 | - $error = 'Error saving avatar to profile'; |
|
| 1374 | + $error = 'Error saving avatar to profile'; |
|
| 1375 | 1375 | } |
| 1376 | - } |
|
| 1377 | - else { |
|
| 1376 | + } |
|
| 1377 | + else { |
|
| 1378 | 1378 | $error = 'Unable to load user profile'; |
| 1379 | - } |
|
| 1379 | + } |
|
| 1380 | 1380 | } |
| 1381 | 1381 | else { |
| 1382 | - $error = 'User has no profile, so avatar could not be added'; |
|
| 1382 | + $error = 'User has no profile, so avatar could not be added'; |
|
| 1383 | + } |
|
| 1383 | 1384 | } |
| 1384 | - } |
|
| 1385 | - else { |
|
| 1385 | + else { |
|
| 1386 | 1386 | $error = 'Unable to save remote image'; |
| 1387 | - } |
|
| 1387 | + } |
|
| 1388 | 1388 | } |
| 1389 | 1389 | else { |
| 1390 | - $error = 'Could not find avatar image at URL'; |
|
| 1390 | + $error = 'Could not find avatar image at URL'; |
|
| 1391 | 1391 | } |
| 1392 | - } |
|
| 1393 | - if ($hide_signatures !== NULL) { |
|
| 1392 | + } |
|
| 1393 | + if ($hide_signatures !== NULL) { |
|
| 1394 | 1394 | user_save($account, array('hide_signatures' => ($hide_signatures ? 1 : 0))); |
| 1395 | - } |
|
| 1396 | - if ($signature !== NULL) { |
|
| 1395 | + } |
|
| 1396 | + if ($signature !== NULL) { |
|
| 1397 | 1397 | $signature = check_markup($signature); |
| 1398 | 1398 | user_save($account, array('signature' => $signature)); |
| 1399 | - } |
|
| 1400 | - if ($post_order) { |
|
| 1399 | + } |
|
| 1400 | + if ($post_order) { |
|
| 1401 | 1401 | require_boinc('forum'); |
| 1402 | 1402 | $post_order_map = array( |
| 1403 | - CREATE_TIME_OLD => 2, |
|
| 1404 | - CREATE_TIME_NEW => 1, |
|
| 1403 | + CREATE_TIME_OLD => 2, |
|
| 1404 | + CREATE_TIME_NEW => 1, |
|
| 1405 | 1405 | ); |
| 1406 | 1406 | $drupal_post_order = isset($post_order_map[$post_order]) ? $post_order_map[$post_order] : 2; |
| 1407 | 1407 | user_save($account, array('sort' => $drupal_post_order)); |
| 1408 | - } |
|
| 1409 | - if (!$error) { |
|
| 1408 | + } |
|
| 1409 | + if (!$error) { |
|
| 1410 | 1410 | // Success |
| 1411 | 1411 | $xml = array( |
| 1412 | - 'edit_forum_preferences' => array( |
|
| 1412 | + 'edit_forum_preferences' => array( |
|
| 1413 | 1413 | 'success' => NULL, |
| 1414 | - ), |
|
| 1414 | + ), |
|
| 1415 | 1415 | ); |
| 1416 | - } |
|
| 1417 | - else { |
|
| 1416 | + } |
|
| 1417 | + else { |
|
| 1418 | 1418 | // Failure |
| 1419 | 1419 | $xml = array( |
| 1420 | - 'error' => array( |
|
| 1420 | + 'error' => array( |
|
| 1421 | 1421 | 'error_num' => -1, |
| 1422 | 1422 | 'error_msg' => $error, |
| 1423 | - ), |
|
| 1423 | + ), |
|
| 1424 | 1424 | ); |
| 1425 | - } |
|
| 1425 | + } |
|
| 1426 | 1426 | } |
| 1427 | 1427 | else { |
| 1428 | - // Drupal user not found |
|
| 1429 | - $xml = array( |
|
| 1428 | + // Drupal user not found |
|
| 1429 | + $xml = array( |
|
| 1430 | 1430 | 'error' => array( |
| 1431 | - 'error_num' => -1, |
|
| 1432 | - 'error_msg' => 'Unknown error', |
|
| 1431 | + 'error_num' => -1, |
|
| 1432 | + 'error_msg' => 'Unknown error', |
|
| 1433 | 1433 | ), |
| 1434 | - ); |
|
| 1434 | + ); |
|
| 1435 | 1435 | } |
| 1436 | - } |
|
| 1437 | - else { |
|
| 1436 | + } |
|
| 1437 | + else { |
|
| 1438 | 1438 | // BOINC user not found |
| 1439 | 1439 | $xml = array( |
| 1440 | - 'error' => array( |
|
| 1440 | + 'error' => array( |
|
| 1441 | 1441 | 'error_num' => -136, |
| 1442 | 1442 | 'error_msg' => 'Not found', |
| 1443 | - ), |
|
| 1443 | + ), |
|
| 1444 | 1444 | ); |
| 1445 | - } |
|
| 1446 | - print xml_to_text(array_to_xml($xml), TRUE, TRUE); |
|
| 1445 | + } |
|
| 1446 | + print xml_to_text(array_to_xml($xml), TRUE, TRUE); |
|
| 1447 | 1447 | } |
| 1448 | 1448 | |
| 1449 | 1449 | /** |
@@ -1451,14 +1451,14 @@ discard block |
||
| 1451 | 1451 | * Get the last comments OR threads made by a given user |
| 1452 | 1452 | */ |
| 1453 | 1453 | function boinccore_forum_get_data() { |
| 1454 | - // Do not pass through to BOINC in this case as BOINC forums are no longer |
|
| 1455 | - // relevant -- use Drupal data only |
|
| 1454 | + // Do not pass through to BOINC in this case as BOINC forums are no longer |
|
| 1455 | + // relevant -- use Drupal data only |
|
| 1456 | 1456 | |
| 1457 | - $xml = array(); |
|
| 1458 | - $boinc_id = !empty($_POST['userid']) ? $_POST['userid'] : (!empty($_GET['userid']) ? $_GET['userid'] : NULL); |
|
| 1459 | - $uid = boincuser_lookup_uid($boinc_id); |
|
| 1457 | + $xml = array(); |
|
| 1458 | + $boinc_id = !empty($_POST['userid']) ? $_POST['userid'] : (!empty($_GET['userid']) ? $_GET['userid'] : NULL); |
|
| 1459 | + $uid = boincuser_lookup_uid($boinc_id); |
|
| 1460 | 1460 | |
| 1461 | - if ($uid) { |
|
| 1461 | + if ($uid) { |
|
| 1462 | 1462 | $method = !empty($_POST['method']) ? $_POST['method'] : (!empty($_GET['method']) ? $_GET['method'] : NULL); |
| 1463 | 1463 | $count = !empty($_POST['count']) ? $_POST['count'] : (!empty($_GET['count']) ? $_GET['count'] : NULL); |
| 1464 | 1464 | if (!$count) $count = 10; |
@@ -1466,7 +1466,7 @@ discard block |
||
| 1466 | 1466 | switch ($method) { |
| 1467 | 1467 | case 'user_posts': |
| 1468 | 1468 | $content_length = !empty($_POST['content_length']) ? $_POST['content_length'] : (!empty($_GET['content_length']) ? $_GET['content_length'] : NULL); |
| 1469 | - $posts = db_query(" |
|
| 1469 | + $posts = db_query(" |
|
| 1470 | 1470 | SELECT |
| 1471 | 1471 | c.cid, |
| 1472 | 1472 | n.nid, |
@@ -1480,26 +1480,26 @@ discard block |
||
| 1480 | 1480 | ORDER BY timestamp DESC |
| 1481 | 1481 | LIMIT %d", |
| 1482 | 1482 | $uid, (int) $count |
| 1483 | - ); |
|
| 1484 | - $xml = array( |
|
| 1483 | + ); |
|
| 1484 | + $xml = array( |
|
| 1485 | 1485 | 'rpc_response' => array( |
| 1486 | - 'count' => 0, |
|
| 1487 | - 'posts' => array(), |
|
| 1486 | + 'count' => 0, |
|
| 1487 | + 'posts' => array(), |
|
| 1488 | 1488 | ), |
| 1489 | - ); |
|
| 1490 | - $post_count = 0; |
|
| 1491 | - while ($post = db_fetch_object($posts)) { |
|
| 1489 | + ); |
|
| 1490 | + $post_count = 0; |
|
| 1491 | + while ($post = db_fetch_object($posts)) { |
|
| 1492 | 1492 | $xml['rpc_response']['posts']['post'][] = array( |
| 1493 | - 'id' => $post->cid, |
|
| 1494 | - 'threadid' => $post->nid, |
|
| 1495 | - 'threadtitle' => $post->title, |
|
| 1496 | - 'timestamp' => $post->timestamp, |
|
| 1497 | - 'content' => ($content_length ? substr($post->comment, 0, $content_length) : $post->comment), |
|
| 1493 | + 'id' => $post->cid, |
|
| 1494 | + 'threadid' => $post->nid, |
|
| 1495 | + 'threadtitle' => $post->title, |
|
| 1496 | + 'timestamp' => $post->timestamp, |
|
| 1497 | + 'content' => ($content_length ? substr($post->comment, 0, $content_length) : $post->comment), |
|
| 1498 | 1498 | ); |
| 1499 | 1499 | $post_count++; |
| 1500 | - } |
|
| 1501 | - $xml['rpc_response']['count'] = $post_count; |
|
| 1502 | - break; |
|
| 1500 | + } |
|
| 1501 | + $xml['rpc_response']['count'] = $post_count; |
|
| 1502 | + break; |
|
| 1503 | 1503 | |
| 1504 | 1504 | case 'user_threads': |
| 1505 | 1505 | $threads = db_query(" |
@@ -1523,45 +1523,45 @@ discard block |
||
| 1523 | 1523 | ORDER BY changed DESC |
| 1524 | 1524 | LIMIT %d", |
| 1525 | 1525 | $uid, (int) $count |
| 1526 | - ); |
|
| 1527 | - $xml = array( |
|
| 1526 | + ); |
|
| 1527 | + $xml = array( |
|
| 1528 | 1528 | 'rpc_response' => array( |
| 1529 | - 'count' => 0, |
|
| 1530 | - 'threads' => array(), |
|
| 1529 | + 'count' => 0, |
|
| 1530 | + 'threads' => array(), |
|
| 1531 | 1531 | ), |
| 1532 | - ); |
|
| 1533 | - $thread_count = 0; |
|
| 1534 | - while ($thread = db_fetch_object($threads)) { |
|
| 1532 | + ); |
|
| 1533 | + $thread_count = 0; |
|
| 1534 | + while ($thread = db_fetch_object($threads)) { |
|
| 1535 | 1535 | $xml['rpc_response']['threads']['thread'][] = array( |
| 1536 | - 'id' => $thread->nid, |
|
| 1537 | - 'forumid' => $thread->tid, |
|
| 1538 | - 'replies' => $thread->replies, |
|
| 1539 | - 'views' => $thread->views, |
|
| 1540 | - 'timestamp' => $thread->changed, |
|
| 1541 | - 'title' => $thread->title, |
|
| 1536 | + 'id' => $thread->nid, |
|
| 1537 | + 'forumid' => $thread->tid, |
|
| 1538 | + 'replies' => $thread->replies, |
|
| 1539 | + 'views' => $thread->views, |
|
| 1540 | + 'timestamp' => $thread->changed, |
|
| 1541 | + 'title' => $thread->title, |
|
| 1542 | 1542 | ); |
| 1543 | 1543 | $thread_count++; |
| 1544 | - } |
|
| 1545 | - $xml['rpc_response']['count'] = $thread_count; |
|
| 1546 | - break; |
|
| 1544 | + } |
|
| 1545 | + $xml['rpc_response']['count'] = $thread_count; |
|
| 1546 | + break; |
|
| 1547 | 1547 | default: |
| 1548 | 1548 | $xml = array( |
| 1549 | 1549 | 'error' => array( |
| 1550 | - 'error_num' => -1, |
|
| 1551 | - 'error_msg' => 'Unknown error', |
|
| 1550 | + 'error_num' => -1, |
|
| 1551 | + 'error_msg' => 'Unknown error', |
|
| 1552 | 1552 | ), |
| 1553 | - ); |
|
| 1553 | + ); |
|
| 1554 | 1554 | } |
| 1555 | - } |
|
| 1556 | - else { |
|
| 1555 | + } |
|
| 1556 | + else { |
|
| 1557 | 1557 | $xml = array( |
| 1558 | - 'error' => array( |
|
| 1558 | + 'error' => array( |
|
| 1559 | 1559 | 'error_num' => -136, |
| 1560 | 1560 | 'error_msg' => 'Not found', |
| 1561 | - ), |
|
| 1561 | + ), |
|
| 1562 | 1562 | ); |
| 1563 | - } |
|
| 1564 | - print xml_to_text(array_to_xml($xml), TRUE, TRUE); |
|
| 1563 | + } |
|
| 1564 | + print xml_to_text(array_to_xml($xml), TRUE, TRUE); |
|
| 1565 | 1565 | } |
| 1566 | 1566 | |
| 1567 | 1567 | /** |
@@ -1569,9 +1569,9 @@ discard block |
||
| 1569 | 1569 | * Get information on applications in the system |
| 1570 | 1570 | */ |
| 1571 | 1571 | function boinccore_apps() { |
| 1572 | - // Remove q from the GET request or BOINC will panic |
|
| 1573 | - unset($_GET['q']); |
|
| 1574 | - include_boinc('user/apps.php'); |
|
| 1572 | + // Remove q from the GET request or BOINC will panic |
|
| 1573 | + unset($_GET['q']); |
|
| 1574 | + include_boinc('user/apps.php'); |
|
| 1575 | 1575 | } |
| 1576 | 1576 | |
| 1577 | 1577 | /** |
@@ -1581,141 +1581,141 @@ discard block |
||
| 1581 | 1581 | * controller function, which can compute the page based on the user's settings |
| 1582 | 1582 | */ |
| 1583 | 1583 | function boinccore_url_pagination_handler($type, $object_id = NULL) { |
| 1584 | - global $user; |
|
| 1585 | - $path = NULL; |
|
| 1586 | - $params = array(); |
|
| 1587 | - switch ($type) { |
|
| 1588 | - case 'boinc-forum': |
|
| 1584 | + global $user; |
|
| 1585 | + $path = NULL; |
|
| 1586 | + $params = array(); |
|
| 1587 | + switch ($type) { |
|
| 1588 | + case 'boinc-forum': |
|
| 1589 | 1589 | // Redirect requests to a BOINC forum to the Drupal forum |
| 1590 | 1590 | $forum_id = db_result(db_query(' |
| 1591 | 1591 | SELECT tid |
| 1592 | 1592 | FROM {boincimport_temp_forum} |
| 1593 | 1593 | WHERE forum_id = %d', |
| 1594 | - $object_id |
|
| 1594 | + $object_id |
|
| 1595 | 1595 | )); |
| 1596 | 1596 | if ($forum_id) { |
| 1597 | - drupal_goto("community/forum/{$forum_id}"); |
|
| 1597 | + drupal_goto("community/forum/{$forum_id}"); |
|
| 1598 | 1598 | } |
| 1599 | 1599 | break; |
| 1600 | - case 'boinc-forum-index': |
|
| 1600 | + case 'boinc-forum-index': |
|
| 1601 | 1601 | // Redirect requests to the top level BOINC forum to Drupal forums |
| 1602 | 1602 | drupal_goto("community/forum"); |
| 1603 | 1603 | break; |
| 1604 | - case 'boinc-forum-post': |
|
| 1604 | + case 'boinc-forum-post': |
|
| 1605 | 1605 | // Redirect requests to a BOINC forum post to the Drupal comment |
| 1606 | 1606 | $cid = db_result(db_query(' |
| 1607 | 1607 | SELECT cid |
| 1608 | 1608 | FROM {boincimport_temp_post} |
| 1609 | 1609 | WHERE post_id = %d', |
| 1610 | - $object_id |
|
| 1610 | + $object_id |
|
| 1611 | 1611 | )); |
| 1612 | 1612 | if ($cid) { |
| 1613 | - drupal_goto("goto/comment/{$cid}"); |
|
| 1613 | + drupal_goto("goto/comment/{$cid}"); |
|
| 1614 | 1614 | } |
| 1615 | 1615 | break; |
| 1616 | - case 'boinc-forum-topic': |
|
| 1616 | + case 'boinc-forum-topic': |
|
| 1617 | 1617 | // Redirect requests to a BOINC forum topic to the Drupal node |
| 1618 | 1618 | $nid = db_result(db_query(' |
| 1619 | 1619 | SELECT nid |
| 1620 | 1620 | FROM {boincimport_temp_topic} |
| 1621 | 1621 | WHERE topic_id = %d', |
| 1622 | - $object_id |
|
| 1622 | + $object_id |
|
| 1623 | 1623 | )); |
| 1624 | 1624 | if ($nid) { |
| 1625 | - drupal_goto("node/{$nid}"); |
|
| 1625 | + drupal_goto("node/{$nid}"); |
|
| 1626 | 1626 | } |
| 1627 | 1627 | break; |
| 1628 | - case 'boinc-host': |
|
| 1628 | + case 'boinc-host': |
|
| 1629 | 1629 | // Redirect requests to BOINC host details to the host page in Drupal |
| 1630 | 1630 | drupal_goto("host/{$object_id}"); |
| 1631 | 1631 | break; |
| 1632 | - case 'boinc-hosts-user': |
|
| 1632 | + case 'boinc-hosts-user': |
|
| 1633 | 1633 | // Redirect requests to a BOINC user host list to the host list in Drupal |
| 1634 | 1634 | $uid = boincuser_lookup_uid($object_id); |
| 1635 | 1635 | if ($uid) { |
| 1636 | - drupal_goto("account/{$uid}/computers"); |
|
| 1636 | + drupal_goto("account/{$uid}/computers"); |
|
| 1637 | 1637 | } |
| 1638 | 1638 | break; |
| 1639 | - case 'boinc-result': |
|
| 1639 | + case 'boinc-result': |
|
| 1640 | 1640 | // Redirect requests to BOINC task details to the task page in Drupal |
| 1641 | 1641 | drupal_goto("task/{$object_id}"); |
| 1642 | - case 'boinc-results-host': |
|
| 1642 | + case 'boinc-results-host': |
|
| 1643 | 1643 | // Redirect requests to BOINC tasks by host to the host task page in Drupal |
| 1644 | 1644 | drupal_goto("host/{$object_id}/tasks"); |
| 1645 | 1645 | break; |
| 1646 | - case 'boinc-results-user': |
|
| 1646 | + case 'boinc-results-user': |
|
| 1647 | 1647 | // Redirect requests to a BOINC user's tasks to the Drupal account tasks |
| 1648 | 1648 | drupal_goto("account/tasks"); |
| 1649 | 1649 | break; |
| 1650 | - case 'boinc-user': |
|
| 1650 | + case 'boinc-user': |
|
| 1651 | 1651 | // Redirect requests to a BOINC user ID to the Drupal profile |
| 1652 | 1652 | $uid = boincuser_lookup_uid($object_id); |
| 1653 | 1653 | if ($uid) { |
| 1654 | - drupal_goto("account/{$uid}"); |
|
| 1654 | + drupal_goto("account/{$uid}"); |
|
| 1655 | 1655 | } |
| 1656 | 1656 | break; |
| 1657 | - case 'boinc-workunit': |
|
| 1657 | + case 'boinc-workunit': |
|
| 1658 | 1658 | // Redirect requests to BOINC workunits to the workunit page in Drupal |
| 1659 | 1659 | drupal_goto("workunit/{$object_id}"); |
| 1660 | 1660 | break; |
| 1661 | - case 'comment': |
|
| 1661 | + case 'comment': |
|
| 1662 | 1662 | $object = _comment_load($object_id); |
| 1663 | 1663 | if ($object) { |
| 1664 | - $path = "node/{$object->nid}"; |
|
| 1665 | - // Get the sort order |
|
| 1666 | - $gt_lt = '<'; |
|
| 1667 | - $comment_order = (isset($user->sort)) ? $user->sort : variable_get('comment_default_order_forum', 2); |
|
| 1668 | - if ($comment_order == COMMENT_ORDER_NEWEST_FIRST) { |
|
| 1664 | + $path = "node/{$object->nid}"; |
|
| 1665 | + // Get the sort order |
|
| 1666 | + $gt_lt = '<'; |
|
| 1667 | + $comment_order = (isset($user->sort)) ? $user->sort : variable_get('comment_default_order_forum', 2); |
|
| 1668 | + if ($comment_order == COMMENT_ORDER_NEWEST_FIRST) { |
|
| 1669 | 1669 | $gt_lt = '>'; |
| 1670 | - } |
|
| 1671 | - // See how many comments there are before (or after) this comment... |
|
| 1672 | - $comment_offset = db_result(db_query(' |
|
| 1670 | + } |
|
| 1671 | + // See how many comments there are before (or after) this comment... |
|
| 1672 | + $comment_offset = db_result(db_query(' |
|
| 1673 | 1673 | SELECT COUNT(*) FROM {comments} |
| 1674 | 1674 | WHERE nid = %d AND status = 0 AND timestamp %s %d', |
| 1675 | 1675 | $object->nid, $gt_lt, $object->timestamp)); |
| 1676 | - if ($comment_offset) { |
|
| 1676 | + if ($comment_offset) { |
|
| 1677 | 1677 | // Get the number of comments per page |
| 1678 | 1678 | if ($user->comments_per_page) { |
| 1679 | - $comments_per_page = $user->comments_per_page; |
|
| 1679 | + $comments_per_page = $user->comments_per_page; |
|
| 1680 | 1680 | } |
| 1681 | 1681 | else { |
| 1682 | - $node = node_load($object->nid); |
|
| 1683 | - $comments_per_page = variable_get( |
|
| 1682 | + $node = node_load($object->nid); |
|
| 1683 | + $comments_per_page = variable_get( |
|
| 1684 | 1684 | "comment_default_per_page_{$node->type}", 50 |
| 1685 | - ); |
|
| 1685 | + ); |
|
| 1686 | 1686 | } |
| 1687 | 1687 | // Determine which page to display in order to show the given comment |
| 1688 | 1688 | $page = floor($comment_offset / $comments_per_page); |
| 1689 | 1689 | if ($page) { |
| 1690 | - $params = array('page' => $page); |
|
| 1690 | + $params = array('page' => $page); |
|
| 1691 | + } |
|
| 1691 | 1692 | } |
| 1692 | - } |
|
| 1693 | 1693 | } |
| 1694 | 1694 | if ($path) { |
| 1695 | - drupal_goto($path, $params, "comment-{$object->cid}"); |
|
| 1695 | + drupal_goto($path, $params, "comment-{$object->cid}"); |
|
| 1696 | 1696 | } |
| 1697 | 1697 | break; |
| 1698 | - case 'friend-requests': |
|
| 1698 | + case 'friend-requests': |
|
| 1699 | 1699 | // Check for a login, then redirect to the user's friend requests page |
| 1700 | 1700 | if ($user->uid) { |
| 1701 | - drupal_goto("account/{$user->uid}/friends/pending"); |
|
| 1701 | + drupal_goto("account/{$user->uid}/friends/pending"); |
|
| 1702 | 1702 | } |
| 1703 | 1703 | else { |
| 1704 | - drupal_goto('user/login', array( |
|
| 1704 | + drupal_goto('user/login', array( |
|
| 1705 | 1705 | 'destination' => 'goto/friend-requests' |
| 1706 | - )); |
|
| 1706 | + )); |
|
| 1707 | 1707 | } |
| 1708 | 1708 | break; |
| 1709 | - default: |
|
| 1709 | + default: |
|
| 1710 | 1710 | } |
| 1711 | - drupal_not_found(); |
|
| 1711 | + drupal_not_found(); |
|
| 1712 | 1712 | } |
| 1713 | 1713 | |
| 1714 | 1714 | /* |
| 1715 | 1715 | * Fetch an array of all countries |
| 1716 | 1716 | */ |
| 1717 | 1717 | function boinccore_get_country_list() { |
| 1718 | - return array( |
|
| 1718 | + return array( |
|
| 1719 | 1719 | 'None' => 'None', |
| 1720 | 1720 | 'International' => 'International', |
| 1721 | 1721 | 'Afghanistan' => 'Afghanistan', |
@@ -1949,7 +1949,7 @@ discard block |
||
| 1949 | 1949 | 'Yemen' => 'Yemen', |
| 1950 | 1950 | 'Zambia' => 'Zambia', |
| 1951 | 1951 | 'Zimbabwe' => 'Zimbabwe', |
| 1952 | - ); |
|
| 1952 | + ); |
|
| 1953 | 1953 | } |
| 1954 | 1954 | |
| 1955 | 1955 | |
@@ -1961,46 +1961,46 @@ discard block |
||
| 1961 | 1961 | * Action: Mark node for moderation |
| 1962 | 1962 | */ |
| 1963 | 1963 | function boinccore_rules_action_mark_content_for_moderation($node) { |
| 1964 | - $node->moderate = 1; |
|
| 1965 | - return array('node' => $node); |
|
| 1964 | + $node->moderate = 1; |
|
| 1965 | + return array('node' => $node); |
|
| 1966 | 1966 | } |
| 1967 | 1967 | |
| 1968 | 1968 | /** |
| 1969 | 1969 | * Action: Send mail to moderators. |
| 1970 | 1970 | */ |
| 1971 | 1971 | function boinccore_rules_action_mail_to_moderators($settings) { |
| 1972 | - module_load_include('inc', 'rules', 'modules/system.rules'); |
|
| 1973 | - $mailing_list = variable_get('boinc_moderator_mailing_list', ''); |
|
| 1974 | - $force_individual_notifications = variable_get('boinc_moderator_force_individual_notifications', 0); |
|
| 1972 | + module_load_include('inc', 'rules', 'modules/system.rules'); |
|
| 1973 | + $mailing_list = variable_get('boinc_moderator_mailing_list', ''); |
|
| 1974 | + $force_individual_notifications = variable_get('boinc_moderator_force_individual_notifications', 0); |
|
| 1975 | 1975 | |
| 1976 | - if (!$mailing_list OR $force_individual_notifications) { |
|
| 1976 | + if (!$mailing_list OR $force_individual_notifications) { |
|
| 1977 | 1977 | // Send individual emails to all moderators |
| 1978 | 1978 | $roles = user_roles(); |
| 1979 | 1979 | $moderator_rid = array_search('moderator', $roles); |
| 1980 | 1980 | if ($moderator_rid !== FALSE) { |
| 1981 | - $settings['recipients'] = array($moderator_rid); |
|
| 1982 | - rules_action_mail_to_users_of_role($settings); |
|
| 1981 | + $settings['recipients'] = array($moderator_rid); |
|
| 1982 | + rules_action_mail_to_users_of_role($settings); |
|
| 1983 | 1983 | } |
| 1984 | 1984 | else { |
| 1985 | - watchdog( |
|
| 1985 | + watchdog( |
|
| 1986 | 1986 | 'boinccore', |
| 1987 | 1987 | 'Unable to identify members of the moderator role to send moderator notifications!', |
| 1988 | 1988 | array(), |
| 1989 | 1989 | WATCHDOG_ERROR |
| 1990 | - ); |
|
| 1990 | + ); |
|
| 1991 | 1991 | } |
| 1992 | - } |
|
| 1993 | - if ($mailing_list) { |
|
| 1992 | + } |
|
| 1993 | + if ($mailing_list) { |
|
| 1994 | 1994 | $settings['to'] = $mailing_list; |
| 1995 | 1995 | rules_action_mail($settings); |
| 1996 | - } |
|
| 1996 | + } |
|
| 1997 | 1997 | } |
| 1998 | 1998 | /** |
| 1999 | 1999 | * Action "Send mail to moderators" configuration form |
| 2000 | 2000 | */ |
| 2001 | 2001 | function boinccore_rules_action_mail_to_moderators_form($settings = array(), &$form) { |
| 2002 | - // Select only non-anonymous user roles because anonymous users won't have emails. |
|
| 2003 | - rules_action_mail_to_user_form($settings, $form); |
|
| 2002 | + // Select only non-anonymous user roles because anonymous users won't have emails. |
|
| 2003 | + rules_action_mail_to_user_form($settings, $form); |
|
| 2004 | 2004 | } |
| 2005 | 2005 | |
| 2006 | 2006 | |
@@ -2008,27 +2008,27 @@ discard block |
||
| 2008 | 2008 | * Action: Send mail to admins. |
| 2009 | 2009 | */ |
| 2010 | 2010 | function boinccore_rules_action_mail_to_admins($settings) { |
| 2011 | - module_load_include('inc', 'rules', 'modules/system.rules'); |
|
| 2012 | - $mailing_list = variable_get('boinc_admin_mailing_list', ''); |
|
| 2013 | - if (empty($mailing_list)) { |
|
| 2011 | + module_load_include('inc', 'rules', 'modules/system.rules'); |
|
| 2012 | + $mailing_list = variable_get('boinc_admin_mailing_list', ''); |
|
| 2013 | + if (empty($mailing_list)) { |
|
| 2014 | 2014 | $mailing_list = variable_get('site_mail', ''); |
| 2015 | 2015 | if (empty($mailing_list)) { |
| 2016 | - watchdog('boinccore', |
|
| 2016 | + watchdog('boinccore', |
|
| 2017 | 2017 | 'Attempting to email administrators, but there is no admin email list or site email to send to.', array(), |
| 2018 | 2018 | WATCHDOG_ERROR |
| 2019 | - ); |
|
| 2020 | - return FALSE; |
|
| 2019 | + ); |
|
| 2020 | + return FALSE; |
|
| 2021 | 2021 | } |
| 2022 | - } |
|
| 2023 | - $settings['to'] = $mailing_list; |
|
| 2024 | - rules_action_mail($settings); |
|
| 2022 | + } |
|
| 2023 | + $settings['to'] = $mailing_list; |
|
| 2024 | + rules_action_mail($settings); |
|
| 2025 | 2025 | } |
| 2026 | 2026 | |
| 2027 | 2027 | /** |
| 2028 | 2028 | * Action "Send mail to admins" configuration form |
| 2029 | 2029 | */ |
| 2030 | 2030 | function boinccore_rules_action_mail_to_admins_form($settings = array(), &$form) { |
| 2031 | - rules_action_mail_to_user_form($settings, $form); |
|
| 2031 | + rules_action_mail_to_user_form($settings, $form); |
|
| 2032 | 2032 | } |
| 2033 | 2033 | |
| 2034 | 2034 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * |
@@ -2039,33 +2039,33 @@ discard block |
||
| 2039 | 2039 | * BOINC wrapper for string translation |
| 2040 | 2040 | */ |
| 2041 | 2041 | function bts($string, $args = array(), $langcode = NULL, $context = 'boinc: ', $update = TRUE) { |
| 2042 | - if (function_exists('i18nstrings_ts')) { |
|
| 2042 | + if (function_exists('i18nstrings_ts')) { |
|
| 2043 | 2043 | $string = i18nstrings_ts($context, $string, $langcode, $update); |
| 2044 | - } |
|
| 2045 | - if (empty($args)) { |
|
| 2044 | + } |
|
| 2045 | + if (empty($args)) { |
|
| 2046 | 2046 | return $string; |
| 2047 | - } |
|
| 2048 | - else { |
|
| 2047 | + } |
|
| 2048 | + else { |
|
| 2049 | 2049 | // Transform arguments before inserting them. |
| 2050 | 2050 | foreach ($args as $key => $value) { |
| 2051 | - switch ($key [0]) { |
|
| 2051 | + switch ($key [0]) { |
|
| 2052 | 2052 | case '@': |
| 2053 | 2053 | // Escaped only. |
| 2054 | 2054 | $args [$key] = check_plain($value); |
| 2055 | - break; |
|
| 2055 | + break; |
|
| 2056 | 2056 | |
| 2057 | 2057 | case '%': |
| 2058 | 2058 | default: |
| 2059 | 2059 | // Escaped and placeholder. |
| 2060 | 2060 | $args [$key] = theme('placeholder', $value); |
| 2061 | - break; |
|
| 2061 | + break; |
|
| 2062 | 2062 | |
| 2063 | 2063 | case '!': |
| 2064 | 2064 | // Pass-through. |
| 2065 | 2065 | } |
| 2066 | 2066 | } |
| 2067 | 2067 | return strtr($string, $args); |
| 2068 | - } |
|
| 2068 | + } |
|
| 2069 | 2069 | } |
| 2070 | 2070 | |
| 2071 | 2071 | |
@@ -2077,9 +2077,9 @@ discard block |
||
| 2077 | 2077 | * Overview of moderation queues |
| 2078 | 2078 | */ |
| 2079 | 2079 | function boinccore_moderation_overview_panel() { |
| 2080 | - $output = '<h2 class="pane-title">' . bts('Moderation', array(), NULL, 'boinc:moderate-profiles') . '</h2>'; |
|
| 2081 | - $output .= '<ul class="tab-list action-list">'; |
|
| 2082 | - if (module_exists('user_profiles')) { |
|
| 2080 | + $output = '<h2 class="pane-title">' . bts('Moderation', array(), NULL, 'boinc:moderate-profiles') . '</h2>'; |
|
| 2081 | + $output .= '<ul class="tab-list action-list">'; |
|
| 2082 | + if (module_exists('user_profiles')) { |
|
| 2083 | 2083 | $profile_count = db_result(db_query(" |
| 2084 | 2084 | SELECT COUNT(DISTINCT(n.nid)) |
| 2085 | 2085 | FROM {node} n |
@@ -2091,9 +2091,9 @@ discard block |
||
| 2091 | 2091 | $output .= '<span class="item-count">' . $profile_count . '</span>'; |
| 2092 | 2092 | $output .= '</div>'; |
| 2093 | 2093 | $output .= '</li>'; |
| 2094 | - } |
|
| 2095 | - $output .= '</ul>'; |
|
| 2096 | - return $output; |
|
| 2094 | + } |
|
| 2095 | + $output .= '</ul>'; |
|
| 2096 | + return $output; |
|
| 2097 | 2097 | } |
| 2098 | 2098 | |
| 2099 | 2099 | |
@@ -2103,10 +2103,10 @@ discard block |
||
| 2103 | 2103 | * |
| 2104 | 2104 | */ |
| 2105 | 2105 | function _boinccore_delete_expired_tokens() { |
| 2106 | - require_boinc('boinc_db'); |
|
| 2106 | + require_boinc('boinc_db'); |
|
| 2107 | 2107 | |
| 2108 | - $num_deleted = BoincToken::delete_expired(); |
|
| 2109 | - if ($num_deleted>0) { |
|
| 2108 | + $num_deleted = BoincToken::delete_expired(); |
|
| 2109 | + if ($num_deleted>0) { |
|
| 2110 | 2110 | watchdog('boinccore', "Deleted ${num_deleted} tokens from table token", WATCHDOG_NOTICE); |
| 2111 | - } |
|
| 2111 | + } |
|
| 2112 | 2112 | } |
@@ -14,84 +14,84 @@ discard block |
||
| 14 | 14 | * The definition of the create team form |
| 15 | 15 | */ |
| 16 | 16 | function boincteam_forum_create_form(&$form_state) { |
| 17 | - $form = array(); |
|
| 17 | + $form = array(); |
|
| 18 | 18 | |
| 19 | - global $user; |
|
| 20 | - $account = user_load($user->uid); |
|
| 19 | + global $user; |
|
| 20 | + $account = user_load($user->uid); |
|
| 21 | 21 | |
| 22 | - $default = array( |
|
| 22 | + $default = array( |
|
| 23 | 23 | 'title' => '', |
| 24 | 24 | 'min_time_between_posts' => '', |
| 25 | 25 | 'min_total_credit_to_post' => '', |
| 26 | 26 | 'min_avg_credit_to_post' => '', |
| 27 | 27 | 'public' => 0, |
| 28 | 28 | 'description' => '', |
| 29 | - ); |
|
| 29 | + ); |
|
| 30 | 30 | |
| 31 | - // Standard option sets |
|
| 32 | - $form['boolean_options'] = array( |
|
| 31 | + // Standard option sets |
|
| 32 | + $form['boolean_options'] = array( |
|
| 33 | 33 | '#type' => 'value', |
| 34 | 34 | '#value' => array(1 => bts('yes', array(), NULL, 'boinc:form-yes-no:-1:binary-form-option-pairs-with-no'), 0 => bts('no', array(), NULL, 'boinc:form-yes-no:-1:binary-form-option-pairs-with-yes')), |
| 35 | - ); |
|
| 35 | + ); |
|
| 36 | 36 | |
| 37 | - // Form elements |
|
| 38 | - $form['title'] = array( |
|
| 37 | + // Form elements |
|
| 38 | + $form['title'] = array( |
|
| 39 | 39 | '#title' => bts('Message board title', array(), NULL, 'boinc:team-forum-create/edit'), |
| 40 | 40 | '#type' => 'textfield', |
| 41 | 41 | '#default_value' => $default['title'], |
| 42 | 42 | '#size' => 34, |
| 43 | 43 | '#description' => bts('Text only, no HTML tags', array(), NULL, 'boinc:team-form-help'), |
| 44 | - ); |
|
| 45 | - $form['min_time_between_posts'] = array( |
|
| 44 | + ); |
|
| 45 | + $form['min_time_between_posts'] = array( |
|
| 46 | 46 | '#title' => bts('Minimum time between posts', array(), NULL, 'boinc:team-forum-create/edit'), |
| 47 | 47 | '#type' => 'textfield', |
| 48 | 48 | '#default_value' => $default['min_time_between_posts'], |
| 49 | 49 | '#size' => 12, |
| 50 | 50 | '#description' => bts('seconds', array(), NULL, 'boinc:unit-of-time'), |
| 51 | - ); |
|
| 52 | - $form['min_total_credit_to_post'] = array( |
|
| 51 | + ); |
|
| 52 | + $form['min_total_credit_to_post'] = array( |
|
| 53 | 53 | '#title' => bts('Minimum total credit to post', array(), NULL, 'boinc:team-forum-create/edit'), |
| 54 | 54 | '#type' => 'textfield', |
| 55 | 55 | '#default_value' => $default['min_total_credit_to_post'], |
| 56 | 56 | '#size' => 12, |
| 57 | - ); |
|
| 58 | - $form['min_avg_credit_to_post'] = array( |
|
| 57 | + ); |
|
| 58 | + $form['min_avg_credit_to_post'] = array( |
|
| 59 | 59 | '#title' => bts('Minimum avg credit to post', array(), NULL, 'boinc:team-forum-create/edit'), |
| 60 | 60 | '#type' => 'textfield', |
| 61 | 61 | '#default_value' => $default['min_avg_credit_to_post'], |
| 62 | 62 | '#size' => 12, |
| 63 | - ); |
|
| 64 | - $form['public'] = array( |
|
| 63 | + ); |
|
| 64 | + $form['public'] = array( |
|
| 65 | 65 | '#title' => bts('Allow public to read board?', array(), NULL, 'boinc:team-forum-create/edit'), |
| 66 | 66 | '#type' => 'radios', |
| 67 | 67 | '#options' => $form['boolean_options']['#value'], |
| 68 | 68 | '#attributes' => array('class' => 'fancy'), |
| 69 | 69 | '#default_value' => $default['public'], |
| 70 | - ); |
|
| 71 | - $form['description'] = array( |
|
| 70 | + ); |
|
| 71 | + $form['description'] = array( |
|
| 72 | 72 | '#title' => bts('Description', array(), NULL, 'boinc:team-forum-create/edit:-1:ignoreoverwrite'), |
| 73 | 73 | '#type' => 'textarea', |
| 74 | 74 | '#default_value' => $default['description'], |
| 75 | 75 | '#size' => 5, |
| 76 | - ); |
|
| 76 | + ); |
|
| 77 | 77 | |
| 78 | - // Form control |
|
| 79 | - $form['form control tabs prefix'] = array( |
|
| 78 | + // Form control |
|
| 79 | + $form['form control tabs prefix'] = array( |
|
| 80 | 80 | '#value' => '<ul class="form-control tab-list">' |
| 81 | - ); |
|
| 82 | - $form['submit'] = array( |
|
| 81 | + ); |
|
| 82 | + $form['submit'] = array( |
|
| 83 | 83 | '#prefix' => '<li class="first tab">', |
| 84 | 84 | '#type' => 'submit', |
| 85 | 85 | '#value' => bts('Create message board', array(), NULL, 'boinc:team-forum-create/edit'), |
| 86 | 86 | '#suffix' => '</li>', |
| 87 | - ); |
|
| 88 | - $form['form control tabs'] = array( |
|
| 87 | + ); |
|
| 88 | + $form['form control tabs'] = array( |
|
| 89 | 89 | '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), strstr($_GET['q'], '/forum/add', TRUE)) . '</li>' |
| 90 | - ); |
|
| 90 | + ); |
|
| 91 | 91 | |
| 92 | - $form['#redirect'] = "community/teams/{$account->team}"; |
|
| 92 | + $form['#redirect'] = "community/teams/{$account->team}"; |
|
| 93 | 93 | |
| 94 | - return $form; |
|
| 94 | + return $form; |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /** |
@@ -99,33 +99,33 @@ discard block |
||
| 99 | 99 | */ |
| 100 | 100 | function boincteam_forum_create_form_validate($form, &$form_state) { |
| 101 | 101 | |
| 102 | - $values = $form_state['values']; |
|
| 102 | + $values = $form_state['values']; |
|
| 103 | 103 | |
| 104 | - if (!$values['title']) { |
|
| 104 | + if (!$values['title']) { |
|
| 105 | 105 | form_set_error('name', bts('Message board title is required.', array(), NULL, 'boinc:team-forum-create/edit')); |
| 106 | - } |
|
| 107 | - if (!is_numeric($values['min_time_between_posts']) OR |
|
| 106 | + } |
|
| 107 | + if (!is_numeric($values['min_time_between_posts']) OR |
|
| 108 | 108 | $values['min_time_between_posts'] < 0) { |
| 109 | 109 | form_set_error('min_time_between_posts', |
| 110 | - bts('Please set the minimum time required between posts.', array(), NULL, 'boinc:team-forum-create/edit') |
|
| 110 | + bts('Please set the minimum time required between posts.', array(), NULL, 'boinc:team-forum-create/edit') |
|
| 111 | 111 | ); |
| 112 | - } |
|
| 113 | - if (!is_numeric($values['min_total_credit_to_post']) OR |
|
| 112 | + } |
|
| 113 | + if (!is_numeric($values['min_total_credit_to_post']) OR |
|
| 114 | 114 | $values['min_total_credit_to_post'] < 0) { |
| 115 | 115 | form_set_error('min_total_credit_to_post', |
| 116 | - bts('Please set the minimum total credit that a user' |
|
| 116 | + bts('Please set the minimum total credit that a user' |
|
| 117 | 117 | . ' must earn in order to post to this message board.', |
| 118 | 118 | array(), NULL, 'boinc:team-forum-create/edit') |
| 119 | 119 | ); |
| 120 | - } |
|
| 121 | - if (!is_numeric($values['min_avg_credit_to_post']) OR |
|
| 120 | + } |
|
| 121 | + if (!is_numeric($values['min_avg_credit_to_post']) OR |
|
| 122 | 122 | $values['min_avg_credit_to_post'] < 0) { |
| 123 | 123 | form_set_error('min_avg_credit_to_post', |
| 124 | - bts('Please set the minimum average credit that a user' |
|
| 124 | + bts('Please set the minimum average credit that a user' |
|
| 125 | 125 | . ' is required to have in order to post to this message board.', |
| 126 | 126 | array(), NULL, 'boinc:team-forum-create/edit') |
| 127 | 127 | ); |
| 128 | - } |
|
| 128 | + } |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /** |
@@ -133,13 +133,13 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | function boincteam_forum_create_form_submit($form, &$form_state) { |
| 135 | 135 | |
| 136 | - $values = $form_state['values']; |
|
| 136 | + $values = $form_state['values']; |
|
| 137 | 137 | |
| 138 | - global $user; |
|
| 139 | - $account = user_load($user->uid); |
|
| 138 | + global $user; |
|
| 139 | + $account = user_load($user->uid); |
|
| 140 | 140 | |
| 141 | - // Add the team forum to the db |
|
| 142 | - db_query(" |
|
| 141 | + // Add the team forum to the db |
|
| 142 | + db_query(" |
|
| 143 | 143 | INSERT INTO {boincteam_forum} SET |
| 144 | 144 | nid = %d, |
| 145 | 145 | title = '%s', |
@@ -157,9 +157,9 @@ discard block |
||
| 157 | 157 | (int) $values['min_avg_credit_to_post'], |
| 158 | 158 | ($values['public']) ? 1 : 0, |
| 159 | 159 | $values['description'] |
| 160 | - ); |
|
| 160 | + ); |
|
| 161 | 161 | |
| 162 | - drupal_set_message(t('Message board "@forum" has been created.', |
|
| 162 | + drupal_set_message(t('Message board "@forum" has been created.', |
|
| 163 | 163 | array('@forum' => $values['title']))); |
| 164 | 164 | } |
| 165 | 165 | |
@@ -171,84 +171,84 @@ discard block |
||
| 171 | 171 | * The definition of the edit team forum form |
| 172 | 172 | */ |
| 173 | 173 | function boincteam_forum_edit_form(&$form_state, $tfid) { |
| 174 | - $form = array(); |
|
| 175 | - $boincteam_forum = boincteam_forum_load($tfid); |
|
| 174 | + $form = array(); |
|
| 175 | + $boincteam_forum = boincteam_forum_load($tfid); |
|
| 176 | 176 | |
| 177 | - $form_state['storage']['tfid'] = $tfid; |
|
| 177 | + $form_state['storage']['tfid'] = $tfid; |
|
| 178 | 178 | |
| 179 | - $default = array( |
|
| 179 | + $default = array( |
|
| 180 | 180 | 'title' => $boincteam_forum->title, |
| 181 | 181 | 'min_time_between_posts' => $boincteam_forum->min_time_between_posts, |
| 182 | 182 | 'min_total_credit_to_post' => $boincteam_forum->min_total_credit_to_post, |
| 183 | 183 | 'min_avg_credit_to_post' => $boincteam_forum->min_avg_credit_to_post, |
| 184 | 184 | 'public' => ($boincteam_forum->public) ? 1 : 0, |
| 185 | 185 | 'description' => $boincteam_forum->description, |
| 186 | - ); |
|
| 186 | + ); |
|
| 187 | 187 | |
| 188 | - // Standard option sets |
|
| 189 | - $form['boolean_options'] = array( |
|
| 188 | + // Standard option sets |
|
| 189 | + $form['boolean_options'] = array( |
|
| 190 | 190 | '#type' => 'value', |
| 191 | 191 | '#value' => array(1 => bts('yes', array(), NULL, 'boinc:form-yes-no:-1:binary-form-option-pairs-with-no'), 0 => bts('no', array(), NULL, 'boinc:form-yes-no:-1:binary-form-option-pairs-with-yes')), |
| 192 | - ); |
|
| 192 | + ); |
|
| 193 | 193 | |
| 194 | - // Form elements |
|
| 195 | - $form['title'] = array( |
|
| 194 | + // Form elements |
|
| 195 | + $form['title'] = array( |
|
| 196 | 196 | '#title' => bts('Message board title', array(), NULL, 'boinc:team-forum-create/edit'), |
| 197 | 197 | '#type' => 'textfield', |
| 198 | 198 | '#default_value' => $default['title'], |
| 199 | 199 | '#size' => 34, |
| 200 | 200 | '#description' => bts('Text only, no HTML tags', array(), NULL, 'boinc:team-form-help'), |
| 201 | - ); |
|
| 202 | - $form['min_time_between_posts'] = array( |
|
| 201 | + ); |
|
| 202 | + $form['min_time_between_posts'] = array( |
|
| 203 | 203 | '#title' => bts('Minimum time between posts', array(), NULL, 'boinc:team-forum-create/edit'), |
| 204 | 204 | '#type' => 'textfield', |
| 205 | 205 | '#default_value' => $default['min_time_between_posts'], |
| 206 | 206 | '#size' => 12, |
| 207 | 207 | '#description' => bts('seconds', array(), NULL, 'boinc:unit-of-time'), |
| 208 | - ); |
|
| 209 | - $form['min_total_credit_to_post'] = array( |
|
| 208 | + ); |
|
| 209 | + $form['min_total_credit_to_post'] = array( |
|
| 210 | 210 | '#title' => bts('Minimum total credit to post', array(), NULL, 'boinc:team-forum-create/edit'), |
| 211 | 211 | '#type' => 'textfield', |
| 212 | 212 | '#default_value' => $default['min_total_credit_to_post'], |
| 213 | 213 | '#size' => 12, |
| 214 | - ); |
|
| 215 | - $form['min_avg_credit_to_post'] = array( |
|
| 214 | + ); |
|
| 215 | + $form['min_avg_credit_to_post'] = array( |
|
| 216 | 216 | '#title' => bts('Minimum avg credit to post', array(), NULL, 'boinc:team-forum-create/edit'), |
| 217 | 217 | '#type' => 'textfield', |
| 218 | 218 | '#default_value' => $default['min_avg_credit_to_post'], |
| 219 | 219 | '#size' => 12, |
| 220 | - ); |
|
| 221 | - $form['public'] = array( |
|
| 220 | + ); |
|
| 221 | + $form['public'] = array( |
|
| 222 | 222 | '#title' => bts('Allow public to read board?', array(), NULL, 'boinc:team-forum-create/edit'), |
| 223 | 223 | '#type' => 'radios', |
| 224 | 224 | '#options' => $form['boolean_options']['#value'], |
| 225 | 225 | '#attributes' => array('class' => 'fancy'), |
| 226 | 226 | '#default_value' => $default['public'], |
| 227 | - ); |
|
| 228 | - $form['description'] = array( |
|
| 227 | + ); |
|
| 228 | + $form['description'] = array( |
|
| 229 | 229 | '#title' => bts('Description', array(), NULL, 'boinc:team-forum-create/edit:-1:ignoreoverwrite'), |
| 230 | 230 | '#type' => 'textarea', |
| 231 | 231 | '#default_value' => $default['description'], |
| 232 | 232 | '#size' => 5, |
| 233 | - ); |
|
| 233 | + ); |
|
| 234 | 234 | |
| 235 | - // Form control |
|
| 236 | - $form['form control tabs prefix'] = array( |
|
| 235 | + // Form control |
|
| 236 | + $form['form control tabs prefix'] = array( |
|
| 237 | 237 | '#value' => '<ul class="form-control tab-list">' |
| 238 | - ); |
|
| 239 | - $form['submit'] = array( |
|
| 238 | + ); |
|
| 239 | + $form['submit'] = array( |
|
| 240 | 240 | '#prefix' => '<li class="first tab">', |
| 241 | 241 | '#type' => 'submit', |
| 242 | 242 | '#value' => bts('Save message board', array(), NULL, 'boinc:team-forum-create/edit'), |
| 243 | 243 | '#suffix' => '</li>', |
| 244 | - ); |
|
| 245 | - $form['form control tabs'] = array( |
|
| 244 | + ); |
|
| 245 | + $form['form control tabs'] = array( |
|
| 246 | 246 | '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), strstr($_GET['q'], '/forum', TRUE)) . '</li>' |
| 247 | - ); |
|
| 247 | + ); |
|
| 248 | 248 | |
| 249 | - $form['#redirect'] = "community/teams/{$boincteam_forum->nid}"; |
|
| 249 | + $form['#redirect'] = "community/teams/{$boincteam_forum->nid}"; |
|
| 250 | 250 | |
| 251 | - return $form; |
|
| 251 | + return $form; |
|
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | /** |
@@ -256,33 +256,33 @@ discard block |
||
| 256 | 256 | */ |
| 257 | 257 | function boincteam_forum_edit_form_validate($form, &$form_state) { |
| 258 | 258 | |
| 259 | - $values = $form_state['values']; |
|
| 259 | + $values = $form_state['values']; |
|
| 260 | 260 | |
| 261 | - if (!$values['title']) { |
|
| 261 | + if (!$values['title']) { |
|
| 262 | 262 | form_set_error('name', bts('Message board title is required.', array(), NULL, 'boinc:team-forum-create/edit')); |
| 263 | - } |
|
| 264 | - if (!is_numeric($values['min_time_between_posts']) OR |
|
| 263 | + } |
|
| 264 | + if (!is_numeric($values['min_time_between_posts']) OR |
|
| 265 | 265 | $values['min_time_between_posts'] < 0) { |
| 266 | 266 | form_set_error('min_time_between_posts', |
| 267 | - bts('Please set the minimum time required between posts.', array(), NULL, 'boinc:team-forum-create/edit') |
|
| 267 | + bts('Please set the minimum time required between posts.', array(), NULL, 'boinc:team-forum-create/edit') |
|
| 268 | 268 | ); |
| 269 | - } |
|
| 270 | - if (!is_numeric($values['min_total_credit_to_post']) OR |
|
| 269 | + } |
|
| 270 | + if (!is_numeric($values['min_total_credit_to_post']) OR |
|
| 271 | 271 | $values['min_total_credit_to_post'] < 0) { |
| 272 | 272 | form_set_error('min_total_credit_to_post', |
| 273 | - bts('Please set the minimum total credit that a user' |
|
| 273 | + bts('Please set the minimum total credit that a user' |
|
| 274 | 274 | . ' must earn in order to post to this message board.', |
| 275 | 275 | array(), NULL, 'boinc:team-forum-create/edit') |
| 276 | 276 | ); |
| 277 | - } |
|
| 278 | - if (!is_numeric($values['min_avg_credit_to_post']) OR |
|
| 277 | + } |
|
| 278 | + if (!is_numeric($values['min_avg_credit_to_post']) OR |
|
| 279 | 279 | $values['min_avg_credit_to_post'] < 0) { |
| 280 | 280 | form_set_error('min_avg_credit_to_post', |
| 281 | - bts('Please set the minimum average credit that a user' |
|
| 281 | + bts('Please set the minimum average credit that a user' |
|
| 282 | 282 | . ' is required to have in order to post to this message board.', |
| 283 | 283 | array(), NULL, 'boinc:team-forum-create/edit') |
| 284 | 284 | ); |
| 285 | - } |
|
| 285 | + } |
|
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | /** |
@@ -290,11 +290,11 @@ discard block |
||
| 290 | 290 | */ |
| 291 | 291 | function boincteam_forum_edit_form_submit($form, &$form_state) { |
| 292 | 292 | |
| 293 | - $tfid = $form_state['storage']['tfid']; |
|
| 294 | - $values = $form_state['values']; |
|
| 293 | + $tfid = $form_state['storage']['tfid']; |
|
| 294 | + $values = $form_state['values']; |
|
| 295 | 295 | |
| 296 | - // Update the team forum in the db |
|
| 297 | - db_query(" |
|
| 296 | + // Update the team forum in the db |
|
| 297 | + db_query(" |
|
| 298 | 298 | UPDATE {boincteam_forum} SET |
| 299 | 299 | title = '%s', |
| 300 | 300 | min_time_between_posts = '%d', |
@@ -311,11 +311,11 @@ discard block |
||
| 311 | 311 | ($values['public']) ? 1 : 0, |
| 312 | 312 | $values['description'], |
| 313 | 313 | $tfid |
| 314 | - ); |
|
| 314 | + ); |
|
| 315 | 315 | |
| 316 | - drupal_set_message(t('Details for message board "@forum" have been updated.', |
|
| 316 | + drupal_set_message(t('Details for message board "@forum" have been updated.', |
|
| 317 | 317 | array('@forum' => $values['title']))); |
| 318 | 318 | |
| 319 | - // The storage variable quietly kills redirection for some reason... unset it |
|
| 320 | - unset($form_state['storage']); |
|
| 319 | + // The storage variable quietly kills redirection for some reason... unset it |
|
| 320 | + unset($form_state['storage']); |
|
| 321 | 321 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | '#suffix' => '</li>', |
| 87 | 87 | ); |
| 88 | 88 | $form['form control tabs'] = array( |
| 89 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), strstr($_GET['q'], '/forum/add', TRUE)) . '</li>' |
|
| 89 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), strstr($_GET['q'], '/forum/add', TRUE)).'</li>' |
|
| 90 | 90 | ); |
| 91 | 91 | |
| 92 | 92 | $form['#redirect'] = "community/teams/{$account->team}"; |
@@ -152,9 +152,9 @@ discard block |
||
| 152 | 152 | updated = UNIX_TIMESTAMP()", |
| 153 | 153 | $account->team, |
| 154 | 154 | $values['title'], |
| 155 | - (int) $values['min_time_between_posts'], |
|
| 156 | - (int) $values['min_total_credit_to_post'], |
|
| 157 | - (int) $values['min_avg_credit_to_post'], |
|
| 155 | + (int)$values['min_time_between_posts'], |
|
| 156 | + (int)$values['min_total_credit_to_post'], |
|
| 157 | + (int)$values['min_avg_credit_to_post'], |
|
| 158 | 158 | ($values['public']) ? 1 : 0, |
| 159 | 159 | $values['description'] |
| 160 | 160 | ); |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | '#suffix' => '</li>', |
| 244 | 244 | ); |
| 245 | 245 | $form['form control tabs'] = array( |
| 246 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), strstr($_GET['q'], '/forum', TRUE)) . '</li>' |
|
| 246 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), strstr($_GET['q'], '/forum', TRUE)).'</li>' |
|
| 247 | 247 | ); |
| 248 | 248 | |
| 249 | 249 | $form['#redirect'] = "community/teams/{$boincteam_forum->nid}"; |
@@ -305,9 +305,9 @@ discard block |
||
| 305 | 305 | updated = UNIX_TIMESTAMP() |
| 306 | 306 | WHERE tfid='%d'", |
| 307 | 307 | $values['title'], |
| 308 | - (int) $values['min_time_between_posts'], |
|
| 309 | - (int) $values['min_total_credit_to_post'], |
|
| 310 | - (int) $values['min_avg_credit_to_post'], |
|
| 308 | + (int)$values['min_time_between_posts'], |
|
| 309 | + (int)$values['min_total_credit_to_post'], |
|
| 310 | + (int)$values['min_avg_credit_to_post'], |
|
| 311 | 311 | ($values['public']) ? 1 : 0, |
| 312 | 312 | $values['description'], |
| 313 | 313 | $tfid |
@@ -31,45 +31,45 @@ discard block |
||
| 31 | 31 | // Standard option sets |
| 32 | 32 | $form['boolean_options'] = array( |
| 33 | 33 | '#type' => 'value', |
| 34 | - '#value' => array(1 => bts('yes', array(), NULL, 'boinc:form-yes-no:-1:binary-form-option-pairs-with-no'), 0 => bts('no', array(), NULL, 'boinc:form-yes-no:-1:binary-form-option-pairs-with-yes')), |
|
| 34 | + '#value' => array(1 => bts('yes', array(), null, 'boinc:form-yes-no:-1:binary-form-option-pairs-with-no'), 0 => bts('no', array(), null, 'boinc:form-yes-no:-1:binary-form-option-pairs-with-yes')), |
|
| 35 | 35 | ); |
| 36 | 36 | |
| 37 | 37 | // Form elements |
| 38 | 38 | $form['title'] = array( |
| 39 | - '#title' => bts('Message board title', array(), NULL, 'boinc:team-forum-create/edit'), |
|
| 39 | + '#title' => bts('Message board title', array(), null, 'boinc:team-forum-create/edit'), |
|
| 40 | 40 | '#type' => 'textfield', |
| 41 | 41 | '#default_value' => $default['title'], |
| 42 | 42 | '#size' => 34, |
| 43 | - '#description' => bts('Text only, no HTML tags', array(), NULL, 'boinc:team-form-help'), |
|
| 43 | + '#description' => bts('Text only, no HTML tags', array(), null, 'boinc:team-form-help'), |
|
| 44 | 44 | ); |
| 45 | 45 | $form['min_time_between_posts'] = array( |
| 46 | - '#title' => bts('Minimum time between posts', array(), NULL, 'boinc:team-forum-create/edit'), |
|
| 46 | + '#title' => bts('Minimum time between posts', array(), null, 'boinc:team-forum-create/edit'), |
|
| 47 | 47 | '#type' => 'textfield', |
| 48 | 48 | '#default_value' => $default['min_time_between_posts'], |
| 49 | 49 | '#size' => 12, |
| 50 | - '#description' => bts('seconds', array(), NULL, 'boinc:unit-of-time'), |
|
| 50 | + '#description' => bts('seconds', array(), null, 'boinc:unit-of-time'), |
|
| 51 | 51 | ); |
| 52 | 52 | $form['min_total_credit_to_post'] = array( |
| 53 | - '#title' => bts('Minimum total credit to post', array(), NULL, 'boinc:team-forum-create/edit'), |
|
| 53 | + '#title' => bts('Minimum total credit to post', array(), null, 'boinc:team-forum-create/edit'), |
|
| 54 | 54 | '#type' => 'textfield', |
| 55 | 55 | '#default_value' => $default['min_total_credit_to_post'], |
| 56 | 56 | '#size' => 12, |
| 57 | 57 | ); |
| 58 | 58 | $form['min_avg_credit_to_post'] = array( |
| 59 | - '#title' => bts('Minimum avg credit to post', array(), NULL, 'boinc:team-forum-create/edit'), |
|
| 59 | + '#title' => bts('Minimum avg credit to post', array(), null, 'boinc:team-forum-create/edit'), |
|
| 60 | 60 | '#type' => 'textfield', |
| 61 | 61 | '#default_value' => $default['min_avg_credit_to_post'], |
| 62 | 62 | '#size' => 12, |
| 63 | 63 | ); |
| 64 | 64 | $form['public'] = array( |
| 65 | - '#title' => bts('Allow public to read board?', array(), NULL, 'boinc:team-forum-create/edit'), |
|
| 65 | + '#title' => bts('Allow public to read board?', array(), null, 'boinc:team-forum-create/edit'), |
|
| 66 | 66 | '#type' => 'radios', |
| 67 | 67 | '#options' => $form['boolean_options']['#value'], |
| 68 | 68 | '#attributes' => array('class' => 'fancy'), |
| 69 | 69 | '#default_value' => $default['public'], |
| 70 | 70 | ); |
| 71 | 71 | $form['description'] = array( |
| 72 | - '#title' => bts('Description', array(), NULL, 'boinc:team-forum-create/edit:-1:ignoreoverwrite'), |
|
| 72 | + '#title' => bts('Description', array(), null, 'boinc:team-forum-create/edit:-1:ignoreoverwrite'), |
|
| 73 | 73 | '#type' => 'textarea', |
| 74 | 74 | '#default_value' => $default['description'], |
| 75 | 75 | '#size' => 5, |
@@ -82,11 +82,11 @@ discard block |
||
| 82 | 82 | $form['submit'] = array( |
| 83 | 83 | '#prefix' => '<li class="first tab">', |
| 84 | 84 | '#type' => 'submit', |
| 85 | - '#value' => bts('Create message board', array(), NULL, 'boinc:team-forum-create/edit'), |
|
| 85 | + '#value' => bts('Create message board', array(), null, 'boinc:team-forum-create/edit'), |
|
| 86 | 86 | '#suffix' => '</li>', |
| 87 | 87 | ); |
| 88 | 88 | $form['form control tabs'] = array( |
| 89 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), strstr($_GET['q'], '/forum/add', TRUE)) . '</li>' |
|
| 89 | + '#value' => '<li class="tab">' . l(bts('Cancel', array(), null, 'boinc:form-cancel'), strstr($_GET['q'], '/forum/add', true)) . '</li>' |
|
| 90 | 90 | ); |
| 91 | 91 | |
| 92 | 92 | $form['#redirect'] = "community/teams/{$account->team}"; |
@@ -102,28 +102,28 @@ discard block |
||
| 102 | 102 | $values = $form_state['values']; |
| 103 | 103 | |
| 104 | 104 | if (!$values['title']) { |
| 105 | - form_set_error('name', bts('Message board title is required.', array(), NULL, 'boinc:team-forum-create/edit')); |
|
| 105 | + form_set_error('name', bts('Message board title is required.', array(), null, 'boinc:team-forum-create/edit')); |
|
| 106 | 106 | } |
| 107 | - if (!is_numeric($values['min_time_between_posts']) OR |
|
| 107 | + if (!is_numeric($values['min_time_between_posts']) or |
|
| 108 | 108 | $values['min_time_between_posts'] < 0) { |
| 109 | 109 | form_set_error('min_time_between_posts', |
| 110 | - bts('Please set the minimum time required between posts.', array(), NULL, 'boinc:team-forum-create/edit') |
|
| 110 | + bts('Please set the minimum time required between posts.', array(), null, 'boinc:team-forum-create/edit') |
|
| 111 | 111 | ); |
| 112 | 112 | } |
| 113 | - if (!is_numeric($values['min_total_credit_to_post']) OR |
|
| 113 | + if (!is_numeric($values['min_total_credit_to_post']) or |
|
| 114 | 114 | $values['min_total_credit_to_post'] < 0) { |
| 115 | 115 | form_set_error('min_total_credit_to_post', |
| 116 | 116 | bts('Please set the minimum total credit that a user' |
| 117 | 117 | . ' must earn in order to post to this message board.', |
| 118 | - array(), NULL, 'boinc:team-forum-create/edit') |
|
| 118 | + array(), null, 'boinc:team-forum-create/edit') |
|
| 119 | 119 | ); |
| 120 | 120 | } |
| 121 | - if (!is_numeric($values['min_avg_credit_to_post']) OR |
|
| 121 | + if (!is_numeric($values['min_avg_credit_to_post']) or |
|
| 122 | 122 | $values['min_avg_credit_to_post'] < 0) { |
| 123 | 123 | form_set_error('min_avg_credit_to_post', |
| 124 | 124 | bts('Please set the minimum average credit that a user' |
| 125 | 125 | . ' is required to have in order to post to this message board.', |
| 126 | - array(), NULL, 'boinc:team-forum-create/edit') |
|
| 126 | + array(), null, 'boinc:team-forum-create/edit') |
|
| 127 | 127 | ); |
| 128 | 128 | } |
| 129 | 129 | } |
@@ -188,45 +188,45 @@ discard block |
||
| 188 | 188 | // Standard option sets |
| 189 | 189 | $form['boolean_options'] = array( |
| 190 | 190 | '#type' => 'value', |
| 191 | - '#value' => array(1 => bts('yes', array(), NULL, 'boinc:form-yes-no:-1:binary-form-option-pairs-with-no'), 0 => bts('no', array(), NULL, 'boinc:form-yes-no:-1:binary-form-option-pairs-with-yes')), |
|
| 191 | + '#value' => array(1 => bts('yes', array(), null, 'boinc:form-yes-no:-1:binary-form-option-pairs-with-no'), 0 => bts('no', array(), null, 'boinc:form-yes-no:-1:binary-form-option-pairs-with-yes')), |
|
| 192 | 192 | ); |
| 193 | 193 | |
| 194 | 194 | // Form elements |
| 195 | 195 | $form['title'] = array( |
| 196 | - '#title' => bts('Message board title', array(), NULL, 'boinc:team-forum-create/edit'), |
|
| 196 | + '#title' => bts('Message board title', array(), null, 'boinc:team-forum-create/edit'), |
|
| 197 | 197 | '#type' => 'textfield', |
| 198 | 198 | '#default_value' => $default['title'], |
| 199 | 199 | '#size' => 34, |
| 200 | - '#description' => bts('Text only, no HTML tags', array(), NULL, 'boinc:team-form-help'), |
|
| 200 | + '#description' => bts('Text only, no HTML tags', array(), null, 'boinc:team-form-help'), |
|
| 201 | 201 | ); |
| 202 | 202 | $form['min_time_between_posts'] = array( |
| 203 | - '#title' => bts('Minimum time between posts', array(), NULL, 'boinc:team-forum-create/edit'), |
|
| 203 | + '#title' => bts('Minimum time between posts', array(), null, 'boinc:team-forum-create/edit'), |
|
| 204 | 204 | '#type' => 'textfield', |
| 205 | 205 | '#default_value' => $default['min_time_between_posts'], |
| 206 | 206 | '#size' => 12, |
| 207 | - '#description' => bts('seconds', array(), NULL, 'boinc:unit-of-time'), |
|
| 207 | + '#description' => bts('seconds', array(), null, 'boinc:unit-of-time'), |
|
| 208 | 208 | ); |
| 209 | 209 | $form['min_total_credit_to_post'] = array( |
| 210 | - '#title' => bts('Minimum total credit to post', array(), NULL, 'boinc:team-forum-create/edit'), |
|
| 210 | + '#title' => bts('Minimum total credit to post', array(), null, 'boinc:team-forum-create/edit'), |
|
| 211 | 211 | '#type' => 'textfield', |
| 212 | 212 | '#default_value' => $default['min_total_credit_to_post'], |
| 213 | 213 | '#size' => 12, |
| 214 | 214 | ); |
| 215 | 215 | $form['min_avg_credit_to_post'] = array( |
| 216 | - '#title' => bts('Minimum avg credit to post', array(), NULL, 'boinc:team-forum-create/edit'), |
|
| 216 | + '#title' => bts('Minimum avg credit to post', array(), null, 'boinc:team-forum-create/edit'), |
|
| 217 | 217 | '#type' => 'textfield', |
| 218 | 218 | '#default_value' => $default['min_avg_credit_to_post'], |
| 219 | 219 | '#size' => 12, |
| 220 | 220 | ); |
| 221 | 221 | $form['public'] = array( |
| 222 | - '#title' => bts('Allow public to read board?', array(), NULL, 'boinc:team-forum-create/edit'), |
|
| 222 | + '#title' => bts('Allow public to read board?', array(), null, 'boinc:team-forum-create/edit'), |
|
| 223 | 223 | '#type' => 'radios', |
| 224 | 224 | '#options' => $form['boolean_options']['#value'], |
| 225 | 225 | '#attributes' => array('class' => 'fancy'), |
| 226 | 226 | '#default_value' => $default['public'], |
| 227 | 227 | ); |
| 228 | 228 | $form['description'] = array( |
| 229 | - '#title' => bts('Description', array(), NULL, 'boinc:team-forum-create/edit:-1:ignoreoverwrite'), |
|
| 229 | + '#title' => bts('Description', array(), null, 'boinc:team-forum-create/edit:-1:ignoreoverwrite'), |
|
| 230 | 230 | '#type' => 'textarea', |
| 231 | 231 | '#default_value' => $default['description'], |
| 232 | 232 | '#size' => 5, |
@@ -239,11 +239,11 @@ discard block |
||
| 239 | 239 | $form['submit'] = array( |
| 240 | 240 | '#prefix' => '<li class="first tab">', |
| 241 | 241 | '#type' => 'submit', |
| 242 | - '#value' => bts('Save message board', array(), NULL, 'boinc:team-forum-create/edit'), |
|
| 242 | + '#value' => bts('Save message board', array(), null, 'boinc:team-forum-create/edit'), |
|
| 243 | 243 | '#suffix' => '</li>', |
| 244 | 244 | ); |
| 245 | 245 | $form['form control tabs'] = array( |
| 246 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), strstr($_GET['q'], '/forum', TRUE)) . '</li>' |
|
| 246 | + '#value' => '<li class="tab">' . l(bts('Cancel', array(), null, 'boinc:form-cancel'), strstr($_GET['q'], '/forum', true)) . '</li>' |
|
| 247 | 247 | ); |
| 248 | 248 | |
| 249 | 249 | $form['#redirect'] = "community/teams/{$boincteam_forum->nid}"; |
@@ -259,28 +259,28 @@ discard block |
||
| 259 | 259 | $values = $form_state['values']; |
| 260 | 260 | |
| 261 | 261 | if (!$values['title']) { |
| 262 | - form_set_error('name', bts('Message board title is required.', array(), NULL, 'boinc:team-forum-create/edit')); |
|
| 262 | + form_set_error('name', bts('Message board title is required.', array(), null, 'boinc:team-forum-create/edit')); |
|
| 263 | 263 | } |
| 264 | - if (!is_numeric($values['min_time_between_posts']) OR |
|
| 264 | + if (!is_numeric($values['min_time_between_posts']) or |
|
| 265 | 265 | $values['min_time_between_posts'] < 0) { |
| 266 | 266 | form_set_error('min_time_between_posts', |
| 267 | - bts('Please set the minimum time required between posts.', array(), NULL, 'boinc:team-forum-create/edit') |
|
| 267 | + bts('Please set the minimum time required between posts.', array(), null, 'boinc:team-forum-create/edit') |
|
| 268 | 268 | ); |
| 269 | 269 | } |
| 270 | - if (!is_numeric($values['min_total_credit_to_post']) OR |
|
| 270 | + if (!is_numeric($values['min_total_credit_to_post']) or |
|
| 271 | 271 | $values['min_total_credit_to_post'] < 0) { |
| 272 | 272 | form_set_error('min_total_credit_to_post', |
| 273 | 273 | bts('Please set the minimum total credit that a user' |
| 274 | 274 | . ' must earn in order to post to this message board.', |
| 275 | - array(), NULL, 'boinc:team-forum-create/edit') |
|
| 275 | + array(), null, 'boinc:team-forum-create/edit') |
|
| 276 | 276 | ); |
| 277 | 277 | } |
| 278 | - if (!is_numeric($values['min_avg_credit_to_post']) OR |
|
| 278 | + if (!is_numeric($values['min_avg_credit_to_post']) or |
|
| 279 | 279 | $values['min_avg_credit_to_post'] < 0) { |
| 280 | 280 | form_set_error('min_avg_credit_to_post', |
| 281 | 281 | bts('Please set the minimum average credit that a user' |
| 282 | 282 | . ' is required to have in order to post to this message board.', |
| 283 | - array(), NULL, 'boinc:team-forum-create/edit') |
|
| 283 | + array(), null, 'boinc:team-forum-create/edit') |
|
| 284 | 284 | ); |
| 285 | 285 | } |
| 286 | 286 | } |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | echo 'Hint: Example greps: "RESULT#106876", "26fe99aa_25636_00119.wu_1", "WU#8152", "too many errors", "2003-07-17", "CRITICAL" <br>'; |
| 61 | 61 | |
| 62 | 62 | if (strlen($f)) { |
| 63 | - $f = "../log*/". $f; |
|
| 63 | + $f = "../log*/". $f; |
|
| 64 | 64 | } else { |
| 65 | 65 | $f = "../log*/*.log"; |
| 66 | 66 | } |
@@ -27,19 +27,19 @@ discard block |
||
| 27 | 27 | exit("Error: couldn't get log_dir from config file."); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | -if( isset($_GET["f"]) ){ |
|
| 30 | +if (isset($_GET["f"])) { |
|
| 31 | 31 | $f = $_GET["f"]; |
| 32 | 32 | $f = escapeshellcmd($f); |
| 33 | 33 | } else { |
| 34 | 34 | $f = ""; |
| 35 | 35 | } |
| 36 | -if( isset($_GET["s"]) ){ |
|
| 36 | +if (isset($_GET["s"])) { |
|
| 37 | 37 | $s = $_GET["s"]; |
| 38 | 38 | $s = escapeshellcmd($s); |
| 39 | 39 | } else { |
| 40 | 40 | $s = ""; |
| 41 | 41 | } |
| 42 | -if( isset($_GET["l"]) ){ |
|
| 42 | +if (isset($_GET["l"])) { |
|
| 43 | 43 | $l = (int)$_GET["l"]; |
| 44 | 44 | } else { |
| 45 | 45 | $l = 0; |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | echo 'Hint: Example greps: "RESULT#106876", "26fe99aa_25636_00119.wu_1", "WU#8152", "too many errors", "2003-07-17", "CRITICAL" <br>'; |
| 61 | 61 | |
| 62 | 62 | if (strlen($f)) { |
| 63 | - $f = "../log*/". $f; |
|
| 63 | + $f = "../log*/".$f; |
|
| 64 | 64 | } else { |
| 65 | 65 | $f = "../log*/*.log"; |
| 66 | 66 | } |
@@ -27,19 +27,19 @@ |
||
| 27 | 27 | exit("Error: couldn't get log_dir from config file."); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | -if( isset($_GET["f"]) ){ |
|
| 30 | +if( isset($_GET["f"]) ) { |
|
| 31 | 31 | $f = $_GET["f"]; |
| 32 | 32 | $f = escapeshellcmd($f); |
| 33 | 33 | } else { |
| 34 | 34 | $f = ""; |
| 35 | 35 | } |
| 36 | -if( isset($_GET["s"]) ){ |
|
| 36 | +if( isset($_GET["s"]) ) { |
|
| 37 | 37 | $s = $_GET["s"]; |
| 38 | 38 | $s = escapeshellcmd($s); |
| 39 | 39 | } else { |
| 40 | 40 | $s = ""; |
| 41 | 41 | } |
| 42 | -if( isset($_GET["l"]) ){ |
|
| 42 | +if( isset($_GET["l"]) ) { |
|
| 43 | 43 | $l = (int)$_GET["l"]; |
| 44 | 44 | } else { |
| 45 | 45 | $l = 0; |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | $view->base_table = 'node'; |
| 15 | 15 | $view->core = 0; |
| 16 | 16 | $view->api_version = '2'; |
| 17 | - $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */ |
|
| 17 | + $view->disabled = false; /* Edit this to true to make a default view disabled initially */ |
|
| 18 | 18 | $handler = $view->new_display('default', 'Defaults', 'default'); |
| 19 | 19 | $handler->override_option('relationships', array( |
| 20 | 20 | 'content_profile_rel' => array( |
@@ -70,9 +70,9 @@ discard block |
||
| 70 | 70 | 'news' => 'news', |
| 71 | 71 | ), |
| 72 | 72 | 'group' => '0', |
| 73 | - 'exposed' => FALSE, |
|
| 73 | + 'exposed' => false, |
|
| 74 | 74 | 'expose' => array( |
| 75 | - 'operator' => FALSE, |
|
| 75 | + 'operator' => false, |
|
| 76 | 76 | 'label' => '', |
| 77 | 77 | ), |
| 78 | 78 | 'id' => 'type', |
@@ -84,9 +84,9 @@ discard block |
||
| 84 | 84 | 'operator' => '=', |
| 85 | 85 | 'value' => '1', |
| 86 | 86 | 'group' => '0', |
| 87 | - 'exposed' => FALSE, |
|
| 87 | + 'exposed' => false, |
|
| 88 | 88 | 'expose' => array( |
| 89 | - 'operator' => FALSE, |
|
| 89 | + 'operator' => false, |
|
| 90 | 90 | 'label' => '', |
| 91 | 91 | ), |
| 92 | 92 | 'id' => 'status', |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | 'hide_empty' => 1, |
| 312 | 312 | 'empty_zero' => 0, |
| 313 | 313 | 'hide_alter_empty' => 0, |
| 314 | - 'set_precision' => FALSE, |
|
| 314 | + 'set_precision' => false, |
|
| 315 | 315 | 'precision' => 0, |
| 316 | 316 | 'decimal' => '.', |
| 317 | 317 | 'separator' => '', |
@@ -467,9 +467,9 @@ discard block |
||
| 467 | 467 | 'news' => 'news', |
| 468 | 468 | ), |
| 469 | 469 | 'group' => '0', |
| 470 | - 'exposed' => FALSE, |
|
| 470 | + 'exposed' => false, |
|
| 471 | 471 | 'expose' => array( |
| 472 | - 'operator' => FALSE, |
|
| 472 | + 'operator' => false, |
|
| 473 | 473 | 'label' => '', |
| 474 | 474 | ), |
| 475 | 475 | 'id' => 'type', |
@@ -481,9 +481,9 @@ discard block |
||
| 481 | 481 | 'operator' => '=', |
| 482 | 482 | 'value' => '1', |
| 483 | 483 | 'group' => '0', |
| 484 | - 'exposed' => FALSE, |
|
| 484 | + 'exposed' => false, |
|
| 485 | 485 | 'expose' => array( |
| 486 | - 'operator' => FALSE, |
|
| 486 | + 'operator' => false, |
|
| 487 | 487 | 'label' => '', |
| 488 | 488 | ), |
| 489 | 489 | 'id' => 'status', |
@@ -500,9 +500,9 @@ discard block |
||
| 500 | 500 | 'max' => '', |
| 501 | 501 | ), |
| 502 | 502 | 'group' => '0', |
| 503 | - 'exposed' => FALSE, |
|
| 503 | + 'exposed' => false, |
|
| 504 | 504 | 'expose' => array( |
| 505 | - 'operator' => FALSE, |
|
| 505 | + 'operator' => false, |
|
| 506 | 506 | 'label' => '', |
| 507 | 507 | ), |
| 508 | 508 | 'id' => 'changed', |
@@ -516,7 +516,7 @@ discard block |
||
| 516 | 516 | )); |
| 517 | 517 | $handler->override_option('style_plugin', 'rss'); |
| 518 | 518 | $handler->override_option('style_options', array( |
| 519 | - 'mission_description' => FALSE, |
|
| 519 | + 'mission_description' => false, |
|
| 520 | 520 | 'description' => '', |
| 521 | 521 | )); |
| 522 | 522 | $handler->override_option('row_plugin', 'node_rss'); |
@@ -544,7 +544,7 @@ discard block |
||
| 544 | 544 | 'page_2' => 'page_2', |
| 545 | 545 | 'default' => 0, |
| 546 | 546 | )); |
| 547 | - $handler->override_option('sitename_title', FALSE); |
|
| 547 | + $handler->override_option('sitename_title', false); |
|
| 548 | 548 | $handler = $view->new_display('page', 'Short blurbs', 'page_2'); |
| 549 | 549 | $handler->override_option('relationships', array()); |
| 550 | 550 | $handler->override_option('fields', array( |
@@ -825,7 +825,7 @@ discard block |
||
| 825 | 825 | 'hide_empty' => 1, |
| 826 | 826 | 'empty_zero' => 0, |
| 827 | 827 | 'hide_alter_empty' => 0, |
| 828 | - 'set_precision' => FALSE, |
|
| 828 | + 'set_precision' => false, |
|
| 829 | 829 | 'precision' => 0, |
| 830 | 830 | 'decimal' => '.', |
| 831 | 831 | 'separator' => '', |
@@ -882,9 +882,9 @@ discard block |
||
| 882 | 882 | 'news' => 'news', |
| 883 | 883 | ), |
| 884 | 884 | 'group' => '0', |
| 885 | - 'exposed' => FALSE, |
|
| 885 | + 'exposed' => false, |
|
| 886 | 886 | 'expose' => array( |
| 887 | - 'operator' => FALSE, |
|
| 887 | + 'operator' => false, |
|
| 888 | 888 | 'label' => '', |
| 889 | 889 | ), |
| 890 | 890 | 'id' => 'type', |
@@ -896,9 +896,9 @@ discard block |
||
| 896 | 896 | 'operator' => '=', |
| 897 | 897 | 'value' => '1', |
| 898 | 898 | 'group' => '0', |
| 899 | - 'exposed' => FALSE, |
|
| 899 | + 'exposed' => false, |
|
| 900 | 900 | 'expose' => array( |
| 901 | - 'operator' => FALSE, |
|
| 901 | + 'operator' => false, |
|
| 902 | 902 | 'label' => '', |
| 903 | 903 | ), |
| 904 | 904 | 'id' => 'status', |
@@ -910,9 +910,9 @@ discard block |
||
| 910 | 910 | 'operator' => '=', |
| 911 | 911 | 'value' => '1', |
| 912 | 912 | 'group' => '0', |
| 913 | - 'exposed' => FALSE, |
|
| 913 | + 'exposed' => false, |
|
| 914 | 914 | 'expose' => array( |
| 915 | - 'operator' => FALSE, |
|
| 915 | + 'operator' => false, |
|
| 916 | 916 | 'label' => '', |
| 917 | 917 | ), |
| 918 | 918 | 'id' => 'promote', |
@@ -4,114 +4,114 @@ discard block |
||
| 4 | 4 | * Implementation of hook_views_default_views(). |
| 5 | 5 | */ |
| 6 | 6 | function news_views_default_views() { |
| 7 | - $views = array(); |
|
| 7 | + $views = array(); |
|
| 8 | 8 | |
| 9 | - // Exported view: news |
|
| 10 | - $view = new view; |
|
| 11 | - $view->name = 'news'; |
|
| 12 | - $view->description = ''; |
|
| 13 | - $view->tag = ''; |
|
| 14 | - $view->base_table = 'node'; |
|
| 15 | - $view->core = 0; |
|
| 16 | - $view->api_version = '2'; |
|
| 17 | - $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */ |
|
| 18 | - $handler = $view->new_display('default', 'Defaults', 'default'); |
|
| 19 | - $handler->override_option('relationships', array( |
|
| 9 | + // Exported view: news |
|
| 10 | + $view = new view; |
|
| 11 | + $view->name = 'news'; |
|
| 12 | + $view->description = ''; |
|
| 13 | + $view->tag = ''; |
|
| 14 | + $view->base_table = 'node'; |
|
| 15 | + $view->core = 0; |
|
| 16 | + $view->api_version = '2'; |
|
| 17 | + $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */ |
|
| 18 | + $handler = $view->new_display('default', 'Defaults', 'default'); |
|
| 19 | + $handler->override_option('relationships', array( |
|
| 20 | 20 | 'content_profile_rel' => array( |
| 21 | - 'id' => 'content_profile_rel', |
|
| 22 | - 'table' => 'users', |
|
| 23 | - 'field' => 'content_profile_rel', |
|
| 21 | + 'id' => 'content_profile_rel', |
|
| 22 | + 'table' => 'users', |
|
| 23 | + 'field' => 'content_profile_rel', |
|
| 24 | 24 | ), |
| 25 | - )); |
|
| 26 | - $handler->override_option('fields', array( |
|
| 25 | + )); |
|
| 26 | + $handler->override_option('fields', array( |
|
| 27 | 27 | 'comment_count' => array( |
| 28 | - 'id' => 'comment_count', |
|
| 29 | - 'table' => 'node_comment_statistics', |
|
| 30 | - 'field' => 'comment_count', |
|
| 28 | + 'id' => 'comment_count', |
|
| 29 | + 'table' => 'node_comment_statistics', |
|
| 30 | + 'field' => 'comment_count', |
|
| 31 | 31 | ), |
| 32 | 32 | 'view_node' => array( |
| 33 | - 'id' => 'view_node', |
|
| 34 | - 'table' => 'node', |
|
| 35 | - 'field' => 'view_node', |
|
| 33 | + 'id' => 'view_node', |
|
| 34 | + 'table' => 'node', |
|
| 35 | + 'field' => 'view_node', |
|
| 36 | 36 | ), |
| 37 | 37 | 'created' => array( |
| 38 | - 'id' => 'created', |
|
| 39 | - 'table' => 'node', |
|
| 40 | - 'field' => 'created', |
|
| 38 | + 'id' => 'created', |
|
| 39 | + 'table' => 'node', |
|
| 40 | + 'field' => 'created', |
|
| 41 | 41 | ), |
| 42 | 42 | 'teaser' => array( |
| 43 | - 'id' => 'teaser', |
|
| 44 | - 'table' => 'node_revisions', |
|
| 45 | - 'field' => 'teaser', |
|
| 43 | + 'id' => 'teaser', |
|
| 44 | + 'table' => 'node_revisions', |
|
| 45 | + 'field' => 'teaser', |
|
| 46 | 46 | ), |
| 47 | 47 | 'title' => array( |
| 48 | - 'id' => 'title', |
|
| 49 | - 'table' => 'node', |
|
| 50 | - 'field' => 'title', |
|
| 48 | + 'id' => 'title', |
|
| 49 | + 'table' => 'node', |
|
| 50 | + 'field' => 'title', |
|
| 51 | 51 | ), |
| 52 | - )); |
|
| 53 | - $handler->override_option('sorts', array( |
|
| 52 | + )); |
|
| 53 | + $handler->override_option('sorts', array( |
|
| 54 | 54 | 'created_1' => array( |
| 55 | - 'order' => 'DESC', |
|
| 56 | - 'granularity' => 'second', |
|
| 57 | - 'id' => 'created_1', |
|
| 58 | - 'table' => 'node', |
|
| 59 | - 'field' => 'created', |
|
| 60 | - 'override' => array( |
|
| 55 | + 'order' => 'DESC', |
|
| 56 | + 'granularity' => 'second', |
|
| 57 | + 'id' => 'created_1', |
|
| 58 | + 'table' => 'node', |
|
| 59 | + 'field' => 'created', |
|
| 60 | + 'override' => array( |
|
| 61 | 61 | 'button' => 'Override', |
| 62 | - ), |
|
| 63 | - 'relationship' => 'none', |
|
| 62 | + ), |
|
| 63 | + 'relationship' => 'none', |
|
| 64 | 64 | ), |
| 65 | - )); |
|
| 66 | - $handler->override_option('filters', array( |
|
| 65 | + )); |
|
| 66 | + $handler->override_option('filters', array( |
|
| 67 | 67 | 'type' => array( |
| 68 | - 'operator' => 'in', |
|
| 69 | - 'value' => array( |
|
| 68 | + 'operator' => 'in', |
|
| 69 | + 'value' => array( |
|
| 70 | 70 | 'news' => 'news', |
| 71 | - ), |
|
| 72 | - 'group' => '0', |
|
| 73 | - 'exposed' => FALSE, |
|
| 74 | - 'expose' => array( |
|
| 71 | + ), |
|
| 72 | + 'group' => '0', |
|
| 73 | + 'exposed' => FALSE, |
|
| 74 | + 'expose' => array( |
|
| 75 | 75 | 'operator' => FALSE, |
| 76 | 76 | 'label' => '', |
| 77 | - ), |
|
| 78 | - 'id' => 'type', |
|
| 79 | - 'table' => 'node', |
|
| 80 | - 'field' => 'type', |
|
| 81 | - 'relationship' => 'none', |
|
| 77 | + ), |
|
| 78 | + 'id' => 'type', |
|
| 79 | + 'table' => 'node', |
|
| 80 | + 'field' => 'type', |
|
| 81 | + 'relationship' => 'none', |
|
| 82 | 82 | ), |
| 83 | 83 | 'status' => array( |
| 84 | - 'operator' => '=', |
|
| 85 | - 'value' => '1', |
|
| 86 | - 'group' => '0', |
|
| 87 | - 'exposed' => FALSE, |
|
| 88 | - 'expose' => array( |
|
| 84 | + 'operator' => '=', |
|
| 85 | + 'value' => '1', |
|
| 86 | + 'group' => '0', |
|
| 87 | + 'exposed' => FALSE, |
|
| 88 | + 'expose' => array( |
|
| 89 | 89 | 'operator' => FALSE, |
| 90 | 90 | 'label' => '', |
| 91 | - ), |
|
| 92 | - 'id' => 'status', |
|
| 93 | - 'table' => 'node', |
|
| 94 | - 'field' => 'status', |
|
| 95 | - 'relationship' => 'none', |
|
| 96 | - ), |
|
| 97 | - )); |
|
| 98 | - $handler->override_option('access', array( |
|
| 91 | + ), |
|
| 92 | + 'id' => 'status', |
|
| 93 | + 'table' => 'node', |
|
| 94 | + 'field' => 'status', |
|
| 95 | + 'relationship' => 'none', |
|
| 96 | + ), |
|
| 97 | + )); |
|
| 98 | + $handler->override_option('access', array( |
|
| 99 | 99 | 'type' => 'none', |
| 100 | - )); |
|
| 101 | - $handler->override_option('cache', array( |
|
| 100 | + )); |
|
| 101 | + $handler->override_option('cache', array( |
|
| 102 | 102 | 'type' => 'none', |
| 103 | - )); |
|
| 104 | - $handler->override_option('empty', 'No news is good news...'); |
|
| 105 | - $handler->override_option('empty_format', '5'); |
|
| 106 | - $handler->override_option('items_per_page', 3); |
|
| 107 | - $handler->override_option('use_pager', '1'); |
|
| 108 | - $handler->override_option('row_plugin', 'node'); |
|
| 109 | - $handler = $view->new_display('page', 'Page', 'page_1'); |
|
| 110 | - $handler->override_option('relationships', array()); |
|
| 111 | - $handler->override_option('fields', array( |
|
| 103 | + )); |
|
| 104 | + $handler->override_option('empty', 'No news is good news...'); |
|
| 105 | + $handler->override_option('empty_format', '5'); |
|
| 106 | + $handler->override_option('items_per_page', 3); |
|
| 107 | + $handler->override_option('use_pager', '1'); |
|
| 108 | + $handler->override_option('row_plugin', 'node'); |
|
| 109 | + $handler = $view->new_display('page', 'Page', 'page_1'); |
|
| 110 | + $handler->override_option('relationships', array()); |
|
| 111 | + $handler->override_option('fields', array( |
|
| 112 | 112 | 'title' => array( |
| 113 | - 'label' => '', |
|
| 114 | - 'alter' => array( |
|
| 113 | + 'label' => '', |
|
| 114 | + 'alter' => array( |
|
| 115 | 115 | 'alter_text' => 1, |
| 116 | 116 | 'text' => '<h2>[title]</h2>', |
| 117 | 117 | 'make_link' => 0, |
@@ -128,23 +128,23 @@ discard block |
||
| 128 | 128 | 'ellipsis' => 1, |
| 129 | 129 | 'html' => 0, |
| 130 | 130 | 'strip_tags' => 0, |
| 131 | - ), |
|
| 132 | - 'empty' => '', |
|
| 133 | - 'hide_empty' => 0, |
|
| 134 | - 'empty_zero' => 0, |
|
| 135 | - 'link_to_node' => 0, |
|
| 136 | - 'exclude' => 0, |
|
| 137 | - 'id' => 'title', |
|
| 138 | - 'table' => 'node', |
|
| 139 | - 'field' => 'title', |
|
| 140 | - 'override' => array( |
|
| 131 | + ), |
|
| 132 | + 'empty' => '', |
|
| 133 | + 'hide_empty' => 0, |
|
| 134 | + 'empty_zero' => 0, |
|
| 135 | + 'link_to_node' => 0, |
|
| 136 | + 'exclude' => 0, |
|
| 137 | + 'id' => 'title', |
|
| 138 | + 'table' => 'node', |
|
| 139 | + 'field' => 'title', |
|
| 140 | + 'override' => array( |
|
| 141 | 141 | 'button' => 'Use default', |
| 142 | - ), |
|
| 143 | - 'relationship' => 'none', |
|
| 142 | + ), |
|
| 143 | + 'relationship' => 'none', |
|
| 144 | 144 | ), |
| 145 | 145 | 'created' => array( |
| 146 | - 'label' => '', |
|
| 147 | - 'alter' => array( |
|
| 146 | + 'label' => '', |
|
| 147 | + 'alter' => array( |
|
| 148 | 148 | 'alter_text' => 0, |
| 149 | 149 | 'text' => '', |
| 150 | 150 | 'make_link' => 0, |
@@ -161,24 +161,24 @@ discard block |
||
| 161 | 161 | 'ellipsis' => 1, |
| 162 | 162 | 'html' => 0, |
| 163 | 163 | 'strip_tags' => 0, |
| 164 | - ), |
|
| 165 | - 'empty' => '', |
|
| 166 | - 'hide_empty' => 0, |
|
| 167 | - 'empty_zero' => 0, |
|
| 168 | - 'date_format' => 'custom', |
|
| 169 | - 'custom_date_format' => 'F d, Y', |
|
| 170 | - 'exclude' => 0, |
|
| 171 | - 'id' => 'created', |
|
| 172 | - 'table' => 'node', |
|
| 173 | - 'field' => 'created', |
|
| 174 | - 'override' => array( |
|
| 164 | + ), |
|
| 165 | + 'empty' => '', |
|
| 166 | + 'hide_empty' => 0, |
|
| 167 | + 'empty_zero' => 0, |
|
| 168 | + 'date_format' => 'custom', |
|
| 169 | + 'custom_date_format' => 'F d, Y', |
|
| 170 | + 'exclude' => 0, |
|
| 171 | + 'id' => 'created', |
|
| 172 | + 'table' => 'node', |
|
| 173 | + 'field' => 'created', |
|
| 174 | + 'override' => array( |
|
| 175 | 175 | 'button' => 'Use default', |
| 176 | - ), |
|
| 177 | - 'relationship' => 'none', |
|
| 176 | + ), |
|
| 177 | + 'relationship' => 'none', |
|
| 178 | 178 | ), |
| 179 | 179 | 'name' => array( |
| 180 | - 'label' => '', |
|
| 181 | - 'alter' => array( |
|
| 180 | + 'label' => '', |
|
| 181 | + 'alter' => array( |
|
| 182 | 182 | 'alter_text' => 1, |
| 183 | 183 | 'text' => ' / Posted by [name]', |
| 184 | 184 | 'make_link' => 0, |
@@ -197,26 +197,26 @@ discard block |
||
| 197 | 197 | 'ellipsis' => 1, |
| 198 | 198 | 'html' => 0, |
| 199 | 199 | 'strip_tags' => 0, |
| 200 | - ), |
|
| 201 | - 'empty' => '', |
|
| 202 | - 'hide_empty' => 0, |
|
| 203 | - 'empty_zero' => 0, |
|
| 204 | - 'hide_alter_empty' => 1, |
|
| 205 | - 'link_to_user' => 0, |
|
| 206 | - 'overwrite_anonymous' => 0, |
|
| 207 | - 'anonymous_text' => '', |
|
| 208 | - 'exclude' => 1, |
|
| 209 | - 'id' => 'name', |
|
| 210 | - 'table' => 'users', |
|
| 211 | - 'field' => 'name', |
|
| 212 | - 'override' => array( |
|
| 200 | + ), |
|
| 201 | + 'empty' => '', |
|
| 202 | + 'hide_empty' => 0, |
|
| 203 | + 'empty_zero' => 0, |
|
| 204 | + 'hide_alter_empty' => 1, |
|
| 205 | + 'link_to_user' => 0, |
|
| 206 | + 'overwrite_anonymous' => 0, |
|
| 207 | + 'anonymous_text' => '', |
|
| 208 | + 'exclude' => 1, |
|
| 209 | + 'id' => 'name', |
|
| 210 | + 'table' => 'users', |
|
| 211 | + 'field' => 'name', |
|
| 212 | + 'override' => array( |
|
| 213 | 213 | 'button' => 'Use default', |
| 214 | - ), |
|
| 215 | - 'relationship' => 'none', |
|
| 214 | + ), |
|
| 215 | + 'relationship' => 'none', |
|
| 216 | 216 | ), |
| 217 | 217 | 'teaser' => array( |
| 218 | - 'label' => '', |
|
| 219 | - 'alter' => array( |
|
| 218 | + 'label' => '', |
|
| 219 | + 'alter' => array( |
|
| 220 | 220 | 'alter_text' => 0, |
| 221 | 221 | 'text' => '', |
| 222 | 222 | 'make_link' => 0, |
@@ -235,23 +235,23 @@ discard block |
||
| 235 | 235 | 'ellipsis' => 1, |
| 236 | 236 | 'html' => 0, |
| 237 | 237 | 'strip_tags' => 0, |
| 238 | - ), |
|
| 239 | - 'empty' => '', |
|
| 240 | - 'hide_empty' => 0, |
|
| 241 | - 'empty_zero' => 0, |
|
| 242 | - 'hide_alter_empty' => 1, |
|
| 243 | - 'exclude' => 0, |
|
| 244 | - 'id' => 'teaser', |
|
| 245 | - 'table' => 'node_revisions', |
|
| 246 | - 'field' => 'teaser', |
|
| 247 | - 'override' => array( |
|
| 238 | + ), |
|
| 239 | + 'empty' => '', |
|
| 240 | + 'hide_empty' => 0, |
|
| 241 | + 'empty_zero' => 0, |
|
| 242 | + 'hide_alter_empty' => 1, |
|
| 243 | + 'exclude' => 0, |
|
| 244 | + 'id' => 'teaser', |
|
| 245 | + 'table' => 'node_revisions', |
|
| 246 | + 'field' => 'teaser', |
|
| 247 | + 'override' => array( |
|
| 248 | 248 | 'button' => 'Use default', |
| 249 | - ), |
|
| 250 | - 'relationship' => 'none', |
|
| 249 | + ), |
|
| 250 | + 'relationship' => 'none', |
|
| 251 | 251 | ), |
| 252 | 252 | 'view_node' => array( |
| 253 | - 'label' => '', |
|
| 254 | - 'alter' => array( |
|
| 253 | + 'label' => '', |
|
| 254 | + 'alter' => array( |
|
| 255 | 255 | 'alter_text' => 0, |
| 256 | 256 | 'text' => '', |
| 257 | 257 | 'make_link' => 0, |
@@ -270,24 +270,24 @@ discard block |
||
| 270 | 270 | 'ellipsis' => 1, |
| 271 | 271 | 'html' => 0, |
| 272 | 272 | 'strip_tags' => 0, |
| 273 | - ), |
|
| 274 | - 'empty' => '', |
|
| 275 | - 'hide_empty' => 0, |
|
| 276 | - 'empty_zero' => 0, |
|
| 277 | - 'hide_alter_empty' => 1, |
|
| 278 | - 'text' => 'more', |
|
| 279 | - 'exclude' => 0, |
|
| 280 | - 'id' => 'view_node', |
|
| 281 | - 'table' => 'node', |
|
| 282 | - 'field' => 'view_node', |
|
| 283 | - 'override' => array( |
|
| 273 | + ), |
|
| 274 | + 'empty' => '', |
|
| 275 | + 'hide_empty' => 0, |
|
| 276 | + 'empty_zero' => 0, |
|
| 277 | + 'hide_alter_empty' => 1, |
|
| 278 | + 'text' => 'more', |
|
| 279 | + 'exclude' => 0, |
|
| 280 | + 'id' => 'view_node', |
|
| 281 | + 'table' => 'node', |
|
| 282 | + 'field' => 'view_node', |
|
| 283 | + 'override' => array( |
|
| 284 | 284 | 'button' => 'Use default', |
| 285 | - ), |
|
| 286 | - 'relationship' => 'none', |
|
| 285 | + ), |
|
| 286 | + 'relationship' => 'none', |
|
| 287 | 287 | ), |
| 288 | 288 | 'comment_count' => array( |
| 289 | - 'label' => '', |
|
| 290 | - 'alter' => array( |
|
| 289 | + 'label' => '', |
|
| 290 | + 'alter' => array( |
|
| 291 | 291 | 'alter_text' => 0, |
| 292 | 292 | 'text' => '', |
| 293 | 293 | 'make_link' => 0, |
@@ -306,32 +306,32 @@ discard block |
||
| 306 | 306 | 'ellipsis' => 1, |
| 307 | 307 | 'html' => 0, |
| 308 | 308 | 'strip_tags' => 0, |
| 309 | - ), |
|
| 310 | - 'empty' => '0', |
|
| 311 | - 'hide_empty' => 1, |
|
| 312 | - 'empty_zero' => 0, |
|
| 313 | - 'hide_alter_empty' => 0, |
|
| 314 | - 'set_precision' => FALSE, |
|
| 315 | - 'precision' => 0, |
|
| 316 | - 'decimal' => '.', |
|
| 317 | - 'separator' => '', |
|
| 318 | - 'format_plural' => 0, |
|
| 319 | - 'format_plural_singular' => '1', |
|
| 320 | - 'format_plural_plural' => '@count', |
|
| 321 | - 'prefix' => '', |
|
| 322 | - 'suffix' => '', |
|
| 323 | - 'exclude' => 0, |
|
| 324 | - 'id' => 'comment_count', |
|
| 325 | - 'table' => 'node_comment_statistics', |
|
| 326 | - 'field' => 'comment_count', |
|
| 327 | - 'override' => array( |
|
| 309 | + ), |
|
| 310 | + 'empty' => '0', |
|
| 311 | + 'hide_empty' => 1, |
|
| 312 | + 'empty_zero' => 0, |
|
| 313 | + 'hide_alter_empty' => 0, |
|
| 314 | + 'set_precision' => FALSE, |
|
| 315 | + 'precision' => 0, |
|
| 316 | + 'decimal' => '.', |
|
| 317 | + 'separator' => '', |
|
| 318 | + 'format_plural' => 0, |
|
| 319 | + 'format_plural_singular' => '1', |
|
| 320 | + 'format_plural_plural' => '@count', |
|
| 321 | + 'prefix' => '', |
|
| 322 | + 'suffix' => '', |
|
| 323 | + 'exclude' => 0, |
|
| 324 | + 'id' => 'comment_count', |
|
| 325 | + 'table' => 'node_comment_statistics', |
|
| 326 | + 'field' => 'comment_count', |
|
| 327 | + 'override' => array( |
|
| 328 | 328 | 'button' => 'Use default', |
| 329 | - ), |
|
| 330 | - 'relationship' => 'none', |
|
| 329 | + ), |
|
| 330 | + 'relationship' => 'none', |
|
| 331 | 331 | ), |
| 332 | 332 | 'nothing' => array( |
| 333 | - 'label' => '', |
|
| 334 | - 'alter' => array( |
|
| 333 | + 'label' => '', |
|
| 334 | + 'alter' => array( |
|
| 335 | 335 | 'text' => '<div class="clearfix"></div>', |
| 336 | 336 | 'make_link' => 0, |
| 337 | 337 | 'path' => '', |
@@ -347,210 +347,210 @@ discard block |
||
| 347 | 347 | 'ellipsis' => 1, |
| 348 | 348 | 'html' => 0, |
| 349 | 349 | 'strip_tags' => 0, |
| 350 | - ), |
|
| 351 | - 'empty' => '', |
|
| 352 | - 'hide_empty' => 0, |
|
| 353 | - 'empty_zero' => 0, |
|
| 354 | - 'exclude' => 0, |
|
| 355 | - 'id' => 'nothing', |
|
| 356 | - 'table' => 'views', |
|
| 357 | - 'field' => 'nothing', |
|
| 358 | - 'override' => array( |
|
| 350 | + ), |
|
| 351 | + 'empty' => '', |
|
| 352 | + 'hide_empty' => 0, |
|
| 353 | + 'empty_zero' => 0, |
|
| 354 | + 'exclude' => 0, |
|
| 355 | + 'id' => 'nothing', |
|
| 356 | + 'table' => 'views', |
|
| 357 | + 'field' => 'nothing', |
|
| 358 | + 'override' => array( |
|
| 359 | 359 | 'button' => 'Use default', |
| 360 | - ), |
|
| 361 | - 'relationship' => 'none', |
|
| 362 | - ), |
|
| 363 | - )); |
|
| 364 | - $handler->override_option('title', 'News'); |
|
| 365 | - $handler->override_option('row_plugin', 'fields'); |
|
| 366 | - $handler->override_option('path', 'news'); |
|
| 367 | - $handler->override_option('menu', array( |
|
| 360 | + ), |
|
| 361 | + 'relationship' => 'none', |
|
| 362 | + ), |
|
| 363 | + )); |
|
| 364 | + $handler->override_option('title', 'News'); |
|
| 365 | + $handler->override_option('row_plugin', 'fields'); |
|
| 366 | + $handler->override_option('path', 'news'); |
|
| 367 | + $handler->override_option('menu', array( |
|
| 368 | 368 | 'type' => 'normal', |
| 369 | 369 | 'title' => 'News', |
| 370 | 370 | 'description' => '', |
| 371 | 371 | 'weight' => '0', |
| 372 | 372 | 'name' => 'navigation', |
| 373 | - )); |
|
| 374 | - $handler->override_option('tab_options', array( |
|
| 373 | + )); |
|
| 374 | + $handler->override_option('tab_options', array( |
|
| 375 | 375 | 'type' => 'none', |
| 376 | 376 | 'title' => '', |
| 377 | 377 | 'description' => '', |
| 378 | 378 | 'weight' => 0, |
| 379 | 379 | 'name' => 'navigation', |
| 380 | - )); |
|
| 381 | - $handler = $view->new_display('feed', 'Feed', 'feed_1'); |
|
| 382 | - $handler->override_option('arguments', array( |
|
| 380 | + )); |
|
| 381 | + $handler = $view->new_display('feed', 'Feed', 'feed_1'); |
|
| 382 | + $handler->override_option('arguments', array( |
|
| 383 | 383 | 'null' => array( |
| 384 | - 'default_action' => 'default', |
|
| 385 | - 'style_plugin' => 'default_summary', |
|
| 386 | - 'style_options' => array(), |
|
| 387 | - 'wildcard' => 'all', |
|
| 388 | - 'wildcard_substitution' => 'All', |
|
| 389 | - 'title' => '%1 | News', |
|
| 390 | - 'breadcrumb' => '', |
|
| 391 | - 'default_argument_type' => 'php', |
|
| 392 | - 'default_argument' => '', |
|
| 393 | - 'validate_type' => 'none', |
|
| 394 | - 'validate_fail' => 'not found', |
|
| 395 | - 'must_not_be' => 0, |
|
| 396 | - 'id' => 'null', |
|
| 397 | - 'table' => 'views', |
|
| 398 | - 'field' => 'null', |
|
| 399 | - 'validate_user_argument_type' => 'uid', |
|
| 400 | - 'validate_user_roles' => array( |
|
| 384 | + 'default_action' => 'default', |
|
| 385 | + 'style_plugin' => 'default_summary', |
|
| 386 | + 'style_options' => array(), |
|
| 387 | + 'wildcard' => 'all', |
|
| 388 | + 'wildcard_substitution' => 'All', |
|
| 389 | + 'title' => '%1 | News', |
|
| 390 | + 'breadcrumb' => '', |
|
| 391 | + 'default_argument_type' => 'php', |
|
| 392 | + 'default_argument' => '', |
|
| 393 | + 'validate_type' => 'none', |
|
| 394 | + 'validate_fail' => 'not found', |
|
| 395 | + 'must_not_be' => 0, |
|
| 396 | + 'id' => 'null', |
|
| 397 | + 'table' => 'views', |
|
| 398 | + 'field' => 'null', |
|
| 399 | + 'validate_user_argument_type' => 'uid', |
|
| 400 | + 'validate_user_roles' => array( |
|
| 401 | 401 | 2 => 0, |
| 402 | 402 | 4 => 0, |
| 403 | 403 | 7 => 0, |
| 404 | 404 | 5 => 0, |
| 405 | 405 | 3 => 0, |
| 406 | 406 | 6 => 0, |
| 407 | - ), |
|
| 408 | - 'me_redirect' => 0, |
|
| 409 | - 'me_validate_user_argument_type' => 'uid', |
|
| 410 | - 'me_validate_user_roles' => array( |
|
| 407 | + ), |
|
| 408 | + 'me_redirect' => 0, |
|
| 409 | + 'me_validate_user_argument_type' => 'uid', |
|
| 410 | + 'me_validate_user_roles' => array( |
|
| 411 | 411 | 2 => 0, |
| 412 | 412 | 4 => 0, |
| 413 | 413 | 7 => 0, |
| 414 | 414 | 5 => 0, |
| 415 | 415 | 3 => 0, |
| 416 | 416 | 6 => 0, |
| 417 | - ), |
|
| 418 | - 'override' => array( |
|
| 417 | + ), |
|
| 418 | + 'override' => array( |
|
| 419 | 419 | 'button' => 'Use default', |
| 420 | - ), |
|
| 421 | - 'relationship' => 'none', |
|
| 422 | - 'default_options_div_prefix' => '', |
|
| 423 | - 'default_taxonomy_tid_term_page' => 0, |
|
| 424 | - 'default_taxonomy_tid_node' => 0, |
|
| 425 | - 'default_taxonomy_tid_limit' => 0, |
|
| 426 | - 'default_taxonomy_tid_vids' => array( |
|
| 420 | + ), |
|
| 421 | + 'relationship' => 'none', |
|
| 422 | + 'default_options_div_prefix' => '', |
|
| 423 | + 'default_taxonomy_tid_term_page' => 0, |
|
| 424 | + 'default_taxonomy_tid_node' => 0, |
|
| 425 | + 'default_taxonomy_tid_limit' => 0, |
|
| 426 | + 'default_taxonomy_tid_vids' => array( |
|
| 427 | 427 | 1 => 0, |
| 428 | 428 | 2 => 0, |
| 429 | - ), |
|
| 430 | - 'default_argument_user' => 0, |
|
| 431 | - 'default_argument_fixed' => '', |
|
| 432 | - 'default_argument_php' => '// Use this to set a custom feed title that works both in the feed and |
|
| 429 | + ), |
|
| 430 | + 'default_argument_user' => 0, |
|
| 431 | + 'default_argument_fixed' => '', |
|
| 432 | + 'default_argument_php' => '// Use this to set a custom feed title that works both in the feed and |
|
| 433 | 433 | // in the auto discovery link in the page header |
| 434 | 434 | return variable_get(\'site_name\', \'Drupal-BOINC\'); |
| 435 | 435 | ', |
| 436 | - 'validate_argument_node_type' => array( |
|
| 436 | + 'validate_argument_node_type' => array( |
|
| 437 | 437 | 'page' => 0, |
| 438 | 438 | 'news' => 0, |
| 439 | 439 | 'profile' => 0, |
| 440 | 440 | 'forum' => 0, |
| 441 | 441 | 'panel' => 0, |
| 442 | 442 | 'story' => 0, |
| 443 | - ), |
|
| 444 | - 'validate_argument_node_access' => 0, |
|
| 445 | - 'validate_argument_nid_type' => 'nid', |
|
| 446 | - 'validate_argument_vocabulary' => array( |
|
| 443 | + ), |
|
| 444 | + 'validate_argument_node_access' => 0, |
|
| 445 | + 'validate_argument_nid_type' => 'nid', |
|
| 446 | + 'validate_argument_vocabulary' => array( |
|
| 447 | 447 | 1 => 0, |
| 448 | 448 | 2 => 0, |
| 449 | - ), |
|
| 450 | - 'validate_argument_type' => 'tid', |
|
| 451 | - 'validate_argument_transform' => 0, |
|
| 452 | - 'validate_user_restrict_roles' => 0, |
|
| 453 | - 'validate_argument_node_flag_name' => '*relationship*', |
|
| 454 | - 'validate_argument_node_flag_test' => 'flaggable', |
|
| 455 | - 'validate_argument_node_flag_id_type' => 'id', |
|
| 456 | - 'validate_argument_user_flag_name' => '*relationship*', |
|
| 457 | - 'validate_argument_user_flag_test' => 'flaggable', |
|
| 458 | - 'validate_argument_user_flag_id_type' => 'id', |
|
| 459 | - 'validate_argument_php' => '', |
|
| 460 | - 'me_validate_user_restrict_roles' => 0, |
|
| 461 | - ), |
|
| 462 | - )); |
|
| 463 | - $handler->override_option('filters', array( |
|
| 449 | + ), |
|
| 450 | + 'validate_argument_type' => 'tid', |
|
| 451 | + 'validate_argument_transform' => 0, |
|
| 452 | + 'validate_user_restrict_roles' => 0, |
|
| 453 | + 'validate_argument_node_flag_name' => '*relationship*', |
|
| 454 | + 'validate_argument_node_flag_test' => 'flaggable', |
|
| 455 | + 'validate_argument_node_flag_id_type' => 'id', |
|
| 456 | + 'validate_argument_user_flag_name' => '*relationship*', |
|
| 457 | + 'validate_argument_user_flag_test' => 'flaggable', |
|
| 458 | + 'validate_argument_user_flag_id_type' => 'id', |
|
| 459 | + 'validate_argument_php' => '', |
|
| 460 | + 'me_validate_user_restrict_roles' => 0, |
|
| 461 | + ), |
|
| 462 | + )); |
|
| 463 | + $handler->override_option('filters', array( |
|
| 464 | 464 | 'type' => array( |
| 465 | - 'operator' => 'in', |
|
| 466 | - 'value' => array( |
|
| 465 | + 'operator' => 'in', |
|
| 466 | + 'value' => array( |
|
| 467 | 467 | 'news' => 'news', |
| 468 | - ), |
|
| 469 | - 'group' => '0', |
|
| 470 | - 'exposed' => FALSE, |
|
| 471 | - 'expose' => array( |
|
| 468 | + ), |
|
| 469 | + 'group' => '0', |
|
| 470 | + 'exposed' => FALSE, |
|
| 471 | + 'expose' => array( |
|
| 472 | 472 | 'operator' => FALSE, |
| 473 | 473 | 'label' => '', |
| 474 | - ), |
|
| 475 | - 'id' => 'type', |
|
| 476 | - 'table' => 'node', |
|
| 477 | - 'field' => 'type', |
|
| 478 | - 'relationship' => 'none', |
|
| 474 | + ), |
|
| 475 | + 'id' => 'type', |
|
| 476 | + 'table' => 'node', |
|
| 477 | + 'field' => 'type', |
|
| 478 | + 'relationship' => 'none', |
|
| 479 | 479 | ), |
| 480 | 480 | 'status' => array( |
| 481 | - 'operator' => '=', |
|
| 482 | - 'value' => '1', |
|
| 483 | - 'group' => '0', |
|
| 484 | - 'exposed' => FALSE, |
|
| 485 | - 'expose' => array( |
|
| 481 | + 'operator' => '=', |
|
| 482 | + 'value' => '1', |
|
| 483 | + 'group' => '0', |
|
| 484 | + 'exposed' => FALSE, |
|
| 485 | + 'expose' => array( |
|
| 486 | 486 | 'operator' => FALSE, |
| 487 | 487 | 'label' => '', |
| 488 | - ), |
|
| 489 | - 'id' => 'status', |
|
| 490 | - 'table' => 'node', |
|
| 491 | - 'field' => 'status', |
|
| 492 | - 'relationship' => 'none', |
|
| 488 | + ), |
|
| 489 | + 'id' => 'status', |
|
| 490 | + 'table' => 'node', |
|
| 491 | + 'field' => 'status', |
|
| 492 | + 'relationship' => 'none', |
|
| 493 | 493 | ), |
| 494 | 494 | 'changed' => array( |
| 495 | - 'operator' => '>=', |
|
| 496 | - 'value' => array( |
|
| 495 | + 'operator' => '>=', |
|
| 496 | + 'value' => array( |
|
| 497 | 497 | 'type' => 'offset', |
| 498 | 498 | 'value' => '-90 days', |
| 499 | 499 | 'min' => '', |
| 500 | 500 | 'max' => '', |
| 501 | - ), |
|
| 502 | - 'group' => '0', |
|
| 503 | - 'exposed' => FALSE, |
|
| 504 | - 'expose' => array( |
|
| 501 | + ), |
|
| 502 | + 'group' => '0', |
|
| 503 | + 'exposed' => FALSE, |
|
| 504 | + 'expose' => array( |
|
| 505 | 505 | 'operator' => FALSE, |
| 506 | 506 | 'label' => '', |
| 507 | - ), |
|
| 508 | - 'id' => 'changed', |
|
| 509 | - 'table' => 'node', |
|
| 510 | - 'field' => 'changed', |
|
| 511 | - 'override' => array( |
|
| 507 | + ), |
|
| 508 | + 'id' => 'changed', |
|
| 509 | + 'table' => 'node', |
|
| 510 | + 'field' => 'changed', |
|
| 511 | + 'override' => array( |
|
| 512 | 512 | 'button' => 'Use default', |
| 513 | - ), |
|
| 514 | - 'relationship' => 'none', |
|
| 513 | + ), |
|
| 514 | + 'relationship' => 'none', |
|
| 515 | 515 | ), |
| 516 | - )); |
|
| 517 | - $handler->override_option('style_plugin', 'rss'); |
|
| 518 | - $handler->override_option('style_options', array( |
|
| 516 | + )); |
|
| 517 | + $handler->override_option('style_plugin', 'rss'); |
|
| 518 | + $handler->override_option('style_options', array( |
|
| 519 | 519 | 'mission_description' => FALSE, |
| 520 | 520 | 'description' => '', |
| 521 | - )); |
|
| 522 | - $handler->override_option('row_plugin', 'node_rss'); |
|
| 523 | - $handler->override_option('row_options', array( |
|
| 521 | + )); |
|
| 522 | + $handler->override_option('row_plugin', 'node_rss'); |
|
| 523 | + $handler->override_option('row_options', array( |
|
| 524 | 524 | 'relationship' => 'none', |
| 525 | 525 | 'item_length' => 'default', |
| 526 | - )); |
|
| 527 | - $handler->override_option('path', 'rss_main.php'); |
|
| 528 | - $handler->override_option('menu', array( |
|
| 526 | + )); |
|
| 527 | + $handler->override_option('path', 'rss_main.php'); |
|
| 528 | + $handler->override_option('menu', array( |
|
| 529 | 529 | 'type' => 'none', |
| 530 | 530 | 'title' => '', |
| 531 | 531 | 'description' => '', |
| 532 | 532 | 'weight' => 0, |
| 533 | 533 | 'name' => 'primary-links', |
| 534 | - )); |
|
| 535 | - $handler->override_option('tab_options', array( |
|
| 534 | + )); |
|
| 535 | + $handler->override_option('tab_options', array( |
|
| 536 | 536 | 'type' => 'none', |
| 537 | 537 | 'title' => '', |
| 538 | 538 | 'description' => '', |
| 539 | 539 | 'weight' => 0, |
| 540 | 540 | 'name' => 'navigation', |
| 541 | - )); |
|
| 542 | - $handler->override_option('displays', array( |
|
| 541 | + )); |
|
| 542 | + $handler->override_option('displays', array( |
|
| 543 | 543 | 'page_1' => 'page_1', |
| 544 | 544 | 'page_2' => 'page_2', |
| 545 | 545 | 'default' => 0, |
| 546 | - )); |
|
| 547 | - $handler->override_option('sitename_title', FALSE); |
|
| 548 | - $handler = $view->new_display('page', 'Short blurbs', 'page_2'); |
|
| 549 | - $handler->override_option('relationships', array()); |
|
| 550 | - $handler->override_option('fields', array( |
|
| 546 | + )); |
|
| 547 | + $handler->override_option('sitename_title', FALSE); |
|
| 548 | + $handler = $view->new_display('page', 'Short blurbs', 'page_2'); |
|
| 549 | + $handler->override_option('relationships', array()); |
|
| 550 | + $handler->override_option('fields', array( |
|
| 551 | 551 | 'nid' => array( |
| 552 | - 'label' => 'Nid', |
|
| 553 | - 'alter' => array( |
|
| 552 | + 'label' => 'Nid', |
|
| 553 | + 'alter' => array( |
|
| 554 | 554 | 'alter_text' => 0, |
| 555 | 555 | 'text' => '', |
| 556 | 556 | 'make_link' => 0, |
@@ -569,24 +569,24 @@ discard block |
||
| 569 | 569 | 'ellipsis' => 1, |
| 570 | 570 | 'html' => 0, |
| 571 | 571 | 'strip_tags' => 0, |
| 572 | - ), |
|
| 573 | - 'empty' => '', |
|
| 574 | - 'hide_empty' => 0, |
|
| 575 | - 'empty_zero' => 0, |
|
| 576 | - 'hide_alter_empty' => 1, |
|
| 577 | - 'link_to_node' => 0, |
|
| 578 | - 'exclude' => 1, |
|
| 579 | - 'id' => 'nid', |
|
| 580 | - 'table' => 'node', |
|
| 581 | - 'field' => 'nid', |
|
| 582 | - 'override' => array( |
|
| 572 | + ), |
|
| 573 | + 'empty' => '', |
|
| 574 | + 'hide_empty' => 0, |
|
| 575 | + 'empty_zero' => 0, |
|
| 576 | + 'hide_alter_empty' => 1, |
|
| 577 | + 'link_to_node' => 0, |
|
| 578 | + 'exclude' => 1, |
|
| 579 | + 'id' => 'nid', |
|
| 580 | + 'table' => 'node', |
|
| 581 | + 'field' => 'nid', |
|
| 582 | + 'override' => array( |
|
| 583 | 583 | 'button' => 'Use default', |
| 584 | - ), |
|
| 585 | - 'relationship' => 'none', |
|
| 584 | + ), |
|
| 585 | + 'relationship' => 'none', |
|
| 586 | 586 | ), |
| 587 | 587 | 'comment' => array( |
| 588 | - 'label' => 'Comment status', |
|
| 589 | - 'alter' => array( |
|
| 588 | + 'label' => 'Comment status', |
|
| 589 | + 'alter' => array( |
|
| 590 | 590 | 'alter_text' => 0, |
| 591 | 591 | 'text' => '', |
| 592 | 592 | 'make_link' => 0, |
@@ -605,23 +605,23 @@ discard block |
||
| 605 | 605 | 'ellipsis' => 1, |
| 606 | 606 | 'html' => 0, |
| 607 | 607 | 'strip_tags' => 0, |
| 608 | - ), |
|
| 609 | - 'empty' => '', |
|
| 610 | - 'hide_empty' => 0, |
|
| 611 | - 'empty_zero' => 0, |
|
| 612 | - 'hide_alter_empty' => 1, |
|
| 613 | - 'exclude' => 1, |
|
| 614 | - 'id' => 'comment', |
|
| 615 | - 'table' => 'node', |
|
| 616 | - 'field' => 'comment', |
|
| 617 | - 'override' => array( |
|
| 608 | + ), |
|
| 609 | + 'empty' => '', |
|
| 610 | + 'hide_empty' => 0, |
|
| 611 | + 'empty_zero' => 0, |
|
| 612 | + 'hide_alter_empty' => 1, |
|
| 613 | + 'exclude' => 1, |
|
| 614 | + 'id' => 'comment', |
|
| 615 | + 'table' => 'node', |
|
| 616 | + 'field' => 'comment', |
|
| 617 | + 'override' => array( |
|
| 618 | 618 | 'button' => 'Use default', |
| 619 | - ), |
|
| 620 | - 'relationship' => 'none', |
|
| 619 | + ), |
|
| 620 | + 'relationship' => 'none', |
|
| 621 | 621 | ), |
| 622 | 622 | 'title' => array( |
| 623 | - 'label' => '', |
|
| 624 | - 'alter' => array( |
|
| 623 | + 'label' => '', |
|
| 624 | + 'alter' => array( |
|
| 625 | 625 | 'alter_text' => 1, |
| 626 | 626 | 'text' => '<h2>[title]</h2>', |
| 627 | 627 | 'make_link' => 0, |
@@ -638,23 +638,23 @@ discard block |
||
| 638 | 638 | 'ellipsis' => 1, |
| 639 | 639 | 'html' => 0, |
| 640 | 640 | 'strip_tags' => 0, |
| 641 | - ), |
|
| 642 | - 'empty' => '', |
|
| 643 | - 'hide_empty' => 0, |
|
| 644 | - 'empty_zero' => 0, |
|
| 645 | - 'link_to_node' => 0, |
|
| 646 | - 'exclude' => 0, |
|
| 647 | - 'id' => 'title', |
|
| 648 | - 'table' => 'node', |
|
| 649 | - 'field' => 'title', |
|
| 650 | - 'override' => array( |
|
| 641 | + ), |
|
| 642 | + 'empty' => '', |
|
| 643 | + 'hide_empty' => 0, |
|
| 644 | + 'empty_zero' => 0, |
|
| 645 | + 'link_to_node' => 0, |
|
| 646 | + 'exclude' => 0, |
|
| 647 | + 'id' => 'title', |
|
| 648 | + 'table' => 'node', |
|
| 649 | + 'field' => 'title', |
|
| 650 | + 'override' => array( |
|
| 651 | 651 | 'button' => 'Use default', |
| 652 | - ), |
|
| 653 | - 'relationship' => 'none', |
|
| 652 | + ), |
|
| 653 | + 'relationship' => 'none', |
|
| 654 | 654 | ), |
| 655 | 655 | 'created' => array( |
| 656 | - 'label' => '', |
|
| 657 | - 'alter' => array( |
|
| 656 | + 'label' => '', |
|
| 657 | + 'alter' => array( |
|
| 658 | 658 | 'alter_text' => 0, |
| 659 | 659 | 'text' => '', |
| 660 | 660 | 'make_link' => 0, |
@@ -671,24 +671,24 @@ discard block |
||
| 671 | 671 | 'ellipsis' => 1, |
| 672 | 672 | 'html' => 0, |
| 673 | 673 | 'strip_tags' => 0, |
| 674 | - ), |
|
| 675 | - 'empty' => '', |
|
| 676 | - 'hide_empty' => 0, |
|
| 677 | - 'empty_zero' => 0, |
|
| 678 | - 'date_format' => 'custom', |
|
| 679 | - 'custom_date_format' => 'F d, Y', |
|
| 680 | - 'exclude' => 0, |
|
| 681 | - 'id' => 'created', |
|
| 682 | - 'table' => 'node', |
|
| 683 | - 'field' => 'created', |
|
| 684 | - 'override' => array( |
|
| 674 | + ), |
|
| 675 | + 'empty' => '', |
|
| 676 | + 'hide_empty' => 0, |
|
| 677 | + 'empty_zero' => 0, |
|
| 678 | + 'date_format' => 'custom', |
|
| 679 | + 'custom_date_format' => 'F d, Y', |
|
| 680 | + 'exclude' => 0, |
|
| 681 | + 'id' => 'created', |
|
| 682 | + 'table' => 'node', |
|
| 683 | + 'field' => 'created', |
|
| 684 | + 'override' => array( |
|
| 685 | 685 | 'button' => 'Use default', |
| 686 | - ), |
|
| 687 | - 'relationship' => 'none', |
|
| 686 | + ), |
|
| 687 | + 'relationship' => 'none', |
|
| 688 | 688 | ), |
| 689 | 689 | 'teaser' => array( |
| 690 | - 'label' => '', |
|
| 691 | - 'alter' => array( |
|
| 690 | + 'label' => '', |
|
| 691 | + 'alter' => array( |
|
| 692 | 692 | 'alter_text' => 0, |
| 693 | 693 | 'text' => '', |
| 694 | 694 | 'make_link' => 0, |
@@ -707,23 +707,23 @@ discard block |
||
| 707 | 707 | 'ellipsis' => 1, |
| 708 | 708 | 'html' => 0, |
| 709 | 709 | 'strip_tags' => 0, |
| 710 | - ), |
|
| 711 | - 'empty' => '', |
|
| 712 | - 'hide_empty' => 0, |
|
| 713 | - 'empty_zero' => 0, |
|
| 714 | - 'hide_alter_empty' => 1, |
|
| 715 | - 'exclude' => 0, |
|
| 716 | - 'id' => 'teaser', |
|
| 717 | - 'table' => 'node_revisions', |
|
| 718 | - 'field' => 'teaser', |
|
| 719 | - 'override' => array( |
|
| 710 | + ), |
|
| 711 | + 'empty' => '', |
|
| 712 | + 'hide_empty' => 0, |
|
| 713 | + 'empty_zero' => 0, |
|
| 714 | + 'hide_alter_empty' => 1, |
|
| 715 | + 'exclude' => 0, |
|
| 716 | + 'id' => 'teaser', |
|
| 717 | + 'table' => 'node_revisions', |
|
| 718 | + 'field' => 'teaser', |
|
| 719 | + 'override' => array( |
|
| 720 | 720 | 'button' => 'Use default', |
| 721 | - ), |
|
| 722 | - 'relationship' => 'none', |
|
| 721 | + ), |
|
| 722 | + 'relationship' => 'none', |
|
| 723 | 723 | ), |
| 724 | 724 | 'view_node_1' => array( |
| 725 | - 'label' => '', |
|
| 726 | - 'alter' => array( |
|
| 725 | + 'label' => '', |
|
| 726 | + 'alter' => array( |
|
| 727 | 727 | 'alter_text' => 0, |
| 728 | 728 | 'text' => '', |
| 729 | 729 | 'make_link' => 0, |
@@ -742,24 +742,24 @@ discard block |
||
| 742 | 742 | 'ellipsis' => 1, |
| 743 | 743 | 'html' => 0, |
| 744 | 744 | 'strip_tags' => 0, |
| 745 | - ), |
|
| 746 | - 'empty' => '', |
|
| 747 | - 'hide_empty' => 0, |
|
| 748 | - 'empty_zero' => 0, |
|
| 749 | - 'hide_alter_empty' => 1, |
|
| 750 | - 'text' => 'more', |
|
| 751 | - 'exclude' => 0, |
|
| 752 | - 'id' => 'view_node_1', |
|
| 753 | - 'table' => 'node', |
|
| 754 | - 'field' => 'view_node', |
|
| 755 | - 'override' => array( |
|
| 745 | + ), |
|
| 746 | + 'empty' => '', |
|
| 747 | + 'hide_empty' => 0, |
|
| 748 | + 'empty_zero' => 0, |
|
| 749 | + 'hide_alter_empty' => 1, |
|
| 750 | + 'text' => 'more', |
|
| 751 | + 'exclude' => 0, |
|
| 752 | + 'id' => 'view_node_1', |
|
| 753 | + 'table' => 'node', |
|
| 754 | + 'field' => 'view_node', |
|
| 755 | + 'override' => array( |
|
| 756 | 756 | 'button' => 'Use default', |
| 757 | - ), |
|
| 758 | - 'relationship' => 'none', |
|
| 757 | + ), |
|
| 758 | + 'relationship' => 'none', |
|
| 759 | 759 | ), |
| 760 | 760 | 'phpcode' => array( |
| 761 | - 'label' => '', |
|
| 762 | - 'alter' => array( |
|
| 761 | + 'label' => '', |
|
| 762 | + 'alter' => array( |
|
| 763 | 763 | 'alter_text' => 0, |
| 764 | 764 | 'text' => '', |
| 765 | 765 | 'make_link' => 0, |
@@ -778,30 +778,30 @@ discard block |
||
| 778 | 778 | 'ellipsis' => 1, |
| 779 | 779 | 'html' => 0, |
| 780 | 780 | 'strip_tags' => 0, |
| 781 | - ), |
|
| 782 | - 'empty' => '', |
|
| 783 | - 'hide_empty' => 0, |
|
| 784 | - 'empty_zero' => 0, |
|
| 785 | - 'hide_alter_empty' => 1, |
|
| 786 | - 'value' => '<?php |
|
| 781 | + ), |
|
| 782 | + 'empty' => '', |
|
| 783 | + 'hide_empty' => 0, |
|
| 784 | + 'empty_zero' => 0, |
|
| 785 | + 'hide_alter_empty' => 1, |
|
| 786 | + 'value' => '<?php |
|
| 787 | 787 | if ($data->node_comment == COMMENT_NODE_READ_WRITE) { |
| 788 | 788 | $cid = boincuser_get_first_unread_comment_id($data->nid); |
| 789 | 789 | $link = ($cid) ? "goto/comment/{$cid}" : "node/{$data->nid}"; |
| 790 | 790 | return l(bts(\'discuss\', array(), NULL, \'boinc:front-page-discuss-news\'), $link); |
| 791 | 791 | } |
| 792 | 792 | ?>', |
| 793 | - 'exclude' => 0, |
|
| 794 | - 'id' => 'phpcode', |
|
| 795 | - 'table' => 'customfield', |
|
| 796 | - 'field' => 'phpcode', |
|
| 797 | - 'override' => array( |
|
| 793 | + 'exclude' => 0, |
|
| 794 | + 'id' => 'phpcode', |
|
| 795 | + 'table' => 'customfield', |
|
| 796 | + 'field' => 'phpcode', |
|
| 797 | + 'override' => array( |
|
| 798 | 798 | 'button' => 'Use default', |
| 799 | - ), |
|
| 800 | - 'relationship' => 'none', |
|
| 799 | + ), |
|
| 800 | + 'relationship' => 'none', |
|
| 801 | 801 | ), |
| 802 | 802 | 'comment_count' => array( |
| 803 | - 'label' => '', |
|
| 804 | - 'alter' => array( |
|
| 803 | + 'label' => '', |
|
| 804 | + 'alter' => array( |
|
| 805 | 805 | 'alter_text' => 0, |
| 806 | 806 | 'text' => '', |
| 807 | 807 | 'make_link' => 0, |
@@ -820,32 +820,32 @@ discard block |
||
| 820 | 820 | 'ellipsis' => 1, |
| 821 | 821 | 'html' => 0, |
| 822 | 822 | 'strip_tags' => 0, |
| 823 | - ), |
|
| 824 | - 'empty' => '0', |
|
| 825 | - 'hide_empty' => 1, |
|
| 826 | - 'empty_zero' => 0, |
|
| 827 | - 'hide_alter_empty' => 0, |
|
| 828 | - 'set_precision' => FALSE, |
|
| 829 | - 'precision' => 0, |
|
| 830 | - 'decimal' => '.', |
|
| 831 | - 'separator' => '', |
|
| 832 | - 'format_plural' => 0, |
|
| 833 | - 'format_plural_singular' => '1', |
|
| 834 | - 'format_plural_plural' => '@count', |
|
| 835 | - 'prefix' => '', |
|
| 836 | - 'suffix' => '', |
|
| 837 | - 'exclude' => 0, |
|
| 838 | - 'id' => 'comment_count', |
|
| 839 | - 'table' => 'node_comment_statistics', |
|
| 840 | - 'field' => 'comment_count', |
|
| 841 | - 'override' => array( |
|
| 823 | + ), |
|
| 824 | + 'empty' => '0', |
|
| 825 | + 'hide_empty' => 1, |
|
| 826 | + 'empty_zero' => 0, |
|
| 827 | + 'hide_alter_empty' => 0, |
|
| 828 | + 'set_precision' => FALSE, |
|
| 829 | + 'precision' => 0, |
|
| 830 | + 'decimal' => '.', |
|
| 831 | + 'separator' => '', |
|
| 832 | + 'format_plural' => 0, |
|
| 833 | + 'format_plural_singular' => '1', |
|
| 834 | + 'format_plural_plural' => '@count', |
|
| 835 | + 'prefix' => '', |
|
| 836 | + 'suffix' => '', |
|
| 837 | + 'exclude' => 0, |
|
| 838 | + 'id' => 'comment_count', |
|
| 839 | + 'table' => 'node_comment_statistics', |
|
| 840 | + 'field' => 'comment_count', |
|
| 841 | + 'override' => array( |
|
| 842 | 842 | 'button' => 'Use default', |
| 843 | - ), |
|
| 844 | - 'relationship' => 'none', |
|
| 843 | + ), |
|
| 844 | + 'relationship' => 'none', |
|
| 845 | 845 | ), |
| 846 | 846 | 'nothing' => array( |
| 847 | - 'label' => '', |
|
| 848 | - 'alter' => array( |
|
| 847 | + 'label' => '', |
|
| 848 | + 'alter' => array( |
|
| 849 | 849 | 'text' => '<div class="clearfix"></div>', |
| 850 | 850 | 'make_link' => 0, |
| 851 | 851 | 'path' => '', |
@@ -861,88 +861,88 @@ discard block |
||
| 861 | 861 | 'ellipsis' => 1, |
| 862 | 862 | 'html' => 0, |
| 863 | 863 | 'strip_tags' => 0, |
| 864 | - ), |
|
| 865 | - 'empty' => '', |
|
| 866 | - 'hide_empty' => 0, |
|
| 867 | - 'empty_zero' => 0, |
|
| 868 | - 'exclude' => 0, |
|
| 869 | - 'id' => 'nothing', |
|
| 870 | - 'table' => 'views', |
|
| 871 | - 'field' => 'nothing', |
|
| 872 | - 'override' => array( |
|
| 864 | + ), |
|
| 865 | + 'empty' => '', |
|
| 866 | + 'hide_empty' => 0, |
|
| 867 | + 'empty_zero' => 0, |
|
| 868 | + 'exclude' => 0, |
|
| 869 | + 'id' => 'nothing', |
|
| 870 | + 'table' => 'views', |
|
| 871 | + 'field' => 'nothing', |
|
| 872 | + 'override' => array( |
|
| 873 | 873 | 'button' => 'Use default', |
| 874 | - ), |
|
| 875 | - 'relationship' => 'none', |
|
| 874 | + ), |
|
| 875 | + 'relationship' => 'none', |
|
| 876 | 876 | ), |
| 877 | - )); |
|
| 878 | - $handler->override_option('filters', array( |
|
| 877 | + )); |
|
| 878 | + $handler->override_option('filters', array( |
|
| 879 | 879 | 'type' => array( |
| 880 | - 'operator' => 'in', |
|
| 881 | - 'value' => array( |
|
| 880 | + 'operator' => 'in', |
|
| 881 | + 'value' => array( |
|
| 882 | 882 | 'news' => 'news', |
| 883 | - ), |
|
| 884 | - 'group' => '0', |
|
| 885 | - 'exposed' => FALSE, |
|
| 886 | - 'expose' => array( |
|
| 883 | + ), |
|
| 884 | + 'group' => '0', |
|
| 885 | + 'exposed' => FALSE, |
|
| 886 | + 'expose' => array( |
|
| 887 | 887 | 'operator' => FALSE, |
| 888 | 888 | 'label' => '', |
| 889 | - ), |
|
| 890 | - 'id' => 'type', |
|
| 891 | - 'table' => 'node', |
|
| 892 | - 'field' => 'type', |
|
| 893 | - 'relationship' => 'none', |
|
| 889 | + ), |
|
| 890 | + 'id' => 'type', |
|
| 891 | + 'table' => 'node', |
|
| 892 | + 'field' => 'type', |
|
| 893 | + 'relationship' => 'none', |
|
| 894 | 894 | ), |
| 895 | 895 | 'status' => array( |
| 896 | - 'operator' => '=', |
|
| 897 | - 'value' => '1', |
|
| 898 | - 'group' => '0', |
|
| 899 | - 'exposed' => FALSE, |
|
| 900 | - 'expose' => array( |
|
| 896 | + 'operator' => '=', |
|
| 897 | + 'value' => '1', |
|
| 898 | + 'group' => '0', |
|
| 899 | + 'exposed' => FALSE, |
|
| 900 | + 'expose' => array( |
|
| 901 | 901 | 'operator' => FALSE, |
| 902 | 902 | 'label' => '', |
| 903 | - ), |
|
| 904 | - 'id' => 'status', |
|
| 905 | - 'table' => 'node', |
|
| 906 | - 'field' => 'status', |
|
| 907 | - 'relationship' => 'none', |
|
| 903 | + ), |
|
| 904 | + 'id' => 'status', |
|
| 905 | + 'table' => 'node', |
|
| 906 | + 'field' => 'status', |
|
| 907 | + 'relationship' => 'none', |
|
| 908 | 908 | ), |
| 909 | 909 | 'promote' => array( |
| 910 | - 'operator' => '=', |
|
| 911 | - 'value' => '1', |
|
| 912 | - 'group' => '0', |
|
| 913 | - 'exposed' => FALSE, |
|
| 914 | - 'expose' => array( |
|
| 910 | + 'operator' => '=', |
|
| 911 | + 'value' => '1', |
|
| 912 | + 'group' => '0', |
|
| 913 | + 'exposed' => FALSE, |
|
| 914 | + 'expose' => array( |
|
| 915 | 915 | 'operator' => FALSE, |
| 916 | 916 | 'label' => '', |
| 917 | - ), |
|
| 918 | - 'id' => 'promote', |
|
| 919 | - 'table' => 'node', |
|
| 920 | - 'field' => 'promote', |
|
| 921 | - 'override' => array( |
|
| 917 | + ), |
|
| 918 | + 'id' => 'promote', |
|
| 919 | + 'table' => 'node', |
|
| 920 | + 'field' => 'promote', |
|
| 921 | + 'override' => array( |
|
| 922 | 922 | 'button' => 'Use default', |
| 923 | - ), |
|
| 924 | - 'relationship' => 'none', |
|
| 925 | - ), |
|
| 926 | - )); |
|
| 927 | - $handler->override_option('title', 'News'); |
|
| 928 | - $handler->override_option('row_plugin', 'fields'); |
|
| 929 | - $handler->override_option('path', 'news'); |
|
| 930 | - $handler->override_option('menu', array( |
|
| 923 | + ), |
|
| 924 | + 'relationship' => 'none', |
|
| 925 | + ), |
|
| 926 | + )); |
|
| 927 | + $handler->override_option('title', 'News'); |
|
| 928 | + $handler->override_option('row_plugin', 'fields'); |
|
| 929 | + $handler->override_option('path', 'news'); |
|
| 930 | + $handler->override_option('menu', array( |
|
| 931 | 931 | 'type' => 'default tab', |
| 932 | 932 | 'title' => 'News', |
| 933 | 933 | 'description' => '', |
| 934 | 934 | 'weight' => '0', |
| 935 | 935 | 'name' => 'navigation', |
| 936 | - )); |
|
| 937 | - $handler->override_option('tab_options', array( |
|
| 936 | + )); |
|
| 937 | + $handler->override_option('tab_options', array( |
|
| 938 | 938 | 'type' => 'none', |
| 939 | 939 | 'title' => '', |
| 940 | 940 | 'description' => '', |
| 941 | 941 | 'weight' => 0, |
| 942 | 942 | 'name' => 'navigation', |
| 943 | - )); |
|
| 943 | + )); |
|
| 944 | 944 | |
| 945 | - $views[$view->name] = $view; |
|
| 945 | + $views[$view->name] = $view; |
|
| 946 | 946 | |
| 947 | - return $views; |
|
| 947 | + return $views; |
|
| 948 | 948 | } |
@@ -35,23 +35,23 @@ discard block |
||
| 35 | 35 | $openid = new LightOpenID; |
| 36 | 36 | echo "<pre>"; |
| 37 | 37 | print_r($openid); exit; |
| 38 | - if(!$openid->mode) { |
|
| 39 | - if(isset($_POST['openid_identifier'])) { |
|
| 38 | + if (!$openid->mode) { |
|
| 39 | + if (isset($_POST['openid_identifier'])) { |
|
| 40 | 40 | $openid->identity = $_POST['openid_identifier']; |
| 41 | 41 | $openid->required = array('namePerson/friendly', 'contact/email'); |
| 42 | 42 | $openid->optional = array('contact/country/home'); |
| 43 | - header('Location: ' . $openid->authUrl()); |
|
| 43 | + header('Location: '.$openid->authUrl()); |
|
| 44 | 44 | } |
| 45 | - if(isset($_GET['openid_identifier'])) { |
|
| 45 | + if (isset($_GET['openid_identifier'])) { |
|
| 46 | 46 | $openid->identity = $_GET['openid_identifier']; |
| 47 | 47 | $openid->required = array('namePerson/friendly', 'contact/email'); |
| 48 | 48 | $openid->optional = array('contact/country/home'); |
| 49 | - header('Location: ' . $openid->authUrl()); |
|
| 49 | + header('Location: '.$openid->authUrl()); |
|
| 50 | 50 | } |
| 51 | - } elseif($openid->mode == 'cancel') { |
|
| 51 | + } elseif ($openid->mode == 'cancel') { |
|
| 52 | 52 | echo 'User has canceled authentication!'; |
| 53 | 53 | } else { |
| 54 | - echo 'User ' . ($openid->validate() ? $openid->identity . ' has ' : 'has not ') . 'logged in.'; |
|
| 54 | + echo 'User '.($openid->validate() ? $openid->identity.' has ' : 'has not ').'logged in.'; |
|
| 55 | 55 | //print_r($openid->getAttributes()); |
| 56 | 56 | // Create the user in the DB |
| 57 | 57 | $data = $openid->getAttributes(); |
@@ -125,13 +125,13 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | $user = make_user( |
| 127 | 127 | $new_email_addr, $new_name, $passwd_hash, |
| 128 | - $country, '', $project_prefs="", $teamid=0 |
|
| 128 | + $country, '', $project_prefs = "", $teamid = 0 |
|
| 129 | 129 | ); |
| 130 | 130 | if (!$user) { |
| 131 | 131 | show_error("Couldn't create account"); |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | - if(defined('INVITE_CODES')) { |
|
| 134 | + if (defined('INVITE_CODES')) { |
|
| 135 | 135 | error_log("Account '$new_email_addr' created using invitation code '$invite_code'"); |
| 136 | 136 | } |
| 137 | 137 | } |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | send_cookie('auth', $user->authenticator, true); |
| 154 | 154 | |
| 155 | 155 | } |
| 156 | -} catch(ErrorException $e) { |
|
| 156 | +} catch (ErrorException $e) { |
|
| 157 | 157 | echo $e->getMessage(); |
| 158 | 158 | } |
| 159 | 159 | |
@@ -8,38 +8,38 @@ discard block |
||
| 8 | 8 | |
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | - * The BOINC stats configuration determines where statistics are sourced |
|
| 12 | - */ |
|
| 11 | + * The BOINC stats configuration determines where statistics are sourced |
|
| 12 | + */ |
|
| 13 | 13 | function boincstats_admin_stats_system(&$form_state) { |
| 14 | - $form = array(); |
|
| 15 | - $default = array( |
|
| 14 | + $form = array(); |
|
| 15 | + $default = array( |
|
| 16 | 16 | 'boinc_stats_server' => variable_get('boinc_stats_server', 'stats.gridrepublic.org'), |
| 17 | 17 | 'boinc_stats_project_list_rpc' => variable_get('boinc_stats_project_list_rpc', 'rpc/get_projects.php'), |
| 18 | 18 | 'boinc_stats_project_credit_history_rpc' => variable_get('boinc_stats_project_credit_history_rpc', 'rpc2/get_project_tc_history.php'), |
| 19 | 19 | 'boinc_stats_user_credit_history_rpc' => variable_get('boinc_stats_user_credit_history_rpc', 'rpc2/get_user_credit_history.php'), |
| 20 | 20 | 'boinc_stats_remote_project_id' => variable_get('boinc_stats_remote_project_id', ''), |
| 21 | - ); |
|
| 22 | - // Define the form |
|
| 23 | - $form['boinc_stats_server'] = array( |
|
| 21 | + ); |
|
| 22 | + // Define the form |
|
| 23 | + $form['boinc_stats_server'] = array( |
|
| 24 | 24 | '#type' => 'value', |
| 25 | 25 | '#value' => $default['boinc_stats_server'] |
| 26 | - ); |
|
| 27 | - $form['boinc_stats_project_list_rpc'] = array( |
|
| 26 | + ); |
|
| 27 | + $form['boinc_stats_project_list_rpc'] = array( |
|
| 28 | 28 | '#type' => 'value', |
| 29 | 29 | '#value' => $default['boinc_stats_project_list_rpc'] |
| 30 | - ); |
|
| 31 | - $form['boinc_stats_project_credit_history_rpc'] = array( |
|
| 30 | + ); |
|
| 31 | + $form['boinc_stats_project_credit_history_rpc'] = array( |
|
| 32 | 32 | '#type' => 'value', |
| 33 | 33 | '#value' => $default['boinc_stats_project_credit_history_rpc'] |
| 34 | - ); |
|
| 35 | - $form['boinc_stats_user_credit_history_rpc'] = array( |
|
| 34 | + ); |
|
| 35 | + $form['boinc_stats_user_credit_history_rpc'] = array( |
|
| 36 | 36 | '#type' => 'value', |
| 37 | 37 | '#value' => $default['boinc_stats_user_credit_history_rpc'] |
| 38 | - ); |
|
| 39 | - $form['boinc_stats_remote_project_id'] = array( |
|
| 38 | + ); |
|
| 39 | + $form['boinc_stats_remote_project_id'] = array( |
|
| 40 | 40 | '#type' => 'textfield', |
| 41 | 41 | '#title' => t('Stats ID for @project', array( |
| 42 | - '@project' => variable_get('site_name', 'Drupal-BOINC'))), |
|
| 42 | + '@project' => variable_get('site_name', 'Drupal-BOINC'))), |
|
| 43 | 43 | '#default_value' => $default['boinc_stats_remote_project_id'], |
| 44 | 44 | '#description' => t('This project must be registered with a stats system in |
| 45 | 45 | order for some statistics to be available. Currently only one system is |
@@ -47,26 +47,26 @@ discard block |
||
| 47 | 47 | '!find_project_id' => l(t('Find your project ID'), |
| 48 | 48 | "http://{$default['boinc_stats_server']}/{$default['boinc_stats_project_list_rpc']}", |
| 49 | 49 | array('attributes' => array('target' => 'external'))) |
| 50 | - ) |
|
| 50 | + ) |
|
| 51 | 51 | ) |
| 52 | - ); |
|
| 53 | - return system_settings_form($form); |
|
| 52 | + ); |
|
| 53 | + return system_settings_form($form); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | - * Validate the BOINC stats form. |
|
| 58 | - */ |
|
| 57 | + * Validate the BOINC stats form. |
|
| 58 | + */ |
|
| 59 | 59 | function boincstats_admin_stats_system_validate($form, &$form_state) { |
| 60 | - $values = $form_state['values']; |
|
| 61 | - if (!$values['boinc_stats_remote_project_id']) { |
|
| 60 | + $values = $form_state['values']; |
|
| 61 | + if (!$values['boinc_stats_remote_project_id']) { |
|
| 62 | 62 | form_set_error('boinc_stats_remote_project_id', |
| 63 | - t('Stats may not work without a valid stats ID configured!')); |
|
| 64 | - } |
|
| 63 | + t('Stats may not work without a valid stats ID configured!')); |
|
| 64 | + } |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /** |
| 68 | - * Handle post-validation submission of BOINC stats form. |
|
| 69 | - */ |
|
| 68 | + * Handle post-validation submission of BOINC stats form. |
|
| 69 | + */ |
|
| 70 | 70 | function boincstats_admin_stats_system_submit($form, &$form_state) { |
| 71 | - drupal_set_message(t('Stats system configuration has been updated.')); |
|
| 71 | + drupal_set_message(t('Stats system configuration has been updated.')); |
|
| 72 | 72 | } |
@@ -626,13 +626,13 @@ discard block |
||
| 626 | 626 | $sender = user_load($sender->uid); |
| 627 | 627 | |
| 628 | 628 | switch ($status) { |
| 629 | - case FLAG_FRIEND_FLAGGED: |
|
| 630 | - // Sender accepted recipient's friend request |
|
| 631 | - $email['subject'] = bts('!name accepted your friend request [!site]', array( |
|
| 632 | - '!name' => $sender->boincuser_name, |
|
| 633 | - '!site' => variable_get('site_name', 'Drupal-BOINC'), |
|
| 634 | - ), NULL, 'boinc:friend-request-email'); |
|
| 635 | - $email['body'] = bts('!name confirmed you as a friend on !site. |
|
| 629 | + case FLAG_FRIEND_FLAGGED: |
|
| 630 | + // Sender accepted recipient's friend request |
|
| 631 | + $email['subject'] = bts('!name accepted your friend request [!site]', array( |
|
| 632 | + '!name' => $sender->boincuser_name, |
|
| 633 | + '!site' => variable_get('site_name', 'Drupal-BOINC'), |
|
| 634 | + ), NULL, 'boinc:friend-request-email'); |
|
| 635 | + $email['body'] = bts('!name confirmed you as a friend on !site. |
|
| 636 | 636 | |
| 637 | 637 | Follow this link to view his or her profile: |
| 638 | 638 | !link |
@@ -641,17 +641,17 @@ discard block |
||
| 641 | 641 | |
| 642 | 642 | Thanks, |
| 643 | 643 | The !site team', array( |
| 644 | - '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
|
| 645 | - '!site' => variable_get('site_name', 'Drupal-BOINC'), |
|
| 646 | - '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '', |
|
| 647 | - '!link' => url('account/'. $sender->uid, array('absolute' => TRUE)), |
|
| 648 | - ), array(), NULL, 'boinc:friend-request-email'); |
|
| 649 | - break; |
|
| 644 | + '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
|
| 645 | + '!site' => variable_get('site_name', 'Drupal-BOINC'), |
|
| 646 | + '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '', |
|
| 647 | + '!link' => url('account/'. $sender->uid, array('absolute' => TRUE)), |
|
| 648 | + ), array(), NULL, 'boinc:friend-request-email'); |
|
| 649 | + break; |
|
| 650 | 650 | |
| 651 | - case FLAG_FRIEND_PENDING: |
|
| 652 | - // Sender is requesting to be recipient's friend |
|
| 653 | - $email['subject'] = bts('Friend request from !name [!site]', array('!name' => $sender->boincuser_name, '!site' => variable_get('site_name', 'Drupal-BOINC')), NULL, 'boinc:friend-request-email'); |
|
| 654 | - $email['body'] = bts('!name added you as a friend on !site. You can approve or deny this request. Denying a request will not send a notification, but will remove the request from both of your accounts. |
|
| 651 | + case FLAG_FRIEND_PENDING: |
|
| 652 | + // Sender is requesting to be recipient's friend |
|
| 653 | + $email['subject'] = bts('Friend request from !name [!site]', array('!name' => $sender->boincuser_name, '!site' => variable_get('site_name', 'Drupal-BOINC')), NULL, 'boinc:friend-request-email'); |
|
| 654 | + $email['body'] = bts('!name added you as a friend on !site. You can approve or deny this request. Denying a request will not send a notification, but will remove the request from both of your accounts. |
|
| 655 | 655 | |
| 656 | 656 | Follow the link below to view this request: |
| 657 | 657 | !link |
@@ -660,13 +660,13 @@ discard block |
||
| 660 | 660 | |
| 661 | 661 | Thanks, |
| 662 | 662 | The !site team', array( |
| 663 | - '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
|
| 664 | - '!site' => variable_get('site_name', 'Drupal-BOINC'), |
|
| 665 | - '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '', |
|
| 666 | - '!link' => url('goto/friend-requests', array('absolute' => TRUE)), |
|
| 667 | - ), |
|
| 668 | - array(), NULL, 'boinc:friend-request-email'); |
|
| 669 | - break; |
|
| 663 | + '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
|
| 664 | + '!site' => variable_get('site_name', 'Drupal-BOINC'), |
|
| 665 | + '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '', |
|
| 666 | + '!link' => url('goto/friend-requests', array('absolute' => TRUE)), |
|
| 667 | + ), |
|
| 668 | + array(), NULL, 'boinc:friend-request-email'); |
|
| 669 | + break; |
|
| 670 | 670 | } |
| 671 | 671 | return $email; |
| 672 | 672 | } |
@@ -129,8 +129,7 @@ discard block |
||
| 129 | 129 | AND strpos($link, 'Edit Panel')) { |
| 130 | 130 | // Remove Edit Panel tab |
| 131 | 131 | return ''; |
| 132 | - } |
|
| 133 | - else { |
|
| 132 | + } else { |
|
| 134 | 133 | return '<li '. ($active ? 'class="active" ' : '') .'>'. $link ."</li>\n"; |
| 135 | 134 | } |
| 136 | 135 | } |
@@ -211,19 +210,15 @@ discard block |
||
| 211 | 210 | // "head_title" which is placed in the HTML <head> section. Most of |
| 212 | 211 | // these pages are defined in the Page Manager module. |
| 213 | 212 | // See: https://dev.gridrepublic.org/browse/DBOINC-65 |
| 214 | - if (arg(0) == 'search') { |
|
| 213 | + if (arg(0) == 'search') { |
|
| 215 | 214 | unset($vars['title']); |
| 216 | - } |
|
| 217 | - else if ( (arg(0)=='account') AND (is_numeric(arg(1))) AND (empty(arg(2))) ) { |
|
| 215 | + } else if ( (arg(0)=='account') AND (is_numeric(arg(1))) AND (empty(arg(2))) ) { |
|
| 218 | 216 | unset($vars['title']); |
| 219 | - } |
|
| 220 | - else if ( (arg(0)=='account') AND (arg(1)=='profile') ) { |
|
| 217 | + } else if ( (arg(0)=='account') AND (arg(1)=='profile') ) { |
|
| 221 | 218 | unset($vars['title']); |
| 222 | - } |
|
| 223 | - else if ( (arg(0)=='dashboard') ) { |
|
| 219 | + } else if ( (arg(0)=='dashboard') ) { |
|
| 224 | 220 | unset($vars['title']); |
| 225 | - } |
|
| 226 | - else if ( (arg(0)=='community') AND ( (arg(1)=='teams') OR (arg(1)=='stats') ) ) { |
|
| 221 | + } else if ( (arg(0)=='community') AND ( (arg(1)=='teams') OR (arg(1)=='stats') ) ) { |
|
| 227 | 222 | unset($vars['title']); |
| 228 | 223 | } |
| 229 | 224 | |
@@ -241,8 +236,7 @@ discard block |
||
| 241 | 236 | if ($key == $last_key) { |
| 242 | 237 | $tab = str_replace('li class="', 'li class="last ', $tab) . '</ul>'; |
| 243 | 238 | } |
| 244 | - } |
|
| 245 | - elseif (strpos($tab, 'li ')) { |
|
| 239 | + } elseif (strpos($tab, 'li ')) { |
|
| 246 | 240 | if ($key == 0) { |
| 247 | 241 | $tab = str_replace('li ', 'li class="first" ', $tab); |
| 248 | 242 | } |
@@ -395,8 +389,7 @@ discard block |
||
| 395 | 389 | $cid = boincuser_get_first_unread_comment_id($topic->nid); |
| 396 | 390 | if ($cid) { |
| 397 | 391 | $variables['topics'][$id]->new_url = url("goto/comment/{$cid}"); |
| 398 | - } |
|
| 399 | - else { |
|
| 392 | + } else { |
|
| 400 | 393 | // User hasn't visited this topic before, so all replies are new... |
| 401 | 394 | $topic->new_replies = NULL; |
| 402 | 395 | } |
@@ -453,8 +446,7 @@ discard block |
||
| 453 | 446 | case 'boinc_host_list': |
| 454 | 447 | if ($vars['display_id'] == 'page_2') { |
| 455 | 448 | $vars['empty'] = boincwork_views_host_list_empty_text(); |
| 456 | - } |
|
| 457 | - elseif ($vars['display_id'] == 'page_1') { |
|
| 449 | + } elseif ($vars['display_id'] == 'page_1') { |
|
| 458 | 450 | $vars['empty'] = boincwork_views_host_list_empty_text('active'); |
| 459 | 451 | } |
| 460 | 452 | break; |
@@ -510,8 +502,7 @@ discard block |
||
| 510 | 502 | if ($user_image) { |
| 511 | 503 | if (is_array($user_image) AND $user_image['image']['filepath']) { |
| 512 | 504 | $author_picture .= theme('imagefield_image', $user_image['image'], $user_image['alt'], $user_image['alt'], array(), false); |
| 513 | - } |
|
| 514 | - elseif (is_string($user_image)) { |
|
| 505 | + } elseif (is_string($user_image)) { |
|
| 515 | 506 | $author_picture .= '<img src="' . $user_image . '"/>'; |
| 516 | 507 | } |
| 517 | 508 | } |
@@ -615,26 +606,22 @@ discard block |
||
| 615 | 606 | |
| 616 | 607 | if (user_access('access user profiles')) { |
| 617 | 608 | $output = l($name, 'account/' . $object->uid, array('attributes' => array('title' => bts('View user profile.', array(), NULL, 'boinc:users-table')))); |
| 618 | - } |
|
| 619 | - else { |
|
| 609 | + } else { |
|
| 620 | 610 | $output = check_plain($name); |
| 621 | 611 | } |
| 622 | - } |
|
| 623 | - else if ($object->name) { |
|
| 612 | + } else if ($object->name) { |
|
| 624 | 613 | // Sometimes modules display content composed by people who are |
| 625 | 614 | // not registered members of the site (e.g. mailing list or news |
| 626 | 615 | // aggregator modules). This clause enables modules to display |
| 627 | 616 | // the true author of the content. |
| 628 | 617 | if (!empty($object->homepage)) { |
| 629 | 618 | $output = l($object->name, $object->homepage, array('attributes' => array('rel' => 'nofollow'))); |
| 630 | - } |
|
| 631 | - else { |
|
| 619 | + } else { |
|
| 632 | 620 | $output = check_plain($object->name); |
| 633 | 621 | } |
| 634 | 622 | |
| 635 | 623 | $output .= ' (' . bts('not verified', array(), NULL, 'boinc:user-not-found') . ')'; |
| 636 | - } |
|
| 637 | - else { |
|
| 624 | + } else { |
|
| 638 | 625 | $output = check_plain(variable_get('anonymous', bts('Anonymous', array(), NULL, 'boinc:anonymous-user'))); |
| 639 | 626 | } |
| 640 | 627 | |
@@ -719,7 +706,7 @@ discard block |
||
| 719 | 706 | * Edit action links |
| 720 | 707 | */ |
| 721 | 708 | function phptemplate_links($links, $attributes = array('class' => 'links')) { |
| 722 | - if ($links){ |
|
| 709 | + if ($links) { |
|
| 723 | 710 | // Remove flag-subscriptions link. It will be placed elsewhere. |
| 724 | 711 | if (isset($links['flag-subscriptions'])) { |
| 725 | 712 | unset($links['flag-subscriptions']); |
@@ -908,8 +895,7 @@ discard block |
||
| 908 | 895 | ), |
| 909 | 896 | ); |
| 910 | 897 | } |
| 911 | - } |
|
| 912 | - else if ($type == 'comment' && $user->uid != $object->uid && $object->uid != 0 && user_access('ignore user')) { |
|
| 898 | + } else if ($type == 'comment' && $user->uid != $object->uid && $object->uid != 0 && user_access('ignore user')) { |
|
| 913 | 899 | if (!isset($ignored[$object->uid])) { |
| 914 | 900 | $ignored[$object->uid] = db_result(db_query('SELECT COUNT(*) FROM {ignore_user} WHERE uid = %d AND iuid = %d', $user->uid, $object->uid)); |
| 915 | 901 | } |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | if ($i == $item_count) $classes[] = 'last'; |
| 92 | 92 | $html .= '<li class="' . implode(' ', $classes) .'">'; |
| 93 | 93 | if ($link['title'] == 'Home') { |
| 94 | - $link['title'] = bts('Home', array(), NULL, 'boinc:menu-link'); |
|
| 94 | + $link['title'] = bts('Home', array(), null, 'boinc:menu-link'); |
|
| 95 | 95 | } |
| 96 | 96 | if (module_exists('privatemsg')) { |
| 97 | 97 | // Put a new mail notification next to the Account menu item |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $item_count = privatemsg_unread_count(); |
| 100 | 100 | if ($item_count) { |
| 101 | 101 | $link['title'] .= '</a> <a href="' . url('messages') . '" class="compound secondary"><div class="item-count-wrapper"><span class="item-count">' . $item_count . '</span></div>'; |
| 102 | - $link['html'] = TRUE; |
|
| 102 | + $link['html'] = true; |
|
| 103 | 103 | $link['attributes']['class'] = 'compound'; |
| 104 | 104 | } |
| 105 | 105 | } |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | $item_count = boincuser_moderation_queue_count(); |
| 110 | 110 | if ($item_count) { |
| 111 | 111 | $link['title'] .= ' <div class="item-count-wrapper"><span class="item-count">' . $item_count . '</span></div>'; |
| 112 | - $link['html'] = TRUE; |
|
| 112 | + $link['html'] = true; |
|
| 113 | 113 | } |
| 114 | 114 | } |
| 115 | 115 | $html .= l($link['title'], $link['href'], $link); |
@@ -124,9 +124,9 @@ discard block |
||
| 124 | 124 | /** |
| 125 | 125 | * Remove undesired local task tabs |
| 126 | 126 | */ |
| 127 | -function boinc_menu_local_task($link, $active = FALSE) { |
|
| 128 | - if (strpos($link, 'admin/build/pages') !== FALSE |
|
| 129 | - AND strpos($link, 'Edit Panel')) { |
|
| 127 | +function boinc_menu_local_task($link, $active = false) { |
|
| 128 | + if (strpos($link, 'admin/build/pages') !== false |
|
| 129 | + and strpos($link, 'Edit Panel')) { |
|
| 130 | 130 | // Remove Edit Panel tab |
| 131 | 131 | return ''; |
| 132 | 132 | } |
@@ -214,16 +214,16 @@ discard block |
||
| 214 | 214 | if (arg(0) == 'search') { |
| 215 | 215 | unset($vars['title']); |
| 216 | 216 | } |
| 217 | - else if ( (arg(0)=='account') AND (is_numeric(arg(1))) AND (empty(arg(2))) ) { |
|
| 217 | + else if ( (arg(0)=='account') and (is_numeric(arg(1))) and (empty(arg(2))) ) { |
|
| 218 | 218 | unset($vars['title']); |
| 219 | 219 | } |
| 220 | - else if ( (arg(0)=='account') AND (arg(1)=='profile') ) { |
|
| 220 | + else if ( (arg(0)=='account') and (arg(1)=='profile') ) { |
|
| 221 | 221 | unset($vars['title']); |
| 222 | 222 | } |
| 223 | 223 | else if ( (arg(0)=='dashboard') ) { |
| 224 | 224 | unset($vars['title']); |
| 225 | 225 | } |
| 226 | - else if ( (arg(0)=='community') AND ( (arg(1)=='teams') OR (arg(1)=='stats') ) ) { |
|
| 226 | + else if ( (arg(0)=='community') and ( (arg(1)=='teams') or (arg(1)=='stats') ) ) { |
|
| 227 | 227 | unset($vars['title']); |
| 228 | 228 | } |
| 229 | 229 | |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | unset($vars['links']['forum']); |
| 303 | 303 | // Add a link to manage subscriptions for the user |
| 304 | 304 | $vars['links']['subscriptions'] = array( |
| 305 | - 'title' => bts('Manage subscriptions', array(), NULL, 'boinc:forum-footer'), |
|
| 305 | + 'title' => bts('Manage subscriptions', array(), null, 'boinc:forum-footer'), |
|
| 306 | 306 | 'href' => 'account/prefs/subscriptions', |
| 307 | 307 | ); |
| 308 | 308 | } |
@@ -326,17 +326,17 @@ discard block |
||
| 326 | 326 | $vars['signature'] = check_markup($account->signature, $vars['node']->format); |
| 327 | 327 | |
| 328 | 328 | // Show signatures based on user preference |
| 329 | - $vars['show_signatures'] = ($user->hide_signatures) ? FALSE : TRUE; |
|
| 329 | + $vars['show_signatures'] = ($user->hide_signatures) ? false : true; |
|
| 330 | 330 | |
| 331 | 331 | // Expose comment sort order so that the template can put the topic node |
| 332 | 332 | // content (i.e. initial post) at the very end if "Newest post first" is the |
| 333 | 333 | // preference used by this user |
| 334 | - $vars['oldest_post_first'] = ($user->sort != 1) ? TRUE : FALSE; |
|
| 334 | + $vars['oldest_post_first'] = ($user->sort != 1) ? true : false; |
|
| 335 | 335 | $vars['node']->comment = 0; |
| 336 | 336 | |
| 337 | - $vars['first_page'] = (!isset($_GET['page']) OR ($_GET['page'] < 1)); |
|
| 337 | + $vars['first_page'] = (!isset($_GET['page']) or ($_GET['page'] < 1)); |
|
| 338 | 338 | $page_count = max(ceil($vars['comment_count'] / $comments_per_page), 1); |
| 339 | - $vars['last_page'] = ($page_count == 1 OR ($page_count > 1 AND $_GET['page'] == $page_count - 1)); |
|
| 339 | + $vars['last_page'] = ($page_count == 1 or ($page_count > 1 and $_GET['page'] == $page_count - 1)); |
|
| 340 | 340 | |
| 341 | 341 | $links = $vars['links']; |
| 342 | 342 | $moderator_links = array(); |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | $vars['locality'] = $language->language; |
| 374 | 374 | |
| 375 | 375 | // Show signatures based on user preference |
| 376 | - $vars['show_signatures'] = ($user->hide_signatures) ? FALSE : TRUE; |
|
| 376 | + $vars['show_signatures'] = ($user->hide_signatures) ? false : true; |
|
| 377 | 377 | |
| 378 | 378 | $links = $vars['links']; |
| 379 | 379 | $moderator_links = array(); |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | } |
| 399 | 399 | else { |
| 400 | 400 | // User hasn't visited this topic before, so all replies are new... |
| 401 | - $topic->new_replies = NULL; |
|
| 401 | + $topic->new_replies = null; |
|
| 402 | 402 | } |
| 403 | 403 | } |
| 404 | 404 | // Use same logic in forum.module to change message if topic has |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | case 'boinc_host': |
| 448 | 448 | $view = views_get_current_view(); |
| 449 | 449 | if (!($view->result)) { |
| 450 | - $vars['footer'] = '<h3>' . bts ('Host not found in database.', array(), NULL, 'boinc:host-details') . '</h3>'; |
|
| 450 | + $vars['footer'] = '<h3>' . bts ('Host not found in database.', array(), null, 'boinc:host-details') . '</h3>'; |
|
| 451 | 451 | } |
| 452 | 452 | break; |
| 453 | 453 | case 'boinc_host_list': |
@@ -466,10 +466,10 @@ discard block |
||
| 466 | 466 | |
| 467 | 467 | if ($result) { |
| 468 | 468 | // Display the stderr output in the footer |
| 469 | - $vars['footer'] = '<h3>' . bts('Stderr output', array(), NULL, 'boinc:task-details-errorlog') .'</h3>'; |
|
| 469 | + $vars['footer'] = '<h3>' . bts('Stderr output', array(), null, 'boinc:task-details-errorlog') .'</h3>'; |
|
| 470 | 470 | $vars['footer'] .= '<pre>' . htmlspecialchars($result->result_stderr_out) . '</pre>'; |
| 471 | 471 | } else { |
| 472 | - $vars['footer'] = '<h3>' . bts ('Task not found in database.', array(), NULL, 'boinc:task-details') . '</h3>'; |
|
| 472 | + $vars['footer'] = '<h3>' . bts ('Task not found in database.', array(), null, 'boinc:task-details') . '</h3>'; |
|
| 473 | 473 | } |
| 474 | 474 | break; |
| 475 | 475 | case 'boinc_teams': |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | // Output of project_workunit() gets caught in the buffer |
| 491 | 491 | $vars['footer'] = ob_get_clean(); |
| 492 | 492 | } else { |
| 493 | - $vars['footer'] = '<h3>' . bts ('Workunit not found in database.', array(), NULL, 'boinc:workunit-details') . '</h3>'; |
|
| 493 | + $vars['footer'] = '<h3>' . bts ('Workunit not found in database.', array(), null, 'boinc:workunit-details') . '</h3>'; |
|
| 494 | 494 | } |
| 495 | 495 | default: |
| 496 | 496 | } |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | $author_picture = '<div class="picture">'; |
| 509 | 509 | $user_image = boincuser_get_user_profile_image($vars['message']['author']->uid); |
| 510 | 510 | if ($user_image) { |
| 511 | - if (is_array($user_image) AND $user_image['image']['filepath']) { |
|
| 511 | + if (is_array($user_image) and $user_image['image']['filepath']) { |
|
| 512 | 512 | $author_picture .= theme('imagefield_image', $user_image['image'], $user_image['alt'], $user_image['alt'], array(), false); |
| 513 | 513 | } |
| 514 | 514 | elseif (is_string($user_image)) { |
@@ -590,7 +590,7 @@ discard block |
||
| 590 | 590 | // Remove the mess of text under the search form and don't display "no results" |
| 591 | 591 | // if a search hasn't even been submitted |
| 592 | 592 | function boinc_apachesolr_search_noresults() { |
| 593 | - $message = bts('No results found...', array(), NULL, 'boinc:search-with-no-results'); |
|
| 593 | + $message = bts('No results found...', array(), null, 'boinc:search-with-no-results'); |
|
| 594 | 594 | if (!arg(2)) { |
| 595 | 595 | $message = ''; |
| 596 | 596 | } |
@@ -614,7 +614,7 @@ discard block |
||
| 614 | 614 | } |
| 615 | 615 | |
| 616 | 616 | if (user_access('access user profiles')) { |
| 617 | - $output = l($name, 'account/' . $object->uid, array('attributes' => array('title' => bts('View user profile.', array(), NULL, 'boinc:users-table')))); |
|
| 617 | + $output = l($name, 'account/' . $object->uid, array('attributes' => array('title' => bts('View user profile.', array(), null, 'boinc:users-table')))); |
|
| 618 | 618 | } |
| 619 | 619 | else { |
| 620 | 620 | $output = check_plain($name); |
@@ -632,10 +632,10 @@ discard block |
||
| 632 | 632 | $output = check_plain($object->name); |
| 633 | 633 | } |
| 634 | 634 | |
| 635 | - $output .= ' (' . bts('not verified', array(), NULL, 'boinc:user-not-found') . ')'; |
|
| 635 | + $output .= ' (' . bts('not verified', array(), null, 'boinc:user-not-found') . ')'; |
|
| 636 | 636 | } |
| 637 | 637 | else { |
| 638 | - $output = check_plain(variable_get('anonymous', bts('Anonymous', array(), NULL, 'boinc:anonymous-user'))); |
|
| 638 | + $output = check_plain(variable_get('anonymous', bts('Anonymous', array(), null, 'boinc:anonymous-user'))); |
|
| 639 | 639 | } |
| 640 | 640 | |
| 641 | 641 | return $output; |
@@ -675,7 +675,7 @@ discard block |
||
| 675 | 675 | $email['subject'] = bts('!name accepted your friend request [!site]', array( |
| 676 | 676 | '!name' => $sender->boincuser_name, |
| 677 | 677 | '!site' => variable_get('site_name', 'Drupal-BOINC'), |
| 678 | - ), NULL, 'boinc:friend-request-email'); |
|
| 678 | + ), null, 'boinc:friend-request-email'); |
|
| 679 | 679 | $email['body'] = bts('!name confirmed you as a friend on !site. |
| 680 | 680 | |
| 681 | 681 | Follow this link to view his or her profile: |
@@ -687,14 +687,14 @@ discard block |
||
| 687 | 687 | The !site team', array( |
| 688 | 688 | '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
| 689 | 689 | '!site' => variable_get('site_name', 'Drupal-BOINC'), |
| 690 | - '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '', |
|
| 691 | - '!link' => url('account/'. $sender->uid, array('absolute' => TRUE)), |
|
| 692 | - ), array(), NULL, 'boinc:friend-request-email'); |
|
| 690 | + '!message' => $flag->friend_message ? bts('Message', array(), null, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '', |
|
| 691 | + '!link' => url('account/'. $sender->uid, array('absolute' => true)), |
|
| 692 | + ), array(), null, 'boinc:friend-request-email'); |
|
| 693 | 693 | break; |
| 694 | 694 | |
| 695 | 695 | case FLAG_FRIEND_PENDING: |
| 696 | 696 | // Sender is requesting to be recipient's friend |
| 697 | - $email['subject'] = bts('Friend request from !name [!site]', array('!name' => $sender->boincuser_name, '!site' => variable_get('site_name', 'Drupal-BOINC')), NULL, 'boinc:friend-request-email'); |
|
| 697 | + $email['subject'] = bts('Friend request from !name [!site]', array('!name' => $sender->boincuser_name, '!site' => variable_get('site_name', 'Drupal-BOINC')), null, 'boinc:friend-request-email'); |
|
| 698 | 698 | $email['body'] = bts('!name added you as a friend on !site. You can approve or deny this request. Denying a request will not send a notification, but will remove the request from both of your accounts. |
| 699 | 699 | |
| 700 | 700 | Follow the link below to view this request: |
@@ -706,10 +706,10 @@ discard block |
||
| 706 | 706 | The !site team', array( |
| 707 | 707 | '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
| 708 | 708 | '!site' => variable_get('site_name', 'Drupal-BOINC'), |
| 709 | - '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '', |
|
| 710 | - '!link' => url('goto/friend-requests', array('absolute' => TRUE)), |
|
| 709 | + '!message' => $flag->friend_message ? bts('Message', array(), null, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '', |
|
| 710 | + '!link' => url('goto/friend-requests', array('absolute' => true)), |
|
| 711 | 711 | ), |
| 712 | - array(), NULL, 'boinc:friend-request-email'); |
|
| 712 | + array(), null, 'boinc:friend-request-email'); |
|
| 713 | 713 | break; |
| 714 | 714 | } |
| 715 | 715 | return $email; |
@@ -867,13 +867,13 @@ discard block |
||
| 867 | 867 | |
| 868 | 868 | $output = '<ul class="menu"><li class="first">'; |
| 869 | 869 | if ($user->uid) { |
| 870 | - $output .= '<a href="' . url('logout') . '">' . bts('Logout', array(), NULL, 'boinc:menu-link') . '</a>'; |
|
| 870 | + $output .= '<a href="' . url('logout') . '">' . bts('Logout', array(), null, 'boinc:menu-link') . '</a>'; |
|
| 871 | 871 | } else { |
| 872 | - $output .= '<a href="' . url('user/login', array('query' => drupal_get_destination()) ) . '">' . bts('Login', array(), NULL, 'boinc:menu-link') . '</a>'; |
|
| 872 | + $output .= '<a href="' . url('user/login', array('query' => drupal_get_destination()) ) . '">' . bts('Login', array(), null, 'boinc:menu-link') . '</a>'; |
|
| 873 | 873 | } |
| 874 | 874 | $output .= '</li>'; |
| 875 | - if (module_exists('global_search') OR module_exists('global_search_solr')) { |
|
| 876 | - $output .= '<li class="last"> <a class="search" href="' . url('search/site') . '">' . bts('search', array(), NULL, 'boinc:menu-link') .'</a> </l1>'; |
|
| 875 | + if (module_exists('global_search') or module_exists('global_search_solr')) { |
|
| 876 | + $output .= '<li class="last"> <a class="search" href="' . url('search/site') . '">' . bts('search', array(), null, 'boinc:menu-link') .'</a> </l1>'; |
|
| 877 | 877 | } |
| 878 | 878 | $output .= '</ul>'; |
| 879 | 879 | return $output; |
@@ -883,7 +883,7 @@ discard block |
||
| 883 | 883 | * Private function, based on ignore_user ignore_user_link() |
| 884 | 884 | * function. Modified for boinc functionality. |
| 885 | 885 | */ |
| 886 | -function _boinc_ignore_user_link($type, $object = NULL, $teaser = FALSE) { |
|
| 886 | +function _boinc_ignore_user_link($type, $object = null, $teaser = false) { |
|
| 887 | 887 | global $user; |
| 888 | 888 | |
| 889 | 889 | if (!$user || !$user->uid) { |
@@ -899,12 +899,12 @@ discard block |
||
| 899 | 899 | } |
| 900 | 900 | if ($ignored[$object->uid] == 0) { |
| 901 | 901 | $links['ignore_user'] = array( |
| 902 | - 'title' => bts('Ignore user', array(), NULL, 'boinc:ignore-user-add'), |
|
| 902 | + 'title' => bts('Ignore user', array(), null, 'boinc:ignore-user-add'), |
|
| 903 | 903 | 'href' => 'account/prefs/privacy/ignore_user/add/'. $object->uid, |
| 904 | 904 | 'query' => 'destination='. $_GET['q'], |
| 905 | 905 | 'attributes' => array( |
| 906 | 906 | 'class' => 'ignore-user', |
| 907 | - 'title' => bts('Add user to your ignore list', array(), NULL, 'boinc:ignore-user-add'), |
|
| 907 | + 'title' => bts('Add user to your ignore list', array(), null, 'boinc:ignore-user-add'), |
|
| 908 | 908 | ), |
| 909 | 909 | ); |
| 910 | 910 | } |
@@ -915,12 +915,12 @@ discard block |
||
| 915 | 915 | } |
| 916 | 916 | if ($ignored[$object->uid] == 0) { |
| 917 | 917 | $links['ignore_user'] = array( |
| 918 | - 'title' => bts('Ignore user', array(), NULL, 'boinc:ignore-user-add'), |
|
| 918 | + 'title' => bts('Ignore user', array(), null, 'boinc:ignore-user-add'), |
|
| 919 | 919 | 'href' => 'account/prefs/privacy/ignore_user/add/'. $object->uid, |
| 920 | 920 | 'query' => 'destination='. $_GET['q'], |
| 921 | 921 | 'attributes' => array( |
| 922 | 922 | 'class' => 'ignore-user', |
| 923 | - 'title' => bts('Add user to your ignore list', array(), NULL, 'boinc:ignore-user-add'), |
|
| 923 | + 'title' => bts('Add user to your ignore list', array(), null, 'boinc:ignore-user-add'), |
|
| 924 | 924 | ), |
| 925 | 925 | ); |
| 926 | 926 | } |
@@ -67,13 +67,13 @@ discard block |
||
| 67 | 67 | * Implementation of HOOK_theme(). |
| 68 | 68 | */ |
| 69 | 69 | function boinc_theme(&$existing, $type, $theme, $path) { |
| 70 | - $hooks = zen_theme($existing, $type, $theme, $path); |
|
| 71 | - // Add your theme hooks like this: |
|
| 72 | - /* |
|
| 70 | + $hooks = zen_theme($existing, $type, $theme, $path); |
|
| 71 | + // Add your theme hooks like this: |
|
| 72 | + /* |
|
| 73 | 73 | $hooks['hook_name_here'] = array( // Details go here ); |
| 74 | 74 | */ |
| 75 | - // @TODO: Needs detailed comments. Patches welcome! |
|
| 76 | - return $hooks; |
|
| 75 | + // @TODO: Needs detailed comments. Patches welcome! |
|
| 76 | + return $hooks; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | |
@@ -81,44 +81,44 @@ discard block |
||
| 81 | 81 | * Adjust the rendering of the menu |
| 82 | 82 | */ |
| 83 | 83 | function boinc_links__system_main_menu($links, $menu, $element) { |
| 84 | - $html = ''; |
|
| 85 | - $html .= '<ul id="' . $menu['id'] . '" class="' . $menu['class'] . '">' . "\n"; |
|
| 86 | - $item_count = count($links); |
|
| 87 | - $i = 1; |
|
| 88 | - foreach ($links as $key => $link) { |
|
| 84 | + $html = ''; |
|
| 85 | + $html .= '<ul id="' . $menu['id'] . '" class="' . $menu['class'] . '">' . "\n"; |
|
| 86 | + $item_count = count($links); |
|
| 87 | + $i = 1; |
|
| 88 | + foreach ($links as $key => $link) { |
|
| 89 | 89 | $classes = array($key); |
| 90 | 90 | if (strpos($key, 'active-trail')) $classes[] = 'active'; |
| 91 | 91 | if ($i == 1) $classes[] = 'first'; |
| 92 | 92 | if ($i == $item_count) $classes[] = 'last'; |
| 93 | 93 | $html .= '<li class="' . implode(' ', $classes) .'">'; |
| 94 | 94 | if ($link['title'] == 'Home') { |
| 95 | - $link['title'] = bts('Home', array(), NULL, 'boinc:menu-link'); |
|
| 95 | + $link['title'] = bts('Home', array(), NULL, 'boinc:menu-link'); |
|
| 96 | 96 | } |
| 97 | 97 | if (module_exists('privatemsg')) { |
| 98 | - // Put a new mail notification next to the Account menu item |
|
| 99 | - if ($link['href'] == 'dashboard') { |
|
| 98 | + // Put a new mail notification next to the Account menu item |
|
| 99 | + if ($link['href'] == 'dashboard') { |
|
| 100 | 100 | $item_count = privatemsg_unread_count(); |
| 101 | 101 | if ($item_count) { |
| 102 | - $link['title'] .= '</a> <a href="' . url('messages') . '" class="compound secondary"><div class="item-count-wrapper"><span class="item-count">' . $item_count . '</span></div>'; |
|
| 103 | - $link['html'] = TRUE; |
|
| 104 | - $link['attributes']['class'] = 'compound'; |
|
| 102 | + $link['title'] .= '</a> <a href="' . url('messages') . '" class="compound secondary"><div class="item-count-wrapper"><span class="item-count">' . $item_count . '</span></div>'; |
|
| 103 | + $link['html'] = TRUE; |
|
| 104 | + $link['attributes']['class'] = 'compound'; |
|
| 105 | + } |
|
| 105 | 106 | } |
| 106 | - } |
|
| 107 | 107 | } |
| 108 | 108 | // Put a count of items on the Moderation menu item |
| 109 | 109 | if ($link['href'] == 'moderate') { |
| 110 | - $item_count = boincuser_moderation_queue_count(); |
|
| 111 | - if ($item_count) { |
|
| 110 | + $item_count = boincuser_moderation_queue_count(); |
|
| 111 | + if ($item_count) { |
|
| 112 | 112 | $link['title'] .= ' <div class="item-count-wrapper"><span class="item-count">' . $item_count . '</span></div>'; |
| 113 | 113 | $link['html'] = TRUE; |
| 114 | - } |
|
| 114 | + } |
|
| 115 | 115 | } |
| 116 | 116 | $html .= l($link['title'], $link['href'], $link); |
| 117 | 117 | $html .= '</li>'; |
| 118 | 118 | $i++; |
| 119 | - } |
|
| 120 | - $html .= '</ul>' . "\n"; |
|
| 121 | - return $html; |
|
| 119 | + } |
|
| 120 | + $html .= '</ul>' . "\n"; |
|
| 121 | + return $html; |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | |
@@ -126,14 +126,14 @@ discard block |
||
| 126 | 126 | * Remove undesired local task tabs |
| 127 | 127 | */ |
| 128 | 128 | function boinc_menu_local_task($link, $active = FALSE) { |
| 129 | - if (strpos($link, 'admin/build/pages') !== FALSE |
|
| 129 | + if (strpos($link, 'admin/build/pages') !== FALSE |
|
| 130 | 130 | AND strpos($link, 'Edit Panel')) { |
| 131 | 131 | // Remove Edit Panel tab |
| 132 | 132 | return ''; |
| 133 | - } |
|
| 134 | - else { |
|
| 133 | + } |
|
| 134 | + else { |
|
| 135 | 135 | return '<li '. ($active ? 'class="active" ' : '') .'>'. $link ."</li>\n"; |
| 136 | - } |
|
| 136 | + } |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | |
@@ -169,103 +169,103 @@ discard block |
||
| 169 | 169 | * The name of the template being rendered ("page" in this case.) |
| 170 | 170 | */ |
| 171 | 171 | function boinc_preprocess_page(&$vars, $hook) { |
| 172 | - // Responsive Design: Add viewport meta tag to HTML head |
|
| 173 | - drupal_set_html_head('<meta name="viewport" content="width=device-width, initial-scale=1.0" />'); |
|
| 174 | - $vars['head'] = drupal_get_html_head(); |
|
| 175 | - //dpm($vars['head'], "preprocess (all) vars[head]"); |
|
| 176 | - |
|
| 177 | - // Expose comments to template files; this is needed so that comments can be |
|
| 178 | - // rendered in locations other than directly below the node content |
|
| 179 | - $vars['comments'] = $vars['comment_form'] = ''; |
|
| 180 | - if (module_exists('comment') && isset($vars['node'])) { |
|
| 172 | + // Responsive Design: Add viewport meta tag to HTML head |
|
| 173 | + drupal_set_html_head('<meta name="viewport" content="width=device-width, initial-scale=1.0" />'); |
|
| 174 | + $vars['head'] = drupal_get_html_head(); |
|
| 175 | + //dpm($vars['head'], "preprocess (all) vars[head]"); |
|
| 176 | + |
|
| 177 | + // Expose comments to template files; this is needed so that comments can be |
|
| 178 | + // rendered in locations other than directly below the node content |
|
| 179 | + $vars['comments'] = $vars['comment_form'] = ''; |
|
| 180 | + if (module_exists('comment') && isset($vars['node'])) { |
|
| 181 | 181 | $vars['comments'] = comment_render($vars['node']); |
| 182 | 182 | $vars['comment_form'] = drupal_get_form('comment_form', array('nid' => $vars['node']->nid)); |
| 183 | - } |
|
| 183 | + } |
|
| 184 | 184 | |
| 185 | - // Determine locale region code so the correct flag is displayed in footer |
|
| 186 | - global $language; |
|
| 187 | - global $theme_path; |
|
| 188 | - $locality = $language->language; |
|
| 189 | - if (strpos($language->language, '-')) { |
|
| 185 | + // Determine locale region code so the correct flag is displayed in footer |
|
| 186 | + global $language; |
|
| 187 | + global $theme_path; |
|
| 188 | + $locality = $language->language; |
|
| 189 | + if (strpos($language->language, '-')) { |
|
| 190 | 190 | $flag_icon = "{$theme_path}/images/flags/{$language->language}.png"; |
| 191 | 191 | if (!file_exists($flag_icon)) { |
| 192 | - $lang_code = explode('-', $language->language); |
|
| 193 | - $locality = $lang_code[0]; |
|
| 192 | + $lang_code = explode('-', $language->language); |
|
| 193 | + $locality = $lang_code[0]; |
|
| 194 | 194 | } |
| 195 | - } |
|
| 196 | - // If there is no language set for some reason, default to English (en). |
|
| 197 | - if (empty($locality)) { |
|
| 195 | + } |
|
| 196 | + // If there is no language set for some reason, default to English (en). |
|
| 197 | + if (empty($locality)) { |
|
| 198 | 198 | $locality = "en"; |
| 199 | - } |
|
| 200 | - $vars['flag_path'] = base_path() . path_to_theme() . "/images/flags/{$locality}.png"; |
|
| 199 | + } |
|
| 200 | + $vars['flag_path'] = base_path() . path_to_theme() . "/images/flags/{$locality}.png"; |
|
| 201 | 201 | |
| 202 | - $server_status_url = variable_get('boinc_server_status_url', ''); |
|
| 203 | - if (!$server_status_url) { |
|
| 202 | + $server_status_url = variable_get('boinc_server_status_url', ''); |
|
| 203 | + if (!$server_status_url) { |
|
| 204 | 204 | $server_status_url = 'server_status.php'; |
| 205 | - } |
|
| 206 | - $vars['server_status_url'] = $server_status_url; |
|
| 205 | + } |
|
| 206 | + $vars['server_status_url'] = $server_status_url; |
|
| 207 | 207 | |
| 208 | - $app_list_url = variable_get('boinc_app_list_url', ''); |
|
| 209 | - if (!$app_list_url) { |
|
| 208 | + $app_list_url = variable_get('boinc_app_list_url', ''); |
|
| 209 | + if (!$app_list_url) { |
|
| 210 | 210 | $app_list_url = 'apps.php'; |
| 211 | - } |
|
| 212 | - $vars['app_list_url'] = $app_list_url; |
|
| 213 | - |
|
| 214 | - // Remove title from certain pages using URL. |
|
| 215 | - // This is a kludge to remove the title of the page but not the |
|
| 216 | - // "head_title" which is placed in the HTML <head> section. Most of |
|
| 217 | - // these pages are defined in the Page Manager module. |
|
| 218 | - // See: https://dev.gridrepublic.org/browse/DBOINC-65 |
|
| 219 | - if (arg(0) == 'search') { |
|
| 211 | + } |
|
| 212 | + $vars['app_list_url'] = $app_list_url; |
|
| 213 | + |
|
| 214 | + // Remove title from certain pages using URL. |
|
| 215 | + // This is a kludge to remove the title of the page but not the |
|
| 216 | + // "head_title" which is placed in the HTML <head> section. Most of |
|
| 217 | + // these pages are defined in the Page Manager module. |
|
| 218 | + // See: https://dev.gridrepublic.org/browse/DBOINC-65 |
|
| 219 | + if (arg(0) == 'search') { |
|
| 220 | 220 | unset($vars['title']); |
| 221 | - } |
|
| 222 | - else if ( (arg(0)=='account') AND (is_numeric(arg(1))) AND (empty(arg(2))) ) { |
|
| 221 | + } |
|
| 222 | + else if ( (arg(0)=='account') AND (is_numeric(arg(1))) AND (empty(arg(2))) ) { |
|
| 223 | 223 | unset($vars['title']); |
| 224 | - } |
|
| 225 | - else if ( (arg(0)=='account') AND (arg(1)=='profile') ) { |
|
| 224 | + } |
|
| 225 | + else if ( (arg(0)=='account') AND (arg(1)=='profile') ) { |
|
| 226 | 226 | unset($vars['title']); |
| 227 | - } |
|
| 228 | - else if ( (arg(0)=='dashboard') ) { |
|
| 227 | + } |
|
| 228 | + else if ( (arg(0)=='dashboard') ) { |
|
| 229 | 229 | unset($vars['title']); |
| 230 | - } |
|
| 231 | - else if ( (arg(0)=='community') AND ( (arg(1)=='teams') OR (arg(1)=='stats') ) ) { |
|
| 230 | + } |
|
| 231 | + else if ( (arg(0)=='community') AND ( (arg(1)=='teams') OR (arg(1)=='stats') ) ) { |
|
| 232 | 232 | unset($vars['title']); |
| 233 | - } |
|
| 233 | + } |
|
| 234 | 234 | |
| 235 | - // Apply classes to tabs to allow for better styling options |
|
| 236 | - $tabs = explode("\n", $vars['tabs']); |
|
| 237 | - array_pop($tabs); |
|
| 238 | - end($tabs); |
|
| 239 | - $last_key = key($tabs); |
|
| 240 | - |
|
| 241 | - foreach ($tabs as $key => &$tab) { |
|
| 242 | - if (strpos($tab, 'li class=')) { |
|
| 243 | - if ($key == 0) { |
|
| 244 | - $tab = str_replace('li class="', 'li class="first ', $tab); |
|
| 245 | - } |
|
| 246 | - if ($key == $last_key) { |
|
| 247 | - $tab = str_replace('li class="', 'li class="last ', $tab) . '</ul>'; |
|
| 248 | - } |
|
| 249 | - } |
|
| 250 | - elseif (strpos($tab, 'li ')) { |
|
| 251 | - if ($key == 0) { |
|
| 252 | - $tab = str_replace('li ', 'li class="first" ', $tab); |
|
| 253 | - } |
|
| 254 | - if ($key == $last_key) { |
|
| 255 | - $tab = str_replace('li ', 'li class="last" ', $tab) . '</ul>'; |
|
| 256 | - } |
|
| 257 | - } |
|
| 258 | - } |
|
| 259 | - $vars['tabs'] = implode("\n", $tabs); |
|
| 235 | + // Apply classes to tabs to allow for better styling options |
|
| 236 | + $tabs = explode("\n", $vars['tabs']); |
|
| 237 | + array_pop($tabs); |
|
| 238 | + end($tabs); |
|
| 239 | + $last_key = key($tabs); |
|
| 240 | + |
|
| 241 | + foreach ($tabs as $key => &$tab) { |
|
| 242 | + if (strpos($tab, 'li class=')) { |
|
| 243 | + if ($key == 0) { |
|
| 244 | + $tab = str_replace('li class="', 'li class="first ', $tab); |
|
| 245 | + } |
|
| 246 | + if ($key == $last_key) { |
|
| 247 | + $tab = str_replace('li class="', 'li class="last ', $tab) . '</ul>'; |
|
| 248 | + } |
|
| 249 | + } |
|
| 250 | + elseif (strpos($tab, 'li ')) { |
|
| 251 | + if ($key == 0) { |
|
| 252 | + $tab = str_replace('li ', 'li class="first" ', $tab); |
|
| 253 | + } |
|
| 254 | + if ($key == $last_key) { |
|
| 255 | + $tab = str_replace('li ', 'li class="last" ', $tab) . '</ul>'; |
|
| 256 | + } |
|
| 257 | + } |
|
| 258 | + } |
|
| 259 | + $vars['tabs'] = implode("\n", $tabs); |
|
| 260 | 260 | |
| 261 | - // Get the main menu but only for the branch the page is on. |
|
| 262 | - $vars['menu_tree_onlyactive'] = menu_tree('primary-links'); |
|
| 261 | + // Get the main menu but only for the branch the page is on. |
|
| 262 | + $vars['menu_tree_onlyactive'] = menu_tree('primary-links'); |
|
| 263 | 263 | |
| 264 | - // Create tertiary menu |
|
| 265 | - $vars['tertiary_links'] = menu_navigation_links(variable_get('menu_primary_links_source', 'primary-links'), 2); |
|
| 264 | + // Create tertiary menu |
|
| 265 | + $vars['tertiary_links'] = menu_navigation_links(variable_get('menu_primary_links_source', 'primary-links'), 2); |
|
| 266 | 266 | |
| 267 | - // Create action links |
|
| 268 | - $vars['action_links'] = _boinc_action_links(); |
|
| 267 | + // Create action links |
|
| 268 | + $vars['action_links'] = _boinc_action_links(); |
|
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | /** |
@@ -278,79 +278,79 @@ discard block |
||
| 278 | 278 | */ |
| 279 | 279 | function boinc_preprocess_node(&$vars, $hook) { |
| 280 | 280 | |
| 281 | - //$vars['sample_variable'] = t('Lorem ipsum.'); |
|
| 281 | + //$vars['sample_variable'] = t('Lorem ipsum.'); |
|
| 282 | 282 | |
| 283 | - // Detach subscribe link from the links list. Subscribe link will be placed |
|
| 284 | - // on page separately from links. |
|
| 285 | - if (!empty($vars['node']->links['flag-subscriptions']['title'])) { |
|
| 283 | + // Detach subscribe link from the links list. Subscribe link will be placed |
|
| 284 | + // on page separately from links. |
|
| 285 | + if (!empty($vars['node']->links['flag-subscriptions']['title'])) { |
|
| 286 | 286 | $vars['subscribe_link'] = $vars['node']->links['flag-subscriptions']['title']; |
| 287 | 287 | unset($vars['node']->links['flag-subscriptions']); |
| 288 | - } |
|
| 288 | + } |
|
| 289 | 289 | |
| 290 | - // Optionally, run node-type-specific preprocess functions, like |
|
| 291 | - // boinc_preprocess_node_page() or boinc_preprocess_node_story(). |
|
| 292 | - $function = __FUNCTION__ . '_' . $vars['node']->type; |
|
| 293 | - if (function_exists($function)) { |
|
| 290 | + // Optionally, run node-type-specific preprocess functions, like |
|
| 291 | + // boinc_preprocess_node_page() or boinc_preprocess_node_story(). |
|
| 292 | + $function = __FUNCTION__ . '_' . $vars['node']->type; |
|
| 293 | + if (function_exists($function)) { |
|
| 294 | 294 | $function($vars, $hook); |
| 295 | - } |
|
| 295 | + } |
|
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | /** |
| 299 | 299 | * Preprocessing for forum lists |
| 300 | 300 | */ |
| 301 | 301 | function boinc_preprocess_forums(&$vars, $hook) { |
| 302 | - // Add a link to mark all forums as read |
|
| 303 | - module_load_include('inc', 'forum_tweaks', 'includes/mark-read'); |
|
| 304 | - forum_tweaks_get_mark_read_link($vars['tid'], $vars['links']); |
|
| 305 | - if (!$vars['parents']) { |
|
| 302 | + // Add a link to mark all forums as read |
|
| 303 | + module_load_include('inc', 'forum_tweaks', 'includes/mark-read'); |
|
| 304 | + forum_tweaks_get_mark_read_link($vars['tid'], $vars['links']); |
|
| 305 | + if (!$vars['parents']) { |
|
| 306 | 306 | // Remove the "Post new forum topic" link from the top level forum list |
| 307 | 307 | unset($vars['links']['forum']); |
| 308 | 308 | // Add a link to manage subscriptions for the user |
| 309 | 309 | $vars['links']['subscriptions'] = array( |
| 310 | - 'title' => bts('Manage subscriptions', array(), NULL, 'boinc:forum-footer'), |
|
| 311 | - 'href' => 'account/prefs/subscriptions', |
|
| 310 | + 'title' => bts('Manage subscriptions', array(), NULL, 'boinc:forum-footer'), |
|
| 311 | + 'href' => 'account/prefs/subscriptions', |
|
| 312 | 312 | ); |
| 313 | - } |
|
| 313 | + } |
|
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | /** |
| 317 | 317 | * Preprocessing for forum type nodes |
| 318 | 318 | */ |
| 319 | 319 | function boinc_preprocess_node_forum(&$vars, $hook) { |
| 320 | - global $language; |
|
| 321 | - global $user; |
|
| 320 | + global $language; |
|
| 321 | + global $user; |
|
| 322 | 322 | |
| 323 | - // Locality |
|
| 324 | - $vars['locality'] = $language->language; |
|
| 323 | + // Locality |
|
| 324 | + $vars['locality'] = $language->language; |
|
| 325 | 325 | |
| 326 | - // Get the author of the node |
|
| 327 | - $account = user_load($vars['uid']); |
|
| 328 | - $comments_per_page = ($user->comments_per_page) ? $user->comments_per_page : variable_get("comment_default_per_page_{$vars['node']->type}", 50); |
|
| 326 | + // Get the author of the node |
|
| 327 | + $account = user_load($vars['uid']); |
|
| 328 | + $comments_per_page = ($user->comments_per_page) ? $user->comments_per_page : variable_get("comment_default_per_page_{$vars['node']->type}", 50); |
|
| 329 | 329 | |
| 330 | - // Add signature |
|
| 331 | - $vars['signature'] = check_markup($account->signature, $vars['node']->format); |
|
| 330 | + // Add signature |
|
| 331 | + $vars['signature'] = check_markup($account->signature, $vars['node']->format); |
|
| 332 | 332 | |
| 333 | - // Show signatures based on user preference |
|
| 334 | - $vars['show_signatures'] = ($user->hide_signatures) ? FALSE : TRUE; |
|
| 333 | + // Show signatures based on user preference |
|
| 334 | + $vars['show_signatures'] = ($user->hide_signatures) ? FALSE : TRUE; |
|
| 335 | 335 | |
| 336 | - // Expose comment sort order so that the template can put the topic node |
|
| 337 | - // content (i.e. initial post) at the very end if "Newest post first" is the |
|
| 338 | - // preference used by this user |
|
| 339 | - $vars['oldest_post_first'] = ($user->sort != 1) ? TRUE : FALSE; |
|
| 340 | - $vars['node']->comment = 0; |
|
| 336 | + // Expose comment sort order so that the template can put the topic node |
|
| 337 | + // content (i.e. initial post) at the very end if "Newest post first" is the |
|
| 338 | + // preference used by this user |
|
| 339 | + $vars['oldest_post_first'] = ($user->sort != 1) ? TRUE : FALSE; |
|
| 340 | + $vars['node']->comment = 0; |
|
| 341 | 341 | |
| 342 | - $vars['first_page'] = (!isset($_GET['page']) OR ($_GET['page'] < 1)); |
|
| 343 | - $page_count = max(ceil($vars['comment_count'] / $comments_per_page), 1); |
|
| 344 | - $vars['last_page'] = ($page_count == 1 OR ($page_count > 1 AND $_GET['page'] == $page_count - 1)); |
|
| 345 | - |
|
| 346 | - $links = $vars['links']; |
|
| 347 | - $moderator_links = array(); |
|
| 348 | - _boinc_create_moderator_links($links, $moderator_links); |
|
| 349 | - $vars['links'] = $links; |
|
| 350 | - $vars['moderator_links'] = $moderator_links; |
|
| 351 | - |
|
| 352 | - // Ignore user link |
|
| 353 | - $vars['ignore_link'] = _boinc_ignore_user_link('node', $vars['node']); |
|
| 342 | + $vars['first_page'] = (!isset($_GET['page']) OR ($_GET['page'] < 1)); |
|
| 343 | + $page_count = max(ceil($vars['comment_count'] / $comments_per_page), 1); |
|
| 344 | + $vars['last_page'] = ($page_count == 1 OR ($page_count > 1 AND $_GET['page'] == $page_count - 1)); |
|
| 345 | + |
|
| 346 | + $links = $vars['links']; |
|
| 347 | + $moderator_links = array(); |
|
| 348 | + _boinc_create_moderator_links($links, $moderator_links); |
|
| 349 | + $vars['links'] = $links; |
|
| 350 | + $vars['moderator_links'] = $moderator_links; |
|
| 351 | + |
|
| 352 | + // Ignore user link |
|
| 353 | + $vars['ignore_link'] = _boinc_ignore_user_link('node', $vars['node']); |
|
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | |
@@ -371,48 +371,48 @@ discard block |
||
| 371 | 371 | * The name of the template being rendered ("comment" in this case.) |
| 372 | 372 | */ |
| 373 | 373 | function boinc_preprocess_comment(&$vars, $hook) { |
| 374 | - global $language; |
|
| 375 | - global $user; |
|
| 374 | + global $language; |
|
| 375 | + global $user; |
|
| 376 | 376 | |
| 377 | - // Locality |
|
| 378 | - $vars['locality'] = $language->language; |
|
| 377 | + // Locality |
|
| 378 | + $vars['locality'] = $language->language; |
|
| 379 | 379 | |
| 380 | - // Show signatures based on user preference |
|
| 381 | - $vars['show_signatures'] = ($user->hide_signatures) ? FALSE : TRUE; |
|
| 380 | + // Show signatures based on user preference |
|
| 381 | + $vars['show_signatures'] = ($user->hide_signatures) ? FALSE : TRUE; |
|
| 382 | 382 | |
| 383 | - $links = $vars['links']; |
|
| 384 | - $moderator_links = array(); |
|
| 385 | - _boinc_create_moderator_links($links, $moderator_links); |
|
| 386 | - $vars['links'] = $links; |
|
| 387 | - $vars['moderator_links'] = $moderator_links; |
|
| 383 | + $links = $vars['links']; |
|
| 384 | + $moderator_links = array(); |
|
| 385 | + _boinc_create_moderator_links($links, $moderator_links); |
|
| 386 | + $vars['links'] = $links; |
|
| 387 | + $vars['moderator_links'] = $moderator_links; |
|
| 388 | 388 | |
| 389 | - // Ignore user link |
|
| 390 | - $vars['ignore_link'] = _boinc_ignore_user_link('comment', $vars['comment']); |
|
| 389 | + // Ignore user link |
|
| 390 | + $vars['ignore_link'] = _boinc_ignore_user_link('comment', $vars['comment']); |
|
| 391 | 391 | } |
| 392 | 392 | |
| 393 | 393 | /** |
| 394 | 394 | * |
| 395 | 395 | */ |
| 396 | 396 | function boinc_preprocess_forum_topic_list(&$variables) { |
| 397 | - if (!empty($variables['topics'])) { |
|
| 397 | + if (!empty($variables['topics'])) { |
|
| 398 | 398 | foreach ($variables['topics'] as $id => $topic) { |
| 399 | - if ($topic->new_replies) { |
|
| 399 | + if ($topic->new_replies) { |
|
| 400 | 400 | $cid = boincuser_get_first_unread_comment_id($topic->nid); |
| 401 | 401 | if ($cid) { |
| 402 | - $variables['topics'][$id]->new_url = url("goto/comment/{$cid}"); |
|
| 402 | + $variables['topics'][$id]->new_url = url("goto/comment/{$cid}"); |
|
| 403 | 403 | } |
| 404 | 404 | else { |
| 405 | - // User hasn't visited this topic before, so all replies are new... |
|
| 406 | - $topic->new_replies = NULL; |
|
| 405 | + // User hasn't visited this topic before, so all replies are new... |
|
| 406 | + $topic->new_replies = NULL; |
|
| 407 | + } |
|
| 407 | 408 | } |
| 408 | - } |
|
| 409 | - // Use same logic in forum.module to change message if topic has |
|
| 410 | - // moved. Changed link to match boinc path-added "community". |
|
| 411 | - if ($topic->forum_tid != $variables['tid']) { |
|
| 409 | + // Use same logic in forum.module to change message if topic has |
|
| 410 | + // moved. Changed link to match boinc path-added "community". |
|
| 411 | + if ($topic->forum_tid != $variables['tid']) { |
|
| 412 | 412 | $variables['topics'][$id]->message = l(t('This topic has been moved'), "community/forum/$topic->forum_tid"); |
| 413 | - } |
|
| 413 | + } |
|
| 414 | + } |
|
| 414 | 415 | } |
| 415 | - } |
|
| 416 | 416 | } |
| 417 | 417 | |
| 418 | 418 | /** |
@@ -425,79 +425,79 @@ discard block |
||
| 425 | 425 | */ |
| 426 | 426 | ///* -- Delete this line if you want to use this function |
| 427 | 427 | function boinc_preprocess_views_view(&$vars, $hook) { |
| 428 | - switch ($vars['name']) { |
|
| 429 | - case 'boinc_account_computers': |
|
| 428 | + switch ($vars['name']) { |
|
| 429 | + case 'boinc_account_computers': |
|
| 430 | 430 | switch ($vars['display_id']) { |
| 431 | 431 | case 'page_1': |
| 432 | 432 | case 'panel_pane_1': |
| 433 | 433 | $vars['empty'] = boincwork_views_host_list_empty_text(); |
| 434 | - break; |
|
| 434 | + break; |
|
| 435 | 435 | case 'page_2': |
| 436 | 436 | $vars['empty'] = boincwork_views_host_list_empty_text('active'); |
| 437 | - break; |
|
| 437 | + break; |
|
| 438 | 438 | case 'block_1': |
| 439 | 439 | $vars['empty'] = boincwork_views_host_list_empty_text('preferences'); |
| 440 | - break; |
|
| 440 | + break; |
|
| 441 | 441 | default: |
| 442 | 442 | } |
| 443 | 443 | break; |
| 444 | - case 'boinc_account_tasks_all': |
|
| 444 | + case 'boinc_account_tasks_all': |
|
| 445 | 445 | $vars['empty'] = boincwork_views_task_list_empty_text(); |
| 446 | 446 | break; |
| 447 | - case 'boinc_friends': |
|
| 447 | + case 'boinc_friends': |
|
| 448 | 448 | if ($vars['display_id'] == 'block_1') { |
| 449 | - $vars['header'] = boincuser_views_friends_block_header(); |
|
| 449 | + $vars['header'] = boincuser_views_friends_block_header(); |
|
| 450 | 450 | } |
| 451 | 451 | break; |
| 452 | - case 'boinc_host': |
|
| 452 | + case 'boinc_host': |
|
| 453 | 453 | $view = views_get_current_view(); |
| 454 | - if (!($view->result)) { |
|
| 454 | + if (!($view->result)) { |
|
| 455 | 455 | $vars['footer'] = '<h3>' . bts ('Host not found in database.', array(), NULL, 'boinc:host-details') . '</h3>'; |
| 456 | - } |
|
| 456 | + } |
|
| 457 | 457 | break; |
| 458 | - case 'boinc_host_list': |
|
| 458 | + case 'boinc_host_list': |
|
| 459 | 459 | if ($vars['display_id'] == 'page_2') { |
| 460 | - $vars['empty'] = boincwork_views_host_list_empty_text(); |
|
| 460 | + $vars['empty'] = boincwork_views_host_list_empty_text(); |
|
| 461 | 461 | } |
| 462 | 462 | elseif ($vars['display_id'] == 'page_1') { |
| 463 | - $vars['empty'] = boincwork_views_host_list_empty_text('active'); |
|
| 463 | + $vars['empty'] = boincwork_views_host_list_empty_text('active'); |
|
| 464 | 464 | } |
| 465 | 465 | break; |
| 466 | - case 'boinc_task': |
|
| 466 | + case 'boinc_task': |
|
| 467 | 467 | // Load view object (view data is not available in header / footer); execute view query |
| 468 | 468 | $view = views_get_current_view(); |
| 469 | 469 | $view->execute(); |
| 470 | 470 | $result = reset($view->result); |
| 471 | 471 | |
| 472 | 472 | if ($result) { |
| 473 | - // Display the stderr output in the footer |
|
| 474 | - $vars['footer'] = '<h3>' . bts('Stderr output', array(), NULL, 'boinc:task-details-errorlog') .'</h3>'; |
|
| 475 | - $vars['footer'] .= '<pre>' . htmlspecialchars($result->result_stderr_out) . '</pre>'; |
|
| 473 | + // Display the stderr output in the footer |
|
| 474 | + $vars['footer'] = '<h3>' . bts('Stderr output', array(), NULL, 'boinc:task-details-errorlog') .'</h3>'; |
|
| 475 | + $vars['footer'] .= '<pre>' . htmlspecialchars($result->result_stderr_out) . '</pre>'; |
|
| 476 | 476 | } else { |
| 477 | - $vars['footer'] = '<h3>' . bts ('Task not found in database.', array(), NULL, 'boinc:task-details') . '</h3>'; |
|
| 477 | + $vars['footer'] = '<h3>' . bts ('Task not found in database.', array(), NULL, 'boinc:task-details') . '</h3>'; |
|
| 478 | 478 | } |
| 479 | 479 | break; |
| 480 | - case 'boinc_teams': |
|
| 480 | + case 'boinc_teams': |
|
| 481 | 481 | if ($vars['display_id'] == 'panel_pane_3') { |
| 482 | - $team_id = arg(2); |
|
| 483 | - $vars['header'] = boincteam_manage_admins_panel_header($team_id); |
|
| 482 | + $team_id = arg(2); |
|
| 483 | + $vars['header'] = boincteam_manage_admins_panel_header($team_id); |
|
| 484 | 484 | } |
| 485 | 485 | break; |
| 486 | - case 'boinc_workunit': |
|
| 486 | + case 'boinc_workunit': |
|
| 487 | 487 | ob_start(); |
| 488 | 488 | // Get the workunit ID from the URL |
| 489 | 489 | $result_id = arg(1); |
| 490 | 490 | require_boinc(array('util','boinc_db')); |
| 491 | 491 | $wu = BoincWorkunit::lookup_id($result_id); |
| 492 | 492 | if ($wu) { |
| 493 | - // Output from admin defined BOINC project-specific function |
|
| 494 | - project_workunit($wu); |
|
| 495 | - // Output of project_workunit() gets caught in the buffer |
|
| 496 | - $vars['footer'] = ob_get_clean(); |
|
| 493 | + // Output from admin defined BOINC project-specific function |
|
| 494 | + project_workunit($wu); |
|
| 495 | + // Output of project_workunit() gets caught in the buffer |
|
| 496 | + $vars['footer'] = ob_get_clean(); |
|
| 497 | 497 | } else { |
| 498 | - $vars['footer'] = '<h3>' . bts ('Workunit not found in database.', array(), NULL, 'boinc:workunit-details') . '</h3>'; |
|
| 498 | + $vars['footer'] = '<h3>' . bts ('Workunit not found in database.', array(), NULL, 'boinc:workunit-details') . '</h3>'; |
|
| 499 | 499 | } |
| 500 | - default: |
|
| 500 | + default: |
|
| 501 | 501 | } |
| 502 | 502 | } |
| 503 | 503 | // */ |
@@ -510,19 +510,19 @@ discard block |
||
| 510 | 510 | */ |
| 511 | 511 | ///* -- Delete this line if you want to use this function |
| 512 | 512 | function boinc_preprocess_privatemsg_view(&$vars, $hook) { |
| 513 | - $author_picture = '<div class="picture">'; |
|
| 514 | - $user_image = boincuser_get_user_profile_image($vars['message']['author']->uid); |
|
| 515 | - if ($user_image) { |
|
| 513 | + $author_picture = '<div class="picture">'; |
|
| 514 | + $user_image = boincuser_get_user_profile_image($vars['message']['author']->uid); |
|
| 515 | + if ($user_image) { |
|
| 516 | 516 | if (is_array($user_image) AND $user_image['image']['filepath']) { |
| 517 | - $author_picture .= theme('imagefield_image', $user_image['image'], $user_image['alt'], $user_image['alt'], array(), false); |
|
| 517 | + $author_picture .= theme('imagefield_image', $user_image['image'], $user_image['alt'], $user_image['alt'], array(), false); |
|
| 518 | 518 | } |
| 519 | 519 | elseif (is_string($user_image)) { |
| 520 | - $author_picture .= '<img src="' . $user_image . '"/>'; |
|
| 520 | + $author_picture .= '<img src="' . $user_image . '"/>'; |
|
| 521 | 521 | } |
| 522 | - } |
|
| 523 | - $author_picture .= '</div>'; |
|
| 524 | - $vars['author_picture'] = $author_picture; |
|
| 525 | - $vars['message_timestamp'] = date('j M Y G:i:s T', $vars['message']['timestamp']); |
|
| 522 | + } |
|
| 523 | + $author_picture .= '</div>'; |
|
| 524 | + $vars['author_picture'] = $author_picture; |
|
| 525 | + $vars['message_timestamp'] = date('j M Y G:i:s T', $vars['message']['timestamp']); |
|
| 526 | 526 | } |
| 527 | 527 | // */ |
| 528 | 528 | |
@@ -541,19 +541,19 @@ discard block |
||
| 541 | 541 | // */ |
| 542 | 542 | |
| 543 | 543 | function boinc_preprocess_search_result(&$variables) { |
| 544 | - global $language; |
|
| 545 | - // Locality |
|
| 546 | - $variables['locality'] = $language->language; |
|
| 544 | + global $language; |
|
| 545 | + // Locality |
|
| 546 | + $variables['locality'] = $language->language; |
|
| 547 | 547 | |
| 548 | - // Change the format of the search result date/time in the info string. |
|
| 549 | - if ($variables['result']['date']) { |
|
| 548 | + // Change the format of the search result date/time in the info string. |
|
| 549 | + if ($variables['result']['date']) { |
|
| 550 | 550 | $variables['info_split']['date'] = date('j M Y G:i:s T', $variables['result']['date']); |
| 551 | - } |
|
| 552 | - $variables['info'] = implode(' - ', $variables['info_split']); |
|
| 551 | + } |
|
| 552 | + $variables['info'] = implode(' - ', $variables['info_split']); |
|
| 553 | 553 | |
| 554 | - $type = strtolower($variables['result']['bundle']); |
|
| 555 | - switch ($type) { |
|
| 556 | - case 'profile': |
|
| 554 | + $type = strtolower($variables['result']['bundle']); |
|
| 555 | + switch ($type) { |
|
| 556 | + case 'profile': |
|
| 557 | 557 | case 'user': |
| 558 | 558 | $node = $variables['result']['node']; |
| 559 | 559 | $variables['url'] = url('account/' . $node->is_uid); |
@@ -561,20 +561,20 @@ discard block |
||
| 561 | 561 | $variables['user_image'] = boincuser_get_user_profile_image($node->is_uid); |
| 562 | 562 | $variables['account'] = user_load($node->is_uid); |
| 563 | 563 | break; |
| 564 | - case 'team': |
|
| 564 | + case 'team': |
|
| 565 | 565 | $node = $variables['result']['node']; |
| 566 | 566 | $variables['url'] = url('/community/teams/' . $node->entity_id);; |
| 567 | 567 | break; |
| 568 | - case 'forum': |
|
| 568 | + case 'forum': |
|
| 569 | 569 | $node = $variables['result']['node']; |
| 570 | 570 | $drupalnode = node_load($node->entity_id); |
| 571 | 571 | // Get the taxonomy for the node, creates a link to the parent forum |
| 572 | 572 | $taxonomy = reset($drupalnode->taxonomy); |
| 573 | 573 | if ($vocab = taxonomy_vocabulary_load($taxonomy->vid)) { |
| 574 | - $variables['parent_forum'] = l($taxonomy->name, "community/forum/{$taxonomy->tid}"); |
|
| 574 | + $variables['parent_forum'] = l($taxonomy->name, "community/forum/{$taxonomy->tid}"); |
|
| 575 | 575 | } |
| 576 | 576 | break; |
| 577 | - case 'comment': |
|
| 577 | + case 'comment': |
|
| 578 | 578 | // Get the node id for this comment |
| 579 | 579 | $nid = $variables['result']['fields']['tos_content_extra']; |
| 580 | 580 | $drupalnode = node_load($nid); |
@@ -585,21 +585,21 @@ discard block |
||
| 585 | 585 | // Get the taxonomy for the node, creates a link to the parent forum |
| 586 | 586 | $taxonomy = reset($drupalnode->taxonomy); |
| 587 | 587 | if ($vocab = taxonomy_vocabulary_load($taxonomy->vid)) { |
| 588 | - $variables['parent_forum'] = l($taxonomy->name, "community/forum/{$taxonomy->tid}"); |
|
| 588 | + $variables['parent_forum'] = l($taxonomy->name, "community/forum/{$taxonomy->tid}"); |
|
| 589 | 589 | } |
| 590 | - break; |
|
| 591 | - default: |
|
| 590 | + break; |
|
| 591 | + default: |
|
| 592 | 592 | } |
| 593 | 593 | } |
| 594 | 594 | |
| 595 | 595 | // Remove the mess of text under the search form and don't display "no results" |
| 596 | 596 | // if a search hasn't even been submitted |
| 597 | 597 | function boinc_apachesolr_search_noresults() { |
| 598 | - $message = bts('No results found...', array(), NULL, 'boinc:search-with-no-results'); |
|
| 599 | - if (!arg(2)) { |
|
| 598 | + $message = bts('No results found...', array(), NULL, 'boinc:search-with-no-results'); |
|
| 599 | + if (!arg(2)) { |
|
| 600 | 600 | $message = ''; |
| 601 | - } |
|
| 602 | - return '<p>' . $message . '</p>'; |
|
| 601 | + } |
|
| 602 | + return '<p>' . $message . '</p>'; |
|
| 603 | 603 | } |
| 604 | 604 | |
| 605 | 605 | /** |
@@ -608,42 +608,42 @@ discard block |
||
| 608 | 608 | */ |
| 609 | 609 | function phptemplate_username($object) { |
| 610 | 610 | |
| 611 | - if ($object->uid && $object->name) { |
|
| 611 | + if ($object->uid && $object->name) { |
|
| 612 | 612 | |
| 613 | 613 | // Show the profile name in general, not the username |
| 614 | 614 | $name = user_load($object->uid)->boincuser_name; |
| 615 | 615 | |
| 616 | 616 | // Shorten the name when it is too long or it will break many tables. |
| 617 | 617 | if (drupal_strlen($name) > 20) { |
| 618 | - $name = drupal_substr($name, 0, 15) . '...'; |
|
| 618 | + $name = drupal_substr($name, 0, 15) . '...'; |
|
| 619 | 619 | } |
| 620 | 620 | |
| 621 | 621 | if (user_access('access user profiles')) { |
| 622 | - $output = l($name, 'account/' . $object->uid, array('attributes' => array('title' => bts('View user profile.', array(), NULL, 'boinc:users-table')))); |
|
| 622 | + $output = l($name, 'account/' . $object->uid, array('attributes' => array('title' => bts('View user profile.', array(), NULL, 'boinc:users-table')))); |
|
| 623 | 623 | } |
| 624 | 624 | else { |
| 625 | - $output = check_plain($name); |
|
| 625 | + $output = check_plain($name); |
|
| 626 | 626 | } |
| 627 | - } |
|
| 628 | - else if ($object->name) { |
|
| 627 | + } |
|
| 628 | + else if ($object->name) { |
|
| 629 | 629 | // Sometimes modules display content composed by people who are |
| 630 | 630 | // not registered members of the site (e.g. mailing list or news |
| 631 | 631 | // aggregator modules). This clause enables modules to display |
| 632 | 632 | // the true author of the content. |
| 633 | 633 | if (!empty($object->homepage)) { |
| 634 | - $output = l($object->name, $object->homepage, array('attributes' => array('rel' => 'nofollow'))); |
|
| 634 | + $output = l($object->name, $object->homepage, array('attributes' => array('rel' => 'nofollow'))); |
|
| 635 | 635 | } |
| 636 | 636 | else { |
| 637 | - $output = check_plain($object->name); |
|
| 637 | + $output = check_plain($object->name); |
|
| 638 | 638 | } |
| 639 | 639 | |
| 640 | 640 | $output .= ' (' . bts('not verified', array(), NULL, 'boinc:user-not-found') . ')'; |
| 641 | - } |
|
| 642 | - else { |
|
| 641 | + } |
|
| 642 | + else { |
|
| 643 | 643 | $output = check_plain(variable_get('anonymous', bts('Anonymous', array(), NULL, 'boinc:anonymous-user'))); |
| 644 | - } |
|
| 644 | + } |
|
| 645 | 645 | |
| 646 | - return $output; |
|
| 646 | + return $output; |
|
| 647 | 647 | } |
| 648 | 648 | |
| 649 | 649 | /** |
@@ -651,7 +651,7 @@ discard block |
||
| 651 | 651 | * "More information about formatting options" |
| 652 | 652 | */ |
| 653 | 653 | function boinc_filter_tips_more_info () { |
| 654 | - return ''; |
|
| 654 | + return ''; |
|
| 655 | 655 | } |
| 656 | 656 | |
| 657 | 657 | /** |
@@ -669,19 +669,19 @@ discard block |
||
| 669 | 669 | * An array containing the email [type] (mailkey), [subject] and [body]. |
| 670 | 670 | */ |
| 671 | 671 | function boinc_flag_friend_message_email($status, $flag, $recipient, $sender) { |
| 672 | - $email = array(); |
|
| 673 | - $email['type'] = 'flag-friend'; |
|
| 674 | - // Reload the sender to get a full user object |
|
| 675 | - $sender = user_load($sender->uid); |
|
| 672 | + $email = array(); |
|
| 673 | + $email['type'] = 'flag-friend'; |
|
| 674 | + // Reload the sender to get a full user object |
|
| 675 | + $sender = user_load($sender->uid); |
|
| 676 | 676 | |
| 677 | - switch ($status) { |
|
| 677 | + switch ($status) { |
|
| 678 | 678 | case FLAG_FRIEND_FLAGGED: |
| 679 | 679 | // Sender accepted recipient's friend request |
| 680 | 680 | $email['subject'] = bts('!name accepted your friend request [!site]', array( |
| 681 | 681 | '!name' => $sender->boincuser_name, |
| 682 | 682 | '!site' => variable_get('site_name', 'Drupal-BOINC'), |
| 683 | 683 | ), NULL, 'boinc:friend-request-email'); |
| 684 | - $email['body'] = bts('!name confirmed you as a friend on !site. |
|
| 684 | + $email['body'] = bts('!name confirmed you as a friend on !site. |
|
| 685 | 685 | |
| 686 | 686 | Follow this link to view his or her profile: |
| 687 | 687 | !link |
@@ -695,12 +695,12 @@ discard block |
||
| 695 | 695 | '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '', |
| 696 | 696 | '!link' => url('account/'. $sender->uid, array('absolute' => TRUE)), |
| 697 | 697 | ), array(), NULL, 'boinc:friend-request-email'); |
| 698 | - break; |
|
| 698 | + break; |
|
| 699 | 699 | |
| 700 | 700 | case FLAG_FRIEND_PENDING: |
| 701 | 701 | // Sender is requesting to be recipient's friend |
| 702 | 702 | $email['subject'] = bts('Friend request from !name [!site]', array('!name' => $sender->boincuser_name, '!site' => variable_get('site_name', 'Drupal-BOINC')), NULL, 'boinc:friend-request-email'); |
| 703 | - $email['body'] = bts('!name added you as a friend on !site. You can approve or deny this request. Denying a request will not send a notification, but will remove the request from both of your accounts. |
|
| 703 | + $email['body'] = bts('!name added you as a friend on !site. You can approve or deny this request. Denying a request will not send a notification, but will remove the request from both of your accounts. |
|
| 704 | 704 | |
| 705 | 705 | Follow the link below to view this request: |
| 706 | 706 | !link |
@@ -714,26 +714,26 @@ discard block |
||
| 714 | 714 | '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '', |
| 715 | 715 | '!link' => url('goto/friend-requests', array('absolute' => TRUE)), |
| 716 | 716 | ), |
| 717 | - array(), NULL, 'boinc:friend-request-email'); |
|
| 718 | - break; |
|
| 719 | - } |
|
| 720 | - return $email; |
|
| 717 | + array(), NULL, 'boinc:friend-request-email'); |
|
| 718 | + break; |
|
| 719 | + } |
|
| 720 | + return $email; |
|
| 721 | 721 | } |
| 722 | 722 | |
| 723 | 723 | /** |
| 724 | 724 | * Edit action links |
| 725 | 725 | */ |
| 726 | 726 | function phptemplate_links($links, $attributes = array('class' => 'links')) { |
| 727 | - if ($links){ |
|
| 727 | + if ($links){ |
|
| 728 | 728 | // Remove flag-subscriptions link. It will be placed elsewhere. |
| 729 | 729 | if (isset($links['flag-subscriptions'])) { |
| 730 | - unset($links['flag-subscriptions']); |
|
| 730 | + unset($links['flag-subscriptions']); |
|
| 731 | 731 | } |
| 732 | 732 | // Reorder the links however you need them. |
| 733 | 733 | $links = reorder_links($links, array('comment_edit','quote','comment_add','comment_reply','flag-abuse_comment','flag-abuse_node'), array('comment_delete')); |
| 734 | 734 | // Use the built-in theme_links() function to format the $links array. |
| 735 | 735 | return theme_links($links, $attributes); |
| 736 | - } |
|
| 736 | + } |
|
| 737 | 737 | } |
| 738 | 738 | |
| 739 | 739 | /** |
@@ -777,8 +777,8 @@ discard block |
||
| 777 | 777 | * That is to say, get rid of it and use the views-view-table.tpl.php template. |
| 778 | 778 | */ |
| 779 | 779 | function boinc_tablesort_indicator($style) { |
| 780 | - return ''; |
|
| 781 | - /* |
|
| 780 | + return ''; |
|
| 781 | + /* |
|
| 782 | 782 | if ($style == "asc") { |
| 783 | 783 | return theme('image', 'misc/arrow-asc.png', t('sort icon'), t('sort ascending')); |
| 784 | 784 | } |
@@ -801,48 +801,48 @@ discard block |
||
| 801 | 801 | * |
| 802 | 802 | */ |
| 803 | 803 | function _boinc_create_moderator_links(&$links, &$moderator_links) { |
| 804 | - // If there are no links, then do nothing |
|
| 805 | - if (empty($links)) { |
|
| 804 | + // If there are no links, then do nothing |
|
| 805 | + if (empty($links)) { |
|
| 806 | 806 | return; |
| 807 | - } |
|
| 807 | + } |
|
| 808 | 808 | |
| 809 | - $alllinks = array(); |
|
| 810 | - $modlinks = array(); |
|
| 809 | + $alllinks = array(); |
|
| 810 | + $modlinks = array(); |
|
| 811 | 811 | |
| 812 | - // Create an array of HTML elements from the $links string, keys |
|
| 813 | - // are the class attribute for the <li> tags. |
|
| 814 | - $dom = new DOMDocument; |
|
| 815 | - $dom->loadHTML(mb_convert_encoding($links, 'HTML-ENTITIES', 'UTF-8')); |
|
| 816 | - foreach($dom->getElementsByTagName('li') as $node) { |
|
| 812 | + // Create an array of HTML elements from the $links string, keys |
|
| 813 | + // are the class attribute for the <li> tags. |
|
| 814 | + $dom = new DOMDocument; |
|
| 815 | + $dom->loadHTML(mb_convert_encoding($links, 'HTML-ENTITIES', 'UTF-8')); |
|
| 816 | + foreach($dom->getElementsByTagName('li') as $node) { |
|
| 817 | 817 | $key = $node->getAttribute("class"); |
| 818 | 818 | $alllinks[$key] = $dom->saveHTML($node); |
| 819 | - } |
|
| 819 | + } |
|
| 820 | 820 | |
| 821 | - // Select classes to be placed into moderator links array |
|
| 822 | - $selected_classes = array( |
|
| 821 | + // Select classes to be placed into moderator links array |
|
| 822 | + $selected_classes = array( |
|
| 823 | 823 | "make_sticky", "make_unsticky", |
| 824 | 824 | "lock", "unlock", |
| 825 | 825 | "convert", |
| 826 | 826 | "hide", "unhide", |
| 827 | 827 | "comment_delete", |
| 828 | - ); |
|
| 829 | - foreach(array_keys($alllinks) as $key1) { |
|
| 828 | + ); |
|
| 829 | + foreach(array_keys($alllinks) as $key1) { |
|
| 830 | 830 | // Select string up to first space, if present. |
| 831 | 831 | $class1 = strtok($key1, ' '); |
| 832 | 832 | if (in_array($class1, $selected_classes)) { |
| 833 | - if (empty($modlinks)) { |
|
| 833 | + if (empty($modlinks)) { |
|
| 834 | 834 | _boinc_firstlink($alllinks[$key1]); |
| 835 | - } |
|
| 836 | - $modlinks[$key1] = $alllinks[$key1]; |
|
| 837 | - unset($alllinks[$key1]); |
|
| 835 | + } |
|
| 836 | + $modlinks[$key1] = $alllinks[$key1]; |
|
| 837 | + unset($alllinks[$key1]); |
|
| 838 | 838 | } |
| 839 | - } |
|
| 840 | - // Convert the HTML arrays back into strings, wrap them in <ul> |
|
| 841 | - // tags |
|
| 842 | - $links = "<ul class=\"links\">".implode($alllinks)."</ul>"; |
|
| 843 | - $moderator_links = "<ul class=\"links\">".implode($modlinks)."</ul>"; |
|
| 839 | + } |
|
| 840 | + // Convert the HTML arrays back into strings, wrap them in <ul> |
|
| 841 | + // tags |
|
| 842 | + $links = "<ul class=\"links\">".implode($alllinks)."</ul>"; |
|
| 843 | + $moderator_links = "<ul class=\"links\">".implode($modlinks)."</ul>"; |
|
| 844 | 844 | |
| 845 | - return; |
|
| 845 | + return; |
|
| 846 | 846 | } |
| 847 | 847 | |
| 848 | 848 | /* |
@@ -850,38 +850,38 @@ discard block |
||
| 850 | 850 | * attribute to class. |
| 851 | 851 | */ |
| 852 | 852 | function _boinc_firstlink(&$alink) { |
| 853 | - if (!empty($alink)) { |
|
| 853 | + if (!empty($alink)) { |
|
| 854 | 854 | $dom = new DomDocument; |
| 855 | 855 | $dom->loadHTML(mb_convert_encoding($alink, 'HTML-ENTITIES', 'UTF-8')); |
| 856 | 856 | |
| 857 | 857 | $myli = $dom->getElementsByTagName('li'); |
| 858 | 858 | if ($myli->length>0) { |
| 859 | - $newclasses = trim(($myli[0]->getAttribute("class"))." first"); |
|
| 860 | - $myli[0]->setAttribute("class", $newclasses); |
|
| 861 | - $alink = $dom->saveHTML($myli[0]); |
|
| 859 | + $newclasses = trim(($myli[0]->getAttribute("class"))." first"); |
|
| 860 | + $myli[0]->setAttribute("class", $newclasses); |
|
| 861 | + $alink = $dom->saveHTML($myli[0]); |
|
| 862 | + } |
|
| 862 | 863 | } |
| 863 | - } |
|
| 864 | 864 | } |
| 865 | 865 | |
| 866 | 866 | /* |
| 867 | 867 | * Private function to generate the action links |
| 868 | 868 | */ |
| 869 | 869 | function _boinc_action_links() { |
| 870 | - global $user; |
|
| 871 | - global $base_path; |
|
| 870 | + global $user; |
|
| 871 | + global $base_path; |
|
| 872 | 872 | |
| 873 | - $output = '<ul class="menu"><li class="first">'; |
|
| 874 | - if ($user->uid) { |
|
| 873 | + $output = '<ul class="menu"><li class="first">'; |
|
| 874 | + if ($user->uid) { |
|
| 875 | 875 | $output .= '<a href="' . url('logout') . '">' . bts('Logout', array(), NULL, 'boinc:menu-link') . '</a>'; |
| 876 | - } else { |
|
| 876 | + } else { |
|
| 877 | 877 | $output .= '<a href="' . url('user/login', array('query' => drupal_get_destination()) ) . '">' . bts('Login', array(), NULL, 'boinc:menu-link') . '</a>'; |
| 878 | - } |
|
| 879 | - $output .= '</li>'; |
|
| 880 | - if (module_exists('global_search') OR module_exists('global_search_solr')) { |
|
| 878 | + } |
|
| 879 | + $output .= '</li>'; |
|
| 880 | + if (module_exists('global_search') OR module_exists('global_search_solr')) { |
|
| 881 | 881 | $output .= '<li class="last"> <a class="search" href="' . url('search/site') . '">' . bts('search', array(), NULL, 'boinc:menu-link') .'</a> </l1>'; |
| 882 | - } |
|
| 883 | - $output .= '</ul>'; |
|
| 884 | - return $output; |
|
| 882 | + } |
|
| 883 | + $output .= '</ul>'; |
|
| 884 | + return $output; |
|
| 885 | 885 | } |
| 886 | 886 | |
| 887 | 887 | /** |
@@ -889,47 +889,47 @@ discard block |
||
| 889 | 889 | * function. Modified for boinc functionality. |
| 890 | 890 | */ |
| 891 | 891 | function _boinc_ignore_user_link($type, $object = NULL, $teaser = FALSE) { |
| 892 | - global $user; |
|
| 892 | + global $user; |
|
| 893 | 893 | |
| 894 | - if (!$user || !$user->uid) { |
|
| 894 | + if (!$user || !$user->uid) { |
|
| 895 | 895 | return; |
| 896 | - } |
|
| 896 | + } |
|
| 897 | 897 | |
| 898 | - static $ignored; |
|
| 899 | - $links = array(); |
|
| 898 | + static $ignored; |
|
| 899 | + $links = array(); |
|
| 900 | 900 | |
| 901 | - if ($type == 'node' && $user->uid != $object->uid && $object->uid != 0 && user_access('ignore user')) { |
|
| 901 | + if ($type == 'node' && $user->uid != $object->uid && $object->uid != 0 && user_access('ignore user')) { |
|
| 902 | 902 | if (!isset($ignored[$object->uid])) { |
| 903 | - $ignored[$object->uid] = db_result(db_query('SELECT COUNT(*) FROM {ignore_user} WHERE uid = %d AND iuid = %d', $user->uid, $object->uid)); |
|
| 903 | + $ignored[$object->uid] = db_result(db_query('SELECT COUNT(*) FROM {ignore_user} WHERE uid = %d AND iuid = %d', $user->uid, $object->uid)); |
|
| 904 | 904 | } |
| 905 | 905 | if ($ignored[$object->uid] == 0) { |
| 906 | - $links['ignore_user'] = array( |
|
| 906 | + $links['ignore_user'] = array( |
|
| 907 | 907 | 'title' => bts('Ignore user', array(), NULL, 'boinc:ignore-user-add'), |
| 908 | 908 | 'href' => 'account/prefs/privacy/ignore_user/add/'. $object->uid, |
| 909 | 909 | 'query' => 'destination='. $_GET['q'], |
| 910 | 910 | 'attributes' => array( |
| 911 | - 'class' => 'ignore-user', |
|
| 912 | - 'title' => bts('Add user to your ignore list', array(), NULL, 'boinc:ignore-user-add'), |
|
| 911 | + 'class' => 'ignore-user', |
|
| 912 | + 'title' => bts('Add user to your ignore list', array(), NULL, 'boinc:ignore-user-add'), |
|
| 913 | 913 | ), |
| 914 | - ); |
|
| 914 | + ); |
|
| 915 | 915 | } |
| 916 | - } |
|
| 917 | - else if ($type == 'comment' && $user->uid != $object->uid && $object->uid != 0 && user_access('ignore user')) { |
|
| 916 | + } |
|
| 917 | + else if ($type == 'comment' && $user->uid != $object->uid && $object->uid != 0 && user_access('ignore user')) { |
|
| 918 | 918 | if (!isset($ignored[$object->uid])) { |
| 919 | - $ignored[$object->uid] = db_result(db_query('SELECT COUNT(*) FROM {ignore_user} WHERE uid = %d AND iuid = %d', $user->uid, $object->uid)); |
|
| 919 | + $ignored[$object->uid] = db_result(db_query('SELECT COUNT(*) FROM {ignore_user} WHERE uid = %d AND iuid = %d', $user->uid, $object->uid)); |
|
| 920 | 920 | } |
| 921 | 921 | if ($ignored[$object->uid] == 0) { |
| 922 | - $links['ignore_user'] = array( |
|
| 922 | + $links['ignore_user'] = array( |
|
| 923 | 923 | 'title' => bts('Ignore user', array(), NULL, 'boinc:ignore-user-add'), |
| 924 | 924 | 'href' => 'account/prefs/privacy/ignore_user/add/'. $object->uid, |
| 925 | 925 | 'query' => 'destination='. $_GET['q'], |
| 926 | 926 | 'attributes' => array( |
| 927 | - 'class' => 'ignore-user', |
|
| 928 | - 'title' => bts('Add user to your ignore list', array(), NULL, 'boinc:ignore-user-add'), |
|
| 927 | + 'class' => 'ignore-user', |
|
| 928 | + 'title' => bts('Add user to your ignore list', array(), NULL, 'boinc:ignore-user-add'), |
|
| 929 | 929 | ), |
| 930 | - ); |
|
| 930 | + ); |
|
| 931 | + } |
|
| 931 | 932 | } |
| 932 | - } |
|
| 933 | 933 | |
| 934 | - return $links; |
|
| 934 | + return $links; |
|
| 935 | 935 | } |
| 936 | 936 | \ No newline at end of file |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | function boinc_links__system_main_menu($links, $menu, $element) { |
| 84 | 84 | $html = ''; |
| 85 | - $html .= '<ul id="' . $menu['id'] . '" class="' . $menu['class'] . '">' . "\n"; |
|
| 85 | + $html .= '<ul id="'.$menu['id'].'" class="'.$menu['class'].'">'."\n"; |
|
| 86 | 86 | $item_count = count($links); |
| 87 | 87 | $i = 1; |
| 88 | 88 | foreach ($links as $key => $link) { |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | if (strpos($key, 'active-trail')) $classes[] = 'active'; |
| 91 | 91 | if ($i == 1) $classes[] = 'first'; |
| 92 | 92 | if ($i == $item_count) $classes[] = 'last'; |
| 93 | - $html .= '<li class="' . implode(' ', $classes) .'">'; |
|
| 93 | + $html .= '<li class="'.implode(' ', $classes).'">'; |
|
| 94 | 94 | if ($link['title'] == 'Home') { |
| 95 | 95 | $link['title'] = bts('Home', array(), NULL, 'boinc:menu-link'); |
| 96 | 96 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | if ($link['href'] == 'dashboard') { |
| 100 | 100 | $item_count = privatemsg_unread_count(); |
| 101 | 101 | if ($item_count) { |
| 102 | - $link['title'] .= '</a> <a href="' . url('messages') . '" class="compound secondary"><div class="item-count-wrapper"><span class="item-count">' . $item_count . '</span></div>'; |
|
| 102 | + $link['title'] .= '</a> <a href="'.url('messages').'" class="compound secondary"><div class="item-count-wrapper"><span class="item-count">'.$item_count.'</span></div>'; |
|
| 103 | 103 | $link['html'] = TRUE; |
| 104 | 104 | $link['attributes']['class'] = 'compound'; |
| 105 | 105 | } |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | if ($link['href'] == 'moderate') { |
| 110 | 110 | $item_count = boincuser_moderation_queue_count(); |
| 111 | 111 | if ($item_count) { |
| 112 | - $link['title'] .= ' <div class="item-count-wrapper"><span class="item-count">' . $item_count . '</span></div>'; |
|
| 112 | + $link['title'] .= ' <div class="item-count-wrapper"><span class="item-count">'.$item_count.'</span></div>'; |
|
| 113 | 113 | $link['html'] = TRUE; |
| 114 | 114 | } |
| 115 | 115 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $html .= '</li>'; |
| 118 | 118 | $i++; |
| 119 | 119 | } |
| 120 | - $html .= '</ul>' . "\n"; |
|
| 120 | + $html .= '</ul>'."\n"; |
|
| 121 | 121 | return $html; |
| 122 | 122 | } |
| 123 | 123 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | return ''; |
| 133 | 133 | } |
| 134 | 134 | else { |
| 135 | - return '<li '. ($active ? 'class="active" ' : '') .'>'. $link ."</li>\n"; |
|
| 135 | + return '<li '.($active ? 'class="active" ' : '').'>'.$link."</li>\n"; |
|
| 136 | 136 | } |
| 137 | 137 | } |
| 138 | 138 | |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | if (empty($locality)) { |
| 198 | 198 | $locality = "en"; |
| 199 | 199 | } |
| 200 | - $vars['flag_path'] = base_path() . path_to_theme() . "/images/flags/{$locality}.png"; |
|
| 200 | + $vars['flag_path'] = base_path().path_to_theme()."/images/flags/{$locality}.png"; |
|
| 201 | 201 | |
| 202 | 202 | $server_status_url = variable_get('boinc_server_status_url', ''); |
| 203 | 203 | if (!$server_status_url) { |
@@ -219,16 +219,16 @@ discard block |
||
| 219 | 219 | if (arg(0) == 'search') { |
| 220 | 220 | unset($vars['title']); |
| 221 | 221 | } |
| 222 | - else if ( (arg(0)=='account') AND (is_numeric(arg(1))) AND (empty(arg(2))) ) { |
|
| 222 | + else if ((arg(0) == 'account') AND (is_numeric(arg(1))) AND (empty(arg(2)))) { |
|
| 223 | 223 | unset($vars['title']); |
| 224 | 224 | } |
| 225 | - else if ( (arg(0)=='account') AND (arg(1)=='profile') ) { |
|
| 225 | + else if ((arg(0) == 'account') AND (arg(1) == 'profile')) { |
|
| 226 | 226 | unset($vars['title']); |
| 227 | 227 | } |
| 228 | - else if ( (arg(0)=='dashboard') ) { |
|
| 228 | + else if ((arg(0) == 'dashboard')) { |
|
| 229 | 229 | unset($vars['title']); |
| 230 | 230 | } |
| 231 | - else if ( (arg(0)=='community') AND ( (arg(1)=='teams') OR (arg(1)=='stats') ) ) { |
|
| 231 | + else if ((arg(0) == 'community') AND ((arg(1) == 'teams') OR (arg(1) == 'stats'))) { |
|
| 232 | 232 | unset($vars['title']); |
| 233 | 233 | } |
| 234 | 234 | |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | $tab = str_replace('li class="', 'li class="first ', $tab); |
| 245 | 245 | } |
| 246 | 246 | if ($key == $last_key) { |
| 247 | - $tab = str_replace('li class="', 'li class="last ', $tab) . '</ul>'; |
|
| 247 | + $tab = str_replace('li class="', 'li class="last ', $tab).'</ul>'; |
|
| 248 | 248 | } |
| 249 | 249 | } |
| 250 | 250 | elseif (strpos($tab, 'li ')) { |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | $tab = str_replace('li ', 'li class="first" ', $tab); |
| 253 | 253 | } |
| 254 | 254 | if ($key == $last_key) { |
| 255 | - $tab = str_replace('li ', 'li class="last" ', $tab) . '</ul>'; |
|
| 255 | + $tab = str_replace('li ', 'li class="last" ', $tab).'</ul>'; |
|
| 256 | 256 | } |
| 257 | 257 | } |
| 258 | 258 | } |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | |
| 290 | 290 | // Optionally, run node-type-specific preprocess functions, like |
| 291 | 291 | // boinc_preprocess_node_page() or boinc_preprocess_node_story(). |
| 292 | - $function = __FUNCTION__ . '_' . $vars['node']->type; |
|
| 292 | + $function = __FUNCTION__.'_'.$vars['node']->type; |
|
| 293 | 293 | if (function_exists($function)) { |
| 294 | 294 | $function($vars, $hook); |
| 295 | 295 | } |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | $vars['node']->comment = 0; |
| 341 | 341 | |
| 342 | 342 | $vars['first_page'] = (!isset($_GET['page']) OR ($_GET['page'] < 1)); |
| 343 | - $page_count = max(ceil($vars['comment_count'] / $comments_per_page), 1); |
|
| 343 | + $page_count = max(ceil($vars['comment_count']/$comments_per_page), 1); |
|
| 344 | 344 | $vars['last_page'] = ($page_count == 1 OR ($page_count > 1 AND $_GET['page'] == $page_count - 1)); |
| 345 | 345 | |
| 346 | 346 | $links = $vars['links']; |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | case 'boinc_host': |
| 453 | 453 | $view = views_get_current_view(); |
| 454 | 454 | if (!($view->result)) { |
| 455 | - $vars['footer'] = '<h3>' . bts ('Host not found in database.', array(), NULL, 'boinc:host-details') . '</h3>'; |
|
| 455 | + $vars['footer'] = '<h3>'.bts('Host not found in database.', array(), NULL, 'boinc:host-details').'</h3>'; |
|
| 456 | 456 | } |
| 457 | 457 | break; |
| 458 | 458 | case 'boinc_host_list': |
@@ -471,10 +471,10 @@ discard block |
||
| 471 | 471 | |
| 472 | 472 | if ($result) { |
| 473 | 473 | // Display the stderr output in the footer |
| 474 | - $vars['footer'] = '<h3>' . bts('Stderr output', array(), NULL, 'boinc:task-details-errorlog') .'</h3>'; |
|
| 475 | - $vars['footer'] .= '<pre>' . htmlspecialchars($result->result_stderr_out) . '</pre>'; |
|
| 474 | + $vars['footer'] = '<h3>'.bts('Stderr output', array(), NULL, 'boinc:task-details-errorlog').'</h3>'; |
|
| 475 | + $vars['footer'] .= '<pre>'.htmlspecialchars($result->result_stderr_out).'</pre>'; |
|
| 476 | 476 | } else { |
| 477 | - $vars['footer'] = '<h3>' . bts ('Task not found in database.', array(), NULL, 'boinc:task-details') . '</h3>'; |
|
| 477 | + $vars['footer'] = '<h3>'.bts('Task not found in database.', array(), NULL, 'boinc:task-details').'</h3>'; |
|
| 478 | 478 | } |
| 479 | 479 | break; |
| 480 | 480 | case 'boinc_teams': |
@@ -487,7 +487,7 @@ discard block |
||
| 487 | 487 | ob_start(); |
| 488 | 488 | // Get the workunit ID from the URL |
| 489 | 489 | $result_id = arg(1); |
| 490 | - require_boinc(array('util','boinc_db')); |
|
| 490 | + require_boinc(array('util', 'boinc_db')); |
|
| 491 | 491 | $wu = BoincWorkunit::lookup_id($result_id); |
| 492 | 492 | if ($wu) { |
| 493 | 493 | // Output from admin defined BOINC project-specific function |
@@ -495,7 +495,7 @@ discard block |
||
| 495 | 495 | // Output of project_workunit() gets caught in the buffer |
| 496 | 496 | $vars['footer'] = ob_get_clean(); |
| 497 | 497 | } else { |
| 498 | - $vars['footer'] = '<h3>' . bts ('Workunit not found in database.', array(), NULL, 'boinc:workunit-details') . '</h3>'; |
|
| 498 | + $vars['footer'] = '<h3>'.bts('Workunit not found in database.', array(), NULL, 'boinc:workunit-details').'</h3>'; |
|
| 499 | 499 | } |
| 500 | 500 | default: |
| 501 | 501 | } |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | $author_picture .= theme('imagefield_image', $user_image['image'], $user_image['alt'], $user_image['alt'], array(), false); |
| 518 | 518 | } |
| 519 | 519 | elseif (is_string($user_image)) { |
| 520 | - $author_picture .= '<img src="' . $user_image . '"/>'; |
|
| 520 | + $author_picture .= '<img src="'.$user_image.'"/>'; |
|
| 521 | 521 | } |
| 522 | 522 | } |
| 523 | 523 | $author_picture .= '</div>'; |
@@ -556,14 +556,14 @@ discard block |
||
| 556 | 556 | case 'profile': |
| 557 | 557 | case 'user': |
| 558 | 558 | $node = $variables['result']['node']; |
| 559 | - $variables['url'] = url('account/' . $node->is_uid); |
|
| 559 | + $variables['url'] = url('account/'.$node->is_uid); |
|
| 560 | 560 | $variables['title'] = $node->tos_name; |
| 561 | 561 | $variables['user_image'] = boincuser_get_user_profile_image($node->is_uid); |
| 562 | 562 | $variables['account'] = user_load($node->is_uid); |
| 563 | 563 | break; |
| 564 | 564 | case 'team': |
| 565 | 565 | $node = $variables['result']['node']; |
| 566 | - $variables['url'] = url('/community/teams/' . $node->entity_id);; |
|
| 566 | + $variables['url'] = url('/community/teams/'.$node->entity_id); ; |
|
| 567 | 567 | break; |
| 568 | 568 | case 'forum': |
| 569 | 569 | $node = $variables['result']['node']; |
@@ -581,7 +581,7 @@ discard block |
||
| 581 | 581 | // Parent forum topic title |
| 582 | 582 | $variables['parent_title'] = $drupalnode->title; |
| 583 | 583 | // Link to the parent forum topic |
| 584 | - $variables['parent_topic'] = l($drupalnode->title, drupal_get_path_alias('node/' . $nid) ); |
|
| 584 | + $variables['parent_topic'] = l($drupalnode->title, drupal_get_path_alias('node/'.$nid)); |
|
| 585 | 585 | // Get the taxonomy for the node, creates a link to the parent forum |
| 586 | 586 | $taxonomy = reset($drupalnode->taxonomy); |
| 587 | 587 | if ($vocab = taxonomy_vocabulary_load($taxonomy->vid)) { |
@@ -599,7 +599,7 @@ discard block |
||
| 599 | 599 | if (!arg(2)) { |
| 600 | 600 | $message = ''; |
| 601 | 601 | } |
| 602 | - return '<p>' . $message . '</p>'; |
|
| 602 | + return '<p>'.$message.'</p>'; |
|
| 603 | 603 | } |
| 604 | 604 | |
| 605 | 605 | /** |
@@ -615,11 +615,11 @@ discard block |
||
| 615 | 615 | |
| 616 | 616 | // Shorten the name when it is too long or it will break many tables. |
| 617 | 617 | if (drupal_strlen($name) > 20) { |
| 618 | - $name = drupal_substr($name, 0, 15) . '...'; |
|
| 618 | + $name = drupal_substr($name, 0, 15).'...'; |
|
| 619 | 619 | } |
| 620 | 620 | |
| 621 | 621 | if (user_access('access user profiles')) { |
| 622 | - $output = l($name, 'account/' . $object->uid, array('attributes' => array('title' => bts('View user profile.', array(), NULL, 'boinc:users-table')))); |
|
| 622 | + $output = l($name, 'account/'.$object->uid, array('attributes' => array('title' => bts('View user profile.', array(), NULL, 'boinc:users-table')))); |
|
| 623 | 623 | } |
| 624 | 624 | else { |
| 625 | 625 | $output = check_plain($name); |
@@ -637,7 +637,7 @@ discard block |
||
| 637 | 637 | $output = check_plain($object->name); |
| 638 | 638 | } |
| 639 | 639 | |
| 640 | - $output .= ' (' . bts('not verified', array(), NULL, 'boinc:user-not-found') . ')'; |
|
| 640 | + $output .= ' ('.bts('not verified', array(), NULL, 'boinc:user-not-found').')'; |
|
| 641 | 641 | } |
| 642 | 642 | else { |
| 643 | 643 | $output = check_plain(variable_get('anonymous', bts('Anonymous', array(), NULL, 'boinc:anonymous-user'))); |
@@ -650,7 +650,7 @@ discard block |
||
| 650 | 650 | * Remove the link under text areas that reads: |
| 651 | 651 | * "More information about formatting options" |
| 652 | 652 | */ |
| 653 | -function boinc_filter_tips_more_info () { |
|
| 653 | +function boinc_filter_tips_more_info() { |
|
| 654 | 654 | return ''; |
| 655 | 655 | } |
| 656 | 656 | |
@@ -692,8 +692,8 @@ discard block |
||
| 692 | 692 | The !site team', array( |
| 693 | 693 | '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
| 694 | 694 | '!site' => variable_get('site_name', 'Drupal-BOINC'), |
| 695 | - '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '', |
|
| 696 | - '!link' => url('account/'. $sender->uid, array('absolute' => TRUE)), |
|
| 695 | + '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message').': '.$flag->friend_message : '', |
|
| 696 | + '!link' => url('account/'.$sender->uid, array('absolute' => TRUE)), |
|
| 697 | 697 | ), array(), NULL, 'boinc:friend-request-email'); |
| 698 | 698 | break; |
| 699 | 699 | |
@@ -711,7 +711,7 @@ discard block |
||
| 711 | 711 | The !site team', array( |
| 712 | 712 | '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
| 713 | 713 | '!site' => variable_get('site_name', 'Drupal-BOINC'), |
| 714 | - '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '', |
|
| 714 | + '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message').': '.$flag->friend_message : '', |
|
| 715 | 715 | '!link' => url('goto/friend-requests', array('absolute' => TRUE)), |
| 716 | 716 | ), |
| 717 | 717 | array(), NULL, 'boinc:friend-request-email'); |
@@ -724,13 +724,13 @@ discard block |
||
| 724 | 724 | * Edit action links |
| 725 | 725 | */ |
| 726 | 726 | function phptemplate_links($links, $attributes = array('class' => 'links')) { |
| 727 | - if ($links){ |
|
| 727 | + if ($links) { |
|
| 728 | 728 | // Remove flag-subscriptions link. It will be placed elsewhere. |
| 729 | 729 | if (isset($links['flag-subscriptions'])) { |
| 730 | 730 | unset($links['flag-subscriptions']); |
| 731 | 731 | } |
| 732 | 732 | // Reorder the links however you need them. |
| 733 | - $links = reorder_links($links, array('comment_edit','quote','comment_add','comment_reply','flag-abuse_comment','flag-abuse_node'), array('comment_delete')); |
|
| 733 | + $links = reorder_links($links, array('comment_edit', 'quote', 'comment_add', 'comment_reply', 'flag-abuse_comment', 'flag-abuse_node'), array('comment_delete')); |
|
| 734 | 734 | // Use the built-in theme_links() function to format the $links array. |
| 735 | 735 | return theme_links($links, $attributes); |
| 736 | 736 | } |
@@ -813,7 +813,7 @@ discard block |
||
| 813 | 813 | // are the class attribute for the <li> tags. |
| 814 | 814 | $dom = new DOMDocument; |
| 815 | 815 | $dom->loadHTML(mb_convert_encoding($links, 'HTML-ENTITIES', 'UTF-8')); |
| 816 | - foreach($dom->getElementsByTagName('li') as $node) { |
|
| 816 | + foreach ($dom->getElementsByTagName('li') as $node) { |
|
| 817 | 817 | $key = $node->getAttribute("class"); |
| 818 | 818 | $alllinks[$key] = $dom->saveHTML($node); |
| 819 | 819 | } |
@@ -826,7 +826,7 @@ discard block |
||
| 826 | 826 | "hide", "unhide", |
| 827 | 827 | "comment_delete", |
| 828 | 828 | ); |
| 829 | - foreach(array_keys($alllinks) as $key1) { |
|
| 829 | + foreach (array_keys($alllinks) as $key1) { |
|
| 830 | 830 | // Select string up to first space, if present. |
| 831 | 831 | $class1 = strtok($key1, ' '); |
| 832 | 832 | if (in_array($class1, $selected_classes)) { |
@@ -855,7 +855,7 @@ discard block |
||
| 855 | 855 | $dom->loadHTML(mb_convert_encoding($alink, 'HTML-ENTITIES', 'UTF-8')); |
| 856 | 856 | |
| 857 | 857 | $myli = $dom->getElementsByTagName('li'); |
| 858 | - if ($myli->length>0) { |
|
| 858 | + if ($myli->length > 0) { |
|
| 859 | 859 | $newclasses = trim(($myli[0]->getAttribute("class"))." first"); |
| 860 | 860 | $myli[0]->setAttribute("class", $newclasses); |
| 861 | 861 | $alink = $dom->saveHTML($myli[0]); |
@@ -872,13 +872,13 @@ discard block |
||
| 872 | 872 | |
| 873 | 873 | $output = '<ul class="menu"><li class="first">'; |
| 874 | 874 | if ($user->uid) { |
| 875 | - $output .= '<a href="' . url('logout') . '">' . bts('Logout', array(), NULL, 'boinc:menu-link') . '</a>'; |
|
| 875 | + $output .= '<a href="'.url('logout').'">'.bts('Logout', array(), NULL, 'boinc:menu-link').'</a>'; |
|
| 876 | 876 | } else { |
| 877 | - $output .= '<a href="' . url('user/login', array('query' => drupal_get_destination()) ) . '">' . bts('Login', array(), NULL, 'boinc:menu-link') . '</a>'; |
|
| 877 | + $output .= '<a href="'.url('user/login', array('query' => drupal_get_destination())).'">'.bts('Login', array(), NULL, 'boinc:menu-link').'</a>'; |
|
| 878 | 878 | } |
| 879 | 879 | $output .= '</li>'; |
| 880 | 880 | if (module_exists('global_search') OR module_exists('global_search_solr')) { |
| 881 | - $output .= '<li class="last"> <a class="search" href="' . url('search/site') . '">' . bts('search', array(), NULL, 'boinc:menu-link') .'</a> </l1>'; |
|
| 881 | + $output .= '<li class="last"> <a class="search" href="'.url('search/site').'">'.bts('search', array(), NULL, 'boinc:menu-link').'</a> </l1>'; |
|
| 882 | 882 | } |
| 883 | 883 | $output .= '</ul>'; |
| 884 | 884 | return $output; |
@@ -905,8 +905,8 @@ discard block |
||
| 905 | 905 | if ($ignored[$object->uid] == 0) { |
| 906 | 906 | $links['ignore_user'] = array( |
| 907 | 907 | 'title' => bts('Ignore user', array(), NULL, 'boinc:ignore-user-add'), |
| 908 | - 'href' => 'account/prefs/privacy/ignore_user/add/'. $object->uid, |
|
| 909 | - 'query' => 'destination='. $_GET['q'], |
|
| 908 | + 'href' => 'account/prefs/privacy/ignore_user/add/'.$object->uid, |
|
| 909 | + 'query' => 'destination='.$_GET['q'], |
|
| 910 | 910 | 'attributes' => array( |
| 911 | 911 | 'class' => 'ignore-user', |
| 912 | 912 | 'title' => bts('Add user to your ignore list', array(), NULL, 'boinc:ignore-user-add'), |
@@ -921,8 +921,8 @@ discard block |
||
| 921 | 921 | if ($ignored[$object->uid] == 0) { |
| 922 | 922 | $links['ignore_user'] = array( |
| 923 | 923 | 'title' => bts('Ignore user', array(), NULL, 'boinc:ignore-user-add'), |
| 924 | - 'href' => 'account/prefs/privacy/ignore_user/add/'. $object->uid, |
|
| 925 | - 'query' => 'destination='. $_GET['q'], |
|
| 924 | + 'href' => 'account/prefs/privacy/ignore_user/add/'.$object->uid, |
|
| 925 | + 'query' => 'destination='.$_GET['q'], |
|
| 926 | 926 | 'attributes' => array( |
| 927 | 927 | 'class' => 'ignore-user', |
| 928 | 928 | 'title' => bts('Add user to your ignore list', array(), NULL, 'boinc:ignore-user-add'), |
@@ -4,41 +4,41 @@ discard block |
||
| 4 | 4 | * Implementation of hook_content_default_fields(). |
| 5 | 5 | */ |
| 6 | 6 | function user_profiles_content_default_fields() { |
| 7 | - $fields = array(); |
|
| 7 | + $fields = array(); |
|
| 8 | 8 | |
| 9 | - // Exported field: field_background |
|
| 10 | - $fields['profile-field_background'] = array( |
|
| 9 | + // Exported field: field_background |
|
| 10 | + $fields['profile-field_background'] = array( |
|
| 11 | 11 | 'field_name' => 'field_background', |
| 12 | 12 | 'type_name' => 'profile', |
| 13 | 13 | 'display_settings' => array( |
| 14 | - 'label' => array( |
|
| 14 | + 'label' => array( |
|
| 15 | 15 | 'format' => 'above', |
| 16 | 16 | 'exclude' => 0, |
| 17 | - ), |
|
| 18 | - 'teaser' => array( |
|
| 17 | + ), |
|
| 18 | + 'teaser' => array( |
|
| 19 | 19 | 'format' => 'default', |
| 20 | 20 | 'exclude' => 0, |
| 21 | - ), |
|
| 22 | - 'full' => array( |
|
| 21 | + ), |
|
| 22 | + 'full' => array( |
|
| 23 | 23 | 'format' => 'default', |
| 24 | 24 | 'exclude' => 0, |
| 25 | - ), |
|
| 26 | - '4' => array( |
|
| 25 | + ), |
|
| 26 | + '4' => array( |
|
| 27 | 27 | 'format' => 'default', |
| 28 | 28 | 'exclude' => 0, |
| 29 | - ), |
|
| 30 | - '2' => array( |
|
| 29 | + ), |
|
| 30 | + '2' => array( |
|
| 31 | 31 | 'format' => 'default', |
| 32 | 32 | 'exclude' => 0, |
| 33 | - ), |
|
| 34 | - '3' => array( |
|
| 33 | + ), |
|
| 34 | + '3' => array( |
|
| 35 | 35 | 'format' => 'default', |
| 36 | 36 | 'exclude' => 0, |
| 37 | - ), |
|
| 38 | - 'token' => array( |
|
| 37 | + ), |
|
| 38 | + 'token' => array( |
|
| 39 | 39 | 'format' => 'default', |
| 40 | 40 | 'exclude' => 0, |
| 41 | - ), |
|
| 41 | + ), |
|
| 42 | 42 | ), |
| 43 | 43 | 'widget_active' => '1', |
| 44 | 44 | 'type' => 'text', |
@@ -51,56 +51,56 @@ discard block |
||
| 51 | 51 | 'allowed_values' => '', |
| 52 | 52 | 'allowed_values_php' => '', |
| 53 | 53 | 'widget' => array( |
| 54 | - 'rows' => '10', |
|
| 55 | - 'size' => 60, |
|
| 56 | - 'default_value' => array( |
|
| 54 | + 'rows' => '10', |
|
| 55 | + 'size' => 60, |
|
| 56 | + 'default_value' => array( |
|
| 57 | 57 | '0' => array( |
| 58 | - 'value' => '', |
|
| 59 | - '_error_element' => 'default_value_widget][field_background][0][value', |
|
| 60 | - ), |
|
| 61 | - ), |
|
| 62 | - 'default_value_php' => NULL, |
|
| 63 | - 'label' => bts('Your personal background', array(), NULL, 'boinc:account-profile-edit'), |
|
| 64 | - 'weight' => '3', |
|
| 65 | - 'description' => bts('Tell us about yourself. You could tell us where you\'re from, your age, occupation, hobbies, or anything else about yourself.', array(), NULL, 'boinc:account-profile-edit'), |
|
| 66 | - 'type' => 'text_textarea', |
|
| 67 | - 'module' => 'text', |
|
| 58 | + 'value' => '', |
|
| 59 | + '_error_element' => 'default_value_widget][field_background][0][value', |
|
| 60 | + ), |
|
| 61 | + ), |
|
| 62 | + 'default_value_php' => NULL, |
|
| 63 | + 'label' => bts('Your personal background', array(), NULL, 'boinc:account-profile-edit'), |
|
| 64 | + 'weight' => '3', |
|
| 65 | + 'description' => bts('Tell us about yourself. You could tell us where you\'re from, your age, occupation, hobbies, or anything else about yourself.', array(), NULL, 'boinc:account-profile-edit'), |
|
| 66 | + 'type' => 'text_textarea', |
|
| 67 | + 'module' => 'text', |
|
| 68 | 68 | ), |
| 69 | - ); |
|
| 69 | + ); |
|
| 70 | 70 | |
| 71 | - // Exported field: field_country |
|
| 72 | - $fields['profile-field_country'] = array( |
|
| 71 | + // Exported field: field_country |
|
| 72 | + $fields['profile-field_country'] = array( |
|
| 73 | 73 | 'field_name' => 'field_country', |
| 74 | 74 | 'type_name' => 'profile', |
| 75 | 75 | 'display_settings' => array( |
| 76 | - 'label' => array( |
|
| 76 | + 'label' => array( |
|
| 77 | 77 | 'format' => 'above', |
| 78 | 78 | 'exclude' => 0, |
| 79 | - ), |
|
| 80 | - 'teaser' => array( |
|
| 79 | + ), |
|
| 80 | + 'teaser' => array( |
|
| 81 | 81 | 'format' => 'default', |
| 82 | 82 | 'exclude' => 0, |
| 83 | - ), |
|
| 84 | - 'full' => array( |
|
| 83 | + ), |
|
| 84 | + 'full' => array( |
|
| 85 | 85 | 'format' => 'default', |
| 86 | 86 | 'exclude' => 0, |
| 87 | - ), |
|
| 88 | - '4' => array( |
|
| 87 | + ), |
|
| 88 | + '4' => array( |
|
| 89 | 89 | 'format' => 'default', |
| 90 | 90 | 'exclude' => 0, |
| 91 | - ), |
|
| 92 | - '2' => array( |
|
| 91 | + ), |
|
| 92 | + '2' => array( |
|
| 93 | 93 | 'format' => 'default', |
| 94 | 94 | 'exclude' => 0, |
| 95 | - ), |
|
| 96 | - '3' => array( |
|
| 95 | + ), |
|
| 96 | + '3' => array( |
|
| 97 | 97 | 'format' => 'default', |
| 98 | 98 | 'exclude' => 0, |
| 99 | - ), |
|
| 100 | - 'token' => array( |
|
| 99 | + ), |
|
| 100 | + 'token' => array( |
|
| 101 | 101 | 'format' => 'default', |
| 102 | 102 | 'exclude' => 0, |
| 103 | - ), |
|
| 103 | + ), |
|
| 104 | 104 | ), |
| 105 | 105 | 'widget_active' => '1', |
| 106 | 106 | 'type' => 'text', |
@@ -345,53 +345,53 @@ discard block |
||
| 345 | 345 | Zimbabwe|Zimbabwe', |
| 346 | 346 | 'allowed_values_php' => 'return boinccore_get_country_list();', |
| 347 | 347 | 'widget' => array( |
| 348 | - 'default_value' => array( |
|
| 348 | + 'default_value' => array( |
|
| 349 | 349 | '0' => array( |
| 350 | - 'value' => '', |
|
| 351 | - ), |
|
| 352 | - ), |
|
| 353 | - 'default_value_php' => NULL, |
|
| 354 | - 'label' => 'Country', |
|
| 355 | - 'weight' => '5', |
|
| 356 | - 'description' => '', |
|
| 357 | - 'type' => 'optionwidgets_select', |
|
| 358 | - 'module' => 'optionwidgets', |
|
| 350 | + 'value' => '', |
|
| 351 | + ), |
|
| 352 | + ), |
|
| 353 | + 'default_value_php' => NULL, |
|
| 354 | + 'label' => 'Country', |
|
| 355 | + 'weight' => '5', |
|
| 356 | + 'description' => '', |
|
| 357 | + 'type' => 'optionwidgets_select', |
|
| 358 | + 'module' => 'optionwidgets', |
|
| 359 | 359 | ), |
| 360 | - ); |
|
| 360 | + ); |
|
| 361 | 361 | |
| 362 | - // Exported field: field_image |
|
| 363 | - $fields['profile-field_image'] = array( |
|
| 362 | + // Exported field: field_image |
|
| 363 | + $fields['profile-field_image'] = array( |
|
| 364 | 364 | 'field_name' => 'field_image', |
| 365 | 365 | 'type_name' => 'profile', |
| 366 | 366 | 'display_settings' => array( |
| 367 | - 'label' => array( |
|
| 367 | + 'label' => array( |
|
| 368 | 368 | 'format' => 'above', |
| 369 | 369 | 'exclude' => 0, |
| 370 | - ), |
|
| 371 | - 'teaser' => array( |
|
| 370 | + ), |
|
| 371 | + 'teaser' => array( |
|
| 372 | 372 | 'format' => 'image_plain', |
| 373 | 373 | 'exclude' => 0, |
| 374 | - ), |
|
| 375 | - 'full' => array( |
|
| 374 | + ), |
|
| 375 | + 'full' => array( |
|
| 376 | 376 | 'format' => 'image_plain', |
| 377 | 377 | 'exclude' => 0, |
| 378 | - ), |
|
| 379 | - '4' => array( |
|
| 378 | + ), |
|
| 379 | + '4' => array( |
|
| 380 | 380 | 'format' => 'image_plain', |
| 381 | 381 | 'exclude' => 0, |
| 382 | - ), |
|
| 383 | - '2' => array( |
|
| 382 | + ), |
|
| 383 | + '2' => array( |
|
| 384 | 384 | 'format' => 'image_plain', |
| 385 | 385 | 'exclude' => 0, |
| 386 | - ), |
|
| 387 | - '3' => array( |
|
| 386 | + ), |
|
| 387 | + '3' => array( |
|
| 388 | 388 | 'format' => 'image_plain', |
| 389 | 389 | 'exclude' => 0, |
| 390 | - ), |
|
| 391 | - 'token' => array( |
|
| 390 | + ), |
|
| 391 | + 'token' => array( |
|
| 392 | 392 | 'format' => 'image_plain', |
| 393 | 393 | 'exclude' => 0, |
| 394 | - ), |
|
| 394 | + ), |
|
| 395 | 395 | ), |
| 396 | 396 | 'widget_active' => '1', |
| 397 | 397 | 'type' => 'filefield', |
@@ -403,19 +403,19 @@ discard block |
||
| 403 | 403 | 'list_default' => 1, |
| 404 | 404 | 'description_field' => '0', |
| 405 | 405 | 'widget' => array( |
| 406 | - 'file_extensions' => 'png gif jpg jpeg', |
|
| 407 | - 'file_path' => 'profiles', |
|
| 408 | - 'progress_indicator' => 'bar', |
|
| 409 | - 'max_filesize_per_file' => '512K', |
|
| 410 | - 'max_filesize_per_node' => '', |
|
| 411 | - 'max_resolution' => '300x300', |
|
| 412 | - 'min_resolution' => '50x50', |
|
| 413 | - 'alt' => '', |
|
| 414 | - 'custom_alt' => 0, |
|
| 415 | - 'title' => '', |
|
| 416 | - 'custom_title' => 0, |
|
| 417 | - 'title_type' => 'textfield', |
|
| 418 | - 'default_image' => array( |
|
| 406 | + 'file_extensions' => 'png gif jpg jpeg', |
|
| 407 | + 'file_path' => 'profiles', |
|
| 408 | + 'progress_indicator' => 'bar', |
|
| 409 | + 'max_filesize_per_file' => '512K', |
|
| 410 | + 'max_filesize_per_node' => '', |
|
| 411 | + 'max_resolution' => '300x300', |
|
| 412 | + 'min_resolution' => '50x50', |
|
| 413 | + 'alt' => '', |
|
| 414 | + 'custom_alt' => 0, |
|
| 415 | + 'title' => '', |
|
| 416 | + 'custom_title' => 0, |
|
| 417 | + 'title_type' => 'textfield', |
|
| 418 | + 'default_image' => array( |
|
| 419 | 419 | 'filename' => 'default-avatar.png', |
| 420 | 420 | 'filepath' => 'sites/default/files/imagefield_default_images/default-avatar.png', |
| 421 | 421 | 'filemime' => 'image/png', |
@@ -426,49 +426,49 @@ discard block |
||
| 426 | 426 | 'status' => 1, |
| 427 | 427 | 'timestamp' => 1347855344, |
| 428 | 428 | 'fid' => '1', |
| 429 | - ), |
|
| 430 | - 'use_default_image' => 1, |
|
| 431 | - 'label' => 'Avatar', |
|
| 432 | - 'weight' => '7', |
|
| 433 | - 'description' => '', |
|
| 434 | - 'type' => 'imagefield_widget', |
|
| 435 | - 'module' => 'imagefield', |
|
| 429 | + ), |
|
| 430 | + 'use_default_image' => 1, |
|
| 431 | + 'label' => 'Avatar', |
|
| 432 | + 'weight' => '7', |
|
| 433 | + 'description' => '', |
|
| 434 | + 'type' => 'imagefield_widget', |
|
| 435 | + 'module' => 'imagefield', |
|
| 436 | 436 | ), |
| 437 | - ); |
|
| 437 | + ); |
|
| 438 | 438 | |
| 439 | - // Exported field: field_opinions |
|
| 440 | - $fields['profile-field_opinions'] = array( |
|
| 439 | + // Exported field: field_opinions |
|
| 440 | + $fields['profile-field_opinions'] = array( |
|
| 441 | 441 | 'field_name' => 'field_opinions', |
| 442 | 442 | 'type_name' => 'profile', |
| 443 | 443 | 'display_settings' => array( |
| 444 | - 'label' => array( |
|
| 444 | + 'label' => array( |
|
| 445 | 445 | 'format' => 'above', |
| 446 | 446 | 'exclude' => 0, |
| 447 | - ), |
|
| 448 | - 'teaser' => array( |
|
| 447 | + ), |
|
| 448 | + 'teaser' => array( |
|
| 449 | 449 | 'format' => 'default', |
| 450 | 450 | 'exclude' => 0, |
| 451 | - ), |
|
| 452 | - 'full' => array( |
|
| 451 | + ), |
|
| 452 | + 'full' => array( |
|
| 453 | 453 | 'format' => 'default', |
| 454 | 454 | 'exclude' => 0, |
| 455 | - ), |
|
| 456 | - '4' => array( |
|
| 455 | + ), |
|
| 456 | + '4' => array( |
|
| 457 | 457 | 'format' => 'default', |
| 458 | 458 | 'exclude' => 0, |
| 459 | - ), |
|
| 460 | - '2' => array( |
|
| 459 | + ), |
|
| 460 | + '2' => array( |
|
| 461 | 461 | 'format' => 'default', |
| 462 | 462 | 'exclude' => 0, |
| 463 | - ), |
|
| 464 | - '3' => array( |
|
| 463 | + ), |
|
| 464 | + '3' => array( |
|
| 465 | 465 | 'format' => 'default', |
| 466 | 466 | 'exclude' => 0, |
| 467 | - ), |
|
| 468 | - 'token' => array( |
|
| 467 | + ), |
|
| 468 | + 'token' => array( |
|
| 469 | 469 | 'format' => 'default', |
| 470 | 470 | 'exclude' => 0, |
| 471 | - ), |
|
| 471 | + ), |
|
| 472 | 472 | ), |
| 473 | 473 | 'widget_active' => '1', |
| 474 | 474 | 'type' => 'text', |
@@ -481,60 +481,60 @@ discard block |
||
| 481 | 481 | 'allowed_values' => '', |
| 482 | 482 | 'allowed_values_php' => '', |
| 483 | 483 | 'widget' => array( |
| 484 | - 'rows' => '10', |
|
| 485 | - 'size' => 60, |
|
| 486 | - 'default_value' => array( |
|
| 484 | + 'rows' => '10', |
|
| 485 | + 'size' => 60, |
|
| 486 | + 'default_value' => array( |
|
| 487 | 487 | '0' => array( |
| 488 | - 'value' => '', |
|
| 489 | - '_error_element' => 'default_value_widget][field_opinions][0][value', |
|
| 490 | - ), |
|
| 491 | - ), |
|
| 492 | - 'default_value_php' => NULL, |
|
| 493 | - 'label' => bts('Your opinions about this project', array(), NULL, 'boinc:account-profile-edit'), |
|
| 494 | - 'weight' => '4', |
|
| 495 | - 'description' => bts('Tell us your thoughts about @this_project |
|
| 488 | + 'value' => '', |
|
| 489 | + '_error_element' => 'default_value_widget][field_opinions][0][value', |
|
| 490 | + ), |
|
| 491 | + ), |
|
| 492 | + 'default_value_php' => NULL, |
|
| 493 | + 'label' => bts('Your opinions about this project', array(), NULL, 'boinc:account-profile-edit'), |
|
| 494 | + 'weight' => '4', |
|
| 495 | + 'description' => bts('Tell us your thoughts about @this_project |
|
| 496 | 496 | 1. Why do you run @this_project? |
| 497 | 497 | 2. What are your views about the project? |
| 498 | 498 | 3. Any suggestions?', |
| 499 | - array('@this_project' => variable_get('site_name', 'Drupal-BOINC')), NULL, 'boinc:account-profile-edit'), |
|
| 500 | - 'type' => 'text_textarea', |
|
| 501 | - 'module' => 'text', |
|
| 499 | + array('@this_project' => variable_get('site_name', 'Drupal-BOINC')), NULL, 'boinc:account-profile-edit'), |
|
| 500 | + 'type' => 'text_textarea', |
|
| 501 | + 'module' => 'text', |
|
| 502 | 502 | ), |
| 503 | - ); |
|
| 503 | + ); |
|
| 504 | 504 | |
| 505 | - // Exported field: field_profile_image |
|
| 506 | - $fields['profile-field_profile_image'] = array( |
|
| 505 | + // Exported field: field_profile_image |
|
| 506 | + $fields['profile-field_profile_image'] = array( |
|
| 507 | 507 | 'field_name' => 'field_profile_image', |
| 508 | 508 | 'type_name' => 'profile', |
| 509 | 509 | 'display_settings' => array( |
| 510 | - 'label' => array( |
|
| 510 | + 'label' => array( |
|
| 511 | 511 | 'format' => 'above', |
| 512 | 512 | 'exclude' => 0, |
| 513 | - ), |
|
| 514 | - 'teaser' => array( |
|
| 513 | + ), |
|
| 514 | + 'teaser' => array( |
|
| 515 | 515 | 'format' => 'image_plain', |
| 516 | 516 | 'exclude' => 0, |
| 517 | - ), |
|
| 518 | - 'full' => array( |
|
| 517 | + ), |
|
| 518 | + 'full' => array( |
|
| 519 | 519 | 'format' => 'image_plain', |
| 520 | 520 | 'exclude' => 0, |
| 521 | - ), |
|
| 522 | - '4' => array( |
|
| 521 | + ), |
|
| 522 | + '4' => array( |
|
| 523 | 523 | 'format' => 'image_plain', |
| 524 | 524 | 'exclude' => 0, |
| 525 | - ), |
|
| 526 | - '2' => array( |
|
| 525 | + ), |
|
| 526 | + '2' => array( |
|
| 527 | 527 | 'format' => 'image_plain', |
| 528 | 528 | 'exclude' => 0, |
| 529 | - ), |
|
| 530 | - '3' => array( |
|
| 529 | + ), |
|
| 530 | + '3' => array( |
|
| 531 | 531 | 'format' => 'image_plain', |
| 532 | 532 | 'exclude' => 0, |
| 533 | - ), |
|
| 534 | - 'token' => array( |
|
| 533 | + ), |
|
| 534 | + 'token' => array( |
|
| 535 | 535 | 'format' => 'image_plain', |
| 536 | 536 | 'exclude' => 0, |
| 537 | - ), |
|
| 537 | + ), |
|
| 538 | 538 | ), |
| 539 | 539 | 'widget_active' => '1', |
| 540 | 540 | 'type' => 'filefield', |
@@ -546,19 +546,19 @@ discard block |
||
| 546 | 546 | 'list_default' => 1, |
| 547 | 547 | 'description_field' => '0', |
| 548 | 548 | 'widget' => array( |
| 549 | - 'file_extensions' => 'png gif jpg jpeg', |
|
| 550 | - 'file_path' => 'profiles', |
|
| 551 | - 'progress_indicator' => 'bar', |
|
| 552 | - 'max_filesize_per_file' => '512K', |
|
| 553 | - 'max_filesize_per_node' => '', |
|
| 554 | - 'max_resolution' => '640x480', |
|
| 555 | - 'min_resolution' => '100x100', |
|
| 556 | - 'alt' => '', |
|
| 557 | - 'custom_alt' => 0, |
|
| 558 | - 'title' => '', |
|
| 559 | - 'custom_title' => 0, |
|
| 560 | - 'title_type' => 'textfield', |
|
| 561 | - 'default_image' => array( |
|
| 549 | + 'file_extensions' => 'png gif jpg jpeg', |
|
| 550 | + 'file_path' => 'profiles', |
|
| 551 | + 'progress_indicator' => 'bar', |
|
| 552 | + 'max_filesize_per_file' => '512K', |
|
| 553 | + 'max_filesize_per_node' => '', |
|
| 554 | + 'max_resolution' => '640x480', |
|
| 555 | + 'min_resolution' => '100x100', |
|
| 556 | + 'alt' => '', |
|
| 557 | + 'custom_alt' => 0, |
|
| 558 | + 'title' => '', |
|
| 559 | + 'custom_title' => 0, |
|
| 560 | + 'title_type' => 'textfield', |
|
| 561 | + 'default_image' => array( |
|
| 562 | 562 | 'filename' => 'default-user.png', |
| 563 | 563 | 'filepath' => 'sites/default/files/imagefield_default_images/default-user.png', |
| 564 | 564 | 'filemime' => 'image/png', |
@@ -569,49 +569,49 @@ discard block |
||
| 569 | 569 | 'status' => 1, |
| 570 | 570 | 'timestamp' => 1362770990, |
| 571 | 571 | 'fid' => '5', |
| 572 | - ), |
|
| 573 | - 'use_default_image' => 1, |
|
| 574 | - 'label' => 'Profile image', |
|
| 575 | - 'weight' => '8', |
|
| 576 | - 'description' => '', |
|
| 577 | - 'type' => 'imagefield_widget', |
|
| 578 | - 'module' => 'imagefield', |
|
| 572 | + ), |
|
| 573 | + 'use_default_image' => 1, |
|
| 574 | + 'label' => 'Profile image', |
|
| 575 | + 'weight' => '8', |
|
| 576 | + 'description' => '', |
|
| 577 | + 'type' => 'imagefield_widget', |
|
| 578 | + 'module' => 'imagefield', |
|
| 579 | 579 | ), |
| 580 | - ); |
|
| 580 | + ); |
|
| 581 | 581 | |
| 582 | - // Exported field: field_url |
|
| 583 | - $fields['profile-field_url'] = array( |
|
| 582 | + // Exported field: field_url |
|
| 583 | + $fields['profile-field_url'] = array( |
|
| 584 | 584 | 'field_name' => 'field_url', |
| 585 | 585 | 'type_name' => 'profile', |
| 586 | 586 | 'display_settings' => array( |
| 587 | - 'label' => array( |
|
| 587 | + 'label' => array( |
|
| 588 | 588 | 'format' => 'above', |
| 589 | 589 | 'exclude' => 0, |
| 590 | - ), |
|
| 591 | - 'teaser' => array( |
|
| 590 | + ), |
|
| 591 | + 'teaser' => array( |
|
| 592 | 592 | 'format' => 'default', |
| 593 | 593 | 'exclude' => 0, |
| 594 | - ), |
|
| 595 | - 'full' => array( |
|
| 594 | + ), |
|
| 595 | + 'full' => array( |
|
| 596 | 596 | 'format' => 'default', |
| 597 | 597 | 'exclude' => 0, |
| 598 | - ), |
|
| 599 | - '4' => array( |
|
| 598 | + ), |
|
| 599 | + '4' => array( |
|
| 600 | 600 | 'format' => 'default', |
| 601 | 601 | 'exclude' => 0, |
| 602 | - ), |
|
| 603 | - '2' => array( |
|
| 602 | + ), |
|
| 603 | + '2' => array( |
|
| 604 | 604 | 'format' => 'default', |
| 605 | 605 | 'exclude' => 0, |
| 606 | - ), |
|
| 607 | - '3' => array( |
|
| 606 | + ), |
|
| 607 | + '3' => array( |
|
| 608 | 608 | 'format' => 'default', |
| 609 | 609 | 'exclude' => 0, |
| 610 | - ), |
|
| 611 | - 'token' => array( |
|
| 610 | + ), |
|
| 611 | + 'token' => array( |
|
| 612 | 612 | 'format' => 'default', |
| 613 | 613 | 'exclude' => 0, |
| 614 | - ), |
|
| 614 | + ), |
|
| 615 | 615 | ), |
| 616 | 616 | 'widget_active' => '1', |
| 617 | 617 | 'type' => 'text', |
@@ -624,56 +624,56 @@ discard block |
||
| 624 | 624 | 'allowed_values' => '', |
| 625 | 625 | 'allowed_values_php' => '', |
| 626 | 626 | 'widget' => array( |
| 627 | - 'rows' => 5, |
|
| 628 | - 'size' => '42', |
|
| 629 | - 'default_value' => array( |
|
| 627 | + 'rows' => 5, |
|
| 628 | + 'size' => '42', |
|
| 629 | + 'default_value' => array( |
|
| 630 | 630 | '0' => array( |
| 631 | - 'value' => '', |
|
| 632 | - '_error_element' => 'default_value_widget][field_url][0][value', |
|
| 633 | - ), |
|
| 634 | - ), |
|
| 635 | - 'default_value_php' => NULL, |
|
| 636 | - 'label' => 'Website URL', |
|
| 637 | - 'weight' => '9', |
|
| 638 | - 'description' => '', |
|
| 639 | - 'type' => 'text_textfield', |
|
| 640 | - 'module' => 'text', |
|
| 631 | + 'value' => '', |
|
| 632 | + '_error_element' => 'default_value_widget][field_url][0][value', |
|
| 633 | + ), |
|
| 634 | + ), |
|
| 635 | + 'default_value_php' => NULL, |
|
| 636 | + 'label' => 'Website URL', |
|
| 637 | + 'weight' => '9', |
|
| 638 | + 'description' => '', |
|
| 639 | + 'type' => 'text_textfield', |
|
| 640 | + 'module' => 'text', |
|
| 641 | 641 | ), |
| 642 | - ); |
|
| 642 | + ); |
|
| 643 | 643 | |
| 644 | - // Exported field: field_zip |
|
| 645 | - $fields['profile-field_zip'] = array( |
|
| 644 | + // Exported field: field_zip |
|
| 645 | + $fields['profile-field_zip'] = array( |
|
| 646 | 646 | 'field_name' => 'field_zip', |
| 647 | 647 | 'type_name' => 'profile', |
| 648 | 648 | 'display_settings' => array( |
| 649 | - 'label' => array( |
|
| 649 | + 'label' => array( |
|
| 650 | 650 | 'format' => 'above', |
| 651 | 651 | 'exclude' => 0, |
| 652 | - ), |
|
| 653 | - 'teaser' => array( |
|
| 652 | + ), |
|
| 653 | + 'teaser' => array( |
|
| 654 | 654 | 'format' => 'default', |
| 655 | 655 | 'exclude' => 0, |
| 656 | - ), |
|
| 657 | - 'full' => array( |
|
| 656 | + ), |
|
| 657 | + 'full' => array( |
|
| 658 | 658 | 'format' => 'default', |
| 659 | 659 | 'exclude' => 0, |
| 660 | - ), |
|
| 661 | - '4' => array( |
|
| 660 | + ), |
|
| 661 | + '4' => array( |
|
| 662 | 662 | 'format' => 'default', |
| 663 | 663 | 'exclude' => 0, |
| 664 | - ), |
|
| 665 | - '2' => array( |
|
| 664 | + ), |
|
| 665 | + '2' => array( |
|
| 666 | 666 | 'format' => 'default', |
| 667 | 667 | 'exclude' => 0, |
| 668 | - ), |
|
| 669 | - '3' => array( |
|
| 668 | + ), |
|
| 669 | + '3' => array( |
|
| 670 | 670 | 'format' => 'default', |
| 671 | 671 | 'exclude' => 0, |
| 672 | - ), |
|
| 673 | - 'token' => array( |
|
| 672 | + ), |
|
| 673 | + 'token' => array( |
|
| 674 | 674 | 'format' => 'default', |
| 675 | 675 | 'exclude' => 0, |
| 676 | - ), |
|
| 676 | + ), |
|
| 677 | 677 | ), |
| 678 | 678 | 'widget_active' => '1', |
| 679 | 679 | 'type' => 'text', |
@@ -686,32 +686,32 @@ discard block |
||
| 686 | 686 | 'allowed_values' => '', |
| 687 | 687 | 'allowed_values_php' => '', |
| 688 | 688 | 'widget' => array( |
| 689 | - 'rows' => 5, |
|
| 690 | - 'size' => '10', |
|
| 691 | - 'default_value' => array( |
|
| 689 | + 'rows' => 5, |
|
| 690 | + 'size' => '10', |
|
| 691 | + 'default_value' => array( |
|
| 692 | 692 | '0' => array( |
| 693 | - 'value' => '', |
|
| 694 | - '_error_element' => 'default_value_widget][field_zip][0][value', |
|
| 695 | - ), |
|
| 696 | - ), |
|
| 697 | - 'default_value_php' => NULL, |
|
| 698 | - 'label' => bts('Postal code', array(), NULL, 'boinc:account-profile-edit'), |
|
| 699 | - 'weight' => '6', |
|
| 700 | - 'description' => '', |
|
| 701 | - 'type' => 'text_textfield', |
|
| 702 | - 'module' => 'text', |
|
| 693 | + 'value' => '', |
|
| 694 | + '_error_element' => 'default_value_widget][field_zip][0][value', |
|
| 695 | + ), |
|
| 696 | + ), |
|
| 697 | + 'default_value_php' => NULL, |
|
| 698 | + 'label' => bts('Postal code', array(), NULL, 'boinc:account-profile-edit'), |
|
| 699 | + 'weight' => '6', |
|
| 700 | + 'description' => '', |
|
| 701 | + 'type' => 'text_textfield', |
|
| 702 | + 'module' => 'text', |
|
| 703 | 703 | ), |
| 704 | - ); |
|
| 704 | + ); |
|
| 705 | 705 | |
| 706 | - // Translatables |
|
| 707 | - // Use bts() function to translate additional strings. |
|
| 708 | - bts('Avatar', array(), NULL, 'boinc:account-profile-edit'); |
|
| 709 | - bts('Country', array(), NULL, 'boinc:country-of-origin'); |
|
| 710 | - bts('Profile image', array(), NULL, 'boinc:account-profile-edit'); |
|
| 711 | - bts('Website URL', array(), NULL, 'boinc:account-profile-edit'); |
|
| 712 | - bts('Your opinions about this project', array(), NULL, 'boinc:account-profile-edit'); |
|
| 713 | - bts('Your personal background', array(), NULL, 'boinc:account-profile-edit'); |
|
| 714 | - bts('Postal code', array(), NULL, 'boinc:account-profile-edit'); |
|
| 706 | + // Translatables |
|
| 707 | + // Use bts() function to translate additional strings. |
|
| 708 | + bts('Avatar', array(), NULL, 'boinc:account-profile-edit'); |
|
| 709 | + bts('Country', array(), NULL, 'boinc:country-of-origin'); |
|
| 710 | + bts('Profile image', array(), NULL, 'boinc:account-profile-edit'); |
|
| 711 | + bts('Website URL', array(), NULL, 'boinc:account-profile-edit'); |
|
| 712 | + bts('Your opinions about this project', array(), NULL, 'boinc:account-profile-edit'); |
|
| 713 | + bts('Your personal background', array(), NULL, 'boinc:account-profile-edit'); |
|
| 714 | + bts('Postal code', array(), NULL, 'boinc:account-profile-edit'); |
|
| 715 | 715 | |
| 716 | - return $fields; |
|
| 716 | + return $fields; |
|
| 717 | 717 | } |
@@ -59,10 +59,10 @@ discard block |
||
| 59 | 59 | '_error_element' => 'default_value_widget][field_background][0][value', |
| 60 | 60 | ), |
| 61 | 61 | ), |
| 62 | - 'default_value_php' => NULL, |
|
| 63 | - 'label' => bts('Your personal background', array(), NULL, 'boinc:account-profile-edit'), |
|
| 62 | + 'default_value_php' => null, |
|
| 63 | + 'label' => bts('Your personal background', array(), null, 'boinc:account-profile-edit'), |
|
| 64 | 64 | 'weight' => '3', |
| 65 | - 'description' => bts('Tell us about yourself. You could tell us where you\'re from, your age, occupation, hobbies, or anything else about yourself.', array(), NULL, 'boinc:account-profile-edit'), |
|
| 65 | + 'description' => bts('Tell us about yourself. You could tell us where you\'re from, your age, occupation, hobbies, or anything else about yourself.', array(), null, 'boinc:account-profile-edit'), |
|
| 66 | 66 | 'type' => 'text_textarea', |
| 67 | 67 | 'module' => 'text', |
| 68 | 68 | ), |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | 'value' => '', |
| 351 | 351 | ), |
| 352 | 352 | ), |
| 353 | - 'default_value_php' => NULL, |
|
| 353 | + 'default_value_php' => null, |
|
| 354 | 354 | 'label' => 'Country', |
| 355 | 355 | 'weight' => '5', |
| 356 | 356 | 'description' => '', |
@@ -489,14 +489,14 @@ discard block |
||
| 489 | 489 | '_error_element' => 'default_value_widget][field_opinions][0][value', |
| 490 | 490 | ), |
| 491 | 491 | ), |
| 492 | - 'default_value_php' => NULL, |
|
| 493 | - 'label' => bts('Your opinions about this project', array(), NULL, 'boinc:account-profile-edit'), |
|
| 492 | + 'default_value_php' => null, |
|
| 493 | + 'label' => bts('Your opinions about this project', array(), null, 'boinc:account-profile-edit'), |
|
| 494 | 494 | 'weight' => '4', |
| 495 | 495 | 'description' => bts('Tell us your thoughts about @this_project |
| 496 | 496 | 1. Why do you run @this_project? |
| 497 | 497 | 2. What are your views about the project? |
| 498 | 498 | 3. Any suggestions?', |
| 499 | - array('@this_project' => variable_get('site_name', 'Drupal-BOINC')), NULL, 'boinc:account-profile-edit'), |
|
| 499 | + array('@this_project' => variable_get('site_name', 'Drupal-BOINC')), null, 'boinc:account-profile-edit'), |
|
| 500 | 500 | 'type' => 'text_textarea', |
| 501 | 501 | 'module' => 'text', |
| 502 | 502 | ), |
@@ -632,7 +632,7 @@ discard block |
||
| 632 | 632 | '_error_element' => 'default_value_widget][field_url][0][value', |
| 633 | 633 | ), |
| 634 | 634 | ), |
| 635 | - 'default_value_php' => NULL, |
|
| 635 | + 'default_value_php' => null, |
|
| 636 | 636 | 'label' => 'Website URL', |
| 637 | 637 | 'weight' => '9', |
| 638 | 638 | 'description' => '', |
@@ -694,8 +694,8 @@ discard block |
||
| 694 | 694 | '_error_element' => 'default_value_widget][field_zip][0][value', |
| 695 | 695 | ), |
| 696 | 696 | ), |
| 697 | - 'default_value_php' => NULL, |
|
| 698 | - 'label' => bts('Postal code', array(), NULL, 'boinc:account-profile-edit'), |
|
| 697 | + 'default_value_php' => null, |
|
| 698 | + 'label' => bts('Postal code', array(), null, 'boinc:account-profile-edit'), |
|
| 699 | 699 | 'weight' => '6', |
| 700 | 700 | 'description' => '', |
| 701 | 701 | 'type' => 'text_textfield', |
@@ -705,13 +705,13 @@ discard block |
||
| 705 | 705 | |
| 706 | 706 | // Translatables |
| 707 | 707 | // Use bts() function to translate additional strings. |
| 708 | - bts('Avatar', array(), NULL, 'boinc:account-profile-edit'); |
|
| 709 | - bts('Country', array(), NULL, 'boinc:country-of-origin'); |
|
| 710 | - bts('Profile image', array(), NULL, 'boinc:account-profile-edit'); |
|
| 711 | - bts('Website URL', array(), NULL, 'boinc:account-profile-edit'); |
|
| 712 | - bts('Your opinions about this project', array(), NULL, 'boinc:account-profile-edit'); |
|
| 713 | - bts('Your personal background', array(), NULL, 'boinc:account-profile-edit'); |
|
| 714 | - bts('Postal code', array(), NULL, 'boinc:account-profile-edit'); |
|
| 708 | + bts('Avatar', array(), null, 'boinc:account-profile-edit'); |
|
| 709 | + bts('Country', array(), null, 'boinc:country-of-origin'); |
|
| 710 | + bts('Profile image', array(), null, 'boinc:account-profile-edit'); |
|
| 711 | + bts('Website URL', array(), null, 'boinc:account-profile-edit'); |
|
| 712 | + bts('Your opinions about this project', array(), null, 'boinc:account-profile-edit'); |
|
| 713 | + bts('Your personal background', array(), null, 'boinc:account-profile-edit'); |
|
| 714 | + bts('Postal code', array(), null, 'boinc:account-profile-edit'); |
|
| 715 | 715 | |
| 716 | 716 | return $fields; |
| 717 | 717 | } |
@@ -4,33 +4,33 @@ discard block |
||
| 4 | 4 | * Implementation of hook_default_panels_mini(). |
| 5 | 5 | */ |
| 6 | 6 | function stats_charts_default_panels_mini() { |
| 7 | - $export = array(); |
|
| 7 | + $export = array(); |
|
| 8 | 8 | |
| 9 | - $mini = new stdClass; |
|
| 10 | - $mini->disabled = FALSE; /* Edit this to true to make a default mini disabled initially */ |
|
| 11 | - $mini->api_version = 1; |
|
| 12 | - $mini->name = 'project_stats_overview'; |
|
| 13 | - $mini->category = 'BOINC'; |
|
| 14 | - $mini->admin_title = 'Project stats overview'; |
|
| 15 | - $mini->admin_description = 'General statistical information for the project'; |
|
| 16 | - $mini->requiredcontexts = array(); |
|
| 17 | - $mini->contexts = array(); |
|
| 18 | - $mini->relationships = array(); |
|
| 19 | - $display = new panels_display; |
|
| 20 | - $display->layout = 'onecol'; |
|
| 21 | - $display->layout_settings = array(); |
|
| 22 | - $display->panel_settings = array( |
|
| 9 | + $mini = new stdClass; |
|
| 10 | + $mini->disabled = FALSE; /* Edit this to true to make a default mini disabled initially */ |
|
| 11 | + $mini->api_version = 1; |
|
| 12 | + $mini->name = 'project_stats_overview'; |
|
| 13 | + $mini->category = 'BOINC'; |
|
| 14 | + $mini->admin_title = 'Project stats overview'; |
|
| 15 | + $mini->admin_description = 'General statistical information for the project'; |
|
| 16 | + $mini->requiredcontexts = array(); |
|
| 17 | + $mini->contexts = array(); |
|
| 18 | + $mini->relationships = array(); |
|
| 19 | + $display = new panels_display; |
|
| 20 | + $display->layout = 'onecol'; |
|
| 21 | + $display->layout_settings = array(); |
|
| 22 | + $display->panel_settings = array( |
|
| 23 | 23 | 'style_settings' => array( |
| 24 | - 'default' => NULL, |
|
| 25 | - 'middle' => NULL, |
|
| 24 | + 'default' => NULL, |
|
| 25 | + 'middle' => NULL, |
|
| 26 | 26 | ), |
| 27 | - ); |
|
| 28 | - $display->cache = array(); |
|
| 29 | - $display->title = ''; |
|
| 30 | - $display->storage_type = 'panels_mini'; |
|
| 31 | - $display->storage_id = 'project_stats_overview'; |
|
| 32 | - $display->content = array(); |
|
| 33 | - $display->panels = array(); |
|
| 27 | + ); |
|
| 28 | + $display->cache = array(); |
|
| 29 | + $display->title = ''; |
|
| 30 | + $display->storage_type = 'panels_mini'; |
|
| 31 | + $display->storage_id = 'project_stats_overview'; |
|
| 32 | + $display->content = array(); |
|
| 33 | + $display->panels = array(); |
|
| 34 | 34 | $pane = new stdClass; |
| 35 | 35 | $pane->pid = 'new-1'; |
| 36 | 36 | $pane->panel = 'middle'; |
@@ -39,25 +39,25 @@ discard block |
||
| 39 | 39 | $pane->shown = TRUE; |
| 40 | 40 | $pane->access = array(); |
| 41 | 41 | $pane->configuration = array( |
| 42 | - 'admin_title' => 'Project stats overview', |
|
| 43 | - 'title' => bts('@this_project Progress', array('@this_project' => variable_get('site_name', 'Drupal-BOINC')), NULL, 'boinc:frontpage'), |
|
| 44 | - 'body' => '<?php echo boincstats_get_project_stats_overview(); ?>', |
|
| 45 | - 'format' => '3', |
|
| 46 | - 'substitute' => TRUE, |
|
| 42 | + 'admin_title' => 'Project stats overview', |
|
| 43 | + 'title' => bts('@this_project Progress', array('@this_project' => variable_get('site_name', 'Drupal-BOINC')), NULL, 'boinc:frontpage'), |
|
| 44 | + 'body' => '<?php echo boincstats_get_project_stats_overview(); ?>', |
|
| 45 | + 'format' => '3', |
|
| 46 | + 'substitute' => TRUE, |
|
| 47 | 47 | ); |
| 48 | 48 | $pane->cache = array(); |
| 49 | 49 | $pane->style = array( |
| 50 | - 'settings' => NULL, |
|
| 50 | + 'settings' => NULL, |
|
| 51 | 51 | ); |
| 52 | 52 | $pane->css = array(); |
| 53 | 53 | $pane->extras = array(); |
| 54 | 54 | $pane->position = 0; |
| 55 | 55 | $display->content['new-1'] = $pane; |
| 56 | 56 | $display->panels['middle'][0] = 'new-1'; |
| 57 | - $display->hide_title = PANELS_TITLE_FIXED; |
|
| 58 | - $display->title_pane = 'new-1'; |
|
| 59 | - $mini->display = $display; |
|
| 60 | - $export['project_stats_overview'] = $mini; |
|
| 57 | + $display->hide_title = PANELS_TITLE_FIXED; |
|
| 58 | + $display->title_pane = 'new-1'; |
|
| 59 | + $mini->display = $display; |
|
| 60 | + $export['project_stats_overview'] = $mini; |
|
| 61 | 61 | |
| 62 | - return $export; |
|
| 62 | + return $export; |
|
| 63 | 63 | } |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | $export = array(); |
| 8 | 8 | |
| 9 | 9 | $mini = new stdClass; |
| 10 | - $mini->disabled = FALSE; /* Edit this to true to make a default mini disabled initially */ |
|
| 10 | + $mini->disabled = false; /* Edit this to true to make a default mini disabled initially */ |
|
| 11 | 11 | $mini->api_version = 1; |
| 12 | 12 | $mini->name = 'project_stats_overview'; |
| 13 | 13 | $mini->category = 'BOINC'; |
@@ -21,8 +21,8 @@ discard block |
||
| 21 | 21 | $display->layout_settings = array(); |
| 22 | 22 | $display->panel_settings = array( |
| 23 | 23 | 'style_settings' => array( |
| 24 | - 'default' => NULL, |
|
| 25 | - 'middle' => NULL, |
|
| 24 | + 'default' => null, |
|
| 25 | + 'middle' => null, |
|
| 26 | 26 | ), |
| 27 | 27 | ); |
| 28 | 28 | $display->cache = array(); |
@@ -36,18 +36,18 @@ discard block |
||
| 36 | 36 | $pane->panel = 'middle'; |
| 37 | 37 | $pane->type = 'custom'; |
| 38 | 38 | $pane->subtype = 'custom'; |
| 39 | - $pane->shown = TRUE; |
|
| 39 | + $pane->shown = true; |
|
| 40 | 40 | $pane->access = array(); |
| 41 | 41 | $pane->configuration = array( |
| 42 | 42 | 'admin_title' => 'Project stats overview', |
| 43 | - 'title' => bts('@this_project Progress', array('@this_project' => variable_get('site_name', 'Drupal-BOINC')), NULL, 'boinc:frontpage'), |
|
| 43 | + 'title' => bts('@this_project Progress', array('@this_project' => variable_get('site_name', 'Drupal-BOINC')), null, 'boinc:frontpage'), |
|
| 44 | 44 | 'body' => '<?php echo boincstats_get_project_stats_overview(); ?>', |
| 45 | 45 | 'format' => '3', |
| 46 | - 'substitute' => TRUE, |
|
| 46 | + 'substitute' => true, |
|
| 47 | 47 | ); |
| 48 | 48 | $pane->cache = array(); |
| 49 | 49 | $pane->style = array( |
| 50 | - 'settings' => NULL, |
|
| 50 | + 'settings' => null, |
|
| 51 | 51 | ); |
| 52 | 52 | $pane->css = array(); |
| 53 | 53 | $pane->extras = array(); |