@@ -29,10 +29,10 @@ discard block |
||
29 | 29 | |
30 | 30 | $border = get_str("border", true); |
31 | 31 | |
32 | -if ($border=="no") { |
|
32 | +if ($border == "no") { |
|
33 | 33 | $border = 0; |
34 | 34 | } else { |
35 | - $border=8; |
|
35 | + $border = 8; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | $font = "\"Optima,Lucida Bright,Times New Roman\""; |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | <tr><th align=left>Project</th><th align=left>Cobblestones</th><th align=left>Joined</th></tr> |
76 | 76 | "; |
77 | 77 | foreach ($user->projects as $p) { |
78 | - if ($p->total_credit<100) continue; |
|
78 | + if ($p->total_credit < 100) continue; |
|
79 | 79 | show_proj($p); |
80 | 80 | } |
81 | 81 | echo " |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | */ |
115 | 115 | require_once('dbconfig.php'); |
116 | 116 | if (!isset($dbserver) || empty($dbserver)) |
117 | - $dbserver='localhost'; |
|
117 | + $dbserver = 'localhost'; |
|
118 | 118 | $db_url = array( |
119 | 119 | 'default' => "{$dbtype}://{$dbuser}:".urlencode($dbpass)."@{$dbserver}/{$dbname}", |
120 | 120 | 'boinc_rw' => "{$boinc_rw_dbtype}://{$boinc_rw_dbuser}:".urlencode($boinc_rw_dbpass)."@{$boinc_rw_dbserver}/{$boinc_rw_dbname}" |
@@ -162,14 +162,14 @@ discard block |
||
162 | 162 | * settings are used there. Settings defined here should not be |
163 | 163 | * duplicated there so as to avoid conflict issues. |
164 | 164 | */ |
165 | -ini_set('session.cache_expire', 200000); |
|
166 | -ini_set('session.cache_limiter', 'none'); |
|
167 | -ini_set('session.cookie_lifetime', 2000000); |
|
168 | -ini_set('session.gc_maxlifetime', 200000); |
|
169 | -ini_set('session.save_handler', 'user'); |
|
165 | +ini_set('session.cache_expire', 200000); |
|
166 | +ini_set('session.cache_limiter', 'none'); |
|
167 | +ini_set('session.cookie_lifetime', 2000000); |
|
168 | +ini_set('session.gc_maxlifetime', 200000); |
|
169 | +ini_set('session.save_handler', 'user'); |
|
170 | 170 | ini_set('session.use_only_cookies', 1); |
171 | -ini_set('session.use_trans_sid', 0); |
|
172 | -ini_set('url_rewriter.tags', ''); |
|
171 | +ini_set('session.use_trans_sid', 0); |
|
172 | +ini_set('url_rewriter.tags', ''); |
|
173 | 173 | ini_set('memory_limit', '128M'); |
174 | 174 | ini_set('post_max_size', '8MB'); |
175 | 175 | ini_set('upload_max_filesize', '8MB'); |
@@ -62,21 +62,21 @@ discard block |
||
62 | 62 | ); |
63 | 63 | $items['community/teams/%/edit/admins/remove/%'] = array( |
64 | 64 | 'page callback' => 'boincteam_remove_admin', |
65 | - 'page arguments' => array(2,6), |
|
65 | + 'page arguments' => array(2, 6), |
|
66 | 66 | 'access callback' => 'boincteam_is_founder', |
67 | 67 | 'access arguments' => array(2), |
68 | 68 | 'type' => MENU_CALLBACK |
69 | 69 | ); |
70 | 70 | $items['community/teams/%/edit/founder/set/%'] = array( |
71 | 71 | 'page callback' => 'boincteam_set_founder', |
72 | - 'page arguments' => array(2,6), |
|
72 | + 'page arguments' => array(2, 6), |
|
73 | 73 | 'access callback' => 'boincteam_is_founder', |
74 | 74 | 'access arguments' => array(2), |
75 | 75 | 'type' => MENU_CALLBACK |
76 | 76 | ); |
77 | 77 | $items['community/teams/%/edit/members/remove/%'] = array( |
78 | 78 | 'page callback' => 'boincteam_remove_member', |
79 | - 'page arguments' => array(2,6), |
|
79 | + 'page arguments' => array(2, 6), |
|
80 | 80 | 'access callback' => 'boincteam_is_founder', |
81 | 81 | 'access arguments' => array(2), |
82 | 82 | 'type' => MENU_CALLBACK |
@@ -724,12 +724,12 @@ discard block |
||
724 | 724 | $boincteam = boincteam_load($boincteam_id); |
725 | 725 | $now = time(); |
726 | 726 | if ($boincteam->ping_user <= 0) { |
727 | - if ($boincteam->ping_time < $now - 60 * (24*60*60)) { |
|
727 | + if ($boincteam->ping_time < $now - 60*(24*60*60)) { |
|
728 | 728 | return TRUE; |
729 | 729 | } |
730 | 730 | return FALSE; |
731 | 731 | } |
732 | - if ($boincteam->ping_time < $now - 90 * (24*60*60)) { |
|
732 | + if ($boincteam->ping_time < $now - 90*(24*60*60)) { |
|
733 | 733 | return TRUE; |
734 | 734 | } |
735 | 735 | return FALSE; |
@@ -740,7 +740,7 @@ discard block |
||
740 | 740 | * responded to the request |
741 | 741 | */ |
742 | 742 | function boincteam_foundership_transfer_ok_time($boincteam) { |
743 | - return $boincteam->ping_time + 60 * (24*60*60); |
|
743 | + return $boincteam->ping_time + 60*(24*60*60); |
|
744 | 744 | } |
745 | 745 | |
746 | 746 | /** |
@@ -778,26 +778,26 @@ discard block |
||
778 | 778 | */ |
779 | 779 | function boincteam_about_admins_panel() { |
780 | 780 | $output = ''; |
781 | - $output .= '<h2 class="pane-title">' . bts('About team admins', array(), NULL, 'boinc:team-admins-panel') . '</h2>'; |
|
781 | + $output .= '<h2 class="pane-title">'.bts('About team admins', array(), NULL, 'boinc:team-admins-panel').'</h2>'; |
|
782 | 782 | $output .= '<div>'; |
783 | - $output .= '<p>' . bts('Team admins can:', array(), NULL, 'boinc:team-admins-panel') . '</p>'; |
|
783 | + $output .= '<p>'.bts('Team admins can:', array(), NULL, 'boinc:team-admins-panel').'</p>'; |
|
784 | 784 | $output .= '<ul>'; |
785 | - $output .= ' <li>' . bts('Edit team information', array(), NULL, 'boinc:team-admins-panel') . '</li>'; |
|
786 | - $output .= ' <li>' . bts("View the team's join / quit history", array(), NULL, 'boinc:team-admins-panel') . '</li>'; |
|
787 | - $output .= ' <li>' . bts('Moderate the team forum', array(), NULL, 'boinc:team-admins-panel') . '</li>'; |
|
788 | - $output .= ' <li>' . bts('Remove members from the team', array(), NULL, 'boinc:team-admins-panel') . '</li>'; |
|
789 | - $output .= ' <li>' . bts('Disband a team if it has no members', array(), NULL, 'boinc:team-admins-panel') . '</li>'; |
|
785 | + $output .= ' <li>'.bts('Edit team information', array(), NULL, 'boinc:team-admins-panel').'</li>'; |
|
786 | + $output .= ' <li>'.bts("View the team's join / quit history", array(), NULL, 'boinc:team-admins-panel').'</li>'; |
|
787 | + $output .= ' <li>'.bts('Moderate the team forum', array(), NULL, 'boinc:team-admins-panel').'</li>'; |
|
788 | + $output .= ' <li>'.bts('Remove members from the team', array(), NULL, 'boinc:team-admins-panel').'</li>'; |
|
789 | + $output .= ' <li>'.bts('Disband a team if it has no members', array(), NULL, 'boinc:team-admins-panel').'</li>'; |
|
790 | 790 | $output .= '</ul>'; |
791 | 791 | $output .= '</div>'; |
792 | 792 | $output .= '<div>'; |
793 | - $output .= '<p>' . bts('Team admins cannot:', array(), NULL, 'boinc:team-admins-panel') . '</p>'; |
|
793 | + $output .= '<p>'.bts('Team admins cannot:', array(), NULL, 'boinc:team-admins-panel').'</p>'; |
|
794 | 794 | $output .= '<ul>'; |
795 | - $output .= ' <li>' . bts('Change the team founder', array(), NULL, 'boinc:team-admins-panel') . '</li>'; |
|
796 | - $output .= ' <li>' . bts('Remove members', array(), NULL, 'boinc:team-admins-panel') . '</li>'; |
|
797 | - $output .= ' <li>' . bts('Add / Remove team admins', array(), NULL, 'boinc:team-admins-panel') . '</li>'; |
|
795 | + $output .= ' <li>'.bts('Change the team founder', array(), NULL, 'boinc:team-admins-panel').'</li>'; |
|
796 | + $output .= ' <li>'.bts('Remove members', array(), NULL, 'boinc:team-admins-panel').'</li>'; |
|
797 | + $output .= ' <li>'.bts('Add / Remove team admins', array(), NULL, 'boinc:team-admins-panel').'</li>'; |
|
798 | 798 | $output .= '</ul>'; |
799 | 799 | $output .= '</div>'; |
800 | - $output .= '<p>' . bts('If a team admin quits the team, they cease to be a' |
|
800 | + $output .= '<p>'.bts('If a team admin quits the team, they cease to be a' |
|
801 | 801 | . ' team admin. We recommend only selecting people you know and trust', array(), NULL, 'boinc:team-admins-panel') |
802 | 802 | . '</p>'; |
803 | 803 | return $output; |
@@ -808,26 +808,26 @@ discard block |
||
808 | 808 | */ |
809 | 809 | function boincteam_about_founder_panel() { |
810 | 810 | $output = ''; |
811 | - $output .= '<h2 class="pane-title">' . bts('Changing the team founder', array(), NULL, 'boinc:team-founder-panel') |
|
811 | + $output .= '<h2 class="pane-title">'.bts('Changing the team founder', array(), NULL, 'boinc:team-founder-panel') |
|
812 | 812 | . '</h2>'; |
813 | 813 | $output .= '<div>'; |
814 | - $output .= '<p>' . bts('Notes about changes in foundership:', array(), NULL, 'boinc:team-founder-panel') . '</p>'; |
|
814 | + $output .= '<p>'.bts('Notes about changes in foundership:', array(), NULL, 'boinc:team-founder-panel').'</p>'; |
|
815 | 815 | $output .= '<ul>'; |
816 | - $output .= ' <li>' . bts('Any member of the team is eligible', array(), NULL, 'boinc:team-founder-panel') . '</li>'; |
|
817 | - $output .= ' <li>' . bts('Current founder becomes a normal user', array(), NULL, 'boinc:team-founder-panel') . '</li>'; |
|
816 | + $output .= ' <li>'.bts('Any member of the team is eligible', array(), NULL, 'boinc:team-founder-panel').'</li>'; |
|
817 | + $output .= ' <li>'.bts('Current founder becomes a normal user', array(), NULL, 'boinc:team-founder-panel').'</li>'; |
|
818 | 818 | $output .= '</ul>'; |
819 | 819 | $output .= '</div>'; |
820 | 820 | $output .= '<div>'; |
821 | - $output .= '<p>' . bts('Foundership can be requested by team members:', array(), NULL, 'boinc:team-founder-panel') |
|
821 | + $output .= '<p>'.bts('Foundership can be requested by team members:', array(), NULL, 'boinc:team-founder-panel') |
|
822 | 822 | . '</p>'; |
823 | 823 | $output .= '<ul>'; |
824 | - $output .= ' <li>' . bts('One request is allowed at a time', array(), NULL, 'boinc:team-founder-panel') . '</li>'; |
|
825 | - $output .= ' <li>' . bts('It must be 60 days since any previous request', array(), NULL, 'boinc:team-founder-panel') |
|
824 | + $output .= ' <li>'.bts('One request is allowed at a time', array(), NULL, 'boinc:team-founder-panel').'</li>'; |
|
825 | + $output .= ' <li>'.bts('It must be 60 days since any previous request', array(), NULL, 'boinc:team-founder-panel') |
|
826 | 826 | . '</li>'; |
827 | - $output .= ' <li>' . bts('Any active request must be older than 90 days', array(), NULL, 'boinc:team-founder-panel') |
|
827 | + $output .= ' <li>'.bts('Any active request must be older than 90 days', array(), NULL, 'boinc:team-founder-panel') |
|
828 | 828 | . '</li>'; |
829 | - $output .= ' <li>' . bts('Current founder has 60 days to respond to a' |
|
830 | - . ' request', array(), NULL, 'boinc:team-founder-panel') . '</li>'; |
|
829 | + $output .= ' <li>'.bts('Current founder has 60 days to respond to a' |
|
830 | + . ' request', array(), NULL, 'boinc:team-founder-panel').'</li>'; |
|
831 | 831 | $output .= '</ul>'; |
832 | 832 | $output .= '</div>'; |
833 | 833 | return $output; |
@@ -841,9 +841,9 @@ discard block |
||
841 | 841 | $account = user_load($user->uid); |
842 | 842 | $unrestricted_role = array_search('verified contributor', user_roles(true)); |
843 | 843 | $output = ''; |
844 | - $output .= '<h2 class="pane-title">' . bts('Create a new team', array(), NULL, 'boinc:create-team-panel') . '</h2>'; |
|
845 | - $output .= '<p>' . bts('If you cannot find a team that is right for you, you' |
|
846 | - . ' can create a team.', array(), NULL, 'boinc:create-team-panel') . '</p>'; |
|
844 | + $output .= '<h2 class="pane-title">'.bts('Create a new team', array(), NULL, 'boinc:create-team-panel').'</h2>'; |
|
845 | + $output .= '<p>'.bts('If you cannot find a team that is right for you, you' |
|
846 | + . ' can create a team.', array(), NULL, 'boinc:create-team-panel').'</p>'; |
|
847 | 847 | $output .= '<ul class="tab-list">'; |
848 | 848 | $output .= ' <li class="first last tab">'; |
849 | 849 | if (isset($account->roles[$unrestricted_role])) { |
@@ -879,7 +879,7 @@ discard block |
||
879 | 879 | */ |
880 | 880 | function boincteam_create_team_panel() { |
881 | 881 | $output = ''; |
882 | - $output .= '<h2 class="pane-title">' . bts('Create a team', array(), NULL, 'boinc:create-team-panel') . '</h2>'; |
|
882 | + $output .= '<h2 class="pane-title">'.bts('Create a team', array(), NULL, 'boinc:create-team-panel').'</h2>'; |
|
883 | 883 | $output .= drupal_get_form('boincteam_create_form'); |
884 | 884 | |
885 | 885 | return $output; |
@@ -897,26 +897,26 @@ discard block |
||
897 | 897 | $account = user_load($uid); |
898 | 898 | if ($account->team) { |
899 | 899 | $team = boincteam_load(boincteam_lookup_id($account->team)); |
900 | - $output .= '<h2 class="pane-title">' . bts('Team', array(), NULL, 'boinc:team-dashboard') . '</h2>'; |
|
900 | + $output .= '<h2 class="pane-title">'.bts('Team', array(), NULL, 'boinc:team-dashboard').'</h2>'; |
|
901 | 901 | $output .= '<div class="stats">'; |
902 | - $output .= ' <label>' . bts('Name', array(), NULL, 'boinc:user-or-team-name') . ': </label>'; |
|
903 | - $output .= ' <span>' . l($team->name, "community/teams/{$account->team}") . '</span>'; |
|
904 | - $output .= '</div>' . "\n"; |
|
902 | + $output .= ' <label>'.bts('Name', array(), NULL, 'boinc:user-or-team-name').': </label>'; |
|
903 | + $output .= ' <span>'.l($team->name, "community/teams/{$account->team}").'</span>'; |
|
904 | + $output .= '</div>'."\n"; |
|
905 | 905 | $output .= '<div class="stats">'; |
906 | - $output .= ' <label>' . bts('Member since', array(), NULL, 'boinc:user-info') . ': </label>'; |
|
907 | - $output .= ' <span>' . date('j F Y', boincteam_get_member_join_date($team->id, $account->boincuser_id)) . '</span>'; |
|
908 | - $output .= '</div>' . "\n"; |
|
906 | + $output .= ' <label>'.bts('Member since', array(), NULL, 'boinc:user-info').': </label>'; |
|
907 | + $output .= ' <span>'.date('j F Y', boincteam_get_member_join_date($team->id, $account->boincuser_id)).'</span>'; |
|
908 | + $output .= '</div>'."\n"; |
|
909 | 909 | $output .= '<div class="stats">'; |
910 | - $output .= ' <label>' . bts('Country', array(), NULL, 'boinc:country-of-origin') . ': </label>'; |
|
911 | - $output .= ' <span>' . $team->country . '</span>'; |
|
912 | - $output .= '</div>' . "\n"; |
|
910 | + $output .= ' <label>'.bts('Country', array(), NULL, 'boinc:country-of-origin').': </label>'; |
|
911 | + $output .= ' <span>'.$team->country.'</span>'; |
|
912 | + $output .= '</div>'."\n"; |
|
913 | 913 | $output .= '<div class="stats">'; |
914 | - $output .= ' <label>' . bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits') . ': </label>'; |
|
915 | - $output .= ' <span>' . number_format($team->total_credit, 0) . '</span>'; |
|
916 | - $output .= '</div>' . "\n"; |
|
914 | + $output .= ' <label>'.bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits').': </label>'; |
|
915 | + $output .= ' <span>'.number_format($team->total_credit, 0).'</span>'; |
|
916 | + $output .= '</div>'."\n"; |
|
917 | 917 | } |
918 | 918 | else if ($user->uid == $account->uid) { |
919 | - $output .= '<h2 class="pane-title">' . bts('Team (None)', array(), NULL, 'boinc:team-dashboard') . '</h2>'; |
|
919 | + $output .= '<h2 class="pane-title">'.bts('Team (None)', array(), NULL, 'boinc:team-dashboard').'</h2>'; |
|
920 | 920 | $output .= '<ul class="tab-list action-list">'; |
921 | 921 | $output .= '<li class="tab primary">'; |
922 | 922 | $output .= l(bts('Join a Team', array(), NULL, 'boinc:team-dashboard'), 'community/teams'); |
@@ -932,7 +932,7 @@ discard block |
||
932 | 932 | function boincteam_edit_team_panel($team_id) { |
933 | 933 | $team = node_load($team_id); |
934 | 934 | $output = ''; |
935 | - $output .= '<h2 class="pane-title">' . $team->title . '</h2>'; |
|
935 | + $output .= '<h2 class="pane-title">'.$team->title.'</h2>'; |
|
936 | 936 | $output .= drupal_get_form('boincteam_edit_form', $team_id); |
937 | 937 | |
938 | 938 | return $output; |
@@ -944,12 +944,12 @@ discard block |
||
944 | 944 | function boincteam_join_team_panel($team_id) { |
945 | 945 | $team = node_load($team_id); |
946 | 946 | $output = ''; |
947 | - $output .= '<h2 class="pane-title">' . bts('Join team', array(), NULL, 'boinc:join-team-panel') . '</h2>'; |
|
948 | - $output .= '<p>' . bts('Click here to become a member of @this_team', |
|
949 | - array('@this_team' =>$team->title), NULL, 'boinc:join-team-panel') . '</p>'; |
|
947 | + $output .= '<h2 class="pane-title">'.bts('Join team', array(), NULL, 'boinc:join-team-panel').'</h2>'; |
|
948 | + $output .= '<p>'.bts('Click here to become a member of @this_team', |
|
949 | + array('@this_team' =>$team->title), NULL, 'boinc:join-team-panel').'</p>'; |
|
950 | 950 | $output .= '<ul class="tab-list">'; |
951 | - $output .= ' <li class="first last tab">' . |
|
952 | - l(bts('Join this team', array(), NULL, 'boinc:join-team-panel'), "community/teams/{$team_id}/join") . '</li>'; |
|
951 | + $output .= ' <li class="first last tab">'. |
|
952 | + l(bts('Join this team', array(), NULL, 'boinc:join-team-panel'), "community/teams/{$team_id}/join").'</li>'; |
|
953 | 953 | $output .= '</ul>'; |
954 | 954 | return $output; |
955 | 955 | } |
@@ -960,12 +960,12 @@ discard block |
||
960 | 960 | function boincteam_leave_team_panel($team_id) { |
961 | 961 | $team = node_load($team_id); |
962 | 962 | $output = ''; |
963 | - $output .= '<h2 class="pane-title">' . bts('Leave team', array(), NULL, 'boinc:leave-team-panel') . '</h2>'; |
|
964 | - $output .= '<p>' . bts('Click here to revoke your membership with' |
|
965 | - . ' @this_team', array('@this_team' =>$team->title), NULL, 'boinc:leave-team-panel') . '</p>'; |
|
963 | + $output .= '<h2 class="pane-title">'.bts('Leave team', array(), NULL, 'boinc:leave-team-panel').'</h2>'; |
|
964 | + $output .= '<p>'.bts('Click here to revoke your membership with' |
|
965 | + . ' @this_team', array('@this_team' =>$team->title), NULL, 'boinc:leave-team-panel').'</p>'; |
|
966 | 966 | $output .= '<ul class="tab-list">'; |
967 | - $output .= ' <li class="first last tab">' . |
|
968 | - l(bts('Leave this team', array(), NULL, 'boinc:leave-team-panel'), "community/teams/{$team_id}/leave") . '</li>'; |
|
967 | + $output .= ' <li class="first last tab">'. |
|
968 | + l(bts('Leave this team', array(), NULL, 'boinc:leave-team-panel'), "community/teams/{$team_id}/leave").'</li>'; |
|
969 | 969 | $output .= '</ul>'; |
970 | 970 | return $output; |
971 | 971 | } |
@@ -975,10 +975,10 @@ discard block |
||
975 | 975 | */ |
976 | 976 | function boincteam_manage_admins_panel_header($team_id) { |
977 | 977 | $output = ''; |
978 | - $output .= '<h4>' . bts('Add team admin', array(), NULL, 'boinc:team-manage-admins') . '</h4>'; |
|
978 | + $output .= '<h4>'.bts('Add team admin', array(), NULL, 'boinc:team-manage-admins').'</h4>'; |
|
979 | 979 | $output .= drupal_get_form('boincteam_add_admin_form', $team_id); |
980 | 980 | $output .= '<div class="clearfix"></div>'; |
981 | - $output .= '<h4>' . bts('Current team admins', array(), NULL, 'boinc:team-manage-admins') . '</h4>'; |
|
981 | + $output .= '<h4>'.bts('Current team admins', array(), NULL, 'boinc:team-manage-admins').'</h4>'; |
|
982 | 982 | |
983 | 983 | return $output; |
984 | 984 | } |
@@ -991,17 +991,17 @@ discard block |
||
991 | 991 | $team = node_load($team_id); |
992 | 992 | |
993 | 993 | $output = ''; |
994 | - $output .= '<h2 class="pane-title">' . bts('Manage team', array(), NULL, 'boinc:team-manage') . '</h2>'; |
|
994 | + $output .= '<h2 class="pane-title">'.bts('Manage team', array(), NULL, 'boinc:team-manage').'</h2>'; |
|
995 | 995 | |
996 | 996 | // PM all members |
997 | 997 | if (module_exists('privatemsg')) { |
998 | 998 | $output .= '<div class="form-item">'; |
999 | 999 | $output .= ' <ul class="tab-list action-list">'; |
1000 | - $output .= ' <li class="first tab primary">' . |
|
1001 | - l('Send message to team', "community/teams/{$team_id}/message-all-members") . '</li>'; |
|
1000 | + $output .= ' <li class="first tab primary">'. |
|
1001 | + l('Send message to team', "community/teams/{$team_id}/message-all-members").'</li>'; |
|
1002 | 1002 | $output .= ' </ul>'; |
1003 | 1003 | $output .= ' <div class="description">'; |
1004 | - $output .= bts('Contact all team members using e-mail.', array(), NULL, 'boinc:team-manage'); |
|
1004 | + $output .= bts('Contact all team members using e-mail.', array(), NULL, 'boinc:team-manage'); |
|
1005 | 1005 | $output .= ' </div>'; |
1006 | 1006 | $output .= '</div>'; |
1007 | 1007 | } |
@@ -1019,13 +1019,13 @@ discard block |
||
1019 | 1019 | } |
1020 | 1020 | $output .= '<div class="form-item">'; |
1021 | 1021 | $output .= ' <ul class="tab-list action-list">'; |
1022 | - $output .= ' <li class="first tab primary">' . |
|
1022 | + $output .= ' <li class="first tab primary">'. |
|
1023 | 1023 | l(bts('Manage team message board', array(), NULL, 'boinc:team-manage'), |
1024 | 1024 | "community/teams/{$team_id}/forum/{$team_forum_link_path}" |
1025 | 1025 | ); |
1026 | 1026 | $output .= ' </li>'; |
1027 | 1027 | $output .= ' <div class="description">'; |
1028 | - $output .= bts('Create or manage message board', array(), NULL, 'boinc:team-manage'); |
|
1028 | + $output .= bts('Create or manage message board', array(), NULL, 'boinc:team-manage'); |
|
1029 | 1029 | $output .= ' </div>'; |
1030 | 1030 | $output .= '</div>'; |
1031 | 1031 | } |
@@ -1033,15 +1033,15 @@ discard block |
||
1033 | 1033 | |
1034 | 1034 | // Team history |
1035 | 1035 | $output .= '<div class="form-item">'; |
1036 | - $output .= ' <label>' . bts('View change history', array(), NULL, 'boinc:team-manage') . '</label>'; |
|
1036 | + $output .= ' <label>'.bts('View change history', array(), NULL, 'boinc:team-manage').'</label>'; |
|
1037 | 1037 | $output .= ' <ul class="tab-list">'; |
1038 | - $output .= ' <li class="first tab primary">' . |
|
1039 | - l('HTML', "community/teams/{$team_id}/history") . '</li>'; |
|
1040 | - $output .= ' <li class="last tab primary">' . |
|
1041 | - l('XML', "community/teams/{$team_id}/history/xml") . '</li>'; |
|
1038 | + $output .= ' <li class="first tab primary">'. |
|
1039 | + l('HTML', "community/teams/{$team_id}/history").'</li>'; |
|
1040 | + $output .= ' <li class="last tab primary">'. |
|
1041 | + l('XML', "community/teams/{$team_id}/history/xml").'</li>'; |
|
1042 | 1042 | $output .= ' </ul>'; |
1043 | 1043 | $output .= ' <div class="description">'; |
1044 | - $output .= bts('See member activity', array(), NULL, 'boinc:team-manage'); |
|
1044 | + $output .= bts('See member activity', array(), NULL, 'boinc:team-manage'); |
|
1045 | 1045 | $output .= ' </div>'; |
1046 | 1046 | $output .= '</div>'; |
1047 | 1047 | |
@@ -1049,30 +1049,30 @@ discard block |
||
1049 | 1049 | $output .= ' <ul class="tab-list action-list">'; |
1050 | 1050 | |
1051 | 1051 | // Edit team information |
1052 | - $output .= ' <li class="first tab primary">' . |
|
1053 | - l(bts('Edit team info', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/edit/info") . '</li>'; |
|
1052 | + $output .= ' <li class="first tab primary">'. |
|
1053 | + l(bts('Edit team info', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/edit/info").'</li>'; |
|
1054 | 1054 | |
1055 | 1055 | // Member list |
1056 | - $output .= ' <li class="tab primary">' . |
|
1057 | - l(bts('View member list', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/members") . '</li>'; |
|
1056 | + $output .= ' <li class="tab primary">'. |
|
1057 | + l(bts('View member list', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/members").'</li>'; |
|
1058 | 1058 | |
1059 | 1059 | // Remove members |
1060 | - $output .= ' <li class="tab primary">' . |
|
1061 | - l(bts('Remove members', array(), NULL, 'boinc:team-admins-panel'), "community/teams/{$team_id}/edit/members") . '</li>'; |
|
1060 | + $output .= ' <li class="tab primary">'. |
|
1061 | + l(bts('Remove members', array(), NULL, 'boinc:team-admins-panel'), "community/teams/{$team_id}/edit/members").'</li>'; |
|
1062 | 1062 | |
1063 | 1063 | if ($is_founder) { |
1064 | 1064 | |
1065 | 1065 | // Change founder |
1066 | - $output .= ' <li class="tab primary">' . |
|
1067 | - l(bts('Change founder', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/edit/founder") . '</li>'; |
|
1066 | + $output .= ' <li class="tab primary">'. |
|
1067 | + l(bts('Change founder', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/edit/founder").'</li>'; |
|
1068 | 1068 | |
1069 | 1069 | // Manage admins |
1070 | - $output .= ' <li class="tab primary">' . |
|
1071 | - l(bts('Manage team admins', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/edit/admins") . '</li>'; |
|
1070 | + $output .= ' <li class="tab primary">'. |
|
1071 | + l(bts('Manage team admins', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/edit/admins").'</li>'; |
|
1072 | 1072 | |
1073 | 1073 | // Delete the team |
1074 | - $output .= ' <li class="last tab primary">' . |
|
1075 | - l(bts('Remove team', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/delete") . '</li>'; |
|
1074 | + $output .= ' <li class="last tab primary">'. |
|
1075 | + l(bts('Remove team', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/delete").'</li>'; |
|
1076 | 1076 | } |
1077 | 1077 | |
1078 | 1078 | $output .= ' </ul>'; |
@@ -1089,12 +1089,12 @@ discard block |
||
1089 | 1089 | $account = user_load($user->uid); |
1090 | 1090 | $team = node_load($account->team); |
1091 | 1091 | $output = ''; |
1092 | - $output .= '<h2 class="pane-title">' . bts('My team', array(), NULL, 'boinc:account-team-panel') . '</h2>'; |
|
1093 | - $output .= '<p>' . bts('You are a member of @team.', |
|
1094 | - array('@team' => $team->title), NULL, 'boinc:account-team-panel') . '</p>'; |
|
1092 | + $output .= '<h2 class="pane-title">'.bts('My team', array(), NULL, 'boinc:account-team-panel').'</h2>'; |
|
1093 | + $output .= '<p>'.bts('You are a member of @team.', |
|
1094 | + array('@team' => $team->title), NULL, 'boinc:account-team-panel').'</p>'; |
|
1095 | 1095 | $output .= '<ul class="tab-list">'; |
1096 | - $output .= ' <li class="first last tab">' . |
|
1097 | - l(bts('View my team', array(), NULL, 'boinc:account-team-panel'), "community/teams/{$account->team}") . '</li>'; |
|
1096 | + $output .= ' <li class="first last tab">'. |
|
1097 | + l(bts('View my team', array(), NULL, 'boinc:account-team-panel'), "community/teams/{$account->team}").'</li>'; |
|
1098 | 1098 | $output .= '</ul>'; |
1099 | 1099 | return $output; |
1100 | 1100 | } |
@@ -1110,11 +1110,11 @@ discard block |
||
1110 | 1110 | $boincteam = boincteam_load($boincteam_id); |
1111 | 1111 | $boincuser_id = $account->boincuser_id; |
1112 | 1112 | $output = ''; |
1113 | - $output .= '<h2 class="pane-title">' . bts('Request foundership', array(), NULL, 'boinc:team-request-foundership') . '</h2>'; |
|
1113 | + $output .= '<h2 class="pane-title">'.bts('Request foundership', array(), NULL, 'boinc:team-request-foundership').'</h2>'; |
|
1114 | 1114 | |
1115 | 1115 | if (boincteam_user_requested_foundership($team_id)) { |
1116 | 1116 | $deadline = boincteam_foundership_transfer_ok_time($boincteam); |
1117 | - $days_to_deadline = ceil(($deadline - time()) / (24*60*60)); |
|
1117 | + $days_to_deadline = ceil(($deadline - time())/(24*60*60)); |
|
1118 | 1118 | $request_age = 60 - $days_to_deadline; |
1119 | 1119 | $days_to_respond = 30 + $days_to_deadline; |
1120 | 1120 | if (time() > $deadline) { |
@@ -1142,8 +1142,8 @@ discard block |
||
1142 | 1142 | } |
1143 | 1143 | $output .= '</p>'; |
1144 | 1144 | $output .= '<ul class="tab-list">'; |
1145 | - $output .= ' <li class="first last tab">' . |
|
1146 | - l(bts('Assume foundership', array(), NULL, 'boinc:team-request-foundership'), "community/teams/{$team_id}/assume-foundership") . '</li>'; |
|
1145 | + $output .= ' <li class="first last tab">'. |
|
1146 | + l(bts('Assume foundership', array(), NULL, 'boinc:team-request-foundership'), "community/teams/{$team_id}/assume-foundership").'</li>'; |
|
1147 | 1147 | $output .= '</ul>'; |
1148 | 1148 | } |
1149 | 1149 | else { |
@@ -1167,29 +1167,29 @@ discard block |
||
1167 | 1167 | // who made the request has 30 additional days to assume foundership if |
1168 | 1168 | // there is no response to the request) |
1169 | 1169 | $deadline = boincteam_foundership_transfer_ok_time($boincteam); |
1170 | - $days_to_deadline = ceil(($deadline - time()) / (24*60*60)) + 30; |
|
1170 | + $days_to_deadline = ceil(($deadline - time())/(24*60*60)) + 30; |
|
1171 | 1171 | $output .= '<p>'; |
1172 | 1172 | $output .= bts('A team foundership change was already requested recently.' |
1173 | 1173 | . ' Only one request is allowed within a period of 90 days.', |
1174 | 1174 | NULL, 'boinc:team-request-foundership'); |
1175 | 1175 | if ($days_to_deadline == 1) { |
1176 | - $output .= ' (' . bts('1 day remaining', array(), NULL, 'boinc:team-request-foundership') . ')'; |
|
1176 | + $output .= ' ('.bts('1 day remaining', array(), NULL, 'boinc:team-request-foundership').')'; |
|
1177 | 1177 | } |
1178 | 1178 | else { |
1179 | - $output .= ' (' . bts('@count days remaining', |
|
1179 | + $output .= ' ('.bts('@count days remaining', |
|
1180 | 1180 | array('@count' => $days_to_deadline), |
1181 | - NULL, 'boinc:team-request-foundership') . ')'; |
|
1181 | + NULL, 'boinc:team-request-foundership').')'; |
|
1182 | 1182 | } |
1183 | 1183 | $output .= '</p>'; |
1184 | 1184 | } |
1185 | 1185 | else { |
1186 | - $output .= '<p>' . bts('If the team founder is not active and you want to' |
|
1186 | + $output .= '<p>'.bts('If the team founder is not active and you want to' |
|
1187 | 1187 | . ' assume the role of founder, click below to request foundership of' |
1188 | 1188 | . ' @this_team.', |
1189 | - array('@this_team' =>$team->title), NULL, 'boinc:team-request-foundership') . '</p>'; |
|
1189 | + array('@this_team' =>$team->title), NULL, 'boinc:team-request-foundership').'</p>'; |
|
1190 | 1190 | $output .= '<ul class="tab-list">'; |
1191 | - $output .= ' <li class="first last tab">' . |
|
1192 | - l(bts('Initiate request', array(), NULL, 'boinc:team-request-foundership'), "community/teams/{$team_id}/request-foundership") . '</li>'; |
|
1191 | + $output .= ' <li class="first last tab">'. |
|
1192 | + l(bts('Initiate request', array(), NULL, 'boinc:team-request-foundership'), "community/teams/{$team_id}/request-foundership").'</li>'; |
|
1193 | 1193 | $output .= '</ul>'; |
1194 | 1194 | } |
1195 | 1195 | return $output; |
@@ -1210,15 +1210,15 @@ discard block |
||
1210 | 1210 | if ($boincteam->ping_user) { |
1211 | 1211 | if ($boincteam->ping_user < 0) { |
1212 | 1212 | $member = user_load(boincuser_lookup_uid(-$boincteam->ping_user)); |
1213 | - $output .= '<h2 class="pane-title">' . bts('Obsolete transfer request', array(), NULL, 'boinc:team-request-foundership-response') |
|
1213 | + $output .= '<h2 class="pane-title">'.bts('Obsolete transfer request', array(), NULL, 'boinc:team-request-foundership-response') |
|
1214 | 1214 | . '</h2>'; |
1215 | - $output .= '<p>' . bts('Team member @name requested team foundership on' |
|
1215 | + $output .= '<p>'.bts('Team member @name requested team foundership on' |
|
1216 | 1216 | . ' @date, but then left the team. This request is now canceled.', |
1217 | 1217 | array( |
1218 | 1218 | '@name' => $member->boincuser_name, |
1219 | 1219 | '@date' => date('j M Y', $boincteam->ping_time), |
1220 | 1220 | ), |
1221 | - NULL, 'boinc:team-request-foundership-response') . '</p>'; |
|
1221 | + NULL, 'boinc:team-request-foundership-response').'</p>'; |
|
1222 | 1222 | // Automatically cancel the request |
1223 | 1223 | db_set_active('boinc_rw'); |
1224 | 1224 | db_query(" |
@@ -1231,15 +1231,15 @@ discard block |
||
1231 | 1231 | } |
1232 | 1232 | else { |
1233 | 1233 | $member = user_load(boincuser_lookup_uid($boincteam->ping_user)); |
1234 | - $output .= '<h2 class="pane-title">' . bts('Respond to transfer request', array(), NULL, 'boinc:team-request-foundership-response') |
|
1234 | + $output .= '<h2 class="pane-title">'.bts('Respond to transfer request', array(), NULL, 'boinc:team-request-foundership-response') |
|
1235 | 1235 | . '</h2>'; |
1236 | - $output .= '<p>' . bts('Team member @name has requested team foundership.' |
|
1236 | + $output .= '<p>'.bts('Team member @name has requested team foundership.' |
|
1237 | 1237 | . ' This may be because you left the team or have not had contact with' |
1238 | 1238 | . ' the team for a long time.', array( |
1239 | 1239 | '@name' => $member->boincuser_name, |
1240 | 1240 | ) |
1241 | - , array(), NULL, 'boinc:team-request-foundership-response') . '</p>'; |
|
1242 | - $output .= '<p>' . bts("If you don't decline the request by @date, @name" |
|
1241 | + , array(), NULL, 'boinc:team-request-foundership-response').'</p>'; |
|
1242 | + $output .= '<p>'.bts("If you don't decline the request by @date, @name" |
|
1243 | 1243 | . ' will have the option of assuming team foundership. (note: To' |
1244 | 1244 | . ' accept the request, assign foundership to @name using the form' |
1245 | 1245 | . ' below)', |
@@ -1247,10 +1247,10 @@ discard block |
||
1247 | 1247 | '@name' => $member->boincuser_name, |
1248 | 1248 | '@date' => date('j M Y', boincteam_foundership_transfer_ok_time($boincteam)), |
1249 | 1249 | ), |
1250 | - NULL, 'boinc:team-request-foundership-response') . '</p>'; |
|
1250 | + NULL, 'boinc:team-request-foundership-response').'</p>'; |
|
1251 | 1251 | $output .= '<ul class="tab-list">'; |
1252 | - $output .= ' <li class="first last tab">' . |
|
1253 | - l(bts('Deny request', array(), NULL, 'boinc:team-request-foundership-response'), "community/teams/{$team_id}/deny-foundership-request") . '</li>'; |
|
1252 | + $output .= ' <li class="first last tab">'. |
|
1253 | + l(bts('Deny request', array(), NULL, 'boinc:team-request-foundership-response'), "community/teams/{$team_id}/deny-foundership-request").'</li>'; |
|
1254 | 1254 | $output .= '</ul>'; |
1255 | 1255 | } |
1256 | 1256 | } |
@@ -1260,9 +1260,9 @@ discard block |
||
1260 | 1260 | function boincteam_search_panel() { |
1261 | 1261 | $output = ''; |
1262 | 1262 | if (module_exists('global_search_teams_solr')) { |
1263 | - $output .= '<h2 class="pane-title">' . bts('Search teams', array(), NULL, 'boinc:search-team') . '</h2>'; |
|
1263 | + $output .= '<h2 class="pane-title">'.bts('Search teams', array(), NULL, 'boinc:search-team').'</h2>'; |
|
1264 | 1264 | //$output .= '<p>' . bts('Render a search form here.', array(), NULL, 'boinc:search-team') . '</p>'; |
1265 | - $output .= '<p>' . boincteam_search_view() . '</p>'; |
|
1265 | + $output .= '<p>'.boincteam_search_view().'</p>'; |
|
1266 | 1266 | } |
1267 | 1267 | return $output; |
1268 | 1268 | } |
@@ -1278,20 +1278,20 @@ discard block |
||
1278 | 1278 | * General info about the concept of teams |
1279 | 1279 | */ |
1280 | 1280 | function boincteam_topic_overview_panel() { |
1281 | - $site_name = variable_get('site_name', 'Drupal-BOINC'); |
|
1281 | + $site_name = variable_get('site_name', 'Drupal-BOINC'); |
|
1282 | 1282 | $output = ''; |
1283 | - $output .= '<h2 class="pane-title">' . bts('Teams', array(), NULL, 'boinc:team-general-info') . '</h2>'; |
|
1283 | + $output .= '<h2 class="pane-title">'.bts('Teams', array(), NULL, 'boinc:team-general-info').'</h2>'; |
|
1284 | 1284 | $output .= '<div class="">'; |
1285 | - $output .= '<p>' . bts('@project participants may form teams. You may belong' |
|
1285 | + $output .= '<p>'.bts('@project participants may form teams. You may belong' |
|
1286 | 1286 | . ' to only one team. You can join or quit a team at any time. To join a' |
1287 | 1287 | . ' team, visit its team page and click "Join this team". Each team has a' |
1288 | - . ' founder who may:', array('@project' => $site_name), NULL, 'boinc:team-general-info') . '</p>'; |
|
1288 | + . ' founder who may:', array('@project' => $site_name), NULL, 'boinc:team-general-info').'</p>'; |
|
1289 | 1289 | $output .= '<ul>'; |
1290 | - $output .= ' <li>' . bts('Private Message all team members', array(), NULL, 'boinc:team-general-info') . '</li>'; |
|
1291 | - $output .= ' <li>' . bts("edit the team's name and description", array(), NULL, 'boinc:team-general-info') . '</li>'; |
|
1292 | - $output .= ' <li>' . bts('add or remove team admins', array(), NULL, 'boinc:team-general-info') . '</li>'; |
|
1293 | - $output .= ' <li>' . bts('remove members from the team', array(), NULL, 'boinc:team-general-info') . '</li>'; |
|
1294 | - $output .= ' <li>' . bts('disband a team if it has no members', array(), NULL, 'boinc:team-general-info') . '</li>'; |
|
1290 | + $output .= ' <li>'.bts('Private Message all team members', array(), NULL, 'boinc:team-general-info').'</li>'; |
|
1291 | + $output .= ' <li>'.bts("edit the team's name and description", array(), NULL, 'boinc:team-general-info').'</li>'; |
|
1292 | + $output .= ' <li>'.bts('add or remove team admins', array(), NULL, 'boinc:team-general-info').'</li>'; |
|
1293 | + $output .= ' <li>'.bts('remove members from the team', array(), NULL, 'boinc:team-general-info').'</li>'; |
|
1294 | + $output .= ' <li>'.bts('disband a team if it has no members', array(), NULL, 'boinc:team-general-info').'</li>'; |
|
1295 | 1295 | $output .= '</ul>'; |
1296 | 1296 | $output .= '</div>'; |
1297 | 1297 | return $output; |
@@ -1336,34 +1336,34 @@ discard block |
||
1336 | 1336 | } |
1337 | 1337 | } |
1338 | 1338 | $output = ''; |
1339 | - $output .= '<h2 class="pane-title">' . $boincteam->name . '</h2>'; |
|
1339 | + $output .= '<h2 class="pane-title">'.$boincteam->name.'</h2>'; |
|
1340 | 1340 | $output .= '<div>'; |
1341 | 1341 | $output .= '<div class="left-column">'; |
1342 | 1342 | $output .= '<ul class="stats">'; |
1343 | - $output .= ' <li>' . bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits') . ': ' . number_format($boincteam->total_credit, 0) . '</li>'; |
|
1344 | - $output .= ' <li>' . bts('Recent average credit', array(), NULL, 'boinc:user-or-team-RAC') . ': ' . number_format($boincteam->expavg_credit, 2) . '</li>'; |
|
1345 | - $output .= ' <li>' . bts('Country', array(), NULL, 'boinc:country-of-origin') . ': ' . $boincteam->country . '</li>'; |
|
1346 | - $output .= ' <li>' . bts('Type', array(), NULL, 'boinc:view-team-info') . ': ' . boincteam_get_type($team_id) . '</li>'; |
|
1343 | + $output .= ' <li>'.bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits').': '.number_format($boincteam->total_credit, 0).'</li>'; |
|
1344 | + $output .= ' <li>'.bts('Recent average credit', array(), NULL, 'boinc:user-or-team-RAC').': '.number_format($boincteam->expavg_credit, 2).'</li>'; |
|
1345 | + $output .= ' <li>'.bts('Country', array(), NULL, 'boinc:country-of-origin').': '.$boincteam->country.'</li>'; |
|
1346 | + $output .= ' <li>'.bts('Type', array(), NULL, 'boinc:view-team-info').': '.boincteam_get_type($team_id).'</li>'; |
|
1347 | 1347 | $output .= '</ul>'; |
1348 | 1348 | $output .= '</div>'; |
1349 | 1349 | $output .= '<div class="right-column">'; |
1350 | 1350 | $output .= '<ul class="stats">'; |
1351 | - $output .= ' <li>' . bts('Founder', array(), NULL, 'boinc:view-team-info') . ': ' . l($founder->boincuser_name, "account/{$founder->uid}") . '</li>'; |
|
1352 | - $output .= ' <li>' . bts('New members in last day', array(), NULL, 'boinc:view-team-info') . ': ' . implode('·', $new_members) . '</li>'; |
|
1353 | - $output .= ' <li>' . bts('Total members', array(), NULL, 'boinc:view-team-info') . ': ' . l($boincteam->nusers, "community/teams/{$team_id}/members") . '</li>'; |
|
1354 | - $output .= ' <li>' . bts('Active members', array(), NULL, 'boinc:view-team-info') . ': ' . $boincteam->nusers_active . '</li>'; |
|
1355 | - $output .= ' <li>' . bts('Members with credit', array(), NULL, 'boinc:view-team-info') . ': ' . $boincteam->nusers_worked . '</li>'; |
|
1351 | + $output .= ' <li>'.bts('Founder', array(), NULL, 'boinc:view-team-info').': '.l($founder->boincuser_name, "account/{$founder->uid}").'</li>'; |
|
1352 | + $output .= ' <li>'.bts('New members in last day', array(), NULL, 'boinc:view-team-info').': '.implode('·', $new_members).'</li>'; |
|
1353 | + $output .= ' <li>'.bts('Total members', array(), NULL, 'boinc:view-team-info').': '.l($boincteam->nusers, "community/teams/{$team_id}/members").'</li>'; |
|
1354 | + $output .= ' <li>'.bts('Active members', array(), NULL, 'boinc:view-team-info').': '.$boincteam->nusers_active.'</li>'; |
|
1355 | + $output .= ' <li>'.bts('Members with credit', array(), NULL, 'boinc:view-team-info').': '.$boincteam->nusers_worked.'</li>'; |
|
1356 | 1356 | $output .= '</ul>'; |
1357 | 1357 | $output .= '</div>'; |
1358 | 1358 | $output .= '</div>'; |
1359 | 1359 | $output .= '<div class="clearfix"></div>'; |
1360 | 1360 | if ($boincteam->url) { |
1361 | 1361 | $output .= '<div class="stats">'; |
1362 | - $output .= bts('Website', array(), NULL, 'boinc:website-of-user-or-team') . ': ' . l("http://{$boincteam->url}", "http://{$boincteam->url}"); |
|
1362 | + $output .= bts('Website', array(), NULL, 'boinc:website-of-user-or-team').': '.l("http://{$boincteam->url}", "http://{$boincteam->url}"); |
|
1363 | 1363 | $output .= '</div>'; |
1364 | 1364 | } |
1365 | 1365 | if ($team->body) { |
1366 | - $output .= '<h3>' . bts('Description', array(), NULL, 'boinc:team-description') . '</h3>'; |
|
1366 | + $output .= '<h3>'.bts('Description', array(), NULL, 'boinc:team-description').'</h3>'; |
|
1367 | 1367 | $output .= check_markup($team->body, $team->format); |
1368 | 1368 | $output .= '</div>'; |
1369 | 1369 | } |
@@ -87,15 +87,15 @@ discard block |
||
87 | 87 | 'teaser' => $teaser, |
88 | 88 | 'uid' => boincuser_lookup_uid($boincteam->userid), |
89 | 89 | 'path' => null, |
90 | - 'status' => 1, // published or not - always publish |
|
90 | + 'status' => 1, // published or not - always publish |
|
91 | 91 | 'promote' => 0, |
92 | 92 | 'created' => $boincteam->create_time, |
93 | - 'comment' => 0, // comments disabled |
|
93 | + 'comment' => 0, // comments disabled |
|
94 | 94 | 'moderate' => 0, |
95 | 95 | 'sticky' => 0, |
96 | 96 | 'format' => $input_format |
97 | 97 | ); |
98 | - $node = (object) $node; // node_save requires an object form |
|
98 | + $node = (object)$node; // node_save requires an object form |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | $node->taxonomy[] = taxonomy_get_term($team_type_tid); |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | * flag send_email=1, meaning their notification privacy will be |
126 | 126 | * respected. This is useful the list of users are to be contacted. |
127 | 127 | */ |
128 | -function _boincteam_userids($boincteamid, $boincid=TRUE, $respectprivacy=TRUE) { |
|
128 | +function _boincteam_userids($boincteamid, $boincid = TRUE, $respectprivacy = TRUE) { |
|
129 | 129 | $sql = 'SELECT user.id as id FROM {user} user WHERE user.teamid=%s'; |
130 | 130 | if ($respectprivacy) { |
131 | 131 | $sql .= ' AND user.send_email=1'; |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | * flag send_email=1, meaning their notification privacy will be |
158 | 158 | * respected. This is useful the list of users are to be contacted. |
159 | 159 | */ |
160 | -function _boincteam_emails($boincteamid, $respectprivacy=TRUE) { |
|
160 | +function _boincteam_emails($boincteamid, $respectprivacy = TRUE) { |
|
161 | 161 | $sql = 'SELECT user.email_addr as email_addr FROM {user} user WHERE user.teamid=%s'; |
162 | 162 | if ($respectprivacy) { |
163 | 163 | $sql .= ' AND user.send_email=1'; |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | '#suffix' => '</li>', |
120 | 120 | ); |
121 | 121 | $form['form control tabs'] = array( |
122 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']) . '</li>' |
|
122 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']).'</li>' |
|
123 | 123 | ); |
124 | 124 | |
125 | 125 | return $form; |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | |
164 | 164 | // Create the team in the BOINC db |
165 | 165 | |
166 | - require_boinc(array('user','team')); |
|
166 | + require_boinc(array('user', 'team')); |
|
167 | 167 | $boinc_team = make_team( |
168 | 168 | $account->boincuser_id, |
169 | 169 | $values['name'], |
@@ -199,10 +199,10 @@ discard block |
||
199 | 199 | 'teaser' => $teaser, |
200 | 200 | 'uid' => $user->uid, |
201 | 201 | 'path' => null, |
202 | - 'status' => 1, // published or not - always publish |
|
202 | + 'status' => 1, // published or not - always publish |
|
203 | 203 | 'promote' => 0, |
204 | 204 | 'created' => $created_time, |
205 | - 'comment' => 0, // comments disabled |
|
205 | + 'comment' => 0, // comments disabled |
|
206 | 206 | 'moderate' => 0, |
207 | 207 | 'sticky' => 0, |
208 | 208 | 'format' => $input_format |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | $node['og_private'] = 0; |
230 | 230 | */ |
231 | 231 | |
232 | - $node = (object) $node; // node_save requires an object form |
|
232 | + $node = (object)$node; // node_save requires an object form |
|
233 | 233 | |
234 | 234 | /* |
235 | 235 | $node->field_description[]['value'] = $boincteam->description; |
@@ -379,12 +379,12 @@ discard block |
||
379 | 379 | '#suffix' => '</li>', |
380 | 380 | ); |
381 | 381 | $form['form control tabs'] = array( |
382 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), strstr($_GET['q'], '/edit', TRUE)) . '</li>' |
|
382 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), strstr($_GET['q'], '/edit', TRUE)).'</li>' |
|
383 | 383 | ); |
384 | 384 | } |
385 | 385 | else { |
386 | 386 | $form['description'] = array( |
387 | - '#prefix' => '<div class="form-item"><label>' . bts('Description', array(), NULL, 'boinc:team-description') . ':</label></div><div class="form-item">', |
|
387 | + '#prefix' => '<div class="form-item"><label>'.bts('Description', array(), NULL, 'boinc:team-description').':</label></div><div class="form-item">', |
|
388 | 388 | '#value' => $default['description'], |
389 | 389 | '#suffix' => '</div>', |
390 | 390 | ); |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | '#suffix' => '</li>', |
541 | 541 | ); |
542 | 542 | $form['form control tabs'] = array( |
543 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), strstr($_GET['q'], '/edit', TRUE)) . '</li>' |
|
543 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), strstr($_GET['q'], '/edit', TRUE)).'</li>' |
|
544 | 544 | ); |
545 | 545 | |
546 | 546 | //$form['#redirect'] = "community/teams/{$team_id}"; |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | drupal_set_title($mytitle); |
657 | 657 | |
658 | 658 | $form['emailteam']['header'] = array( |
659 | - '#value' => '<h1>' . $mytitle . '</h1>', |
|
659 | + '#value' => '<h1>'.$mytitle.'</h1>', |
|
660 | 660 | '#weight' => '-10', |
661 | 661 | '#prefix' => "<div id='sendmessageteammembers-header'>", |
662 | 662 | '#suffix' => "</div>", |
@@ -778,7 +778,7 @@ discard block |
||
778 | 778 | } |
779 | 779 | |
780 | 780 | // Check body |
781 | - if ( ($message['body'] === NULL || $message['body'] === '') ) { |
|
781 | + if (($message['body'] === NULL || $message['body'] === '')) { |
|
782 | 782 | form_set_error('body', |
783 | 783 | bts('Not allowed to send an empty message.', array(), NULL, 'boinc:team-message-form') |
784 | 784 | ); |
@@ -803,8 +803,8 @@ discard block |
||
803 | 803 | global $base_path; |
804 | 804 | |
805 | 805 | $suid = $form_state['values']['_senderuid']; |
806 | - $account = user_load(array('uid' => $suid )); |
|
807 | - $site_url = $base_url . $base_path . "messages/new/" . $suid; |
|
806 | + $account = user_load(array('uid' => $suid)); |
|
807 | + $site_url = $base_url.$base_path."messages/new/".$suid; |
|
808 | 808 | |
809 | 809 | // Form is validated, now send to all team members. Lookup boinc |
810 | 810 | // id of all team members, and then use user_load() to load user |
@@ -815,7 +815,7 @@ discard block |
||
815 | 815 | // emails removed. |
816 | 816 | $member_emails = _boincteam_emails($boinc_id); |
817 | 817 | // Remove sender's email address, unless selfsend is true. |
818 | - if ( !$form_state['values']['selfsend'] ) { |
|
818 | + if (!$form_state['values']['selfsend']) { |
|
819 | 819 | $pos = array_search($account->mail, $member_emails); |
820 | 820 | unset($member_emails[$pos]); |
821 | 821 | } |
@@ -839,7 +839,7 @@ discard block |
||
839 | 839 | |
840 | 840 | $om = bts( |
841 | 841 | 'Sent your email message to !number team members.', |
842 | - array( '!number' => count($member_emails) ), |
|
842 | + array('!number' => count($member_emails)), |
|
843 | 843 | 'NULL', |
844 | 844 | 'boinc:team-message-sent' |
845 | 845 | ); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | // Call our custom authentication function to check for an existing BOINC user |
36 | 36 | if (!boincuser_login_authenticate($form_state['values'])) { |
37 | 37 | // Authentication failed; set an error accordingly |
38 | - form_set_error('name', bts('Sorry, unrecognized email address or password.', array(), NULL, 'boinc:forgot-password') . ' ' . l(bts('Have you forgotten your password?', array(), NULL, 'boinc:forgot-password'), 'user/password')); |
|
38 | + form_set_error('name', bts('Sorry, unrecognized email address or password.', array(), NULL, 'boinc:forgot-password').' '.l(bts('Have you forgotten your password?', array(), NULL, 'boinc:forgot-password'), 'user/password')); |
|
39 | 39 | } |
40 | 40 | } |
41 | 41 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | } else { |
85 | 85 | // Create a Drupal user from the BOINC user |
86 | 86 | if ($user = boincuser_register_make_drupal_user($boinc_user)) { |
87 | - watchdog('user', 'New external user: %email using module %module.', array('%email' => $email_addr, '%module' => $module), WATCHDOG_NOTICE, l(t('edit'), 'user/'. $user->uid .'/edit')); |
|
87 | + watchdog('user', 'New external user: %email using module %module.', array('%email' => $email_addr, '%module' => $module), WATCHDOG_NOTICE, l(t('edit'), 'user/'.$user->uid.'/edit')); |
|
88 | 88 | } |
89 | 89 | } |
90 | 90 | } |
@@ -394,14 +394,14 @@ discard block |
||
394 | 394 | // set email address lower-case |
395 | 395 | $edit['mail'] = strtolower($edit['mail']); |
396 | 396 | |
397 | - $boinc_user_already_exists = ( BoincUser::lookup_email_addr($edit['mail']) || BoincUser::lookup_prev_email_addr($edit['mail']) ); |
|
397 | + $boinc_user_already_exists = (BoincUser::lookup_email_addr($edit['mail']) || BoincUser::lookup_prev_email_addr($edit['mail'])); |
|
398 | 398 | if ($boinc_user_already_exists) { |
399 | 399 | form_set_error('mail', bts('A BOINC account already exists for @email.', array('@email' => $edit['mail']), NULL, 'boinc:add-new-user')); |
400 | 400 | } |
401 | 401 | |
402 | 402 | // Check email has not been changed in last X days (default X=7). |
403 | - $duration = 86400 * 7; |
|
404 | - if ( (($boinc_user->email_addr_change_time + $duration) > time()) and (!(user_access('administer users'))) ) { |
|
403 | + $duration = 86400*7; |
|
404 | + if ((($boinc_user->email_addr_change_time + $duration) > time()) and (!(user_access('administer users')))) { |
|
405 | 405 | form_set_error('email_addr_change_time', |
406 | 406 | bts('Your email address was changed within the past seven (7) days. You must wait until !futuredate to change your email again. If you need to reverse this change, please look for an email sent to !prev_email_addr.', |
407 | 407 | array( |
@@ -422,11 +422,11 @@ discard block |
||
422 | 422 | unset($_SESSION['reset_pass']); |
423 | 423 | } |
424 | 424 | else { |
425 | - $given_hash = md5($edit['current_pass'] . strtolower($account->mail)); |
|
425 | + $given_hash = md5($edit['current_pass'].strtolower($account->mail)); |
|
426 | 426 | if (!$edit['current_pass']) { |
427 | 427 | form_set_error('current_pass', bts('Authentication is required when changing E-mail address or setting new password.', array(), NULL, 'boinc:account-credentials-change')); |
428 | 428 | } |
429 | - elseif ( (!password_verify($given_hash, $boinc_user->passwd_hash)) and ($given_hash != $boinc_user->passwd_hash) ) { |
|
429 | + elseif ((!password_verify($given_hash, $boinc_user->passwd_hash)) and ($given_hash != $boinc_user->passwd_hash)) { |
|
430 | 430 | form_set_error('current_pass', bts('Password entered is not valid. Please verify that it is correct.', array(), NULL, 'boinc:account-credentials-change')); |
431 | 431 | } |
432 | 432 | |
@@ -489,29 +489,29 @@ discard block |
||
489 | 489 | $project_domain = $headers['Host']; |
490 | 490 | $form['heading'] = array( |
491 | 491 | '#type' => 'markup', |
492 | - '#value' => '<h3>' . bts("If you forgot your account's email address, or you can't receive email there:", array(), NULL, 'boinc:authenticator-login-page') . '</h3>' |
|
492 | + '#value' => '<h3>'.bts("If you forgot your account's email address, or you can't receive email there:", array(), NULL, 'boinc:authenticator-login-page').'</h3>' |
|
493 | 493 | ); |
494 | 494 | $form['instructions'] = array( |
495 | 495 | '#type' => 'markup', |
496 | - '#value' => '' . |
|
497 | - '<p>' . bts("If you have run BOINC under the account, you can still access it. Here's how:", array(), NULL, 'boinc:authenticator-login-page') . |
|
498 | - ' <ul>' . |
|
499 | - ' <li>' . bts('Go to the BOINC data directory on your computer (see !boinc_wiki for help finding this).', array('!boinc_wiki' => l(bts('BOINC documentation', array(), NULL, 'boinc:authenticator-login-page'), 'http://boinc.berkeley.edu/wiki/BOINC_Data_directory')), NULL, 'boinc:authenticator-login-page') . '</li>' . |
|
500 | - ' <li>' . bts('Find your account file for this project; it will have a name like %file (where the project URL is %url).', array('%file' => "account_{$project_domain}.xml", '%url' => "http://{$project_domain}"), NULL, 'boinc:authenticator-login-page') . '</li>' . |
|
501 | - ' <li>' . bts("Open the file in a text editor like Notepad. You'll see something like:", array(), NULL, 'boinc:authenticator-login-page') . |
|
502 | - ' <pre>' . |
|
503 | - '<account>' . "\n" . |
|
504 | - " <master_url>http://{$project_domain}/</master_url>" . "\n" . |
|
505 | - ' <authenticator>8b8496fdd26df7dc0423ecd43c09a56b</authenticator>' . "\n" . |
|
506 | - " <project_name>{$project_name}</project_name>" . "\n" . |
|
507 | - ' ...' . "\n" . |
|
508 | - '</account>' . |
|
509 | - ' </pre>' . |
|
510 | - ' </li>' . |
|
511 | - ' <li>' . bts('Select and Copy the string between <authenticator> and </authenticator> (%auth in the above example).', array('%auth' => '8b8496fdd26df7dc0423ecd43c09a56b'), NULL, 'boinc:authenticator-login-page') . '</li>' . |
|
512 | - ' <li>' . bts('Paste the string into the field below, and click OK.', array(), NULL, 'boinc:authenticator-login-page') . '</li>' . |
|
513 | - ' <li>' . bts('You will now be logged in to your account; update the email and password of your account.', array(), NULL, 'boinc:authenticator-login-page') . '</li>' . |
|
514 | - ' </ul>' . |
|
496 | + '#value' => ''. |
|
497 | + '<p>'.bts("If you have run BOINC under the account, you can still access it. Here's how:", array(), NULL, 'boinc:authenticator-login-page'). |
|
498 | + ' <ul>'. |
|
499 | + ' <li>'.bts('Go to the BOINC data directory on your computer (see !boinc_wiki for help finding this).', array('!boinc_wiki' => l(bts('BOINC documentation', array(), NULL, 'boinc:authenticator-login-page'), 'http://boinc.berkeley.edu/wiki/BOINC_Data_directory')), NULL, 'boinc:authenticator-login-page').'</li>'. |
|
500 | + ' <li>'.bts('Find your account file for this project; it will have a name like %file (where the project URL is %url).', array('%file' => "account_{$project_domain}.xml", '%url' => "http://{$project_domain}"), NULL, 'boinc:authenticator-login-page').'</li>'. |
|
501 | + ' <li>'.bts("Open the file in a text editor like Notepad. You'll see something like:", array(), NULL, 'boinc:authenticator-login-page'). |
|
502 | + ' <pre>'. |
|
503 | + '<account>'."\n". |
|
504 | + " <master_url>http://{$project_domain}/</master_url>"."\n". |
|
505 | + ' <authenticator>8b8496fdd26df7dc0423ecd43c09a56b</authenticator>'."\n". |
|
506 | + " <project_name>{$project_name}</project_name>"."\n". |
|
507 | + ' ...'."\n". |
|
508 | + '</account>'. |
|
509 | + ' </pre>'. |
|
510 | + ' </li>'. |
|
511 | + ' <li>'.bts('Select and Copy the string between <authenticator> and </authenticator> (%auth in the above example).', array('%auth' => '8b8496fdd26df7dc0423ecd43c09a56b'), NULL, 'boinc:authenticator-login-page').'</li>'. |
|
512 | + ' <li>'.bts('Paste the string into the field below, and click OK.', array(), NULL, 'boinc:authenticator-login-page').'</li>'. |
|
513 | + ' <li>'.bts('You will now be logged in to your account; update the email and password of your account.', array(), NULL, 'boinc:authenticator-login-page').'</li>'. |
|
514 | + ' </ul>'. |
|
515 | 515 | '</p>' |
516 | 516 | ); |
517 | 517 | $form['authenticator'] = array( |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | '#weight' => 1002, |
537 | 537 | ); |
538 | 538 | $form['form control tabs'] = array( |
539 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), 'user/password') . '</li>', |
|
539 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), 'user/password').'</li>', |
|
540 | 540 | '#weight' => 1003, |
541 | 541 | ); |
542 | 542 | $form['form control tabs suffix'] = array( |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | '#weight' => 1002, |
600 | 600 | ); |
601 | 601 | $form['form control tabs'] = array( |
602 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "account/{$uid}") . '</li>', |
|
602 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "account/{$uid}").'</li>', |
|
603 | 603 | '#weight' => 1003, |
604 | 604 | ); |
605 | 605 | $form['form control tabs suffix'] = array( |
@@ -650,7 +650,7 @@ discard block |
||
650 | 650 | '#weight' => 1002, |
651 | 651 | ); |
652 | 652 | $form['form control tabs'] = array( |
653 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "account/{$uid}") . '</li>', |
|
653 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "account/{$uid}").'</li>', |
|
654 | 654 | '#weight' => 1003, |
655 | 655 | ); |
656 | 656 | $form['form control tabs suffix'] = array( |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | $uid = $form_state['storage']['ban_user_uid']; |
668 | 668 | $reason = $form_state['values']['reason']; |
669 | 669 | $duration = $form_state['values']['duration']; |
670 | - if ($duration) $duration = $duration * 24*60*60; |
|
670 | + if ($duration) $duration = $duration*24*60*60; |
|
671 | 671 | boincuser_moderate_user_ban($uid, $reason, $duration); |
672 | 672 | } |
673 | 673 | |
@@ -694,10 +694,10 @@ discard block |
||
694 | 694 | drupal_goto(); |
695 | 695 | } |
696 | 696 | |
697 | - drupal_set_message( bts('WARNING: You have not agreed to our terms of use. Please agree to the terms of use before continuing.', array(), NULL, 'boinc:termsofuse-form'), 'warning' ); |
|
697 | + drupal_set_message(bts('WARNING: You have not agreed to our terms of use. Please agree to the terms of use before continuing.', array(), NULL, 'boinc:termsofuse-form'), 'warning'); |
|
698 | 698 | |
699 | 699 | $form = array(); |
700 | - drupal_add_js(drupal_get_path('module', 'boincuser') . '/boincuser.js'); |
|
700 | + drupal_add_js(drupal_get_path('module', 'boincuser').'/boincuser.js'); |
|
701 | 701 | $termsofuse = variable_get('boinc_weboptions_termsofuse', ''); |
702 | 702 | |
703 | 703 | // Fieldset to hold all of the form as a container |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | |
711 | 711 | $form['termsofuse']['title1'] = array( |
712 | 712 | '#weight' => -12, |
713 | - '#value' => '<h2>' . bts( variable_get('boinc_weboptions_registrationtitle', 'Please read and acknowledge our terms of use'), array(), NULL, 'project:termsofuse-form' ) . '</h2>', |
|
713 | + '#value' => '<h2>'.bts(variable_get('boinc_weboptions_registrationtitle', 'Please read and acknowledge our terms of use'), array(), NULL, 'project:termsofuse-form').'</h2>', |
|
714 | 714 | '#prefix' => '<div id="register-title1">', |
715 | 715 | '#suffix' => '</div>', |
716 | 716 | ); |
@@ -745,12 +745,12 @@ discard block |
||
745 | 745 | '#suffix' => '</li>', |
746 | 746 | ); |
747 | 747 | $form['form control tabs'] = array( |
748 | - '#value' => '<li class="tab">' . l(bts('NO - LOGOUT', array(), NULL, 'boinc:form-cancel'), '/logout') . '</li>', |
|
748 | + '#value' => '<li class="tab">'.l(bts('NO - LOGOUT', array(), NULL, 'boinc:form-cancel'), '/logout').'</li>', |
|
749 | 749 | ); |
750 | 750 | if (module_exists('boincuser_delete')) { |
751 | - $deletelink = '/user/' . $user->uid . '/delete'; |
|
751 | + $deletelink = '/user/'.$user->uid.'/delete'; |
|
752 | 752 | $form['deleteaccount'] = array( |
753 | - '#value' => '<li class="tab">' . l(bts('NO - DELETE ACCOUNT', array(), NULL, 'boinc:form-delete-user'), $deletelink) . '</li>', |
|
753 | + '#value' => '<li class="tab">'.l(bts('NO - DELETE ACCOUNT', array(), NULL, 'boinc:form-delete-user'), $deletelink).'</li>', |
|
754 | 754 | ); |
755 | 755 | } |
756 | 756 | |
@@ -843,7 +843,7 @@ discard block |
||
843 | 843 | $form['buttons']['submit']['#suffix'] = '</li>'; |
844 | 844 | $form['buttons']['submit']['#weight'] = 1002; |
845 | 845 | $form['buttons']['cancel'] = array( |
846 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), 'user/info/edit') . '</li>', |
|
846 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), 'user/info/edit').'</li>', |
|
847 | 847 | '#weight' => 1005, |
848 | 848 | ); |
849 | 849 | $form['buttons']['form control tabs suffix'] = array( |
@@ -887,7 +887,7 @@ discard block |
||
887 | 887 | |
888 | 888 | // Set new password based on previous email address and entered |
889 | 889 | // password. |
890 | - $new_passwd_hash = password_hash( md5($form_state['values']['pass'].$pem), PASSWORD_DEFAULT); |
|
890 | + $new_passwd_hash = password_hash(md5($form_state['values']['pass'].$pem), PASSWORD_DEFAULT); |
|
891 | 891 | |
892 | 892 | $boinc_user->update("email_addr='${pem}', previous_email_addr='', email_addr_change_time=0, passwd_hash='${new_passwd_hash}'"); |
893 | 893 |
@@ -27,73 +27,73 @@ |
||
27 | 27 | define('BATCH_STATE_RETIRED', 4); |
28 | 28 | |
29 | 29 | define('ANON_PLATFORM_UNKNOWN', -1); |
30 | -define('ANON_PLATFORM_CPU', -2); |
|
31 | -define('ANON_PLATFORM_NVIDIA', -3); |
|
32 | -define('ANON_PLATFORM_ATI', -4); |
|
33 | -define('ANON_PLATFORM_INTEL', -5); |
|
30 | +define('ANON_PLATFORM_CPU', -2); |
|
31 | +define('ANON_PLATFORM_NVIDIA', -3); |
|
32 | +define('ANON_PLATFORM_ATI', -4); |
|
33 | +define('ANON_PLATFORM_INTEL', -5); |
|
34 | 34 | |
35 | -define('RESULT_SERVER_STATE_INACTIVE', 1); |
|
36 | -define('RESULT_SERVER_STATE_UNSENT', 2); |
|
37 | -define('RESULT_SERVER_STATE_IN_PROGRESS', 4); |
|
38 | -define('RESULT_SERVER_STATE_OVER', 5); |
|
35 | +define('RESULT_SERVER_STATE_INACTIVE', 1); |
|
36 | +define('RESULT_SERVER_STATE_UNSENT', 2); |
|
37 | +define('RESULT_SERVER_STATE_IN_PROGRESS', 4); |
|
38 | +define('RESULT_SERVER_STATE_OVER', 5); |
|
39 | 39 | |
40 | -define('RESULT_OUTCOME_INIT', 0); |
|
41 | -define('RESULT_OUTCOME_SUCCESS', 1); |
|
42 | -define('RESULT_OUTCOME_COULDNT_SEND', 2); |
|
43 | -define('RESULT_OUTCOME_CLIENT_ERROR', 3); |
|
44 | -define('RESULT_OUTCOME_NO_REPLY', 4); |
|
45 | -define('RESULT_OUTCOME_DIDNT_NEED', 5); |
|
46 | -define('RESULT_OUTCOME_VALIDATE_ERROR', 6); |
|
47 | -define('RESULT_OUTCOME_CLIENT_DETACHED', 7); |
|
40 | +define('RESULT_OUTCOME_INIT', 0); |
|
41 | +define('RESULT_OUTCOME_SUCCESS', 1); |
|
42 | +define('RESULT_OUTCOME_COULDNT_SEND', 2); |
|
43 | +define('RESULT_OUTCOME_CLIENT_ERROR', 3); |
|
44 | +define('RESULT_OUTCOME_NO_REPLY', 4); |
|
45 | +define('RESULT_OUTCOME_DIDNT_NEED', 5); |
|
46 | +define('RESULT_OUTCOME_VALIDATE_ERROR', 6); |
|
47 | +define('RESULT_OUTCOME_CLIENT_DETACHED', 7); |
|
48 | 48 | |
49 | -define('VALIDATE_STATE_INIT', 0); |
|
50 | -define('VALIDATE_STATE_VALID', 1); |
|
51 | -define('VALIDATE_STATE_INVALID', 2); |
|
52 | -define('VALIDATE_STATE_NO_CHECK', 3); |
|
53 | -define('VALIDATE_STATE_INCONCLUSIVE',4); |
|
54 | -define('VALIDATE_STATE_TOO_LATE', 5); |
|
49 | +define('VALIDATE_STATE_INIT', 0); |
|
50 | +define('VALIDATE_STATE_VALID', 1); |
|
51 | +define('VALIDATE_STATE_INVALID', 2); |
|
52 | +define('VALIDATE_STATE_NO_CHECK', 3); |
|
53 | +define('VALIDATE_STATE_INCONCLUSIVE', 4); |
|
54 | +define('VALIDATE_STATE_TOO_LATE', 5); |
|
55 | 55 | |
56 | -define('WU_ERROR_COULDNT_SEND_RESULT', 1); |
|
57 | -define('WU_ERROR_TOO_MANY_ERROR_RESULTS', 2); |
|
58 | -define('WU_ERROR_TOO_MANY_SUCCESS_RESULTS', 4); |
|
59 | -define('WU_ERROR_TOO_MANY_TOTAL_RESULTS', 8); |
|
60 | -define('WU_ERROR_CANCELLED', 16); |
|
61 | -define('WU_ERROR_NO_CANONICAL_RESULT', 32); |
|
56 | +define('WU_ERROR_COULDNT_SEND_RESULT', 1); |
|
57 | +define('WU_ERROR_TOO_MANY_ERROR_RESULTS', 2); |
|
58 | +define('WU_ERROR_TOO_MANY_SUCCESS_RESULTS', 4); |
|
59 | +define('WU_ERROR_TOO_MANY_TOTAL_RESULTS', 8); |
|
60 | +define('WU_ERROR_CANCELLED', 16); |
|
61 | +define('WU_ERROR_NO_CANONICAL_RESULT', 32); |
|
62 | 62 | |
63 | -define('FILE_DELETE_INIT', 0); |
|
64 | -define('FILE_DELETE_READY', 1); |
|
65 | -define('FILE_DELETE_DONE', 2); |
|
66 | -define('FILE_DELETE_ERROR', 3); |
|
63 | +define('FILE_DELETE_INIT', 0); |
|
64 | +define('FILE_DELETE_READY', 1); |
|
65 | +define('FILE_DELETE_DONE', 2); |
|
66 | +define('FILE_DELETE_ERROR', 3); |
|
67 | 67 | |
68 | -define('ASSIMILATE_INIT', 0); |
|
69 | -define('ASSIMILATE_READY', 1); |
|
70 | -define('ASSIMILATE_DONE', 2); |
|
68 | +define('ASSIMILATE_INIT', 0); |
|
69 | +define('ASSIMILATE_READY', 1); |
|
70 | +define('ASSIMILATE_DONE', 2); |
|
71 | 71 | |
72 | 72 | // from lib/common_defs.h |
73 | 73 | // |
74 | -define('RESULT_NEW', 0); |
|
75 | -define('RESULT_FILES_DOWNLOADING', 1); |
|
76 | -define('RESULT_FILES_DOWNLOADED', 2); |
|
77 | -define('RESULT_COMPUTE_ERROR', 3); |
|
78 | -define('RESULT_FILES_UPLOADING', 4); |
|
79 | -define('RESULT_FILES_UPLOADED', 5); |
|
80 | -define('RESULT_ABORTED', 6); |
|
81 | -define('RESULT_UPLOAD_FAILED', 7); |
|
74 | +define('RESULT_NEW', 0); |
|
75 | +define('RESULT_FILES_DOWNLOADING', 1); |
|
76 | +define('RESULT_FILES_DOWNLOADED', 2); |
|
77 | +define('RESULT_COMPUTE_ERROR', 3); |
|
78 | +define('RESULT_FILES_UPLOADING', 4); |
|
79 | +define('RESULT_FILES_UPLOADED', 5); |
|
80 | +define('RESULT_ABORTED', 6); |
|
81 | +define('RESULT_UPLOAD_FAILED', 7); |
|
82 | 82 | |
83 | 83 | // from lib/error_numbers.h |
84 | 84 | // returned by some web RPCs |
85 | 85 | // |
86 | -define('ERR_XML_PARSE', -112); |
|
87 | -define('ERR_DB_NOT_FOUND', -136); |
|
88 | -define('ERR_DB_NOT_UNIQUE', -137); |
|
89 | -define('ERR_DB_CANT_CONNECT', -138); |
|
90 | -define('ERR_PROJECT_DOWN', -183); |
|
91 | -define('ERR_BAD_USER_NAME', -188); |
|
92 | -define('ERR_NO_OPTION', -191); |
|
93 | -define('ERR_BAD_EMAIL_ADDR', -205); |
|
94 | -define('ERR_BAD_PASSWD', -206); |
|
95 | -define('ERR_ACCT_CREATION_DISABLED', -208); |
|
96 | -define('ERR_ATTACH_FAIL_INIT', -209); |
|
97 | -define('ERR_ATTACH_FAIL_DOWNLOAD', -210); |
|
98 | -define('ERR_ACCT_REQUIRE_CONSENT', -242); |
|
86 | +define('ERR_XML_PARSE', -112); |
|
87 | +define('ERR_DB_NOT_FOUND', -136); |
|
88 | +define('ERR_DB_NOT_UNIQUE', -137); |
|
89 | +define('ERR_DB_CANT_CONNECT', -138); |
|
90 | +define('ERR_PROJECT_DOWN', -183); |
|
91 | +define('ERR_BAD_USER_NAME', -188); |
|
92 | +define('ERR_NO_OPTION', -191); |
|
93 | +define('ERR_BAD_EMAIL_ADDR', -205); |
|
94 | +define('ERR_BAD_PASSWD', -206); |
|
95 | +define('ERR_ACCT_CREATION_DISABLED', -208); |
|
96 | +define('ERR_ATTACH_FAIL_INIT', -209); |
|
97 | +define('ERR_ATTACH_FAIL_DOWNLOAD', -210); |
|
98 | +define('ERR_ACCT_REQUIRE_CONSENT', -242); |
|
99 | 99 | ?> |
@@ -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 | } |
@@ -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'), |