@@ -41,7 +41,7 @@ |
||
| 41 | 41 | $f->mode = "local_staged"; |
| 42 | 42 | $f->source = "input"; |
| 43 | 43 | |
| 44 | - for ($i=10; $i<20; $i++) { |
|
| 44 | + for ($i = 10; $i < 20; $i++) { |
|
| 45 | 45 | $job = new StdClass; |
| 46 | 46 | $job->input_files = array($f); |
| 47 | 47 | $job->rsc_fpops_est = $i*1e9; |
@@ -24,71 +24,71 @@ |
||
| 24 | 24 | define('KW_CATEGORY_SCIENCE', 0); |
| 25 | 25 | define('KW_CATEGORY_LOC', 1); |
| 26 | 26 | |
| 27 | -define('KW_ASTRONOMY', 1); |
|
| 28 | -define('KW_SETI', 2); |
|
| 29 | -define('KW_PULSARS', 3); |
|
| 30 | -define('KW_GW', 4); |
|
| 31 | -define('KW_COSMOLOGY', 5); |
|
| 32 | -define('KW_PHYSICS', 6); |
|
| 27 | +define('KW_ASTRONOMY', 1); |
|
| 28 | +define('KW_SETI', 2); |
|
| 29 | +define('KW_PULSARS', 3); |
|
| 30 | +define('KW_GW', 4); |
|
| 31 | +define('KW_COSMOLOGY', 5); |
|
| 32 | +define('KW_PHYSICS', 6); |
|
| 33 | 33 | define('KW_PARTICLE_PHYSICS', 7); |
| 34 | -define('KW_NANOSCIENCE', 8); |
|
| 35 | -define('KW_BIOMED', 9); |
|
| 34 | +define('KW_NANOSCIENCE', 8); |
|
| 35 | +define('KW_BIOMED', 9); |
|
| 36 | 36 | define('KW_DRUG_DISCOVERY', 10); |
| 37 | -define('KW_PROTEINS', 11); |
|
| 38 | -define('KW_GENETICS', 12); |
|
| 39 | -define('KW_DISEASE', 13); |
|
| 40 | -define('KW_CANCER', 14); |
|
| 41 | -define('KW_MATH_CS', 15); |
|
| 42 | -define('KW_AI', 16); |
|
| 43 | -define('KW_OCEANIA', 17); |
|
| 44 | -define('KW_AUSTRALIA', 18); |
|
| 37 | +define('KW_PROTEINS', 11); |
|
| 38 | +define('KW_GENETICS', 12); |
|
| 39 | +define('KW_DISEASE', 13); |
|
| 40 | +define('KW_CANCER', 14); |
|
| 41 | +define('KW_MATH_CS', 15); |
|
| 42 | +define('KW_AI', 16); |
|
| 43 | +define('KW_OCEANIA', 17); |
|
| 44 | +define('KW_AUSTRALIA', 18); |
|
| 45 | 45 | |
| 46 | -define('KW_EUROPE', 20); |
|
| 47 | -define('KW_GERMANY', 21); |
|
| 48 | -define('KW_ASIA', 22); |
|
| 49 | -define('KW_AMERICAS', 23); |
|
| 50 | -define('KW_US', 24); |
|
| 51 | -define('KW_UCB', 25); |
|
| 52 | -define('KW_AEI', 26); |
|
| 53 | -define('KW_CERN', 27); |
|
| 54 | -define('KW_UW', 28); |
|
| 55 | -define('KW_EARTH_SCI', 29); |
|
| 56 | -define('KW_SPAIN', 30); |
|
| 57 | -define('KW_SAN_JORGE', 31); |
|
| 58 | -define('KW_NUMBER_THEORY', 32); |
|
| 59 | -define('KW_CRYPTO', 33); |
|
| 60 | -define('KW_ENV_RESEARCH', 34); |
|
| 61 | -define('KW_CLIMATE', 35); |
|
| 62 | -define('KW_CZECH', 36); |
|
| 46 | +define('KW_EUROPE', 20); |
|
| 47 | +define('KW_GERMANY', 21); |
|
| 48 | +define('KW_ASIA', 22); |
|
| 49 | +define('KW_AMERICAS', 23); |
|
| 50 | +define('KW_US', 24); |
|
| 51 | +define('KW_UCB', 25); |
|
| 52 | +define('KW_AEI', 26); |
|
| 53 | +define('KW_CERN', 27); |
|
| 54 | +define('KW_UW', 28); |
|
| 55 | +define('KW_EARTH_SCI', 29); |
|
| 56 | +define('KW_SPAIN', 30); |
|
| 57 | +define('KW_SAN_JORGE', 31); |
|
| 58 | +define('KW_NUMBER_THEORY', 32); |
|
| 59 | +define('KW_CRYPTO', 33); |
|
| 60 | +define('KW_ENV_RESEARCH', 34); |
|
| 61 | +define('KW_CLIMATE', 35); |
|
| 62 | +define('KW_CZECH', 36); |
|
| 63 | 63 | define('KW_CHARLES_PRAGUE', 37); |
| 64 | -define('KW_RECHENKRAFT', 38); |
|
| 65 | -define('KW_RHEINMAIN', 39); |
|
| 66 | -define('KW_HUNGARY', 40); |
|
| 67 | -define('KW_IRELAND', 41); |
|
| 68 | -define('KW_UC_DUBLIN', 42); |
|
| 69 | -define('KW_POLAND', 43); |
|
| 70 | -define('KW_RUSSIA', 44); |
|
| 64 | +define('KW_RECHENKRAFT', 38); |
|
| 65 | +define('KW_RHEINMAIN', 39); |
|
| 66 | +define('KW_HUNGARY', 40); |
|
| 67 | +define('KW_IRELAND', 41); |
|
| 68 | +define('KW_UC_DUBLIN', 42); |
|
| 69 | +define('KW_POLAND', 43); |
|
| 70 | +define('KW_RUSSIA', 44); |
|
| 71 | 71 | define('KW_SW_STATE_RUSSIA', 45); |
| 72 | -define('KW_RAS', 46); |
|
| 73 | -define('KW_PRBB', 47); |
|
| 74 | -define('KW_UK', 48); |
|
| 75 | -define('KW_OXFORD', 49); |
|
| 76 | -define('KW_CHINA', 50); |
|
| 77 | -define('KW_U_DAYTON', 51); |
|
| 78 | -define('KW_WRIGHT_STATE', 52); |
|
| 79 | -define('KW_USC', 53); |
|
| 80 | -define('KW_FULLERTON', 54); |
|
| 81 | -define('KW_ARIZONA_STATE', 55); |
|
| 82 | -define('KW_U_ILLINOIS', 56); |
|
| 83 | -define('KW_U_WARSAW', 57); |
|
| 84 | -define('KW_RPI', 58); |
|
| 85 | -define('KW_INTERNATIONAL', 59); |
|
| 86 | -define('KW_UND', 60); |
|
| 87 | -define('KW_HOLLAND', 61); |
|
| 88 | -define('KW_CHEMISTRY', 62); |
|
| 89 | -define('KW_GAMES', 63); |
|
| 90 | -define('KW_VIRUS', 64); |
|
| 91 | -define('KW_FRANCE', 65); |
|
| 72 | +define('KW_RAS', 46); |
|
| 73 | +define('KW_PRBB', 47); |
|
| 74 | +define('KW_UK', 48); |
|
| 75 | +define('KW_OXFORD', 49); |
|
| 76 | +define('KW_CHINA', 50); |
|
| 77 | +define('KW_U_DAYTON', 51); |
|
| 78 | +define('KW_WRIGHT_STATE', 52); |
|
| 79 | +define('KW_USC', 53); |
|
| 80 | +define('KW_FULLERTON', 54); |
|
| 81 | +define('KW_ARIZONA_STATE', 55); |
|
| 82 | +define('KW_U_ILLINOIS', 56); |
|
| 83 | +define('KW_U_WARSAW', 57); |
|
| 84 | +define('KW_RPI', 58); |
|
| 85 | +define('KW_INTERNATIONAL', 59); |
|
| 86 | +define('KW_UND', 60); |
|
| 87 | +define('KW_HOLLAND', 61); |
|
| 88 | +define('KW_CHEMISTRY', 62); |
|
| 89 | +define('KW_GAMES', 63); |
|
| 90 | +define('KW_VIRUS', 64); |
|
| 91 | +define('KW_FRANCE', 65); |
|
| 92 | 92 | |
| 93 | 93 | $job_keywords = array(); |
| 94 | 94 | |
@@ -63,13 +63,13 @@ discard block |
||
| 63 | 63 | global $language_names; |
| 64 | 64 | $supported_languages = get_supported_languages(); |
| 65 | 65 | $supported_languages[] = "en"; |
| 66 | - $sel = $cur_lang_name?"":"selected"; |
|
| 66 | + $sel = $cur_lang_name ? "" : "selected"; |
|
| 67 | 67 | echo " |
| 68 | 68 | <option $sel value=auto>Language: default |
| 69 | 69 | "; |
| 70 | 70 | foreach ($language_names as $lang) { |
| 71 | 71 | if (!in_array($lang[0], $supported_languages)) continue; |
| 72 | - $sel = ($cur_lang_name == $lang[0])?"selected":""; |
|
| 72 | + $sel = ($cur_lang_name == $lang[0]) ? "selected" : ""; |
|
| 73 | 73 | if ($lang[0] == "en") { |
| 74 | 74 | echo "<option $sel value=".$lang[0].">".$lang[1]; |
| 75 | 75 | } else { |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | // show a menu of supported languages |
| 83 | 83 | // |
| 84 | -function language_form($cur_lang_name=null) { |
|
| 84 | +function language_form($cur_lang_name = null) { |
|
| 85 | 85 | echo ' |
| 86 | 86 | <form name="language" method="get" action="set_language.php"> |
| 87 | 87 | <select class="selectbox form-control" name="lang" onchange="javascript: submit()"> |
@@ -141,12 +141,12 @@ discard block |
||
| 141 | 141 | // prefix for links; needed for pages not in top dir |
| 142 | 142 | $user, |
| 143 | 143 | // logged-in user, if any |
| 144 | - $fixed=false, |
|
| 144 | + $fixed = false, |
|
| 145 | 145 | // if true, navbar is fixed at top of page. |
| 146 | 146 | // NOTE: if you do this, you must set a global var $fixed_navbar |
| 147 | 147 | // to true at compile time |
| 148 | 148 | // (it needs to be set when page_head() is called). |
| 149 | - $inverse=false |
|
| 149 | + $inverse = false |
|
| 150 | 150 | // white on black? |
| 151 | 151 | ) { |
| 152 | 152 | global $master_url; |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | // output a panel. |
| 215 | 215 | // $content_func is a function that generates the panel contents |
| 216 | 216 | // |
| 217 | -function panel($title, $content_func, $class="panel-primary", $body_class="") { |
|
| 217 | +function panel($title, $content_func, $class = "panel-primary", $body_class = "") { |
|
| 218 | 218 | echo sprintf('<div class="panel %s"> |
| 219 | 219 | ', $class |
| 220 | 220 | ); |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | // are functions that generate the top, left, and right content |
| 241 | 241 | // $left_width is the width of left column in 1/12 units. |
| 242 | 242 | // |
| 243 | -function grid($top_func, $left_func, $right_func, $left_width=6) { |
|
| 243 | +function grid($top_func, $left_func, $right_func, $left_width = 6) { |
|
| 244 | 244 | echo ' |
| 245 | 245 | <div class="container-fluid"> |
| 246 | 246 | '; |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | </div> |
| 256 | 256 | '; |
| 257 | 257 | } |
| 258 | - $right_width = 12-$left_width; |
|
| 258 | + $right_width = 12 - $left_width; |
|
| 259 | 259 | echo ' |
| 260 | 260 | <div class="row"> |
| 261 | 261 | <div class="col-sm-'.$left_width.'"> |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | '; |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | -function form_start($action, $method='get') { |
|
| 276 | +function form_start($action, $method = 'get') { |
|
| 277 | 277 | echo sprintf( |
| 278 | 278 | '<div class="container"> |
| 279 | 279 | <form class="form-horizontal" method="%s" action="%s">' |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | define('FORM_LEFT_OFFSET', 'col-sm-offset-4'); |
| 298 | 298 | define('FORM_RIGHT_CLASS', 'col-sm-8'); |
| 299 | 299 | |
| 300 | -function form_input_text($label, $name, $value='', $type='text', $attrs='', $extra='') { |
|
| 300 | +function form_input_text($label, $name, $value = '', $type = 'text', $attrs = '', $extra = '') { |
|
| 301 | 301 | echo sprintf(' |
| 302 | 302 | <div class="form-group"> |
| 303 | 303 | <label class="control-label %s">%s</label> |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | ); |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | -function form_input_textarea($label, $name, $value='') { |
|
| 327 | +function form_input_textarea($label, $name, $value = '') { |
|
| 328 | 328 | echo sprintf(' |
| 329 | 329 | <div class="form-group"> |
| 330 | 330 | <label class="control-label %s" for="%s">%s</label> |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | ); |
| 374 | 374 | $n = 0; |
| 375 | 375 | foreach ($items as $i) { |
| 376 | - $s = ($flags && $flags[$n])?'selected':''; |
|
| 376 | + $s = ($flags && $flags[$n]) ? 'selected' : ''; |
|
| 377 | 377 | echo '<option '.$s.' value="'.$i[0].'">'.$i[1].'</option> |
| 378 | 378 | '; |
| 379 | 379 | $n++; |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | |
| 384 | 384 | // $items is list of (name, label, checked) |
| 385 | 385 | // |
| 386 | -function form_checkboxes($label, $items, $attrs='') { |
|
| 386 | +function form_checkboxes($label, $items, $attrs = '') { |
|
| 387 | 387 | echo sprintf(' |
| 388 | 388 | <div class="form-group"> |
| 389 | 389 | <label class="control-label %s">%s</label> |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | } |
| 401 | 401 | echo sprintf('<input %s type="checkbox" name="%s" %s> %s |
| 402 | 402 | ', |
| 403 | - $attrs, $i[0], $i[2]?"checked":"", $i[1] |
|
| 403 | + $attrs, $i[0], $i[2] ? "checked" : "", $i[1] |
|
| 404 | 404 | ); |
| 405 | 405 | } |
| 406 | 406 | echo '</div> |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | FORM_LEFT_CLASS, $label, FORM_RIGHT_CLASS |
| 420 | 420 | ); |
| 421 | 421 | foreach ($items as $i) { |
| 422 | - $checked = ($selected == $i[0])?"checked":""; |
|
| 422 | + $checked = ($selected == $i[0]) ? "checked" : ""; |
|
| 423 | 423 | echo sprintf('<input type="radio" name="%s" value="%s" %s> %s <br> |
| 424 | 424 | ', |
| 425 | 425 | $name, $i[0], $checked, $i[1] |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | '; |
| 453 | 453 | } |
| 454 | 454 | |
| 455 | -function form_submit($text, $attrs='') { |
|
| 455 | +function form_submit($text, $attrs = '') { |
|
| 456 | 456 | form_general( |
| 457 | 457 | "", |
| 458 | 458 | sprintf('<button %s type="submit" class="btn btn-success">%s</button>', |
@@ -461,11 +461,11 @@ discard block |
||
| 461 | 461 | ); |
| 462 | 462 | } |
| 463 | 463 | |
| 464 | -function form_checkbox($label, $name, $checked=false) { |
|
| 464 | +function form_checkbox($label, $name, $checked = false) { |
|
| 465 | 465 | echo sprintf(' |
| 466 | 466 | <div class="form-group"> |
| 467 | 467 | <input type="checkbox" name="%s" %s> <span class="lead">%s</span> |
| 468 | 468 | </div> |
| 469 | - ', $name, $checked?"checked":"", $label |
|
| 469 | + ', $name, $checked ? "checked" : "", $label |
|
| 470 | 470 | ); |
| 471 | 471 | } |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | // |
| 65 | 65 | function get_platform($user_agent) { |
| 66 | 66 | if (strstr($user_agent, 'Windows')) { |
| 67 | - if (strstr($user_agent, 'Win64')||strstr($user_agent, 'WOW64')) { |
|
| 67 | + if (strstr($user_agent, 'Win64') || strstr($user_agent, 'WOW64')) { |
|
| 68 | 68 | return 'windows_x86_64'; |
| 69 | 69 | } else { |
| 70 | 70 | return 'windows_intelx86'; |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | $token, |
| 139 | 139 | $user->id, |
| 140 | 140 | (string)$v->filename, |
| 141 | - $green?"btn-success":"btn-info", |
|
| 141 | + $green ? "btn-success" : "btn-info", |
|
| 142 | 142 | (string)$v->platform, |
| 143 | 143 | (string)$v->size_mb, |
| 144 | 144 | (string)$v->version_num |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | |
| 148 | 148 | function download_button_vbox($v, $project_id, $token, $user) { |
| 149 | 149 | // if no vbox version exists for platform, don't show vbox button |
| 150 | - if(!$v->vbox_filename) { |
|
| 150 | + if (!$v->vbox_filename) { |
|
| 151 | 151 | return; |
| 152 | 152 | } |
| 153 | 153 | return sprintf( |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | handle_get_info(); |
| 437 | 437 | } else { |
| 438 | 438 | $dev = get_str("dev", true); |
| 439 | - $user_agent = get_str("user_agent", true); // for debugging |
|
| 439 | + $user_agent = get_str("user_agent", true); // for debugging |
|
| 440 | 440 | if (!$user_agent) { |
| 441 | 441 | $user_agent = $_SERVER['HTTP_USER_AGENT']; |
| 442 | 442 | } |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | // Adapt to your web site. The following assumes Bootstrap. |
| 137 | 137 | // |
| 138 | 138 | function show_download_button($info, $is_vbox) { |
| 139 | - $desc = $is_vbox?$info->boinc_vbox:$info->boinc; |
|
| 139 | + $desc = $is_vbox ? $info->boinc_vbox : $info->boinc; |
|
| 140 | 140 | echo sprintf(' |
| 141 | 141 | <form action="https://boinc.berkeley.edu/concierge.php" method="post"> |
| 142 | 142 | <input type=hidden name=project_id value="%d"> |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | (string)$info->token, |
| 151 | 151 | (int)$info->user_id, |
| 152 | 152 | (string)$desc->filename, |
| 153 | - $is_vbox?" + VirtualBox":"", |
|
| 153 | + $is_vbox ? " + VirtualBox" : "", |
|
| 154 | 154 | (string)$info->platform, |
| 155 | 155 | (string)$desc->size_mb |
| 156 | 156 | ); |