@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | foreach ($ks as $k) { |
35 | 35 | $x[] = $job_keywords[$k]->name; |
36 | 36 | } |
37 | - return implode('<br>', $x);; |
|
37 | + return implode('<br>', $x); ; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | function show_wu($wu) { |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | // (so that bad guys can't tell if they have an unreplicated job) |
69 | 69 | |
70 | 70 | $config = get_config(); |
71 | - if ($app->target_nresults>0 && !$wu->canonical_resultid && !$wu->error_mask && !parse_bool($config, "dont_suppress_pending")) { |
|
71 | + if ($app->target_nresults > 0 && !$wu->canonical_resultid && !$wu->error_mask && !parse_bool($config, "dont_suppress_pending")) { |
|
72 | 72 | row2(tra("Tasks in progress"), tra("suppressed pending completion")); |
73 | 73 | end_table(); |
74 | 74 | } else { |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | // show list of BUDA apps and variants, |
55 | 55 | // w/ buttons for adding and deleting |
56 | 56 | // |
57 | -function app_list($notice=null) { |
|
57 | +function app_list($notice = null) { |
|
58 | 58 | global $buda_root; |
59 | 59 | if (!is_dir($buda_root)) { |
60 | 60 | mkdir($buda_root); |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | // |
257 | 257 | $x = "<input_template>\n"; |
258 | 258 | $ninfiles = 1 + count($variant_desc->input_file_names) + count($variant_desc->app_files); |
259 | - for ($i=0; $i<$ninfiles; $i++) { |
|
259 | + for ($i = 0; $i < $ninfiles; $i++) { |
|
260 | 260 | $x .= " <file_info>\n <sticky/>\n <no_delete/>\n <executable/>\n </file_info>\n"; |
261 | 261 | } |
262 | 262 | $x .= " <workunit>\n"; |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | ); |
287 | 287 | |
288 | 288 | $x .= sprintf(" <max_delay>%f</max_delay>\n", |
289 | - $variant_desc->max_delay * 86400. |
|
289 | + $variant_desc->max_delay*86400. |
|
290 | 290 | ); |
291 | 291 | |
292 | 292 | $x .= " </workunit>\n<input_template>\n"; |
@@ -467,8 +467,8 @@ discard block |
||
467 | 467 | } |
468 | 468 | } |
469 | 469 | |
470 | -function app_form($desc=null) { |
|
471 | - page_head_select2($desc?"Edit BUDA app $desc->name":'Create BUDA app'); |
|
470 | +function app_form($desc = null) { |
|
471 | + page_head_select2($desc ? "Edit BUDA app $desc->name" : 'Create BUDA app'); |
|
472 | 472 | form_start('buda.php'); |
473 | 473 | form_input_hidden('action', 'app_action'); |
474 | 474 | if ($desc) { |
@@ -479,22 +479,22 @@ discard block |
||
479 | 479 | form_input_text('Internal name<br><small>No spaces</small>', 'name'); |
480 | 480 | } |
481 | 481 | form_input_text('User-visible name', 'long_name', |
482 | - $desc?$desc->long_name:null |
|
482 | + $desc ? $desc->long_name : null |
|
483 | 483 | ); |
484 | 484 | form_input_textarea( |
485 | 485 | 'Description<br><small>... of what the app does and of the research goals</small>', |
486 | 486 | 'description', |
487 | - $desc?$desc->description:null |
|
487 | + $desc ? $desc->description : null |
|
488 | 488 | ); |
489 | 489 | form_select2_multi('Science keywords', |
490 | 490 | 'sci_kw', |
491 | 491 | keyword_select_options(KW_CATEGORY_SCIENCE), |
492 | - $desc?$desc->sci_kw:null |
|
492 | + $desc ? $desc->sci_kw : null |
|
493 | 493 | ); |
494 | 494 | form_input_text( |
495 | 495 | 'URL of web page describing app', |
496 | 496 | 'url', |
497 | - !empty($desc->url)?$desc->url:'' |
|
497 | + !empty($desc->url) ? $desc->url : '' |
|
498 | 498 | ); |
499 | 499 | // don't include location keywords; |
500 | 500 | // various people may submit jobs to this app |
@@ -93,9 +93,9 @@ |
||
93 | 93 | global $job_keywords; |
94 | 94 | $kw = $job_keywords[$id]; |
95 | 95 | $u = $uprefs[$id]; |
96 | - $yes_checked = ($u == KW_YES)?"checked":""; |
|
97 | - $no_checked = ($u == KW_NO)?"checked":""; |
|
98 | - $maybe_checked = ($u == KW_MAYBE)?"checked":""; |
|
96 | + $yes_checked = ($u == KW_YES) ? "checked" : ""; |
|
97 | + $no_checked = ($u == KW_NO) ? "checked" : ""; |
|
98 | + $maybe_checked = ($u == KW_MAYBE) ? "checked" : ""; |
|
99 | 99 | |
100 | 100 | echo sprintf('<tr id="%s" hidden>%s', "row$id", "\n"); |
101 | 101 | echo sprintf(' <td width=50%% id="%s"></td>%s', "text$id", "\n"); |
@@ -298,7 +298,7 @@ |
||
298 | 298 | |
299 | 299 | render(); |
300 | 300 | |
301 | -EOT; |
|
301 | +eot; |
|
302 | 302 | echo "</script>\n"; |
303 | 303 | } |
304 | 304 |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $app = BoincApp::lookup_id($ua->app_id); |
39 | 39 | $names[] = $app->name; |
40 | 40 | } |
41 | - $sub = $names?implode(', ', $names):'---'; |
|
41 | + $sub = $names ?implode(', ', $names) : '---'; |
|
42 | 42 | } |
43 | 43 | if ($u->manage_all) { |
44 | 44 | $admin = 'All applications'; |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $app = BoincApp::lookup_id($ua->app_id); |
50 | 50 | $names[] = $app->name; |
51 | 51 | } |
52 | - $admin = $names?implode(', ', $names):'---'; |
|
52 | + $admin = $names ?implode(', ', $names) : '---'; |
|
53 | 53 | } |
54 | 54 | [$yes, $no] = read_kw_prefs($user); |
55 | 55 | global $job_keywords; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | implode('<br>', $kws), |
70 | 70 | $u->quota, |
71 | 71 | $u->max_jobs_in_progress, |
72 | - ($u->logical_start_time > time())?local_time_str($u->logical_start_time):'---' |
|
72 | + ($u->logical_start_time > time()) ?local_time_str($u->logical_start_time) : '---' |
|
73 | 73 | ); |
74 | 74 | } |
75 | 75 | |
@@ -199,18 +199,18 @@ discard block |
||
199 | 199 | $manage_apps = array_map('intval', $manage_apps); |
200 | 200 | foreach ($apps as $app) { |
201 | 201 | $s = in_array($app->id, $submit_apps); |
202 | - $m = in_array($app->id, $manage_apps)?1:0; |
|
202 | + $m = in_array($app->id, $manage_apps) ? 1 : 0; |
|
203 | 203 | if ($s || $m) { |
204 | 204 | BoincUserSubmitApp::insert( |
205 | 205 | "(user_id, app_id, manage) values ($user_id, $app->id, $m)" |
206 | 206 | ); |
207 | 207 | } |
208 | 208 | } |
209 | - $quota = (double) get_str('quota'); |
|
209 | + $quota = (double)get_str('quota'); |
|
210 | 210 | if ($quota != $us->quota) { |
211 | 211 | $us->update("quota=$quota"); |
212 | 212 | } |
213 | - $mj = (int) get_str('max_jobs_in_progress'); |
|
213 | + $mj = (int)get_str('max_jobs_in_progress'); |
|
214 | 214 | if ($mj != $us->max_jobs_in_progress) { |
215 | 215 | $us->update("max_jobs_in_progress=$mj"); |
216 | 216 | } |
@@ -31,14 +31,14 @@ |
||
31 | 31 | if (file_exists($path)) { |
32 | 32 | $x = file($path); |
33 | 33 | $yes = explode(' ', trim($x[0])); |
34 | - if ($yes[0]=='') $yes=[]; |
|
34 | + if ($yes[0] == '') $yes = []; |
|
35 | 35 | $yes = array_map('intval', $yes); |
36 | 36 | $no = explode(' ', trim($x[1])); |
37 | - if ($no[0]=='') $no=[]; |
|
37 | + if ($no[0] == '') $no = []; |
|
38 | 38 | $no = array_map('intval', $no); |
39 | 39 | return [$yes, $no]; |
40 | 40 | } else { |
41 | - return [[],[]]; |
|
41 | + return [[], []]; |
|
42 | 42 | } |
43 | 43 | } |
44 | 44 |