@@ -3,6 +3,11 @@ |
||
3 | 3 | include_once XOOPS_ROOT_PATH."/class/tree.php"; |
4 | 4 | |
5 | 5 | class xhelpTree extends XoopsObjectTree { |
6 | + |
|
7 | + /** |
|
8 | + * @param string $name |
|
9 | + * @param string $fieldName |
|
10 | + */ |
|
6 | 11 | function &makeSelBox($name, $fieldName, $prefix='-', $selected='', $addEmptyOption = false, $key=0, $selectMulti=false) |
7 | 12 | { |
8 | 13 | $ret = '<select name="'.$name.'[]" id="'.$name.'" '. (($selectMulti) ? 'multiple="multiple" size="6"' : "") .'>'; |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | * @param string $page |
85 | 85 | * @param array $vars |
86 | 86 | * @return |
87 | - * |
|
87 | + string |
|
88 | 88 | * @access public |
89 | 89 | */ |
90 | 90 | function xhelpMakeURI($page, $vars = array(), $encodeAmp = true) |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | * |
280 | 280 | * |
281 | 281 | * @param array $tickets array of ticket ids (int) |
282 | - * @param string $response response text to add |
|
282 | + * @param string $sresponse response text to add |
|
283 | 283 | * @param int $timespent Number of minutes spent on ticket |
284 | 284 | * @param bool $private Should this be a private message? |
285 | 285 | * @return xhelpResponses Response information |
@@ -688,7 +688,7 @@ discard block |
||
688 | 688 | * Creates a random number with a specified number of $digits |
689 | 689 | * |
690 | 690 | * @param int $digits number of digits |
691 | - * @return return int random number |
|
691 | + * @return string int random number |
|
692 | 692 | * |
693 | 693 | * @access public |
694 | 694 | */ |
@@ -748,7 +748,7 @@ discard block |
||
748 | 748 | /** |
749 | 749 | * Create default staff roles for a new installation |
750 | 750 | * |
751 | - * @return TRUE if success, FALSE if failure |
|
751 | + * @return boolean if success, FALSE if failure |
|
752 | 752 | * |
753 | 753 | * @access public |
754 | 754 | */ |
@@ -783,7 +783,7 @@ discard block |
||
783 | 783 | /** |
784 | 784 | * Create ticket statuses for a new installation |
785 | 785 | * |
786 | - * @return TRUE if success, FALSE if failure |
|
786 | + * @return boolean if success, FALSE if failure |
|
787 | 787 | * @access public |
788 | 788 | */ |
789 | 789 | function xhelpCreateStatuses() |
@@ -815,6 +815,7 @@ discard block |
||
815 | 815 | /** |
816 | 816 | * Convert Bytes to a human readable size (GB, MB, KB, etc) |
817 | 817 | * |
818 | + * @param integer $bytes |
|
818 | 819 | * @return string Human readable size |
819 | 820 | * @access public |
820 | 821 | */ |
@@ -846,6 +847,7 @@ discard block |
||
846 | 847 | * Add a new database field to an existing table |
847 | 848 | * MySQL Only! |
848 | 849 | * |
850 | + * @param string $table |
|
849 | 851 | * @return RESOURCE SQL query resource |
850 | 852 | * @access public |
851 | 853 | */ |
@@ -893,6 +895,7 @@ discard block |
||
893 | 895 | * Rename an existing database field |
894 | 896 | * MySQL Only! |
895 | 897 | * |
898 | + * @param string $table |
|
896 | 899 | * @return RESOURCE SQL query resource |
897 | 900 | * @access public |
898 | 901 | */ |
@@ -911,6 +914,7 @@ discard block |
||
911 | 914 | * Remove an existing database field |
912 | 915 | * MySQL Only! |
913 | 916 | * |
917 | + * @param string $table |
|
914 | 918 | * @return RESOURCE SQL query resource |
915 | 919 | * @access public |
916 | 920 | */ |
@@ -1214,10 +1218,7 @@ discard block |
||
1214 | 1218 | /** |
1215 | 1219 | * Retrieve the Displayname for the user |
1216 | 1220 | * |
1217 | - * @param int $displayName {xhelp_displayName preference value} |
|
1218 | - * @param string $name {user's real name} |
|
1219 | - * @param string $uname {user's username} |
|
1220 | - * @return string {username or real name} |
|
1221 | + * @return boolean {username or real name} |
|
1221 | 1222 | * @access public |
1222 | 1223 | */ |
1223 | 1224 | function xhelpCreateDefaultTicketLists() |
@@ -8,6 +8,7 @@ |
||
8 | 8 | /** |
9 | 9 | * Check the status of the supplied directory |
10 | 10 | * Thanks to the NewBB2 Development Team and SmartFactory |
11 | + * @param string $path |
|
11 | 12 | */ |
12 | 13 | function &xhelp_admin_getPathStatus($path, $getStatus=false) |
13 | 14 | { |
@@ -282,6 +282,11 @@ discard block |
||
282 | 282 | return $this->isoBars[$i]; |
283 | 283 | } |
284 | 284 | |
285 | + /** |
|
286 | + * @param integer $aRow |
|
287 | + * @param integer $aCol |
|
288 | + * @param integer $aEdgeDir |
|
289 | + */ |
|
285 | 290 | function getCrossingCoord($aRow,$aCol,$aEdgeDir,$aIsobarVal) { |
286 | 291 | // In order to avoid numerical problem when two vertices are very close |
287 | 292 | // we have to check and avoid dividing by close to zero denumerator. |
@@ -637,6 +642,9 @@ discard block |
||
637 | 642 | $this->isoBars = $isoBars; |
638 | 643 | } |
639 | 644 | |
645 | + /** |
|
646 | + * @param double $val |
|
647 | + */ |
|
640 | 648 | function GetIsobarColor($val) { |
641 | 649 | for ($i = 0 ; $i < count($this->isoBars) ; $i++) { |
642 | 650 | if( $val <= $this->isoBars[$i] ) { |
@@ -204,10 +204,18 @@ discard block |
||
204 | 204 | return $this->contcolors[$this->GetNextHigherContourIdx($v)]; |
205 | 205 | } |
206 | 206 | |
207 | + /** |
|
208 | + * @param double $x1 |
|
209 | + * @param double $y1 |
|
210 | + */ |
|
207 | 211 | function storeAnnotation($x1,$y1,$v1,$angle) { |
208 | 212 | $this->labels[$this->GetNextHigherContourIdx($v1)][] = array($x1,$y1,$v1,$angle); |
209 | 213 | } |
210 | 214 | |
215 | + /** |
|
216 | + * @param double $x1 |
|
217 | + * @param double $y1 |
|
218 | + */ |
|
211 | 219 | function labelProx($x1,$y1,$v1) { |
212 | 220 | |
213 | 221 | list($w,$h) = $this->getPlotSize(); |
@@ -236,6 +244,9 @@ discard block |
||
236 | 244 | else return false; |
237 | 245 | } |
238 | 246 | |
247 | + /** |
|
248 | + * @param double $x1 |
|
249 | + */ |
|
239 | 250 | function putLabel($x1,$y1,$x2,$y2,$v1) { |
240 | 251 | |
241 | 252 | $angle = 0; |
@@ -331,6 +342,17 @@ discard block |
||
331 | 342 | return array($x1p,$y1p,$v1p); |
332 | 343 | } |
333 | 344 | |
345 | + /** |
|
346 | + * @param integer $x1 |
|
347 | + * @param integer $y1 |
|
348 | + * @param integer $x2 |
|
349 | + * @param integer $y2 |
|
350 | + * @param integer $x3 |
|
351 | + * @param integer $y3 |
|
352 | + * @param integer $x4 |
|
353 | + * @param integer $y4 |
|
354 | + * @param integer $depth |
|
355 | + */ |
|
334 | 356 | function RectFill($v1,$v2,$v3,$v4,$x1,$y1,$x2,$y2,$x3,$y3,$x4,$y4,$depth) { |
335 | 357 | if( $depth >= self::$maxdepth ) { |
336 | 358 | // Abort and just appoximate the color of this area |
@@ -595,6 +617,15 @@ discard block |
||
595 | 617 | } |
596 | 618 | } |
597 | 619 | |
620 | + /** |
|
621 | + * @param integer $x1 |
|
622 | + * @param integer $y1 |
|
623 | + * @param integer $x2 |
|
624 | + * @param integer $y2 |
|
625 | + * @param integer $x3 |
|
626 | + * @param integer $y3 |
|
627 | + * @param integer $depth |
|
628 | + */ |
|
598 | 629 | function TriFill($v1,$v2,$v3,$x1,$y1,$x2,$y2,$x3,$y3,$depth) { |
599 | 630 | if( $depth >= self::$maxdepth ) { |
600 | 631 | // Abort and just appoximate the color of this area |
@@ -60,14 +60,24 @@ discard block |
||
60 | 60 | |
61 | 61 | } |
62 | 62 | |
63 | + /** |
|
64 | + * @param string $name |
|
65 | + */ |
|
63 | 66 | function GenHTMLSubmit($name) { |
64 | 67 | return '<INPUT TYPE=submit name="ok" value=" Ok " >'; |
65 | 68 | } |
66 | 69 | |
70 | + /** |
|
71 | + * @param string $name |
|
72 | + * @param integer $len |
|
73 | + */ |
|
67 | 74 | function GenHTMLInput($name,$len,$maxlen=100,$val='') { |
68 | 75 | return '<INPUT TYPE=TEXT NAME='.$name.' VALUE="'.$val.'" SIZE='.$len.' MAXLENGTH='.$maxlen.'>'; |
69 | 76 | } |
70 | 77 | |
78 | + /** |
|
79 | + * @param string $name |
|
80 | + */ |
|
71 | 81 | function GenHTMLSelect($name,$option,$selected="",$size=0) { |
72 | 82 | $txt="<select name=$name"; |
73 | 83 | if( $size > 0 ) |
@@ -84,6 +94,9 @@ discard block |
||
84 | 94 | return $txt."</select>\n"; |
85 | 95 | } |
86 | 96 | |
97 | + /** |
|
98 | + * @param string $name |
|
99 | + */ |
|
87 | 100 | function GenHTMLSelectCode($name,$option,$selected="",$size=0) { |
88 | 101 | $txt="<select name=$name"; |
89 | 102 | if( $size > 0 ) |
@@ -164,6 +164,15 @@ discard block |
||
164 | 164 | $f($aToHdl,$aFromHdl,$aToX,$aToY,$aFromX,$aFromY, $aWidth,$aHeight,$aw,$ah); |
165 | 165 | } |
166 | 166 | |
167 | + /** |
|
168 | + * @param null|resource $fromImg |
|
169 | + * @param integer $toX |
|
170 | + * @param integer $toY |
|
171 | + * @param integer $fromX |
|
172 | + * @param integer $fromY |
|
173 | + * @param integer $toWidth |
|
174 | + * @param integer $toHeight |
|
175 | + */ |
|
167 | 176 | function Copy($fromImg,$toX,$toY,$fromX,$fromY,$toWidth,$toHeight,$fromWidth=-1,$fromHeight=-1) { |
168 | 177 | $this->CopyCanvasH($this->img,$fromImg,$toX,$toY,$fromX,$fromY,$toWidth,$toHeight,$fromWidth,$fromHeight); |
169 | 178 | } |
@@ -219,6 +228,9 @@ discard block |
||
219 | 228 | return $img; |
220 | 229 | } |
221 | 230 | |
231 | + /** |
|
232 | + * @param null|resource $aHdl |
|
233 | + */ |
|
222 | 234 | function SetCanvasH($aHdl) { |
223 | 235 | $this->img = $aHdl; |
224 | 236 | $this->rgb->img = $aHdl; |
@@ -600,11 +612,20 @@ discard block |
||
600 | 612 | } |
601 | 613 | |
602 | 614 | // Set text alignment |
615 | + |
|
616 | + /** |
|
617 | + * @param string $halign |
|
618 | + */ |
|
603 | 619 | function SetTextAlign($halign,$valign="bottom") { |
604 | 620 | $this->text_halign=$halign; |
605 | 621 | $this->text_valign=$valign; |
606 | 622 | } |
607 | 623 | |
624 | + /** |
|
625 | + * @param double $x |
|
626 | + * @param double $y |
|
627 | + * @param string $paragraph_align |
|
628 | + */ |
|
608 | 629 | function _StrokeBuiltinFont($x,$y,$txt,$dir,$paragraph_align,&$aBoundingBox,$aDebug=false) { |
609 | 630 | |
610 | 631 | if( is_numeric($dir) && $dir!=90 && $dir!=0) |
@@ -700,6 +721,10 @@ discard block |
||
700 | 721 | return $a; |
701 | 722 | } |
702 | 723 | |
724 | + /** |
|
725 | + * @param integer $size |
|
726 | + * @param string $fontfile |
|
727 | + */ |
|
703 | 728 | function imagettfbbox_fixed($size, $angle, $fontfile, $text) { |
704 | 729 | |
705 | 730 | if( ! USE_LIBRARY_IMAGETTFBBOX ) { |
@@ -799,6 +824,9 @@ discard block |
||
799 | 824 | return $bbox; |
800 | 825 | } |
801 | 826 | |
827 | + /** |
|
828 | + * @return double |
|
829 | + */ |
|
802 | 830 | function GetBBoxTTF($aTxt,$aAngle=0) { |
803 | 831 | // Normalize the bounding box to become a minimum |
804 | 832 | // enscribing rectangle |
@@ -865,6 +893,11 @@ discard block |
||
865 | 893 | return $box[2]-$box[0]+1; |
866 | 894 | } |
867 | 895 | |
896 | + /** |
|
897 | + * @param double $x |
|
898 | + * @param double $y |
|
899 | + * @param string $paragraph_align |
|
900 | + */ |
|
868 | 901 | function _StrokeTTF($x,$y,$txt,$dir,$paragraph_align,&$aBoundingBox,$debug=false) { |
869 | 902 | |
870 | 903 | // Setup default inter line margin for paragraphs to be |
@@ -1142,6 +1175,9 @@ discard block |
||
1142 | 1175 | $this->current_color_name=$this->colorstack[--$this->colorstackidx]; |
1143 | 1176 | } |
1144 | 1177 | |
1178 | + /** |
|
1179 | + * @param integer $weight |
|
1180 | + */ |
|
1145 | 1181 | function SetLineWeight($weight) { |
1146 | 1182 | $old = $this->line_weight; |
1147 | 1183 | imagesetthickness($this->img,$weight); |
@@ -1155,6 +1191,10 @@ discard block |
||
1155 | 1191 | $this->lasty=round($y); |
1156 | 1192 | } |
1157 | 1193 | |
1194 | + /** |
|
1195 | + * @param integer $s |
|
1196 | + * @param integer $e |
|
1197 | + */ |
|
1158 | 1198 | function Arc($cx,$cy,$w,$h,$s,$e) { |
1159 | 1199 | // GD Arc doesn't like negative angles |
1160 | 1200 | while( $s < 0) $s += 360; |
@@ -1235,6 +1275,10 @@ discard block |
||
1235 | 1275 | } |
1236 | 1276 | |
1237 | 1277 | // Set line style dashed, dotted etc |
1278 | + |
|
1279 | + /** |
|
1280 | + * @param string $s |
|
1281 | + */ |
|
1238 | 1282 | function SetLineStyle($s) { |
1239 | 1283 | if( is_numeric($s) ) { |
1240 | 1284 | if( $s<1 || $s>4 ) { |
@@ -1393,6 +1437,14 @@ discard block |
||
1393 | 1437 | $this->FilledPolygon(array($xl,$yu,$xr,$yu,$xr,$yl,$xl,$yl)); |
1394 | 1438 | } |
1395 | 1439 | |
1440 | + /** |
|
1441 | + * @param integer $xl |
|
1442 | + * @param integer $yu |
|
1443 | + * @param integer $xr |
|
1444 | + * @param integer $yl |
|
1445 | + * @param string $color1 |
|
1446 | + * @param string $color2 |
|
1447 | + */ |
|
1396 | 1448 | function FilledRectangle2($xl,$yu,$xr,$yl,$color1,$color2,$style=1) { |
1397 | 1449 | // Fill a rectangle with lines of two colors |
1398 | 1450 | if( $style===1 ) { |
@@ -1422,6 +1474,10 @@ discard block |
||
1422 | 1474 | } |
1423 | 1475 | } |
1424 | 1476 | |
1477 | + /** |
|
1478 | + * @param integer $xl |
|
1479 | + * @param integer $yu |
|
1480 | + */ |
|
1425 | 1481 | function ShadowRectangle($xl,$yu,$xr,$yl,$fcolor=false,$shadow_width=4,$shadow_color='darkgray',$useAlpha=true) { |
1426 | 1482 | // This is complicated by the fact that we must also handle the case where |
1427 | 1483 | // the reactangle has no fill color |
@@ -1456,6 +1512,10 @@ discard block |
||
1456 | 1512 | } |
1457 | 1513 | } |
1458 | 1514 | |
1515 | + /** |
|
1516 | + * @param double $xr |
|
1517 | + * @param double $yl |
|
1518 | + */ |
|
1459 | 1519 | function FilledRoundedRectangle($xt,$yt,$xr,$yl,$r=5) { |
1460 | 1520 | if( $r==0 ) { |
1461 | 1521 | $this->FilledRectangle($xt,$yt,$xr,$yl); |
@@ -1488,6 +1548,10 @@ discard block |
||
1488 | 1548 | |
1489 | 1549 | } |
1490 | 1550 | |
1551 | + /** |
|
1552 | + * @param double $xr |
|
1553 | + * @param double $yl |
|
1554 | + */ |
|
1491 | 1555 | function RoundedRectangle($xt,$yt,$xr,$yl,$r=5) { |
1492 | 1556 | |
1493 | 1557 | if( $r==0 ) { |
@@ -1680,6 +1744,9 @@ discard block |
||
1680 | 1744 | public $dx=0,$dy=0,$transx=0,$transy=0; |
1681 | 1745 | private $m=array(); |
1682 | 1746 | |
1747 | + /** |
|
1748 | + * @param string $aFormat |
|
1749 | + */ |
|
1683 | 1750 | function __construct($aWidth,$aHeight,$a=0,$aFormat=DEFAULT_GFORMAT,$aSetAutoMargin=true) { |
1684 | 1751 | parent::__construct($aWidth,$aHeight,$aFormat,$aSetAutoMargin); |
1685 | 1752 | $this->dx=$this->left_margin+$this->plotwidth/2; |
@@ -1687,6 +1754,10 @@ discard block |
||
1687 | 1754 | $this->SetAngle($a); |
1688 | 1755 | } |
1689 | 1756 | |
1757 | + /** |
|
1758 | + * @param double $dx |
|
1759 | + * @param double $dy |
|
1760 | + */ |
|
1690 | 1761 | function SetCenter($dx,$dy) { |
1691 | 1762 | $old_dx = $this->dx; |
1692 | 1763 | $old_dy = $this->dy; |
@@ -1731,6 +1802,11 @@ discard block |
||
1731 | 1802 | parent::Circle($xc,$yc,$r); |
1732 | 1803 | } |
1733 | 1804 | |
1805 | + /** |
|
1806 | + * @param integer $xc |
|
1807 | + * @param integer $yc |
|
1808 | + * @param integer $r |
|
1809 | + */ |
|
1734 | 1810 | function FilledCircle($xc,$yc,$r) { |
1735 | 1811 | list($xc,$yc) = $this->Rotate($xc,$yc); |
1736 | 1812 | parent::FilledCircle($xc,$yc,$r); |
@@ -1770,6 +1846,12 @@ discard block |
||
1770 | 1846 | } |
1771 | 1847 | } |
1772 | 1848 | |
1849 | + /** |
|
1850 | + * @param integer $fromX |
|
1851 | + * @param integer $fromY |
|
1852 | + * @param integer $toWidth |
|
1853 | + * @param integer $toHeight |
|
1854 | + */ |
|
1773 | 1855 | function CopyMerge($fromImg,$toX,$toY,$fromX,$fromY,$toWidth,$toHeight,$fromWidth=-1,$fromHeight=-1,$aMix=100) { |
1774 | 1856 | list($toX,$toY) = $this->Rotate($toX,$toY); |
1775 | 1857 | parent::CopyMerge($fromImg,$toX,$toY,$fromX,$fromY,$toWidth,$toHeight,$fromWidth,$fromHeight,$aMix); |
@@ -1825,6 +1907,10 @@ discard block |
||
1825 | 1907 | parent::FilledPolygon($this->ArrRotate($pnts)); |
1826 | 1908 | } |
1827 | 1909 | |
1910 | + /** |
|
1911 | + * @param double $x |
|
1912 | + * @param double $y |
|
1913 | + */ |
|
1828 | 1914 | function Point($x,$y) { |
1829 | 1915 | list($xp,$yp) = $this->Rotate($x,$y); |
1830 | 1916 | parent::Point($xp,$yp); |
@@ -1857,11 +1943,21 @@ discard block |
||
1857 | 1943 | // timeout value it will be overwritten with a newer version. |
1858 | 1944 | // If timeout is set to 0 this is the same as infinite large timeout and if |
1859 | 1945 | // timeout is set to -1 this is the same as infinite small timeout |
1946 | + |
|
1947 | + /** |
|
1948 | + * @param integer $aTimeout |
|
1949 | + */ |
|
1860 | 1950 | function SetTimeout($aTimeout) { |
1861 | 1951 | $this->timeout=$aTimeout; |
1862 | 1952 | } |
1863 | 1953 | |
1864 | 1954 | // Output image to browser and also write it to the cache |
1955 | + |
|
1956 | + /** |
|
1957 | + * @param Image $aImage |
|
1958 | + * @param boolean $aInline |
|
1959 | + * @param string $aStrokeFileName |
|
1960 | + */ |
|
1865 | 1961 | function PutAndStream($aImage,$aCacheFileName,$aInline,$aStrokeFileName) { |
1866 | 1962 | |
1867 | 1963 | // Check if we should always stroke the image to a file |
@@ -2008,6 +2104,11 @@ discard block |
||
2008 | 2104 | // Check if a given image is in cache and in that case |
2009 | 2105 | // pass it directly on to web browser. Return false if the |
2010 | 2106 | // image file doesn't exist or exists but is to old |
2107 | + |
|
2108 | + /** |
|
2109 | + * @param Image $aImage |
|
2110 | + * @param string $aCacheFileName |
|
2111 | + */ |
|
2011 | 2112 | function GetAndStream($aImage,$aCacheFileName) { |
2012 | 2113 | if( $this->Isvalid($aCacheFileName) ) { |
2013 | 2114 | $this->StreamImgFile($aImage,$aCacheFileName); |
@@ -2020,6 +2121,10 @@ discard block |
||
2020 | 2121 | //--------------- |
2021 | 2122 | // PRIVATE METHODS |
2022 | 2123 | // Create all necessary directories in a path |
2124 | + |
|
2125 | + /** |
|
2126 | + * @param string $aFile |
|
2127 | + */ |
|
2023 | 2128 | function MakeDirs($aFile) { |
2024 | 2129 | $dirs = array(); |
2025 | 2130 | // In order to better work when open_basedir is enabled |
@@ -465,6 +465,9 @@ discard block |
||
465 | 465 | $this->iBottomMargin = $aBottom; |
466 | 466 | } |
467 | 467 | |
468 | + /** |
|
469 | + * @param Image $aImg |
|
470 | + */ |
|
468 | 471 | function Stroke($aImg) { |
469 | 472 | $y = $aImg->height - $this->iBottomMargin; |
470 | 473 | $x = $this->iLeftMargin; |
@@ -622,6 +625,9 @@ discard block |
||
622 | 625 | $this->tabtitle = new GraphTabTitle(); |
623 | 626 | } |
624 | 627 | |
628 | + /** |
|
629 | + * @param string $aFilename |
|
630 | + */ |
|
625 | 631 | function SetupCache($aFilename,$aTimeout=60) { |
626 | 632 | $this->cache_name = $aFilename; |
627 | 633 | $this->cache->SetTimeOut($aTimeout); |
@@ -662,6 +668,10 @@ discard block |
||
662 | 668 | } |
663 | 669 | |
664 | 670 | // Should the grid be in front or back of the plot? |
671 | + |
|
672 | + /** |
|
673 | + * @param integer $aDepth |
|
674 | + */ |
|
665 | 675 | function SetGridDepth($aDepth) { |
666 | 676 | $this->grid_depth=$aDepth; |
667 | 677 | } |
@@ -671,6 +681,10 @@ discard block |
||
671 | 681 | } |
672 | 682 | |
673 | 683 | // Specify graph angle 0-360 degrees. |
684 | + |
|
685 | + /** |
|
686 | + * @param integer $aAngle |
|
687 | + */ |
|
674 | 688 | function SetAngle($aAngle) { |
675 | 689 | $this->img->SetAngle($aAngle); |
676 | 690 | } |
@@ -926,6 +940,11 @@ discard block |
||
926 | 940 | } |
927 | 941 | |
928 | 942 | // Specify a background image |
943 | + |
|
944 | + /** |
|
945 | + * @param boolean|string $aFileName |
|
946 | + * @param integer $aBgType |
|
947 | + */ |
|
929 | 948 | function SetBackgroundImage($aFileName,$aBgType=BGIMG_FILLPLOT,$aImgFormat='auto') { |
930 | 949 | |
931 | 950 | // Get extension to determine image type |
@@ -1011,6 +1030,10 @@ discard block |
||
1011 | 1030 | |
1012 | 1031 | // Specify x,y scale. Note that if you manually specify the scale |
1013 | 1032 | // you must also specify the tick distance with a call to Ticks::Set() |
1033 | + |
|
1034 | + /** |
|
1035 | + * @param string $aAxisType |
|
1036 | + */ |
|
1014 | 1037 | function SetScale($aAxisType,$aYMin=1,$aYMax=1,$aXMin=1,$aXMax=1) { |
1015 | 1038 | $this->axtype = $aAxisType; |
1016 | 1039 | |
@@ -1115,6 +1138,10 @@ discard block |
||
1115 | 1138 | // Specify density of ticks when autoscaling 'normal', 'dense', 'sparse', 'verysparse' |
1116 | 1139 | // The dividing factor have been determined heuristically according to my aesthetic |
1117 | 1140 | // sense (or lack off) y.m.m.v ! |
1141 | + |
|
1142 | + /** |
|
1143 | + * @param integer $aYDensity |
|
1144 | + */ |
|
1118 | 1145 | function SetTickDensity($aYDensity=TICKD_NORMAL,$aXDensity=TICKD_NORMAL) { |
1119 | 1146 | $this->xtick_factor=30; |
1120 | 1147 | $this->ytick_factor=25; |
@@ -1213,6 +1240,10 @@ discard block |
||
1213 | 1240 | } |
1214 | 1241 | |
1215 | 1242 | // Get a complete <MAP>..</MAP> tag for the final image map |
1243 | + |
|
1244 | + /** |
|
1245 | + * @param string $aMapName |
|
1246 | + */ |
|
1216 | 1247 | function GetHTMLImageMap($aMapName) { |
1217 | 1248 | $im = "<map name=\"$aMapName\" id=\"$aMapName\" >\n"; |
1218 | 1249 | $im .= $this->GetCSIMareas(); |
@@ -1394,6 +1425,9 @@ discard block |
||
1394 | 1425 | } |
1395 | 1426 | } |
1396 | 1427 | |
1428 | + /** |
|
1429 | + * @param string $aCSIMName |
|
1430 | + */ |
|
1397 | 1431 | function GetCSIMImgHTML($aCSIMName, $aScriptName='auto', $aBorder=0 ) { |
1398 | 1432 | if( $aScriptName=='auto' ) { |
1399 | 1433 | $aScriptName=basename($_SERVER['PHP_SELF']); |
@@ -1882,6 +1916,10 @@ discard block |
||
1882 | 1916 | } |
1883 | 1917 | } |
1884 | 1918 | |
1919 | + /** |
|
1920 | + * @param integer $aDepth |
|
1921 | + * @param boolean $aCSIM |
|
1922 | + */ |
|
1885 | 1923 | function StrokeBands($aDepth,$aCSIM) { |
1886 | 1924 | // Stroke bands |
1887 | 1925 | if( $this->bands != null && !$aCSIM) { |
@@ -2998,6 +3036,9 @@ discard block |
||
2998 | 3036 | $this->iStyle = $aStyle; |
2999 | 3037 | } |
3000 | 3038 | |
3039 | + /** |
|
3040 | + * @param string $aColor |
|
3041 | + */ |
|
3001 | 3042 | function SetColor($aColor) { |
3002 | 3043 | $this->iColor = $aColor; |
3003 | 3044 | } |
@@ -3006,6 +3047,9 @@ discard block |
||
3006 | 3047 | $this->iWeight = $aWeight; |
3007 | 3048 | } |
3008 | 3049 | |
3050 | + /** |
|
3051 | + * @param string $aStyle |
|
3052 | + */ |
|
3009 | 3053 | function SetStyle($aStyle) { |
3010 | 3054 | $this->iStyle = $aStyle; |
3011 | 3055 | } |
@@ -3072,6 +3116,9 @@ discard block |
||
3072 | 3116 | $this->corner = $aD ; |
3073 | 3117 | } |
3074 | 3118 | |
3119 | + /** |
|
3120 | + * @param RotImage $aImg |
|
3121 | + */ |
|
3075 | 3122 | function Stroke($aImg,$aDummy1=null,$aDummy2=null) { |
3076 | 3123 | if( $this->hide ) |
3077 | 3124 | return; |
@@ -3350,11 +3397,17 @@ discard block |
||
3350 | 3397 | protected $show=false, $showMinor=false,$majorweight=1,$minorweight=1; |
3351 | 3398 | protected $fill=false,$fillcolor=array('#EFEFEF','#BBCCFF'); |
3352 | 3399 | |
3400 | + /** |
|
3401 | + * @param Axis $aAxis |
|
3402 | + */ |
|
3353 | 3403 | function __construct($aAxis) { |
3354 | 3404 | $this->scale = $aAxis->scale; |
3355 | 3405 | $this->img = $aAxis->img; |
3356 | 3406 | } |
3357 | 3407 | |
3408 | + /** |
|
3409 | + * @param string $aMajColor |
|
3410 | + */ |
|
3358 | 3411 | function SetColor($aMajColor,$aMinColor=false) { |
3359 | 3412 | $this->majorcolor=$aMajColor; |
3360 | 3413 | if( $aMinColor === false ) { |
@@ -3403,6 +3456,12 @@ discard block |
||
3403 | 3456 | //-------------- |
3404 | 3457 | // Private methods |
3405 | 3458 | // Draw the grid |
3459 | + |
|
3460 | + /** |
|
3461 | + * @param string $aType |
|
3462 | + * @param string $aColor |
|
3463 | + * @param integer $aWeight |
|
3464 | + */ |
|
3406 | 3465 | function DoStroke($aTicksPos,$aType,$aColor,$aWeight) { |
3407 | 3466 | if( !$this->show ) return; |
3408 | 3467 | $nbrgrids = count($aTicksPos); |
@@ -3541,6 +3600,9 @@ discard block |
||
3541 | 3600 | $this->scale->ticks->SetLabelFormat($aFormStr); |
3542 | 3601 | } |
3543 | 3602 | |
3603 | + /** |
|
3604 | + * @param string $aFormStr |
|
3605 | + */ |
|
3544 | 3606 | function SetLabelFormatString($aFormStr,$aDate=false) { |
3545 | 3607 | $this->scale->ticks->SetLabelFormat($aFormStr,$aDate); |
3546 | 3608 | } |
@@ -3549,6 +3611,9 @@ discard block |
||
3549 | 3611 | $this->scale->ticks->SetFormatCallback($aFuncName); |
3550 | 3612 | } |
3551 | 3613 | |
3614 | + /** |
|
3615 | + * @param string $aHAlign |
|
3616 | + */ |
|
3552 | 3617 | function SetLabelAlign($aHAlign,$aVAlign='top',$aParagraphAlign='left') { |
3553 | 3618 | $this->label_halign = $aHAlign; |
3554 | 3619 | $this->label_valign = $aVAlign; |
@@ -3612,6 +3677,10 @@ discard block |
||
3612 | 3677 | } |
3613 | 3678 | |
3614 | 3679 | // Weight of axis |
3680 | + |
|
3681 | + /** |
|
3682 | + * @param integer $aWeight |
|
3683 | + */ |
|
3615 | 3684 | function SetWeight($aWeight) { |
3616 | 3685 | $this->weight = $aWeight; |
3617 | 3686 | } |
@@ -3635,6 +3704,10 @@ discard block |
||
3635 | 3704 | } |
3636 | 3705 | |
3637 | 3706 | // Which side of the axis should the axis title be? |
3707 | + |
|
3708 | + /** |
|
3709 | + * @param integer $aSideOfAxis |
|
3710 | + */ |
|
3638 | 3711 | function SetTitleSide($aSideOfAxis) { |
3639 | 3712 | $this->title_side = $aSideOfAxis; |
3640 | 3713 | } |
@@ -3673,11 +3746,19 @@ discard block |
||
3673 | 3746 | $this->label_step=$aStep; |
3674 | 3747 | } |
3675 | 3748 | |
3749 | + /** |
|
3750 | + * @param integer $aSidePos |
|
3751 | + */ |
|
3676 | 3752 | function SetLabelSide($aSidePos) { |
3677 | 3753 | $this->labelPos=$aSidePos; |
3678 | 3754 | } |
3679 | 3755 | |
3680 | 3756 | // Set the font |
3757 | + |
|
3758 | + /** |
|
3759 | + * @param integer $aFamily |
|
3760 | + * @param integer $aStyle |
|
3761 | + */ |
|
3681 | 3762 | function SetFont($aFamily,$aStyle=FS_NORMAL,$aSize=10) { |
3682 | 3763 | $this->font_family = $aFamily; |
3683 | 3764 | $this->font_style = $aStyle; |
@@ -3718,6 +3799,10 @@ discard block |
||
3718 | 3799 | } |
3719 | 3800 | |
3720 | 3801 | // Stroke the axis. |
3802 | + |
|
3803 | + /** |
|
3804 | + * @param LinearScale $aOtherAxisScale |
|
3805 | + */ |
|
3721 | 3806 | function Stroke($aOtherAxisScale,$aStrokeLabels=true) { |
3722 | 3807 | if( $this->hide ) |
3723 | 3808 | return; |
@@ -4700,6 +4785,10 @@ discard block |
||
4700 | 4785 | |
4701 | 4786 | // Calculate autoscale. Used if user hasn't given a scale and ticks |
4702 | 4787 | // $maxsteps is the maximum number of major tickmarks allowed. |
4788 | + |
|
4789 | + /** |
|
4790 | + * @param RotImage $img |
|
4791 | + */ |
|
4703 | 4792 | function AutoScale($img,$min,$max,$maxsteps,$majend=true) { |
4704 | 4793 | |
4705 | 4794 | if( !is_numeric($min) || !is_numeric($max) ) { |
@@ -4864,6 +4953,12 @@ discard block |
||
4864 | 4953 | // [$numsteps,$adjmin,$adjmax,$minstep,$majstep] |
4865 | 4954 | // If $majend==true then the first and last marks on the axis will be major |
4866 | 4955 | // labeled tick marks otherwise it will be adjusted to the closest min tick mark |
4956 | + |
|
4957 | + /** |
|
4958 | + * @param double $min |
|
4959 | + * @param integer $a |
|
4960 | + * @param integer $b |
|
4961 | + */ |
|
4867 | 4962 | function CalcTicks($maxsteps,$min,$max,$a,$b,$majend=true) { |
4868 | 4963 | $diff=$max-$min; |
4869 | 4964 | if( $diff==0 ) { |
@@ -4906,6 +5001,11 @@ discard block |
||
4906 | 5001 | return array($numsteps,$adjmin,$adjmax,$minstep,$majstep); |
4907 | 5002 | } |
4908 | 5003 | |
5004 | + /** |
|
5005 | + * @param double $min |
|
5006 | + * @param integer $a |
|
5007 | + * @param integer $b |
|
5008 | + */ |
|
4909 | 5009 | function CalcTicksFreeze($maxsteps,$min,$max,$a,$b) { |
4910 | 5010 | // Same as CalcTicks but don't adjust min/max values |
4911 | 5011 | $diff=$max-$min; |
@@ -4931,6 +5031,12 @@ discard block |
||
4931 | 5031 | return array($numsteps,$minstep,$majstep); |
4932 | 5032 | } |
4933 | 5033 | |
5034 | + /** |
|
5035 | + * @param double $maxsteps |
|
5036 | + * @param double $min |
|
5037 | + * @param double $max |
|
5038 | + * @param integer $a |
|
5039 | + */ |
|
4934 | 5040 | function IntCalcTicks($maxsteps,$min,$max,$a,$majend=true) { |
4935 | 5041 | $diff=$max-$min; |
4936 | 5042 | if( $diff==0 ) { |
@@ -4978,6 +5084,12 @@ discard block |
||
4978 | 5084 | return array($numsteps,$adjmin,$adjmax,$majstep); |
4979 | 5085 | } |
4980 | 5086 | |
5087 | + /** |
|
5088 | + * @param double $maxsteps |
|
5089 | + * @param double $min |
|
5090 | + * @param double $max |
|
5091 | + * @param integer $a |
|
5092 | + */ |
|
4981 | 5093 | function IntCalcTicksFreeze($maxsteps,$min,$max,$a) { |
4982 | 5094 | // Same as IntCalcTick but don't change min/max values |
4983 | 5095 | $diff=$max-$min; |
@@ -5008,6 +5120,10 @@ discard block |
||
5008 | 5120 | } |
5009 | 5121 | |
5010 | 5122 | // Determine the minimum of three values witha weight for last value |
5123 | + |
|
5124 | + /** |
|
5125 | + * @param double $weight |
|
5126 | + */ |
|
5011 | 5127 | function MatchMin3($a,$b,$c,$weight) { |
5012 | 5128 | if( $a < $b ) { |
5013 | 5129 | if( $a < ($c*$weight) ) { |
@@ -5050,6 +5166,9 @@ discard block |
||
5050 | 5166 | $this->show=$aFlag; |
5051 | 5167 | } |
5052 | 5168 | |
5169 | + /** |
|
5170 | + * @param string $aColor |
|
5171 | + */ |
|
5053 | 5172 | function SetColor($aColor,$aNegcolor='') { |
5054 | 5173 | $this->color = $aColor; |
5055 | 5174 | $this->negcolor = $aNegcolor; |
@@ -5073,11 +5192,17 @@ discard block |
||
5073 | 5192 | $this->angle = $aAngle; |
5074 | 5193 | } |
5075 | 5194 | |
5195 | + /** |
|
5196 | + * @param string $aHAlign |
|
5197 | + */ |
|
5076 | 5198 | function SetAlign($aHAlign,$aVAlign='') { |
5077 | 5199 | $this->halign = $aHAlign; |
5078 | 5200 | $this->valign = $aVAlign; |
5079 | 5201 | } |
5080 | 5202 | |
5203 | + /** |
|
5204 | + * @param string $aFormat |
|
5205 | + */ |
|
5081 | 5206 | function SetFormat($aFormat,$aNegFormat='') { |
5082 | 5207 | $this->format= $aFormat; |
5083 | 5208 | $this->negformat= $aNegFormat; |
@@ -5328,6 +5453,9 @@ discard block |
||
5328 | 5453 | $this->legendcsimalt = $aCSIMAlt; |
5329 | 5454 | } |
5330 | 5455 | |
5456 | + /** |
|
5457 | + * @param integer $aWeight |
|
5458 | + */ |
|
5331 | 5459 | function SetWeight($aWeight) { |
5332 | 5460 | $this->weight=$aWeight; |
5333 | 5461 | } |
@@ -25,6 +25,9 @@ discard block |
||
25 | 25 | private $w,$h; |
26 | 26 | private $ixmin=0,$ixmax=10,$iymin=0,$iymax=10; |
27 | 27 | |
28 | + /** |
|
29 | + * @param CanvasGraph $graph |
|
30 | + */ |
|
28 | 31 | function __construct($graph,$xmin=0,$xmax=10,$ymin=0,$ymax=10) { |
29 | 32 | $this->g = $graph; |
30 | 33 | $this->w = $graph->img->width; |
@@ -74,6 +77,10 @@ discard block |
||
74 | 77 | class Shape { |
75 | 78 | private $img,$scale; |
76 | 79 | |
80 | + /** |
|
81 | + * @param CanvasGraph $aGraph |
|
82 | + * @param CanvasScale $scale |
|
83 | + */ |
|
77 | 84 | function __construct($aGraph,$scale) { |
78 | 85 | $this->img = $aGraph->img; |
79 | 86 | $this->img->SetColor('black'); |