@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | if ($notify) { |
39 | 39 | page_head(tra("Request pending")); |
40 | 40 | $t = date_str($friend->create_time); |
41 | - echo tra("You requested friendship with %1 on %2.", $destuser->name,$t) . " |
|
41 | + echo tra("You requested friendship with %1 on %2.", $destuser->name, $t)." |
|
42 | 42 | <p>" . |
43 | 43 | tra("This request is still pending confirmation."); |
44 | 44 | page_tail(); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | function check_ignoring($srcuser, $destuser) { |
52 | 52 | BoincForumPrefs::lookup($destuser); |
53 | 53 | if (is_ignoring($destuser, $srcuser)) { |
54 | - error_page(tra("%1 is not accepting friendship requests from you",$destuser->name)); |
|
54 | + error_page(tra("%1 is not accepting friendship requests from you", $destuser->name)); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
@@ -72,11 +72,11 @@ discard block |
||
72 | 72 | echo " |
73 | 73 | <form method=post action=friend.php> |
74 | 74 | <input type=hidden name=userid value=$destid> |
75 | - <input type=hidden name=action value=add_confirm>" . |
|
75 | + <input type=hidden name=action value=add_confirm>". |
|
76 | 76 | tra("You have asked to add %1 as a friend. We will notify %1 and will ask him/her to confirm that you are friends.", |
77 | - "<b>".$destuser->name."</b>") ." |
|
77 | + "<b>".$destuser->name."</b>")." |
|
78 | 78 | <p>" . |
79 | - tra("Add an optional message here:") ." |
|
79 | + tra("Add an optional message here:")." |
|
80 | 80 | <br> |
81 | 81 | ".textarea_with_counter("message", 250, "")." |
82 | 82 | <p> |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | send_friend_request_email($user, $destuser, $msg); |
116 | 116 | } |
117 | 117 | page_head(tra("Friend request sent")); |
118 | - echo tra("We have notified %1 of your request.","<b>".$destuser->name."</b>"); |
|
118 | + echo tra("We have notified %1 of your request.", "<b>".$destuser->name."</b>"); |
|
119 | 119 | page_tail(); |
120 | 120 | } |
121 | 121 | |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | } |
187 | 187 | |
188 | 188 | page_head(tra("Friendship confirmed")); |
189 | - echo tra("Your friendship with %1 has been confirmed.","<b>" . $srcuser->name ."</b>"); |
|
189 | + echo tra("Your friendship with %1 has been confirmed.", "<b>".$srcuser->name."</b>"); |
|
190 | 190 | page_tail(); |
191 | 191 | } |
192 | 192 | |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $notify->delete(); |
206 | 206 | } |
207 | 207 | page_head(tra("Friendship declined")); |
208 | - echo tra("You have declined friendship with %1","<b>".$srcuser->name."</b>"); |
|
208 | + echo tra("You have declined friendship with %1", "<b>".$srcuser->name."</b>"); |
|
209 | 209 | page_tail(); |
210 | 210 | } |
211 | 211 | |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | echo tra("Notification not found"); |
224 | 224 | } |
225 | 225 | page_head(tra("Friend confirmed")); |
226 | - echo tra("You are now friends with %1.",$destuser->name); |
|
226 | + echo tra("You are now friends with %1.", $destuser->name); |
|
227 | 227 | page_tail(); |
228 | 228 | } |
229 | 229 | |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | echo |
236 | 236 | tra("Are you sure you want to cancel your friendship with %1?", |
237 | 237 | $destuser->name |
238 | - ) ."<p>\n" |
|
238 | + )."<p>\n" |
|
239 | 239 | ; |
240 | 240 | show_button("friend.php?action=cancel&userid=$destid", tra("Yes"), tra("Cancel friendship")); |
241 | 241 | show_button(USER_HOME, tra("No"), tra("Stay friends")); |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | if (!$destuser) error_page("No such user"); |
250 | 250 | BoincFriend::delete($user->id, $destid); |
251 | 251 | page_head(tra("Friendship cancelled")); |
252 | - echo tra("Your friendship with %1 has been cancelled.",$destuser->name); |
|
252 | + echo tra("Your friendship with %1 has been cancelled.", $destuser->name); |
|
253 | 253 | page_tail(); |
254 | 254 | } |
255 | 255 |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | // In Drupal 7, these operation cases will all exist as their own hooks, |
80 | 80 | // so let's approximate that here so that this function can simply be removed |
81 | 81 | // upon migration to 7 |
82 | - switch($op) { |
|
82 | + switch ($op) { |
|
83 | 83 | case 'update': |
84 | 84 | boinctranslate_node_update($node); |
85 | 85 | break; |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | function boinctranslate_node_update($node) { |
99 | 99 | // Only process nodes of certain types as defined by the individual |
100 | 100 | // node's setting for field_boinctranslate_transifex. |
101 | - if ( ($node->field_boinctranslate_transifex) and ($node->field_boinctranslate_transifex[0]['value']=='1') ) { |
|
101 | + if (($node->field_boinctranslate_transifex) and ($node->field_boinctranslate_transifex[0]['value'] == '1')) { |
|
102 | 102 | // Add page content to translation table. |
103 | 103 | $textgroup = 'project'; |
104 | 104 | $location = "node:{$node->nid}:body"; |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | |
126 | 126 | // Only process this chunk if there is a hash associated with it. |
127 | 127 | if ($chunk['hash']) { |
128 | - $chunkloc = $location . ":{$chunk['hash']}"; |
|
128 | + $chunkloc = $location.":{$chunk['hash']}"; |
|
129 | 129 | |
130 | 130 | // If the hash for this chunk is in the hash table, logically |
131 | 131 | // the chunk is already in the database locales_source table. As |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | * is viewed (forward compatible to Drupal 7) |
180 | 180 | */ |
181 | 181 | function boinctranslate_node_view($node, $view_mode, $langcode) { |
182 | - switch($node->type) { |
|
182 | + switch ($node->type) { |
|
183 | 183 | case 'page': |
184 | 184 | break; |
185 | 185 | default: |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | array( |
203 | 203 | '!token' => l('#SPLIT_TOKEN#', "filter/tips/$format", |
204 | 204 | array( |
205 | - 'fragment' => 'filter-boinctranslate-' . $delta, |
|
205 | + 'fragment' => 'filter-boinctranslate-'.$delta, |
|
206 | 206 | 'attributes' => |
207 | 207 | array( |
208 | 208 | 'target'=>'_blank', |
@@ -238,14 +238,14 @@ discard block |
||
238 | 238 | return $text; |
239 | 239 | } |
240 | 240 | |
241 | - if ( ($node->field_boinctranslate_transifex) and ($node->field_boinctranslate_transifex[0]['value']=='1') ) { |
|
241 | + if (($node->field_boinctranslate_transifex) and ($node->field_boinctranslate_transifex[0]['value'] == '1')) { |
|
242 | 242 | if (variable_get("boinctranslate_filter_debug_$format", 0)) { |
243 | 243 | $timing_start = explode(' ', microtime()); |
244 | 244 | $ret = _boinctranslate_filter_process($text, $format, $mynid); |
245 | 245 | $timing_stop = explode(' ', microtime()); |
246 | 246 | $elapsed = $timing_stop[1] - $timing_start[1]; |
247 | 247 | $elapsed += $timing_stop[0] - $timing_start[0]; |
248 | - $mess = 'DEBUG ' . l('BOINC translate', "filter/tips/$format") .' parsed on '.date('r').'<br />Execution time: '.$elapsed.' seconds.'; |
|
248 | + $mess = 'DEBUG '.l('BOINC translate', "filter/tips/$format").' parsed on '.date('r').'<br />Execution time: '.$elapsed.' seconds.'; |
|
249 | 249 | drupal_set_message($mess, 'warning'); |
250 | 250 | return $ret; |
251 | 251 | } |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | $chunks = array(); |
309 | 309 | foreach ($parts as $key => $value) { |
310 | 310 | if (preg_match('/(#SPLIT_TOKEN#)/', $value)) { |
311 | - $chunks[] = array ('delimiter' => $value,); |
|
311 | + $chunks[] = array('delimiter' => $value,); |
|
312 | 312 | } |
313 | 313 | else { |
314 | 314 | $cleaned = preg_replace('/\s|\n/', '', $value); |
@@ -65,7 +65,7 @@ |
||
65 | 65 | // (so that bad guys can't tell if they have an unreplicated job) |
66 | 66 | |
67 | 67 | $config = get_config(); |
68 | - if ($app->target_nresults>0 && !$wu->canonical_resultid && !$wu->error_mask && !parse_bool($config, "dont_suppress_pending")) { |
|
68 | + if ($app->target_nresults > 0 && !$wu->canonical_resultid && !$wu->error_mask && !parse_bool($config, "dont_suppress_pending")) { |
|
69 | 69 | row2(tra("Tasks in progress"), tra("suppressed pending completion")); |
70 | 70 | end_table(); |
71 | 71 | } else { |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | // |
33 | 33 | function get_pct_badges($badge_name_prefix, $badge_pctiles, $badge_images) { |
34 | 34 | $badges = array(); |
35 | - for ($i=0; $i<3; $i++) { |
|
35 | + for ($i = 0; $i < 3; $i++) { |
|
36 | 36 | $badges[$i] = get_badge($badge_name_prefix."_".$i, "Top ".$badge_pctiles[$i]."% in average credit", $badge_images[$i]); |
37 | 37 | } |
38 | 38 | return $badges; |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | // |
43 | 43 | function get_percentiles($is_user, $badge_pctiles) { |
44 | 44 | $percentiles = array(); |
45 | - for ($i=0; $i<3; $i++) { |
|
45 | + for ($i = 0; $i < 3; $i++) { |
|
46 | 46 | if ($is_user) { |
47 | - $percentiles[$i] = BoincUser::percentile("expavg_credit", "expavg_credit>1", 100-$badge_pctiles[$i]); |
|
47 | + $percentiles[$i] = BoincUser::percentile("expavg_credit", "expavg_credit>1", 100 - $badge_pctiles[$i]); |
|
48 | 48 | } else { |
49 | - $percentiles[$i] = BoincTeam::percentile("expavg_credit", "expavg_credit>1", 100-$badge_pctiles[$i]); |
|
49 | + $percentiles[$i] = BoincTeam::percentile("expavg_credit", "expavg_credit>1", 100 - $badge_pctiles[$i]); |
|
50 | 50 | } |
51 | 51 | if ($percentiles[$i] === false) { |
52 | 52 | die("Can't get percentiles\n"); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | // Unassign other badges. |
60 | 60 | // |
61 | 61 | function assign_pct_badge($is_user, $item, $percentiles, $badges) { |
62 | - for ($i=0; $i<3; $i++) { |
|
62 | + for ($i = 0; $i < 3; $i++) { |
|
63 | 63 | if ($item->expavg_credit >= $percentiles[$i]) { |
64 | 64 | assign_badge($is_user, $item, $badges[$i]); |
65 | 65 | unassign_badges($is_user, $item, $badges, $i); |
@@ -73,13 +73,13 @@ discard block |
||
73 | 73 | // and assign/unassign RAC badges |
74 | 74 | // |
75 | 75 | function assign_badges($is_user, $badge_pctiles, $badge_images) { |
76 | - $kind = $is_user?"user":"team"; |
|
76 | + $kind = $is_user ? "user" : "team"; |
|
77 | 77 | $badges = get_pct_badges($kind."_pct", $badge_pctiles, $badge_images); |
78 | 78 | $pctiles = get_percentiles($is_user, $badge_pctiles); |
79 | 79 | //echo "thresholds for $kind badges: $pctiles[0] $pctiles[1] $pctiles[2]\n"; |
80 | 80 | |
81 | 81 | $n = 0; |
82 | - $maxid = $is_user?BoincUser::max("id"):BoincTeam::max("id"); |
|
82 | + $maxid = $is_user ?BoincUser::max("id") : BoincTeam::max("id"); |
|
83 | 83 | while ($n <= $maxid) { |
84 | 84 | $m = $n + 1000; |
85 | 85 | if ($is_user) { |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | |
104 | 104 | function spaces($level) { |
105 | 105 | $x = ""; |
106 | - for ($i=0; $i<$level; $i++) { |
|
106 | + for ($i = 0; $i < $level; $i++) { |
|
107 | 107 | $x .= " "; |
108 | 108 | } |
109 | 109 | return $x; |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | function avg_score($array) { |
137 | 137 | $sum = 0; |
138 | 138 | $n = count($array); |
139 | - if ($n ==0) return 0; |
|
139 | + if ($n == 0) return 0; |
|
140 | 140 | foreach ($array as $a) { |
141 | 141 | $sum += $a->score; |
142 | 142 | } |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $n++; |
153 | 153 | } |
154 | 154 | } |
155 | - if ($n ==0) return 0; |
|
155 | + if ($n == 0) return 0; |
|
156 | 156 | return $sum/$n; |
157 | 157 | } |
158 | 158 | |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | global $breakdown, $breakdown_cat; |
236 | 236 | global $rownum, $course_id; |
237 | 237 | |
238 | - $a = $is_answer?" (answer)":""; |
|
238 | + $a = $is_answer ? " (answer)" : ""; |
|
239 | 239 | $j = ($rownum++)%2; |
240 | 240 | echo "<tr class=row$j>"; |
241 | 241 | if ($breakdown && $breakdown_cat) { |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | <td><br></td> |
244 | 244 | <td><br></td> |
245 | 245 | "; |
246 | - } else { |
|
246 | + } else { |
|
247 | 247 | $c = class_name($class); |
248 | 248 | echo " |
249 | 249 | <td><b>".spaces($level)."$unit->name</b></td> |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | echo time_graph($t, 200); |
278 | 278 | break; |
279 | 279 | case "BoltExercise": |
280 | - $mode = $is_answer?BOLT_MODE_ANSWER:BOLT_MODE_SHOW; |
|
280 | + $mode = $is_answer ?BOLT_MODE_ANSWER:BOLT_MODE_SHOW; |
|
281 | 281 | $views = get_views($unit, $mode); |
282 | 282 | $n = count($views); |
283 | 283 | $out = outcomes($views); |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | show_unit($unit, $level); |
361 | 361 | if ($unit->is_item) return; |
362 | 362 | foreach ($unit->units as $u) { |
363 | - show_unit_recurse($u, $level+1); |
|
363 | + show_unit_recurse($u, $level + 1); |
|
364 | 364 | } |
365 | 365 | } |
366 | 366 | |
@@ -402,9 +402,9 @@ discard block |
||
402 | 402 | <input type=hidden name=course_id value=$course_id> |
403 | 403 | <table width=600><tr><td valign=top> |
404 | 404 | "; |
405 | - filter_form($filter?$filter->name():"", $filter_cat); |
|
405 | + filter_form($filter ? $filter->name() : "", $filter_cat); |
|
406 | 406 | echo "</td><td valign=top>"; |
407 | - breakdown_form($breakdown?$breakdown->name():""); |
|
407 | + breakdown_form($breakdown ? $breakdown->name() : ""); |
|
408 | 408 | echo " |
409 | 409 | </td></tr></table> |
410 | 410 | <p> |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | ) { |
78 | 78 | $badges = array(); |
79 | 79 | $limit = count($badge_level_names); |
80 | - for ($i=0; $i < $limit; $i++) { |
|
80 | + for ($i = 0; $i < $limit; $i++) { |
|
81 | 81 | $badges[$i] = get_badge($badge_name_prefix."_".$sub_project["short_name"]."_".$i, "$badge_level_names[$i] in ".$sub_project["name"]." credit", $sub_project["short_name"].$badge_images[$i]); |
82 | 82 | } |
83 | 83 | return $badges; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | // count from highest to lowest level, so the user get's assigned the |
91 | 91 | // highest possible level and the lower levels get removed |
92 | 92 | // |
93 | - for ($i=count($levels)-1; $i>=0; $i--) { |
|
93 | + for ($i = count($levels) - 1; $i >= 0; $i--) { |
|
94 | 94 | if ($item->total_credit >= $levels[$i]) { |
95 | 95 | assign_badge($is_user, $item, $badges[$i]); |
96 | 96 | unassign_badges($is_user, $item, $badges, $i); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | // count from highest to lowest level, so the user get's assigned the |
115 | 115 | // highest possible level and the lower levels get removed |
116 | 116 | // |
117 | - for ($i=count($levels)-1; $i>=0; $i--) { |
|
117 | + for ($i = count($levels) - 1; $i >= 0; $i--) { |
|
118 | 118 | if ($sub_total >= $levels[$i]) { |
119 | 119 | assign_badge($is_user, $item, $badges[$i]); |
120 | 120 | unassign_badges($is_user, $item, $badges, $i); |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $is_user, $badge_levels, $badge_level_names, $badge_images, |
135 | 135 | $subprojects_list |
136 | 136 | ) { |
137 | - $kind = $is_user?"user":"team"; |
|
137 | + $kind = $is_user ? "user" : "team"; |
|
138 | 138 | |
139 | 139 | // get badges for all subprojects including total |
140 | 140 | // |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | } |
144 | 144 | |
145 | 145 | $n = 0; |
146 | - $maxid = $is_user?BoincUser::max("id"):BoincTeam::max("id"); |
|
146 | + $maxid = $is_user ?BoincUser::max("id") : BoincTeam::max("id"); |
|
147 | 147 | while ($n <= $maxid) { |
148 | 148 | $m = $n + 1000; |
149 | 149 | if ($is_user) { |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | assign_tot_badge($is_user, $item, $badge_levels, $badges["total"]); |
162 | 162 | } else { |
163 | 163 | // appids come from project/project.inc |
164 | - $where_clause = "appid in (". implode(',', $sp["appids"]) .")"; |
|
164 | + $where_clause = "appid in (".implode(',', $sp["appids"]).")"; |
|
165 | 165 | assign_sub_badge( |
166 | 166 | $is_user, $item, $badge_levels, $badges[$sp["short_name"]], |
167 | 167 | $where_clause |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | function export_item($item, $is_user, $f) { |
29 | 29 | global $sub_projects; |
30 | 30 | |
31 | - fprintf($f, $is_user?"<user>\n":"<team>\n"); |
|
31 | + fprintf($f, $is_user ? "<user>\n" : "<team>\n"); |
|
32 | 32 | fprintf($f, " <id>$item->id</id>\n"); |
33 | - $crs = $is_user? |
|
33 | + $crs = $is_user ? |
|
34 | 34 | BoincCreditUser::enum("userid=$item->id") |
35 | 35 | : BoincCreditTeam::enum("teamid=$item->id") |
36 | 36 | ; |
@@ -56,16 +56,16 @@ discard block |
||
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
59 | - fprintf($f, $is_user?"</user>\n":"</team>\n"); |
|
59 | + fprintf($f, $is_user ? "</user>\n" : "</team>\n"); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | function export($is_user, $dir) { |
63 | 63 | $n = 0; |
64 | - $filename = $is_user?"$dir/user_work":"$dir/team_work"; |
|
64 | + $filename = $is_user ? "$dir/user_work" : "$dir/team_work"; |
|
65 | 65 | $f = fopen($filename, "w"); |
66 | 66 | if (!$f) die("fopen"); |
67 | - $is_user? fprintf($f, "<users>\n"): fprintf($f, "<teams>\n"); |
|
68 | - $maxid = $is_user?BoincUser::max("id"):BoincTeam::max("id"); |
|
67 | + $is_user ? fprintf($f, "<users>\n") : fprintf($f, "<teams>\n"); |
|
68 | + $maxid = $is_user ?BoincUser::max("id") : BoincTeam::max("id"); |
|
69 | 69 | while ($n <= $maxid) { |
70 | 70 | $m = $n + 1000; |
71 | 71 | if ($is_user) { |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | } |
79 | 79 | $n = $m; |
80 | 80 | } |
81 | - $is_user? fprintf($f, "</users>\n"): fprintf($f, "</teams>\n"); |
|
81 | + $is_user ? fprintf($f, "</users>\n") : fprintf($f, "</teams>\n"); |
|
82 | 82 | fclose($f); |
83 | 83 | system("gzip -f $filename"); |
84 | 84 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | // Also error-check values, and return errors in $errors->* |
34 | 34 | |
35 | 35 | function option($name, $val) { |
36 | - $x = ($name == $val) ? "selected" : ""; |
|
36 | + $x = ($name == $val) ? "selected" : ""; |
|
37 | 37 | return "<option name='$name' $x>$name\n"; |
38 | 38 | } |
39 | 39 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | if (APP_SELECT_PREFS) { |
54 | 54 | $app_array = array(); |
55 | 55 | $apps = BoincApp::enum("deprecated=0"); |
56 | - foreach($apps as $app) { |
|
56 | + foreach ($apps as $app) { |
|
57 | 57 | $app_array[] = array($app->id, $app->user_friendly_name); |
58 | 58 | } |
59 | 59 | } else { |
@@ -91,10 +91,10 @@ discard block |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | function number_select($name, $max, $n) { |
94 | - $sel = ($n == 0) ? "selected":""; |
|
94 | + $sel = ($n == 0) ? "selected" : ""; |
|
95 | 95 | $x = "<select class=\"form-control input-sm\" name=$name> <option value=0 $sel>".tra("No limit")."</option>"; |
96 | - for ($i=1; $i<=$max; $i++) { |
|
97 | - $sel = ($n == $i) ? "selected":""; |
|
96 | + for ($i = 1; $i <= $max; $i++) { |
|
97 | + $sel = ($n == $i) ? "selected" : ""; |
|
98 | 98 | $x .= "<option value=$i $sel>$i</option>"; |
99 | 99 | } |
100 | 100 | $x .= "</select>"; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | return tra("No limit"); |
107 | 107 | } |
108 | 108 | |
109 | -function project_specific_prefs_edit($prefs, $error=false) { |
|
109 | +function project_specific_prefs_edit($prefs, $error = false) { |
|
110 | 110 | global $app_array; |
111 | 111 | if (COLOR_PREFS) { |
112 | 112 | $x = $prefs->color_scheme; |
@@ -132,15 +132,15 @@ discard block |
||
132 | 132 | } else { |
133 | 133 | $present = true; |
134 | 134 | } |
135 | - $checked = $present?"checked":""; |
|
135 | + $checked = $present ? "checked" : ""; |
|
136 | 136 | $x .= "<input type=checkbox name=app_id_$app_id $checked> $app_name<br>"; |
137 | 137 | } |
138 | 138 | tooltip_row2(APP_SELECT_TOOLTIP, APP_SELECT_DESC, $x); |
139 | - $checked = $prefs->allow_non_preferred_apps?"checked":""; |
|
139 | + $checked = $prefs->allow_non_preferred_apps ? "checked" : ""; |
|
140 | 140 | row2(ACCEPT_ANY_DESC, "<input type=checkbox name=allow_non_preferred_apps $checked>"); |
141 | 141 | } |
142 | 142 | if (NON_GRAPHICAL_PREF) { |
143 | - $checked = $prefs->non_graphical?"checked":""; |
|
143 | + $checked = $prefs->non_graphical ? "checked" : ""; |
|
144 | 144 | row2( |
145 | 145 | NON_GRAPHICAL_DESC, |
146 | 146 | "<input type=checkbox name=non_graphical $checked>" |
@@ -216,11 +216,11 @@ discard block |
||
216 | 216 | return $x; |
217 | 217 | } |
218 | 218 | |
219 | -function project_specific_prefs_show($prefs, $columns=false) { |
|
219 | +function project_specific_prefs_show($prefs, $columns = false) { |
|
220 | 220 | global $app_array; |
221 | 221 | if ($columns) { |
222 | 222 | if (COLOR_PREFS) { |
223 | - row_defs(COLOR_DESC,"color_scheme", "", "", $prefs); |
|
223 | + row_defs(COLOR_DESC, "color_scheme", "", "", $prefs); |
|
224 | 224 | } |
225 | 225 | if (GFX_CPU_PREFS) { |
226 | 226 | row_defs(MAX_GFX_CPU_PCT_DESC, "max_gfx_cpu_pct", "", "", $prefs); |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | row2(ACCEPT_ANY_DESC, $prefs->allow_non_preferred_apps_text); |
255 | 255 | } |
256 | 256 | if (NON_GRAPHICAL_PREF) { |
257 | - row2(NON_GRAPHICAL_DESC, $prefs->non_graphical?tra("yes"):tra("no")); |
|
257 | + row2(NON_GRAPHICAL_DESC, $prefs->non_graphical ?tra("yes") : tra("no")); |
|
258 | 258 | } |
259 | 259 | if (MAX_JOBS_PREF) { |
260 | 260 | row2(tra("Max # jobs"), limit_string($prefs->max_jobs)); |
@@ -277,12 +277,12 @@ discard block |
||
277 | 277 | $cursor = 0; |
278 | 278 | while ($thisxml = parse_next_element($prefs_xml, "<app_id>", $cursor)) { |
279 | 279 | if (is_numeric($thisxml)) { |
280 | - $n = (int) $thisxml; |
|
280 | + $n = (int)$thisxml; |
|
281 | 281 | $prefs->app_ids[] = $n; |
282 | 282 | } |
283 | 283 | } |
284 | 284 | $prefs->allow_non_preferred_apps = parse_element($prefs_xml, "<allow_non_preferred_apps>"); |
285 | - $prefs->allow_non_preferred_apps_text = $prefs->allow_non_preferred_apps?"yes":"no"; |
|
285 | + $prefs->allow_non_preferred_apps_text = $prefs->allow_non_preferred_apps ? "yes" : "no"; |
|
286 | 286 | } |
287 | 287 | if (NON_GRAPHICAL_PREF) { |
288 | 288 | $prefs->non_graphical = parse_bool($prefs_xml, "non_graphical"); |
@@ -296,6 +296,6 @@ discard block |
||
296 | 296 | return $prefs; |
297 | 297 | } |
298 | 298 | |
299 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
299 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
300 | 300 | |
301 | 301 | ?> |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | return $platforms[$id]; |
54 | 54 | } |
55 | 55 | |
56 | -function anon_platform_string($result, $rsc_name=null) { |
|
56 | +function anon_platform_string($result, $rsc_name = null) { |
|
57 | 57 | $app = get_app($result->appid); |
58 | - $n = $app->user_friendly_name."<br>". tra("Anonymous platform"); |
|
58 | + $n = $app->user_friendly_name."<br>".tra("Anonymous platform"); |
|
59 | 59 | if ($rsc_name) { |
60 | 60 | $n .= " ($rsc_name)"; |
61 | 61 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | return $string_to_show; |
98 | 98 | } |
99 | 99 | if ($result->server_state <> RESULT_SERVER_STATE_OVER) return "---"; |
100 | - switch($result->outcome) { |
|
100 | + switch ($result->outcome) { |
|
101 | 101 | case RESULT_OUTCOME_SUCCESS: |
102 | 102 | switch ($result->validate_state) { |
103 | 103 | case VALIDATE_STATE_INIT: |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | ) { |
213 | 213 | return tra("Not started by deadline - canceled"); |
214 | 214 | } |
215 | - switch($result->client_state) { |
|
215 | + switch ($result->client_state) { |
|
216 | 216 | case RESULT_FILES_DOWNLOADING: return tra("Error while downloading"); |
217 | 217 | case RESULT_FILES_DOWNLOADED: |
218 | 218 | case RESULT_COMPUTE_ERROR: return tra("Error while computing"); |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | } |
232 | 232 | |
233 | 233 | function result_server_state_string($result) { |
234 | - switch($result->server_state) { |
|
234 | + switch ($result->server_state) { |
|
235 | 235 | case RESULT_SERVER_STATE_INACTIVE: return tra("Inactive"); |
236 | 236 | case RESULT_SERVER_STATE_UNSENT: return tra("Unsent"); |
237 | 237 | case RESULT_SERVER_STATE_IN_PROGRESS: return tra("In progress"); |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | } |
242 | 242 | |
243 | 243 | function result_outcome_string($result) { |
244 | - switch($result->outcome) { |
|
244 | + switch ($result->outcome) { |
|
245 | 245 | case RESULT_OUTCOME_INIT: return "---"; |
246 | 246 | case RESULT_OUTCOME_SUCCESS: return tra("Success"); |
247 | 247 | case RESULT_OUTCOME_COULDNT_SEND: return tra("Couldn't send"); |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | } |
260 | 260 | |
261 | 261 | function result_client_state_string($result) { |
262 | - switch($result->client_state) { |
|
262 | + switch ($result->client_state) { |
|
263 | 263 | case RESULT_NEW: return tra("New"); |
264 | 264 | case RESULT_FILES_DOWNLOADING: return tra("Downloading"); |
265 | 265 | case RESULT_FILES_DOWNLOADED: return tra("Processing"); |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | } |
278 | 278 | |
279 | 279 | function validate_state_str($result) { |
280 | - switch($result->validate_state) { |
|
280 | + switch ($result->validate_state) { |
|
281 | 281 | case VALIDATE_STATE_INIT: return tra("Initial"); |
282 | 282 | case VALIDATE_STATE_VALID: return tra("Valid"); |
283 | 283 | case VALIDATE_STATE_INVALID: |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | } |
294 | 294 | |
295 | 295 | function assimilate_state_str($s) { |
296 | - switch($s) { |
|
296 | + switch ($s) { |
|
297 | 297 | case ASSIMILATE_INIT: return "Initial"; |
298 | 298 | case ASSIMILATE_READY: return "Ready to assimilate"; |
299 | 299 | case ASSIMILATE_DONE: return "Assimilated"; |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | } |
303 | 303 | |
304 | 304 | function file_delete_state_str($s) { |
305 | - switch($s) { |
|
305 | + switch ($s) { |
|
306 | 306 | case FILE_DELETE_INIT: return "Initial"; |
307 | 307 | case FILE_DELETE_READY: return "Ready to delete"; |
308 | 308 | case FILE_DELETE_DONE: return "Deleted"; |
@@ -312,27 +312,27 @@ discard block |
||
312 | 312 | } |
313 | 313 | function wu_error_mask_str($s) { |
314 | 314 | $x = ""; |
315 | - if ($s & WU_ERROR_COULDNT_SEND_RESULT) { |
|
315 | + if ($s&WU_ERROR_COULDNT_SEND_RESULT) { |
|
316 | 316 | $x = $x." ".tra("Couldn't send result"); |
317 | 317 | $s -= WU_ERROR_COULDNT_SEND_RESULT; |
318 | 318 | } |
319 | - if ($s & WU_ERROR_TOO_MANY_ERROR_RESULTS) { |
|
319 | + if ($s&WU_ERROR_TOO_MANY_ERROR_RESULTS) { |
|
320 | 320 | $x = $x." ".tra("Too many errors (may have bug)"); |
321 | 321 | $s -= WU_ERROR_TOO_MANY_ERROR_RESULTS; |
322 | 322 | } |
323 | - if ($s & WU_ERROR_TOO_MANY_SUCCESS_RESULTS) { |
|
323 | + if ($s&WU_ERROR_TOO_MANY_SUCCESS_RESULTS) { |
|
324 | 324 | $x = $x." ".tra("Too many results (may be nondeterministic)"); |
325 | 325 | $s -= WU_ERROR_TOO_MANY_SUCCESS_RESULTS; |
326 | 326 | } |
327 | - if ($s & WU_ERROR_TOO_MANY_TOTAL_RESULTS) { |
|
327 | + if ($s&WU_ERROR_TOO_MANY_TOTAL_RESULTS) { |
|
328 | 328 | $x = $x." ".tra("Too many total results"); |
329 | 329 | $s -= WU_ERROR_TOO_MANY_TOTAL_RESULTS; |
330 | 330 | } |
331 | - if ($s & WU_ERROR_CANCELLED) { |
|
331 | + if ($s&WU_ERROR_CANCELLED) { |
|
332 | 332 | $x = $x." ".tra("WU cancelled"); |
333 | 333 | $s -= WU_ERROR_CANCELLED; |
334 | 334 | } |
335 | - if ($s & WU_ERROR_NO_CANONICAL_RESULT) { |
|
335 | + if ($s&WU_ERROR_NO_CANONICAL_RESULT) { |
|
336 | 336 | $x = $x." ".tra("Canonical result is missing"); |
337 | 337 | $s -= WU_ERROR_NO_CANONICAL_RESULT; |
338 | 338 | } |
@@ -340,9 +340,9 @@ discard block |
||
340 | 340 | $x = $x." ".tra("Unrecognized Error: %1", $s); |
341 | 341 | } |
342 | 342 | if (strlen($x)) { |
343 | - $x="<font color=\"#ff3333\">".$x."</font>"; |
|
343 | + $x = "<font color=\"#ff3333\">".$x."</font>"; |
|
344 | 344 | } else { |
345 | - $x=""; |
|
345 | + $x = ""; |
|
346 | 346 | } |
347 | 347 | return $x; |
348 | 348 | } |
@@ -426,10 +426,10 @@ discard block |
||
426 | 426 | if ($result->received_time) { |
427 | 427 | $r = time_str($result->received_time); |
428 | 428 | } else if ($result->report_deadline) { |
429 | - if ($result->report_deadline>time()) { |
|
430 | - $r = "<font color='#33cc33'>" . time_str($result->report_deadline) . "</font>"; |
|
429 | + if ($result->report_deadline > time()) { |
|
430 | + $r = "<font color='#33cc33'>".time_str($result->report_deadline)."</font>"; |
|
431 | 431 | } else { |
432 | - $r = "<font color='#ff3333'>" . time_str($result->report_deadline) . "</font>"; |
|
432 | + $r = "<font color='#ff3333'>".time_str($result->report_deadline)."</font>"; |
|
433 | 433 | } |
434 | 434 | } else { |
435 | 435 | $r = "---"; |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | // @param Integer $dec A signed integer |
491 | 491 | // |
492 | 492 | function int2hex($dec) { |
493 | - return "0x".strtoupper(substr(sprintf("%08x",$dec), -8)); |
|
493 | + return "0x".strtoupper(substr(sprintf("%08x", $dec), -8)); |
|
494 | 494 | } |
495 | 495 | |
496 | 496 | // Decode a windows error number into semi-human-readable, |
@@ -500,9 +500,9 @@ discard block |
||
500 | 500 | // @return String A human readable error message |
501 | 501 | // @param Integer $x An error number |
502 | 502 | // |
503 | -function windows_error_code_str($x){ |
|
504 | - $h=int2hex($x); |
|
505 | - switch($h){ |
|
503 | +function windows_error_code_str($x) { |
|
504 | + $h = int2hex($x); |
|
505 | + switch ($h) { |
|
506 | 506 | case "0xC0000005": return "STATUS_ACCESS_VIOLATION"; |
507 | 507 | case "0xC000001D": return "STATUS_ILLEGAL_INSTRUCTION"; |
508 | 508 | case "0xC0000094": return "STATUS_INTEGER_DIVIDE_BY_ZERO"; |
@@ -523,10 +523,10 @@ discard block |
||
523 | 523 | // @return String A human readable error message |
524 | 524 | // @param Integer $x An error number |
525 | 525 | // |
526 | -function error_code_str($x){ |
|
526 | +function error_code_str($x) { |
|
527 | 527 | // severe Windows error numbers are always large negative integers |
528 | - if ($x<-400) return windows_error_code_str($x); |
|
529 | - switch($x){ |
|
528 | + if ($x < -400) return windows_error_code_str($x); |
|
529 | + switch ($x) { |
|
530 | 530 | case 0: return ""; |
531 | 531 | case 192: return "EXIT_STATEFILE_WRITE"; |
532 | 532 | case 193: return "EXIT_SIGNAL"; |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | return $x." (".int2hex($x).") ".error_code_str($x); |
688 | 688 | } |
689 | 689 | |
690 | -function show_result($result, $show_outfile_links=false) { |
|
690 | +function show_result($result, $show_outfile_links = false) { |
|
691 | 691 | start_table(); |
692 | 692 | row2(tra("Name"), $result->name); |
693 | 693 | row2(tra("Workunit"), "<a href=\"workunit.php?wuid=$result->workunitid\">$result->workunitid</a>"); |
@@ -736,7 +736,7 @@ discard block |
||
736 | 736 | echo "<h3>".tra("Stderr output")."</h3> <pre>" |
737 | 737 | .htmlspecialchars( |
738 | 738 | $result->stderr_out, |
739 | - ENT_QUOTES | (defined('ENT_SUBSTITUTE')?ENT_SUBSTITUTE:0), |
|
739 | + ENT_QUOTES|(defined('ENT_SUBSTITUTE') ?ENT_SUBSTITUTE:0), |
|
740 | 740 | 'utf-8' |
741 | 741 | ) |
742 | 742 | ."</pre>" |
@@ -751,7 +751,7 @@ discard block |
||
751 | 751 | |
752 | 752 | $apps = BoincApp::enum('deprecated=0 ORDER BY user_friendly_name'); |
753 | 753 | |
754 | - for ($i=0; $i<NSTATES; $i++) { |
|
754 | + for ($i = 0; $i < NSTATES; $i++) { |
|
755 | 755 | $state_count[$i] = 0; |
756 | 756 | } |
757 | 757 | foreach ($apps as $app) { |
@@ -793,7 +793,7 @@ discard block |
||
793 | 793 | $x .= "<a href=$url>".tra("Next")." ".$info->results_per_page."</a>"; |
794 | 794 | } |
795 | 795 | $x .= "<br>".tra("State").": "; |
796 | - for ($i=0; $i<NSTATES; $i++) { |
|
796 | + for ($i = 0; $i < NSTATES; $i++) { |
|
797 | 797 | if ($i) $x .= " · "; |
798 | 798 | if ($info->state == $i) { |
799 | 799 | $x .= $state_name[$i]; |
@@ -838,6 +838,6 @@ discard block |
||
838 | 838 | return $x; |
839 | 839 | } |
840 | 840 | |
841 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
841 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
842 | 842 | |
843 | 843 | ?> |