@@ -65,6 +65,10 @@ |
||
65 | 65 | return $forum->parent_type == 0 && ($forum->title === $forum_name); |
66 | 66 | } |
67 | 67 | |
68 | +/** |
|
69 | + * @param integer $start |
|
70 | + * @param integer $count |
|
71 | + */ |
|
68 | 72 | function show_news($start, $count) { |
69 | 73 | $forum = news_forum(); |
70 | 74 | if (!$forum) { |
@@ -27,6 +27,10 @@ discard block |
||
27 | 27 | echo "</div>\n"; |
28 | 28 | } |
29 | 29 | |
30 | +/** |
|
31 | + * @param null|integer $teamid |
|
32 | + * @param string $error |
|
33 | + */ |
|
30 | 34 | function pm_team_form($user, $teamid, $error=null) { |
31 | 35 | global $bbcode_html, $bbcode_js; |
32 | 36 | $team = BoincTeam::lookup_id($teamid); |
@@ -78,6 +82,9 @@ discard block |
||
78 | 82 | page_tail(); |
79 | 83 | } |
80 | 84 | |
85 | +/** |
|
86 | + * @param string $error |
|
87 | + */ |
|
81 | 88 | function pm_form($replyto, $userid, $error = null) { |
82 | 89 | global $bbcode_html, $bbcode_js; |
83 | 90 | global $g_logged_in_user; |
@@ -196,6 +203,9 @@ discard block |
||
196 | 203 | return "<a href=pm.php>".tra("Private message%1 from %2, subject:" , "</a>", $from_user->name )." $pm->subject"; |
197 | 204 | } |
198 | 205 | |
206 | +/** |
|
207 | + * @param boolean $send_email |
|
208 | + */ |
|
199 | 209 | function pm_send_msg($from_user, $to_user, $subject, $content, $send_email) { |
200 | 210 | $sql_subject = BoincDb::escape_string(sanitize_tags($subject)); |
201 | 211 | $sql_content = BoincDb::escape_string($content); |
@@ -224,6 +234,9 @@ discard block |
||
224 | 234 | BoincNotify::insert("(userid, create_time, type, opaque) values ($to_user->id, ".time().", ".NOTIFY_PM.", $mid)"); |
225 | 235 | } |
226 | 236 | |
237 | +/** |
|
238 | + * @param integer $duration |
|
239 | + */ |
|
227 | 240 | function pm_count($userid, $duration) { |
228 | 241 | $time = time() - $duration; |
229 | 242 |
@@ -291,6 +291,9 @@ discard block |
||
291 | 291 | return $dp; |
292 | 292 | } |
293 | 293 | |
294 | +/** |
|
295 | + * @param string $t |
|
296 | + */ |
|
294 | 297 | function group_header($t) { |
295 | 298 | echo "<tr><th class=\"bg-info\">$t</th><td class=\"bg-info\" colspan=4><br></td></tr>\n"; |
296 | 299 | } |
@@ -413,6 +416,9 @@ discard block |
||
413 | 416 | |
414 | 417 | // Display all venues as columns next to descriptions |
415 | 418 | // |
419 | +/** |
|
420 | + * @param stdClass $prefs |
|
421 | + */ |
|
416 | 422 | function prefs_show_columns_global($prefs) { |
417 | 423 | global $cpu_prefs; |
418 | 424 | global $disk_prefs; |
@@ -483,6 +489,11 @@ discard block |
||
483 | 489 | return PROJECT; |
484 | 490 | } |
485 | 491 | |
492 | +/** |
|
493 | + * @param stdClass $prefs |
|
494 | + * @param string $venue |
|
495 | + * @param string $subset |
|
496 | + */ |
|
486 | 497 | function prefs_display_venue($prefs, $venue, $subset) { |
487 | 498 | global $g_logged_in_user; |
488 | 499 | $tokens = url_tokens($g_logged_in_user->authenticator); |
@@ -241,6 +241,9 @@ |
||
241 | 241 | } |
242 | 242 | } |
243 | 243 | |
244 | +/** |
|
245 | + * @param boolean $columns |
|
246 | + */ |
|
244 | 247 | function prefs_show_privacy($user, $columns) { |
245 | 248 | global $privacy_pref_descs; |
246 | 249 | if ($columns) { |
@@ -440,6 +440,10 @@ discard block |
||
440 | 440 | } |
441 | 441 | } |
442 | 442 | |
443 | +/** |
|
444 | + * @param string $id |
|
445 | + * @param string $d |
|
446 | + */ |
|
443 | 447 | function hour_select($x, $name, $id, $d) { |
444 | 448 | $s = ""; |
445 | 449 | $s .= "<select class=\"selectbox form-control input-sm\" name=$name id=$id $d>\n"; |
@@ -533,6 +537,9 @@ discard block |
||
533 | 537 | |
534 | 538 | // display preference subsets as columns |
535 | 539 | // |
540 | +/** |
|
541 | + * @param string $x |
|
542 | + */ |
|
536 | 543 | function row_top($x) { |
537 | 544 | echo "<tr class=\"bg-primary\"><th width=35%>$x</th>"; |
538 | 545 | echo "<th ><b>".tra("Default")."</b></th> |
@@ -545,6 +552,13 @@ discard block |
||
545 | 552 | |
546 | 553 | // row_defs - Display a value for all 4 venues in one row |
547 | 554 | // |
555 | +/** |
|
556 | + * @param string $pre |
|
557 | + * @param string $item |
|
558 | + * @param string $post |
|
559 | + * @param string $type |
|
560 | + * @param string $tooltip |
|
561 | + */ |
|
548 | 562 | function row_defs($pre, $item, $post, $type, $prefs, $tooltip=null) { |
549 | 563 | $gen = $prefs->$item; |
550 | 564 | $hom = (isset($prefs->home) && isset($prefs->home->$item)) ? $prefs->home->$item : "--"; |
@@ -599,6 +613,9 @@ discard block |
||
599 | 613 | // |
600 | 614 | // row_links - Display Edit/Add/Remove links for all venues in 1 row |
601 | 615 | // |
616 | +/** |
|
617 | + * @param string $subset |
|
618 | + */ |
|
602 | 619 | function row_links($subset, $prefs) { |
603 | 620 | global $g_logged_in_user; |
604 | 621 | $tokens = url_tokens($g_logged_in_user->authenticator); |
@@ -114,6 +114,11 @@ |
||
114 | 114 | return BoincProfile::delete_aux("userid=$user->id"); |
115 | 115 | } |
116 | 116 | |
117 | +/** |
|
118 | + * @param resource $image |
|
119 | + * @param integer $targetWidth |
|
120 | + * @param integer $targetHeight |
|
121 | + */ |
|
117 | 122 | function scale_image( |
118 | 123 | $image, $origWidth, $origHeight, $targetWidth, $targetHeight |
119 | 124 | ) { |
@@ -53,6 +53,9 @@ discard block |
||
53 | 53 | return $platforms[$id]; |
54 | 54 | } |
55 | 55 | |
56 | +/** |
|
57 | + * @param string $rsc_name |
|
58 | + */ |
|
56 | 59 | function anon_platform_string($result, $rsc_name=null) { |
57 | 60 | $app = get_app($result->appid); |
58 | 61 | $n = $app->user_friendly_name."<br>". tra("Anonymous platform"); |
@@ -92,6 +95,9 @@ discard block |
||
92 | 95 | return "$n v$v $c<br>$platform->name"; |
93 | 96 | } |
94 | 97 | |
98 | +/** |
|
99 | + * @param string $string_to_show |
|
100 | + */ |
|
95 | 101 | function result_granted_credit_string($result, $string_to_show) { |
96 | 102 | if ($result->server_state == RESULT_SERVER_STATE_IN_PROGRESS && $result->granted_credit > 0) { |
97 | 103 | return $string_to_show; |
@@ -356,6 +362,10 @@ discard block |
||
356 | 362 | return "results.php?$c&offset=$o&show_names=$sn&state=$st&appid=$appid"; |
357 | 363 | } |
358 | 364 | |
365 | +/** |
|
366 | + * @param boolean $show_wu_link |
|
367 | + * @param boolean $show_host_link |
|
368 | + */ |
|
359 | 369 | function result_table_start($show_wu_link, $show_host_link, $info) { |
360 | 370 | start_table('table-striped'); |
361 | 371 | $x = array(); |
@@ -417,6 +427,11 @@ discard block |
||
417 | 427 | return false; |
418 | 428 | } |
419 | 429 | |
430 | +/** |
|
431 | + * @param boolean $show_wu_link |
|
432 | + * @param boolean $show_host_link |
|
433 | + * @param boolean $show_name |
|
434 | + */ |
|
420 | 435 | function show_result_row($result, $show_wu_link, $show_host_link, $show_name) { |
421 | 436 | $s = time_str($result->sent_time); |
422 | 437 | // if result has been reported, show the received time, |
@@ -26,6 +26,9 @@ discard block |
||
26 | 26 | // Create dir if not present. |
27 | 27 | // |
28 | 28 | if (!function_exists("sandbox_dir")){ |
29 | +/** |
|
30 | + * @return string |
|
31 | + */ |
|
29 | 32 | function sandbox_dir($user) { |
30 | 33 | $dir = parse_config(get_config(), "<sandbox_dir>"); |
31 | 34 | if (!$dir) { $dir = "../../sandbox/"; } |
@@ -40,12 +43,18 @@ discard block |
||
40 | 43 | } |
41 | 44 | } |
42 | 45 | |
46 | +/** |
|
47 | + * @param string $md5 |
|
48 | + */ |
|
43 | 49 | function sandbox_write_link_file($path, $size, $md5) { |
44 | 50 | file_put_contents($path, "sb $size $md5"); |
45 | 51 | } |
46 | 52 | |
47 | 53 | // check if a newly update files already exists in sandbox via its md5 sum |
48 | 54 | // |
55 | +/** |
|
56 | + * @param string $md5 |
|
57 | + */ |
|
49 | 58 | function sandbox_lf_exist($user, $md5) { |
50 | 59 | $exist = 0; |
51 | 60 | $elf = ""; |
@@ -115,6 +124,9 @@ discard block |
||
115 | 124 | // return a <select> for files in sandbox |
116 | 125 | // |
117 | 126 | if (!function_exists('sandbox_file_select')) { |
127 | +/** |
|
128 | + * @param string $select_name |
|
129 | + */ |
|
118 | 130 | function sandbox_file_select($user, $select_name, $regexp = null, $allow_none = false) { |
119 | 131 | if ($regexp === null) { |
120 | 132 | $regexp = $select_name; |
@@ -145,6 +145,9 @@ discard block |
||
145 | 145 | } |
146 | 146 | } |
147 | 147 | |
148 | +/** |
|
149 | + * @param string $op |
|
150 | + */ |
|
148 | 151 | function do_batch_op($req, $op) { |
149 | 152 | $retval = validate_request($req); |
150 | 153 | if ($retval) return array(null, $retval); |
@@ -172,6 +175,9 @@ discard block |
||
172 | 175 | |
173 | 176 | // if RPC had a fatal error, return the message |
174 | 177 | // |
178 | +/** |
|
179 | + * @param string $outer_tag |
|
180 | + */ |
|
175 | 181 | function get_error($reply, $outer_tag) { |
176 | 182 | $name = $reply->getName(); |
177 | 183 | if ($name != $outer_tag) { |
@@ -187,6 +193,9 @@ discard block |
||
187 | 193 | |
188 | 194 | //// API functions follow |
189 | 195 | |
196 | +/** |
|
197 | + * @param stdClass $req |
|
198 | + */ |
|
190 | 199 | function boinc_estimate_batch($req) { |
191 | 200 | list($reply, $errmsg) = do_batch_op($req, "estimate_batch"); |
192 | 201 | if ($errmsg) return array(0, $errmsg); |
@@ -205,6 +214,9 @@ discard block |
||
205 | 214 | return array((int)$reply->batch_id, null); |
206 | 215 | } |
207 | 216 | |
217 | +/** |
|
218 | + * @param stdClass $req |
|
219 | + */ |
|
208 | 220 | function boinc_query_batches($req) { |
209 | 221 | $req_xml = "<query_batches> |
210 | 222 | <authenticator>$req->authenticator</authenticator> |
@@ -255,6 +267,9 @@ discard block |
||
255 | 267 | return array($r, null); |
256 | 268 | } |
257 | 269 | |
270 | +/** |
|
271 | + * @param stdClass $req |
|
272 | + */ |
|
258 | 273 | function boinc_query_job($req) { |
259 | 274 | $req_xml = "<query_job> |
260 | 275 | <authenticator>$req->authenticator</authenticator> |
@@ -285,6 +300,9 @@ discard block |
||
285 | 300 | return array($r, null); |
286 | 301 | } |
287 | 302 | |
303 | +/** |
|
304 | + * @return string |
|
305 | + */ |
|
288 | 306 | function boinc_abort_batch($req) { |
289 | 307 | $req_xml = "<abort_batch> |
290 | 308 | <authenticator>$req->authenticator</authenticator> |
@@ -299,6 +317,9 @@ discard block |
||
299 | 317 | return array(true, null); |
300 | 318 | } |
301 | 319 | |
320 | +/** |
|
321 | + * @param stdClass $req |
|
322 | + */ |
|
302 | 323 | function boinc_get_output_file($req) { |
303 | 324 | $auth_str = md5($req->authenticator.$req->instance_name); |
304 | 325 | $name = $req->instance_name; |
@@ -312,6 +333,9 @@ discard block |
||
312 | 333 | return $req->project."/get_output.php?cmd=batch_files&batch_id=$batch_id&auth_str=$auth_str"; |
313 | 334 | } |
314 | 335 | |
336 | +/** |
|
337 | + * @return string |
|
338 | + */ |
|
315 | 339 | function boinc_retire_batch($req) { |
316 | 340 | $req_xml = "<retire_batch> |
317 | 341 | <authenticator>$req->authenticator</authenticator> |