@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | * @param $breadcrumb |
| 33 | 33 | * An array containing the breadcrumb links. |
| 34 | 34 | * @return |
| 35 | - * A string containing the breadcrumb output. |
|
| 35 | + string A string containing the breadcrumb output. |
|
| 36 | 36 | */ |
| 37 | 37 | function zen_breadcrumb($breadcrumb) { |
| 38 | 38 | // Determine if we are to display the breadcrumb. |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | * See http://juicystudio.com/article/screen-readers-display-none.php |
| 88 | 88 | * and http://www.w3.org/TR/WCAG-TECHS/H42.html for more information. |
| 89 | 89 | * @return |
| 90 | - * A string containing an unordered list of links. |
|
| 90 | + string A string containing an unordered list of links. |
|
| 91 | 91 | */ |
| 92 | 92 | function zen_links($links, $attributes = array('class' => 'links'), $heading = '') { |
| 93 | 93 | global $language; |
@@ -600,10 +600,10 @@ discard block |
||
| 600 | 600 | * Do not pass one string containing multiple classes as they will be |
| 601 | 601 | * incorrectly concatenated with dashes, i.e. "one two" will become "one-two". |
| 602 | 602 | * |
| 603 | - * @param $class |
|
| 603 | + * @param string $class |
|
| 604 | 604 | * The class name to clean. |
| 605 | 605 | * @return |
| 606 | - * The cleaned class name. |
|
| 606 | + string The cleaned class name. |
|
| 607 | 607 | */ |
| 608 | 608 | function drupal_html_class($class) { |
| 609 | 609 | // By default, we filter using Drupal's coding standards. |
@@ -633,7 +633,7 @@ discard block |
||
| 633 | 633 | * @param $id |
| 634 | 634 | * The ID to clean. |
| 635 | 635 | * @return |
| 636 | - * The cleaned ID. |
|
| 636 | + string The cleaned ID. |
|
| 637 | 637 | */ |
| 638 | 638 | function drupal_html_id($id) { |
| 639 | 639 | $id = strtr(drupal_strtolower($id), array(' ' => '-', '_' => '-', '[' => '-', ']' => '')); |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | * Set database connection for boincimport |
| 133 | 133 | * |
| 134 | 134 | * @return |
| 135 | - * 1 if can connect to BOINC database. |
|
| 135 | + integer 1 if can connect to BOINC database. |
|
| 136 | 136 | * |
| 137 | 137 | * BEWARE: if you test using db_connect and the connection |
| 138 | 138 | * fails, the process will die() which is a bit too much since we only |
@@ -162,6 +162,7 @@ discard block |
||
| 162 | 162 | /** |
| 163 | 163 | * Check if the module is enabled. |
| 164 | 164 | * |
| 165 | + * @param string $module |
|
| 165 | 166 | * @return array |
| 166 | 167 | * $out['html'] = formatted html. |
| 167 | 168 | * $out['result'] = boolean. |
@@ -422,6 +422,9 @@ |
||
| 422 | 422 | /* |
| 423 | 423 | * |
| 424 | 424 | */ |
| 425 | +/** |
|
| 426 | + * @param integer $credit |
|
| 427 | + */ |
|
| 425 | 428 | function boincstats_credit_to_ghours($credit) { |
| 426 | 429 | return $credit / (100 * 365); |
| 427 | 430 | } |
@@ -179,6 +179,10 @@ |
||
| 179 | 179 | |
| 180 | 180 | function left($value,$NbChar) { return substr($value,0,$NbChar); } |
| 181 | 181 | function right($value,$NbChar) { return substr($value,strlen($value)-$NbChar,$NbChar); } |
| 182 | + |
|
| 183 | + /** |
|
| 184 | + * @param integer $NbChar |
|
| 185 | + */ |
|
| 182 | 186 | function mid($value,$Depart,$NbChar) { return substr($value,$Depart-1,$NbChar); } |
| 183 | 187 | } |
| 184 | 188 | ?> |
| 185 | 189 | \ No newline at end of file |
@@ -181,6 +181,9 @@ discard block |
||
| 181 | 181 | } |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | + /** |
|
| 185 | + * @param string $string |
|
| 186 | + */ |
|
| 184 | 187 | function checksum( $string ) |
| 185 | 188 | { |
| 186 | 189 | $checksum = 0; |
@@ -195,6 +198,11 @@ discard block |
||
| 195 | 198 | |
| 196 | 199 | function left($value,$NbChar) { return substr($value,0,$NbChar); } |
| 197 | 200 | function right($value,$NbChar) { return substr($value,strlen($value)-$NbChar,$NbChar); } |
| 201 | + |
|
| 202 | + /** |
|
| 203 | + * @param integer $Depart |
|
| 204 | + * @param integer $NbChar |
|
| 205 | + */ |
|
| 198 | 206 | function mid($value,$Depart,$NbChar) { return substr($value,$Depart-1,$NbChar); } |
| 199 | 207 | } |
| 200 | 208 | ?> |
| 201 | 209 | \ No newline at end of file |
@@ -47,6 +47,10 @@ discard block |
||
| 47 | 47 | { return(md5($Marker.serialize($Data->Data))); } |
| 48 | 48 | |
| 49 | 49 | /* Write the generated picture to the cache */ |
| 50 | + |
|
| 51 | + /** |
|
| 52 | + * @param pImage $pChartObject |
|
| 53 | + */ |
|
| 50 | 54 | function writeToCache($ID,$pChartObject) |
| 51 | 55 | { |
| 52 | 56 | /* Compute the paths */ |
@@ -81,6 +85,10 @@ discard block |
||
| 81 | 85 | } |
| 82 | 86 | |
| 83 | 87 | /* Remove object older than the specified TS */ |
| 88 | + |
|
| 89 | + /** |
|
| 90 | + * @param integer $Expiry |
|
| 91 | + */ |
|
| 84 | 92 | function removeOlderThan($Expiry) |
| 85 | 93 | { $this->dbRemoval(array("Expiry"=>$Expiry)); } |
| 86 | 94 | |
@@ -235,6 +243,9 @@ discard block |
||
| 235 | 243 | return(TRUE); |
| 236 | 244 | } |
| 237 | 245 | |
| 246 | + /** |
|
| 247 | + * @param string $Destination |
|
| 248 | + */ |
|
| 238 | 249 | function saveFromCache($ID,$Destination) |
| 239 | 250 | { |
| 240 | 251 | /* Get the raw picture from the cache */ |
@@ -105,6 +105,10 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /* Strip VOID values */ |
| 108 | + |
|
| 109 | + /** |
|
| 110 | + * @param string $Values |
|
| 111 | + */ |
|
| 108 | 112 | function stripVOID($Values) |
| 109 | 113 | { if (!is_array($Values)) { return(array()); } $Result = array(); foreach($Values as $Key => $Value) { if ( $Value != VOID ) { $Result[] = $Value; } } return($Result); } |
| 110 | 114 | |
@@ -414,6 +418,11 @@ discard block |
||
| 414 | 418 | } |
| 415 | 419 | |
| 416 | 420 | /* Set the position of an Axis */ |
| 421 | + |
|
| 422 | + /** |
|
| 423 | + * @param integer $AxisID |
|
| 424 | + * @param integer $Position |
|
| 425 | + */ |
|
| 417 | 426 | function setAxisPosition($AxisID,$Position=AXIS_POSITION_LEFT) |
| 418 | 427 | { if ( isset($this->Data["Axis"][$AxisID] ) ) { $this->Data["Axis"][$AxisID]["Position"] = $Position; } } |
| 419 | 428 | |
@@ -497,6 +506,10 @@ discard block |
||
| 497 | 506 | } |
| 498 | 507 | |
| 499 | 508 | /* Set the color of one serie */ |
| 509 | + |
|
| 510 | + /** |
|
| 511 | + * @param string $Series |
|
| 512 | + */ |
|
| 500 | 513 | function setPalette($Series,$Format=NULL) |
| 501 | 514 | { |
| 502 | 515 | if ( !is_array($Series) ) { $Series = $this->convertToArray($Series); } |
@@ -559,6 +572,10 @@ discard block |
||
| 559 | 572 | } |
| 560 | 573 | |
| 561 | 574 | /* Initialise a given scatter serie */ |
| 575 | + |
|
| 576 | + /** |
|
| 577 | + * @param integer $ID |
|
| 578 | + */ |
|
| 562 | 579 | function initScatterSerie($ID) |
| 563 | 580 | { |
| 564 | 581 | if ( isset($this->Data["ScatterSeries"][$ID]) ) { return(0); } |
@@ -581,6 +598,10 @@ discard block |
||
| 581 | 598 | } |
| 582 | 599 | |
| 583 | 600 | /* Initialise a given serie */ |
| 601 | + |
|
| 602 | + /** |
|
| 603 | + * @param string $Serie |
|
| 604 | + */ |
|
| 584 | 605 | function initialise($Serie) |
| 585 | 606 | { |
| 586 | 607 | if ( isset($this->Data["Series"]) ) { $ID = count($this->Data["Series"]); } else { $ID = 0; } |
@@ -781,6 +802,10 @@ discard block |
||
| 781 | 802 | { return("pData object."); } |
| 782 | 803 | |
| 783 | 804 | function left($value,$NbChar) { return substr($value,0,$NbChar); } |
| 805 | + |
|
| 806 | + /** |
|
| 807 | + * @param integer $NbChar |
|
| 808 | + */ |
|
| 784 | 809 | function right($value,$NbChar) { return substr($value,strlen($value)-$NbChar,$NbChar); } |
| 785 | 810 | function mid($value,$Depart,$NbChar) { return substr($value,$Depart-1,$NbChar); } |
| 786 | 811 | } |
@@ -124,6 +124,10 @@ discard block |
||
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | /* Draw a polygon */ |
| 127 | + |
|
| 128 | + /** |
|
| 129 | + * @param string $Points |
|
| 130 | + */ |
|
| 127 | 131 | function drawPolygon($Points,$Format="") |
| 128 | 132 | { |
| 129 | 133 | $R = isset($Format["R"]) ? $Format["R"] : 0; |
@@ -573,6 +577,10 @@ discard block |
||
| 573 | 577 | } |
| 574 | 578 | |
| 575 | 579 | /* Drawn a spline based on the bezier function */ |
| 580 | + |
|
| 581 | + /** |
|
| 582 | + * @param string $Coordinates |
|
| 583 | + */ |
|
| 576 | 584 | function drawSpline($Coordinates,$Format="") |
| 577 | 585 | { |
| 578 | 586 | $R = isset($Format["R"]) ? $Format["R"] : 0; |
@@ -1028,6 +1036,10 @@ discard block |
||
| 1028 | 1036 | } |
| 1029 | 1037 | |
| 1030 | 1038 | /* Draw a gradient within a defined area */ |
| 1039 | + |
|
| 1040 | + /** |
|
| 1041 | + * @param integer $Direction |
|
| 1042 | + */ |
|
| 1031 | 1043 | function drawGradientArea($X1,$Y1,$X2,$Y2,$Direction,$Format="") |
| 1032 | 1044 | { |
| 1033 | 1045 | $StartR = isset($Format["StartR"]) ? $Format["StartR"] : 90; |
@@ -1109,6 +1121,11 @@ discard block |
||
| 1109 | 1121 | } |
| 1110 | 1122 | |
| 1111 | 1123 | /* Draw an aliased pixel */ |
| 1124 | + |
|
| 1125 | + /** |
|
| 1126 | + * @param double $X |
|
| 1127 | + * @param double $Y |
|
| 1128 | + */ |
|
| 1112 | 1129 | function drawAntialiasPixel($X,$Y,$Format="") |
| 1113 | 1130 | { |
| 1114 | 1131 | $R = isset($Format["R"]) ? $Format["R"] : 0; |
@@ -1188,6 +1205,10 @@ discard block |
||
| 1188 | 1205 | } |
| 1189 | 1206 | |
| 1190 | 1207 | /* Convert apha to base 10 */ |
| 1208 | + |
|
| 1209 | + /** |
|
| 1210 | + * @param integer $AlphaValue |
|
| 1211 | + */ |
|
| 1191 | 1212 | function convertAlpha($AlphaValue) |
| 1192 | 1213 | { return((127/100)*(100-$AlphaValue)); } |
| 1193 | 1214 | |
@@ -1205,6 +1226,11 @@ discard block |
||
| 1205 | 1226 | } |
| 1206 | 1227 | |
| 1207 | 1228 | /* Load a PNG file and draw it over the chart */ |
| 1229 | + |
|
| 1230 | + /** |
|
| 1231 | + * @param double $X |
|
| 1232 | + * @param double $Y |
|
| 1233 | + */ |
|
| 1208 | 1234 | function drawFromPNG($X,$Y,$FileName) |
| 1209 | 1235 | { $this->drawFromPicture(1,$FileName,$X,$Y); } |
| 1210 | 1236 | |
@@ -2483,6 +2509,9 @@ discard block |
||
| 2483 | 2509 | } |
| 2484 | 2510 | } |
| 2485 | 2511 | |
| 2512 | + /** |
|
| 2513 | + * @param integer $ID |
|
| 2514 | + */ |
|
| 2486 | 2515 | function isValidLabel($Value,$LastValue,$LabelingMethod,$ID,$LabelSkip) |
| 2487 | 2516 | { |
| 2488 | 2517 | if ( $LabelingMethod == LABELING_DIFFERENT && $Value != $LastValue ) { return(TRUE); } |
@@ -2494,6 +2523,10 @@ discard block |
||
| 2494 | 2523 | } |
| 2495 | 2524 | |
| 2496 | 2525 | /* Compute the scale, check for the best visual factors */ |
| 2526 | + |
|
| 2527 | + /** |
|
| 2528 | + * @param double $MaxDivs |
|
| 2529 | + */ |
|
| 2497 | 2530 | function computeScale($XMin,$XMax,$MaxDivs,$Factors,$AxisID=0) |
| 2498 | 2531 | { |
| 2499 | 2532 | /* Compute each factors */ |
@@ -2522,6 +2555,10 @@ discard block |
||
| 2522 | 2555 | } |
| 2523 | 2556 | |
| 2524 | 2557 | /* Compute the best matching scale based on size & factors */ |
| 2558 | + |
|
| 2559 | + /** |
|
| 2560 | + * @param integer $AxisID |
|
| 2561 | + */ |
|
| 2525 | 2562 | function processScale($XMin,$XMax,$MaxDivs,$Factors,$AxisID) |
| 2526 | 2563 | { |
| 2527 | 2564 | $ScaleHeight = abs(ceil($XMax)-floor($XMin)); |
@@ -2602,6 +2639,9 @@ discard block |
||
| 2602 | 2639 | return($Scale); |
| 2603 | 2640 | } |
| 2604 | 2641 | |
| 2642 | + /** |
|
| 2643 | + * @param double $Value2 |
|
| 2644 | + */ |
|
| 2605 | 2645 | function modulo($Value1,$Value2) |
| 2606 | 2646 | { |
| 2607 | 2647 | if (floor($Value2) == 0) { return(0); } |
@@ -5772,6 +5812,10 @@ discard block |
||
| 5772 | 5812 | } |
| 5773 | 5813 | |
| 5774 | 5814 | /* Draw a label box */ |
| 5815 | + |
|
| 5816 | + /** |
|
| 5817 | + * @param string $Captions |
|
| 5818 | + */ |
|
| 5775 | 5819 | function drawLabelBox($X,$Y,$Title,$Captions,$Format="") |
| 5776 | 5820 | { |
| 5777 | 5821 | $NoTitle = isset($Format["NoTitle"]) ? $Format["NoTitle"] : NULL; |
@@ -82,6 +82,12 @@ discard block |
||
| 82 | 82 | var $LastChartLayout = CHART_LAST_LAYOUT_REGULAR; // Last layout : regular or stacked |
| 83 | 83 | |
| 84 | 84 | /* Class constructor */ |
| 85 | + |
|
| 86 | + /** |
|
| 87 | + * @param integer $XSize |
|
| 88 | + * @param integer $YSize |
|
| 89 | + * @param pData $DataSet |
|
| 90 | + */ |
|
| 85 | 91 | function pImage($XSize,$YSize,$DataSet=NULL,$TransparentBackground=FALSE) |
| 86 | 92 | { |
| 87 | 93 | $this->TransparentBackground = $TransparentBackground; |
@@ -126,6 +132,13 @@ discard block |
||
| 126 | 132 | } |
| 127 | 133 | |
| 128 | 134 | /* Set the graph area position */ |
| 135 | + |
|
| 136 | + /** |
|
| 137 | + * @param integer $X1 |
|
| 138 | + * @param integer $Y1 |
|
| 139 | + * @param integer $X2 |
|
| 140 | + * @param integer $Y2 |
|
| 141 | + */ |
|
| 129 | 142 | function setGraphArea($X1,$Y1,$X2,$Y2) |
| 130 | 143 | { |
| 131 | 144 | if ( $X2 < $X1 || $X1 == $X2 || $Y2 < $Y1 || $Y1 == $Y2 ) { return(-1); } |
@@ -145,6 +158,10 @@ discard block |
||
| 145 | 158 | { return($this->YSize); } |
| 146 | 159 | |
| 147 | 160 | /* Render the picture to a file */ |
| 161 | + |
|
| 162 | + /** |
|
| 163 | + * @param string $FileName |
|
| 164 | + */ |
|
| 148 | 165 | function render($FileName) |
| 149 | 166 | { |
| 150 | 167 | if ( $this->TransparentBackground ) { imagealphablending($this->Picture,false); imagesavealpha($this->Picture,true); } |