@@ -126,6 +126,9 @@ discard block |
||
126 | 126 | return is_https()?secure_url_base():URL_BASE; |
127 | 127 | } |
128 | 128 | |
129 | +/** |
|
130 | + * @param string $name |
|
131 | + */ |
|
129 | 132 | function send_cookie($name, $value, $permanent, $ops=false) { |
130 | 133 | global $master_url; |
131 | 134 | |
@@ -208,6 +211,9 @@ discard block |
||
208 | 211 | // To do so, define page_head() in the project include file. |
209 | 212 | // |
210 | 213 | if (!function_exists("page_head")){ |
214 | +/** |
|
215 | + * @param string $body_attrs |
|
216 | + */ |
|
211 | 217 | function page_head( |
212 | 218 | $title, |
213 | 219 | // page title. Put in <title>, used as title for browser tab. |
@@ -476,6 +482,9 @@ discard block |
||
476 | 482 | "; |
477 | 483 | } |
478 | 484 | |
485 | +/** |
|
486 | + * @param string $x |
|
487 | + */ |
|
479 | 488 | function row2_init($x, $y, $lwidth='40%') { |
480 | 489 | echo '<tr> |
481 | 490 | <td class="text-right " width="'.$lwidth.'" style="padding-right: 20px;">'.$x.'</td> |
@@ -487,6 +496,9 @@ discard block |
||
487 | 496 | echo "<tr><td>$x</td><td>$y</td></tr>\n"; |
488 | 497 | } |
489 | 498 | |
499 | +/** |
|
500 | + * @param string $string |
|
501 | + */ |
|
490 | 502 | function rowify($string) { |
491 | 503 | echo "<tr><td>$string</td></tr>"; |
492 | 504 | } |
@@ -512,6 +524,9 @@ discard block |
||
512 | 524 | echo "</tr>\n"; |
513 | 525 | } |
514 | 526 | |
527 | +/** |
|
528 | + * @param string $x |
|
529 | + */ |
|
515 | 530 | function row_heading($x, $class='bg-primary') { |
516 | 531 | echo sprintf('<tr><th class="%s" colspan=99>%s</th></tr> |
517 | 532 | ', $class, $x |
@@ -574,6 +589,11 @@ discard block |
||
574 | 589 | // If $ellipsis is true, then an ellipsis is added to any sentence which |
575 | 590 | // is cut short. |
576 | 591 | |
592 | +/** |
|
593 | + * @param string $sentence |
|
594 | + * @param string $delimiter |
|
595 | + * @param integer $max_chars |
|
596 | + */ |
|
577 | 597 | function sub_sentence($sentence, $delimiter, $max_chars, $ellipsis=false) { |
578 | 598 | $words = explode($delimiter, $sentence); |
579 | 599 | $total_chars = 0; |
@@ -624,6 +644,9 @@ discard block |
||
624 | 644 | ob_implicit_flush(0); |
625 | 645 | } |
626 | 646 | |
647 | +/** |
|
648 | + * @param string $filename |
|
649 | + */ |
|
627 | 650 | function close_output_buffer($filename) { |
628 | 651 | $fh = fopen($filename, "w"); |
629 | 652 | $page = ob_get_contents(); |
@@ -692,6 +715,9 @@ discard block |
||
692 | 715 | |
693 | 716 | // returns null if the arg is optional and missing |
694 | 717 | // |
718 | +/** |
|
719 | + * @param string $name |
|
720 | + */ |
|
695 | 721 | function post_int($name, $optional=false) { |
696 | 722 | $x = post_num($name, $optional); |
697 | 723 | if (is_null($x)) return null; |
@@ -791,6 +817,9 @@ discard block |
||
791 | 817 | |
792 | 818 | // Generate a "select" element from an array of values |
793 | 819 | // |
820 | +/** |
|
821 | + * @param string $name |
|
822 | + */ |
|
794 | 823 | function select_from_array($name, $array, $selection=null, $width=240) { |
795 | 824 | $out = '<select style="color:#000;"class="form-control input-sm" style="width:'.$width.'px" name="'.$name.'">"'; |
796 | 825 | |
@@ -854,18 +883,33 @@ discard block |
||
854 | 883 | ); |
855 | 884 | } |
856 | 885 | |
886 | +/** |
|
887 | + * @param string $text |
|
888 | + * @param string $desc |
|
889 | + */ |
|
857 | 890 | function show_button($url, $text, $desc=null, $class="btn-success btn-sm") { |
858 | 891 | echo button_text($url, $text, $desc=null, $class); |
859 | 892 | } |
860 | 893 | |
861 | 894 | // for places with a bunch of buttons, like forum posts |
862 | 895 | // |
896 | +/** |
|
897 | + * @param string $url |
|
898 | + * @param string $text |
|
899 | + * @param string $desc |
|
900 | + */ |
|
863 | 901 | function show_button_small($url, $text, $desc=null) { |
864 | 902 | echo button_text($url, $text, $desc, "btn-primary btn-xs"); |
865 | 903 | } |
866 | 904 | |
867 | 905 | // used for showing icons |
868 | 906 | // |
907 | +/** |
|
908 | + * @param string $src |
|
909 | + * @param string $title |
|
910 | + * @param string $alt |
|
911 | + * @param string $height |
|
912 | + */ |
|
869 | 913 | function show_image($src, $title, $alt, $height=null) { |
870 | 914 | $h = ""; |
871 | 915 | if ($height) { |
@@ -986,6 +1030,9 @@ discard block |
||
986 | 1030 | } |
987 | 1031 | } |
988 | 1032 | |
1033 | +/** |
|
1034 | + * @param integer $f |
|
1035 | + */ |
|
989 | 1036 | function flops_to_credit($f) { |
990 | 1037 | return $f*(200/86400e9); |
991 | 1038 | } |
@@ -1020,6 +1067,9 @@ discard block |
||
1020 | 1067 | } |
1021 | 1068 | } |
1022 | 1069 | |
1070 | +/** |
|
1071 | + * @param integer $height |
|
1072 | + */ |
|
1023 | 1073 | function badges_string($is_user, $item, $height) { |
1024 | 1074 | if (DISABLE_BADGES) return null; |
1025 | 1075 | if ($is_user) { |
@@ -1036,6 +1086,9 @@ discard block |
||
1036 | 1086 | return $x; |
1037 | 1087 | } |
1038 | 1088 | |
1089 | +/** |
|
1090 | + * @param boolean $is_user |
|
1091 | + */ |
|
1039 | 1092 | function show_badges_row($is_user, $item) { |
1040 | 1093 | if (BADGE_HEIGHT_LARGE == 0) return; |
1041 | 1094 | $x = badges_string($is_user, $item, BADGE_HEIGHT_LARGE); |
@@ -1080,6 +1133,11 @@ discard block |
||
1080 | 1133 | // return HTML for a textarea with chars-remaining counter. |
1081 | 1134 | // Call text_counter_script() before using this. |
1082 | 1135 | // |
1136 | +/** |
|
1137 | + * @param string $name |
|
1138 | + * @param integer $maxlen |
|
1139 | + * @param string $text |
|
1140 | + */ |
|
1083 | 1141 | function textarea_with_counter($name, $maxlen, $text) { |
1084 | 1142 | $rem_name = $name."_remaining"; |
1085 | 1143 | return "<textarea name=\"$name\" class=\"form-control\" rows=3 id=\"$name\" onkeydown=\"text_counter(this.form.$name, this.form.$rem_name, $maxlen);\" |