@@ -113,6 +113,9 @@ |
||
113 | 113 | return ($a->expavg_credit < $b->expavg_credit)? 1 : -1; |
114 | 114 | } |
115 | 115 | |
116 | +/** |
|
117 | + * @param boolean $personal |
|
118 | + */ |
|
116 | 119 | function show_other_projects($user, $personal) { |
117 | 120 | if (!isset($user->projects)) return; |
118 | 121 | if (count($user->projects) < 2) return; |
@@ -65,10 +65,17 @@ discard block |
||
65 | 65 | . "<p>\n"; |
66 | 66 | } |
67 | 67 | |
68 | +/** |
|
69 | + * @param string $x |
|
70 | + */ |
|
68 | 71 | function row($x, $y) { |
69 | 72 | echo "<tr><td valign=\"top\" align=\"right\">$x</td>\n<td>$y</td>\n</tr>\n"; |
70 | 73 | } |
71 | 74 | |
75 | +/** |
|
76 | + * @param string $color |
|
77 | + * @param string $x |
|
78 | + */ |
|
72 | 79 | function c_row2($color, $x, $y) { |
73 | 80 | echo "<tr bgcolor=\"$color\"><td align=\"right\">$x</td><td>$y</td></tr>\n"; |
74 | 81 | } |
@@ -134,6 +141,9 @@ discard block |
||
134 | 141 | |
135 | 142 | // allow access only if logged in as user in a given set |
136 | 143 | // |
144 | +/** |
|
145 | + * @param integer[] $admin_user_ids |
|
146 | + */ |
|
137 | 147 | function auth_ops_userid($admin_user_ids) { |
138 | 148 | $user = get_logged_in_user_ops(); |
139 | 149 | if (!$user) { |
@@ -288,6 +298,10 @@ discard block |
||
288 | 298 | |
289 | 299 | ////// badge-related stuff |
290 | 300 | |
301 | +/** |
|
302 | + * @param string $name |
|
303 | + * @param string $title |
|
304 | + */ |
|
291 | 305 | function get_badge($name, $title, $image_url) { |
292 | 306 | $b = BoincBadge::lookup("name='$name'"); |
293 | 307 | if ($b) return $b; |
@@ -319,6 +333,9 @@ discard block |
||
319 | 333 | |
320 | 334 | // unassign all badges except the given one |
321 | 335 | // |
336 | +/** |
|
337 | + * @param integer $k |
|
338 | + */ |
|
322 | 339 | function unassign_badges($is_user, $item, $badges, $k) { |
323 | 340 | $list = null; |
324 | 341 | for ($i=0; $i<count($badges); $i++) { |
@@ -21,6 +21,9 @@ discard block |
||
21 | 21 | // my PHP currently doesn't support file_get_contents(https://...) |
22 | 22 | // so do it with Curl |
23 | 23 | // |
24 | +/** |
|
25 | + * @param string $url |
|
26 | + */ |
|
24 | 27 | function fetch_url($url) { |
25 | 28 | if (0) { |
26 | 29 | return file_get_contents($url); |
@@ -35,6 +38,11 @@ discard block |
||
35 | 38 | } |
36 | 39 | } |
37 | 40 | |
41 | +/** |
|
42 | + * @param string $project_url |
|
43 | + * @param string $email_addr |
|
44 | + * @param string $passwd_hash |
|
45 | + */ |
|
38 | 46 | function lookup_account( |
39 | 47 | $project_url, |
40 | 48 | $email_addr, |
@@ -57,6 +65,12 @@ discard block |
||
57 | 65 | |
58 | 66 | // return (authenticator, errmsg) |
59 | 67 | // |
68 | +/** |
|
69 | + * @param string $project_url |
|
70 | + * @param string $email_addr |
|
71 | + * @param string $passwd_hash |
|
72 | + * @param string $user_name |
|
73 | + */ |
|
60 | 74 | function create_account( |
61 | 75 | $project_url, |
62 | 76 | $email_addr, |
@@ -57,6 +57,9 @@ |
||
57 | 57 | |
58 | 58 | $xml_outer_tag = ""; |
59 | 59 | |
60 | +/** |
|
61 | + * @param string $tag |
|
62 | + */ |
|
60 | 63 | function xml_start_tag($tag) { |
61 | 64 | global $xml_outer_tag; |
62 | 65 | echo "<$tag>\n"; |
@@ -72,6 +72,9 @@ discard block |
||
72 | 72 | // badge_name_prefix should be user or team |
73 | 73 | // sub_project is an array with name and short_name as in $sub_projects |
74 | 74 | // |
75 | +/** |
|
76 | + * @param string $badge_name_prefix |
|
77 | + */ |
|
75 | 78 | function get_badges( |
76 | 79 | $badge_name_prefix, $badge_level_names, $badge_images, $sub_project |
77 | 80 | ) { |
@@ -105,6 +108,9 @@ discard block |
||
105 | 108 | // decide which subproject badge to assign, if any. |
106 | 109 | // Unassign other badges. |
107 | 110 | // |
111 | +/** |
|
112 | + * @param string $where_clause |
|
113 | + */ |
|
108 | 114 | function assign_sub_badge($is_user, $item, $levels, $badges, $where_clause) { |
109 | 115 | if ($is_user) { |
110 | 116 | $sub_total = BoincCreditUser::sum('total', "where userid=".$item->id." and ($where_clause)"); |
@@ -173,6 +173,9 @@ discard block |
||
173 | 173 | return $x; |
174 | 174 | } |
175 | 175 | |
176 | +/** |
|
177 | + * @param integer $mode |
|
178 | + */ |
|
176 | 179 | function get_nquestions($unit, $mode) { |
177 | 180 | global $snap; |
178 | 181 | |
@@ -187,6 +190,9 @@ discard block |
||
187 | 190 | return 0; |
188 | 191 | } |
189 | 192 | |
193 | +/** |
|
194 | + * @param integer $mode |
|
195 | + */ |
|
190 | 196 | function get_views($unit, $mode) { |
191 | 197 | global $snap; |
192 | 198 | |
@@ -231,6 +237,10 @@ discard block |
||
231 | 237 | |
232 | 238 | $rownum = 0; |
233 | 239 | |
240 | +/** |
|
241 | + * @param string $class |
|
242 | + * @param boolean $is_answer |
|
243 | + */ |
|
234 | 244 | function show_unit_row($unit, $class, $level, $is_answer) { |
235 | 245 | global $breakdown, $breakdown_cat; |
236 | 246 | global $rownum, $course_id; |
@@ -319,6 +329,9 @@ discard block |
||
319 | 329 | echo "</tr>\n"; |
320 | 330 | } |
321 | 331 | |
332 | +/** |
|
333 | + * @param string $class |
|
334 | + */ |
|
322 | 335 | function breakdown_class($class) { |
323 | 336 | switch ($class) { |
324 | 337 | case "BoltLesson": |
@@ -356,6 +369,9 @@ discard block |
||
356 | 369 | } |
357 | 370 | } |
358 | 371 | |
372 | +/** |
|
373 | + * @param integer $level |
|
374 | + */ |
|
359 | 375 | function show_unit_recurse($unit, $level) { |
360 | 376 | show_unit($unit, $level); |
361 | 377 | if ($unit->is_item) return; |
@@ -34,6 +34,9 @@ |
||
34 | 34 | require_once($file); |
35 | 35 | } |
36 | 36 | |
37 | +/** |
|
38 | + * @param integer $i |
|
39 | + */ |
|
37 | 40 | function show_bossa_app($app, $i) { |
38 | 41 | $j = $i%2; |
39 | 42 | echo "<tr class=row$j> |
@@ -28,6 +28,9 @@ discard block |
||
28 | 28 | require_once("../inc/util_basic.inc"); |
29 | 29 | require_once("../inc/util_ops.inc"); |
30 | 30 | |
31 | +/** |
|
32 | + * @param integer $range |
|
33 | + */ |
|
31 | 34 | function rand_color($im, $range) { |
32 | 35 | $mid = 200; |
33 | 36 | $lo = $mid - $range; |
@@ -35,12 +38,18 @@ discard block |
||
35 | 38 | return imagecolorallocate($im, rand($lo,$hi), rand($lo,$hi), rand($lo,$hi)); |
36 | 39 | } |
37 | 40 | |
41 | +/** |
|
42 | + * @param resource $im |
|
43 | + */ |
|
38 | 44 | function add_ellipse($im, $case) { |
39 | 45 | imagefilledellipse( |
40 | 46 | $im, $case->cx, $case->cy, $case->w, $case->h, rand_color($im, 50) |
41 | 47 | ); |
42 | 48 | } |
43 | 49 | |
50 | +/** |
|
51 | + * @param resource $im |
|
52 | + */ |
|
44 | 53 | function add_rect($im) { |
45 | 54 | $cx = rand(-100, 600); |
46 | 55 | $cy = rand(-100, 400); |
@@ -66,6 +66,9 @@ |
||
66 | 66 | // $x is an array of result/host objects; |
67 | 67 | // return the variance among claimed credits given an FP weight |
68 | 68 | // |
69 | +/** |
|
70 | + * @param double $fpw |
|
71 | + */ |
|
69 | 72 | function fpw_var($results, $fpw) { |
70 | 73 | $cc = array(); |
71 | 74 | foreach ($results as $r) { |