@@ -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(' ' => '-', '_' => '-', '[' => '-', ']' => '')); |
@@ -382,16 +382,16 @@ discard block |
||
382 | 382 | // Store the menu item since it has some useful information. |
383 | 383 | $vars['menu_item'] = menu_get_item(); |
384 | 384 | switch ($vars['menu_item']['page_callback']) { |
385 | - case 'views_page': |
|
386 | - // Is this a Views page? |
|
387 | - $vars['classes_array'][] = 'page-views'; |
|
388 | - break; |
|
389 | - case 'page_manager_page_execute': |
|
390 | - case 'page_manager_node_view': |
|
391 | - case 'page_manager_contact_site': |
|
392 | - // Is this a Panels page? |
|
393 | - $vars['classes_array'][] = 'page-panels'; |
|
394 | - break; |
|
385 | + case 'views_page': |
|
386 | + // Is this a Views page? |
|
387 | + $vars['classes_array'][] = 'page-views'; |
|
388 | + break; |
|
389 | + case 'page_manager_page_execute': |
|
390 | + case 'page_manager_node_view': |
|
391 | + case 'page_manager_contact_site': |
|
392 | + // Is this a Panels page? |
|
393 | + $vars['classes_array'][] = 'page-panels'; |
|
394 | + break; |
|
395 | 395 | } |
396 | 396 | } |
397 | 397 | |
@@ -428,31 +428,31 @@ discard block |
||
428 | 428 | function zen_preprocess_node(&$vars, $hook) { |
429 | 429 | // Create the build_mode variable. |
430 | 430 | switch ($vars['node']->build_mode) { |
431 | - case NODE_BUILD_NORMAL: |
|
432 | - if ($vars['node']->build_mode === NODE_BUILD_NORMAL) { |
|
433 | - $vars['build_mode'] = $vars['teaser'] ? 'teaser' : 'full'; |
|
434 | - } |
|
435 | - else { |
|
436 | - $vars['build_mode'] = $vars['node']->build_mode; |
|
437 | - } |
|
438 | - break; |
|
439 | - case NODE_BUILD_PREVIEW: |
|
440 | - $vars['build_mode'] = 'preview'; |
|
441 | - break; |
|
442 | - case NODE_BUILD_SEARCH_INDEX: |
|
443 | - $vars['build_mode'] = 'search_index'; |
|
444 | - break; |
|
445 | - case NODE_BUILD_SEARCH_RESULT: |
|
446 | - $vars['build_mode'] = 'search_result'; |
|
447 | - break; |
|
448 | - case NODE_BUILD_RSS: |
|
449 | - $vars['build_mode'] = 'rss'; |
|
450 | - break; |
|
451 | - case NODE_BUILD_PRINT: |
|
452 | - $vars['build_mode'] = 'print'; |
|
453 | - break; |
|
454 | - default: |
|
431 | + case NODE_BUILD_NORMAL: |
|
432 | + if ($vars['node']->build_mode === NODE_BUILD_NORMAL) { |
|
433 | + $vars['build_mode'] = $vars['teaser'] ? 'teaser' : 'full'; |
|
434 | + } |
|
435 | + else { |
|
455 | 436 | $vars['build_mode'] = $vars['node']->build_mode; |
437 | + } |
|
438 | + break; |
|
439 | + case NODE_BUILD_PREVIEW: |
|
440 | + $vars['build_mode'] = 'preview'; |
|
441 | + break; |
|
442 | + case NODE_BUILD_SEARCH_INDEX: |
|
443 | + $vars['build_mode'] = 'search_index'; |
|
444 | + break; |
|
445 | + case NODE_BUILD_SEARCH_RESULT: |
|
446 | + $vars['build_mode'] = 'search_result'; |
|
447 | + break; |
|
448 | + case NODE_BUILD_RSS: |
|
449 | + $vars['build_mode'] = 'rss'; |
|
450 | + break; |
|
451 | + case NODE_BUILD_PRINT: |
|
452 | + $vars['build_mode'] = 'print'; |
|
453 | + break; |
|
454 | + default: |
|
455 | + $vars['build_mode'] = $vars['node']->build_mode; |
|
456 | 456 | } |
457 | 457 | |
458 | 458 | // Create the user_picture variable. |
@@ -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. |
@@ -300,125 +300,125 @@ |
||
300 | 300 | } |
301 | 301 | |
302 | 302 | switch ($form_state['values']['import']) { |
303 | - case 'users': |
|
304 | - boincimport_users(); |
|
305 | - break; |
|
306 | - |
|
307 | - case 'teams': |
|
308 | - boincimport_teams(); |
|
309 | - if (!variable_get('boincimport_import_team_successful', 0)) { |
|
310 | - $_SESSION['boincimport_stage_selected'] = 'teams'; |
|
311 | - } |
|
312 | - else { |
|
313 | - $_SESSION['boincimport_stage_selected'] = 'friends'; |
|
314 | - } |
|
315 | - break; |
|
303 | + case 'users': |
|
304 | + boincimport_users(); |
|
305 | + break; |
|
316 | 306 | |
317 | - case 'friends': |
|
318 | - boincimport_friends(); |
|
319 | - if (!variable_get('boincimport_import_friend_successful', 0)) { |
|
320 | - $_SESSION['boincimport_stage_selected'] = 'friends'; |
|
321 | - } |
|
322 | - else { |
|
323 | - $_SESSION['boincimport_stage_selected'] = 'preferences'; |
|
324 | - } |
|
325 | - break; |
|
307 | + case 'teams': |
|
308 | + boincimport_teams(); |
|
309 | + if (!variable_get('boincimport_import_team_successful', 0)) { |
|
310 | + $_SESSION['boincimport_stage_selected'] = 'teams'; |
|
311 | + } |
|
312 | + else { |
|
313 | + $_SESSION['boincimport_stage_selected'] = 'friends'; |
|
314 | + } |
|
315 | + break; |
|
326 | 316 | |
327 | - case 'preferences': |
|
328 | - boincimport_preferences(); |
|
329 | - if (!variable_get('boincimport_import_preferences_successful', 0)) { |
|
330 | - $_SESSION['boincimport_stage_selected'] = 'preferences'; |
|
331 | - } |
|
332 | - else { |
|
333 | - $_SESSION['boincimport_stage_selected'] = 'private messages'; |
|
334 | - } |
|
335 | - break; |
|
317 | + case 'friends': |
|
318 | + boincimport_friends(); |
|
319 | + if (!variable_get('boincimport_import_friend_successful', 0)) { |
|
320 | + $_SESSION['boincimport_stage_selected'] = 'friends'; |
|
321 | + } |
|
322 | + else { |
|
323 | + $_SESSION['boincimport_stage_selected'] = 'preferences'; |
|
324 | + } |
|
325 | + break; |
|
336 | 326 | |
337 | - case 'private messages': |
|
338 | - boincimport_private_msgs(); |
|
339 | - if (!variable_get('boincimport_import_private_msg_successful', 0)) { |
|
340 | - $_SESSION['boincimport_stage_selected'] = 'private messages'; |
|
341 | - } |
|
342 | - else { |
|
343 | - $_SESSION['boincimport_stage_selected'] = 'categories'; |
|
344 | - } |
|
345 | - break; |
|
327 | + case 'preferences': |
|
328 | + boincimport_preferences(); |
|
329 | + if (!variable_get('boincimport_import_preferences_successful', 0)) { |
|
330 | + $_SESSION['boincimport_stage_selected'] = 'preferences'; |
|
331 | + } |
|
332 | + else { |
|
333 | + $_SESSION['boincimport_stage_selected'] = 'private messages'; |
|
334 | + } |
|
335 | + break; |
|
346 | 336 | |
347 | - case 'categories': |
|
348 | - boincimport_forum_categories(); |
|
349 | - if (!variable_get('boincimport_import_category_successful', 0)) { |
|
350 | - $_SESSION['boincimport_stage_selected'] = 'categories'; |
|
351 | - } |
|
352 | - else { |
|
353 | - $_SESSION['boincimport_stage_selected'] = 'topics'; |
|
354 | - } |
|
355 | - break; |
|
337 | + case 'private messages': |
|
338 | + boincimport_private_msgs(); |
|
339 | + if (!variable_get('boincimport_import_private_msg_successful', 0)) { |
|
340 | + $_SESSION['boincimport_stage_selected'] = 'private messages'; |
|
341 | + } |
|
342 | + else { |
|
343 | + $_SESSION['boincimport_stage_selected'] = 'categories'; |
|
344 | + } |
|
345 | + break; |
|
356 | 346 | |
357 | - case 'topics': |
|
358 | - boincimport_forum_topics(); |
|
359 | - if (!variable_get('boincimport_import_topic_successful', 0)) { |
|
360 | - $_SESSION['boincimport_stage_selected'] = 'topics'; |
|
361 | - } |
|
362 | - else { |
|
363 | - $_SESSION['boincimport_stage_selected'] = 'posts'; |
|
364 | - } |
|
365 | - break; |
|
347 | + case 'categories': |
|
348 | + boincimport_forum_categories(); |
|
349 | + if (!variable_get('boincimport_import_category_successful', 0)) { |
|
350 | + $_SESSION['boincimport_stage_selected'] = 'categories'; |
|
351 | + } |
|
352 | + else { |
|
353 | + $_SESSION['boincimport_stage_selected'] = 'topics'; |
|
354 | + } |
|
355 | + break; |
|
356 | + |
|
357 | + case 'topics': |
|
358 | + boincimport_forum_topics(); |
|
359 | + if (!variable_get('boincimport_import_topic_successful', 0)) { |
|
360 | + $_SESSION['boincimport_stage_selected'] = 'topics'; |
|
361 | + } |
|
362 | + else { |
|
363 | + $_SESSION['boincimport_stage_selected'] = 'posts'; |
|
364 | + } |
|
365 | + break; |
|
366 | 366 | |
367 | - case 'posts': |
|
368 | - boincimport_forum_posts(); |
|
369 | - if (!variable_get('boincimport_import_post_successful', 0)) { |
|
370 | - $_SESSION['boincimport_stage_selected'] = 'posts'; |
|
371 | - } |
|
372 | - else { |
|
373 | - $_SESSION['boincimport_stage_selected'] = 'url'; |
|
374 | - } |
|
375 | - break; |
|
367 | + case 'posts': |
|
368 | + boincimport_forum_posts(); |
|
369 | + if (!variable_get('boincimport_import_post_successful', 0)) { |
|
370 | + $_SESSION['boincimport_stage_selected'] = 'posts'; |
|
371 | + } |
|
372 | + else { |
|
373 | + $_SESSION['boincimport_stage_selected'] = 'url'; |
|
374 | + } |
|
375 | + break; |
|
376 | 376 | |
377 | - case 'team forums': |
|
378 | - boincimport_team_forums(); |
|
379 | - if (!variable_get('boincimport_team_forum_successful', 0)) { |
|
380 | - $_SESSION['boincimport_stage_selected'] = 'team forums'; |
|
381 | - } |
|
382 | - else { |
|
383 | - $_SESSION['boincimport_stage_selected'] = 'team topics'; |
|
384 | - } |
|
385 | - break; |
|
377 | + case 'team forums': |
|
378 | + boincimport_team_forums(); |
|
379 | + if (!variable_get('boincimport_team_forum_successful', 0)) { |
|
380 | + $_SESSION['boincimport_stage_selected'] = 'team forums'; |
|
381 | + } |
|
382 | + else { |
|
383 | + $_SESSION['boincimport_stage_selected'] = 'team topics'; |
|
384 | + } |
|
385 | + break; |
|
386 | 386 | |
387 | - case 'team topics': |
|
388 | - boincimport_team_forum_topics(); |
|
389 | - if (!variable_get('boincimport_team_topic_successful', 0)) { |
|
390 | - $_SESSION['boincimport_stage_selected'] = 'team topics'; |
|
391 | - } |
|
392 | - else { |
|
393 | - $_SESSION['boincimport_stage_selected'] = 'team posts'; |
|
394 | - } |
|
395 | - break; |
|
387 | + case 'team topics': |
|
388 | + boincimport_team_forum_topics(); |
|
389 | + if (!variable_get('boincimport_team_topic_successful', 0)) { |
|
390 | + $_SESSION['boincimport_stage_selected'] = 'team topics'; |
|
391 | + } |
|
392 | + else { |
|
393 | + $_SESSION['boincimport_stage_selected'] = 'team posts'; |
|
394 | + } |
|
395 | + break; |
|
396 | 396 | |
397 | - case 'team posts': |
|
398 | - boincimport_team_forum_posts(); |
|
399 | - if (!variable_get('boincimport_team_post_successful', 0)) { |
|
400 | - $_SESSION['boincimport_stage_selected'] = 'team posts'; |
|
401 | - } |
|
402 | - else { |
|
403 | - $_SESSION['boincimport_stage_selected'] = 'url'; |
|
404 | - } |
|
405 | - break; |
|
397 | + case 'team posts': |
|
398 | + boincimport_team_forum_posts(); |
|
399 | + if (!variable_get('boincimport_team_post_successful', 0)) { |
|
400 | + $_SESSION['boincimport_stage_selected'] = 'team posts'; |
|
401 | + } |
|
402 | + else { |
|
403 | + $_SESSION['boincimport_stage_selected'] = 'url'; |
|
404 | + } |
|
405 | + break; |
|
406 | 406 | |
407 | - case 'url': |
|
408 | - boincimport_replace_urls(); |
|
409 | - if (!variable_get('boincimport_replace_url_successful', 0)) { |
|
410 | - $_SESSION['boincimport_stage_selected'] = 'url'; |
|
411 | - } |
|
412 | - else { |
|
413 | - drupal_set_message('Congratulations. Import Finished'); |
|
414 | - drupal_set_message('Please visit the '. l('Post migration configuration', 'admin/boinc/import/post_configuration') .' page'); |
|
415 | - watchdog('boincimport', 'Import process is complete', array(), WATCHDOG_INFO); |
|
416 | - unset($_SESSION['boincimport_stage_selected']); |
|
417 | - } |
|
418 | - break; |
|
419 | - default: |
|
420 | - $_SESSION['boincimport_stage_selected'] = 'users'; |
|
421 | - break; |
|
407 | + case 'url': |
|
408 | + boincimport_replace_urls(); |
|
409 | + if (!variable_get('boincimport_replace_url_successful', 0)) { |
|
410 | + $_SESSION['boincimport_stage_selected'] = 'url'; |
|
411 | + } |
|
412 | + else { |
|
413 | + drupal_set_message('Congratulations. Import Finished'); |
|
414 | + drupal_set_message('Please visit the '. l('Post migration configuration', 'admin/boinc/import/post_configuration') .' page'); |
|
415 | + watchdog('boincimport', 'Import process is complete', array(), WATCHDOG_INFO); |
|
416 | + unset($_SESSION['boincimport_stage_selected']); |
|
417 | + } |
|
418 | + break; |
|
419 | + default: |
|
420 | + $_SESSION['boincimport_stage_selected'] = 'users'; |
|
421 | + break; |
|
422 | 422 | } |
423 | 423 | } |
424 | 424 |
@@ -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; |
@@ -1066,42 +1066,42 @@ |
||
1066 | 1066 | $R=$StartR;$G=$StartG;$B=$StartB; |
1067 | 1067 | switch($Direction) |
1068 | 1068 | { |
1069 | - case DIRECTION_VERTICAL: |
|
1070 | - $StartY = $Y1; $EndY = floor($Y2)+1; $LastY2 = $StartY; |
|
1071 | - for($i=0;$i<=$Step;$i++) |
|
1069 | + case DIRECTION_VERTICAL: |
|
1070 | + $StartY = $Y1; $EndY = floor($Y2)+1; $LastY2 = $StartY; |
|
1071 | + for($i=0;$i<=$Step;$i++) |
|
1072 | + { |
|
1073 | + $Y2 = floor($StartY + ($i * $StepSize)); |
|
1074 | + |
|
1075 | + if ($Y2 > $EndY) { $Y2 = $EndY; } |
|
1076 | + if (($Y1 != $Y2 && $Y1 < $Y2) || $Y2 == $EndY) |
|
1072 | 1077 | { |
1073 | - $Y2 = floor($StartY + ($i * $StepSize)); |
|
1074 | - |
|
1075 | - if ($Y2 > $EndY) { $Y2 = $EndY; } |
|
1076 | - if (($Y1 != $Y2 && $Y1 < $Y2) || $Y2 == $EndY) |
|
1077 | - { |
|
1078 | - $Color = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha); |
|
1079 | - $this->drawFilledRectangle($X1,$Y1,$X2,$Y2,$Color); |
|
1080 | - $LastY2 = max($LastY2,$Y2); |
|
1081 | - $Y1 = $Y2+1; |
|
1082 | - } |
|
1083 | - $R = $R + $RStep; $G = $G + $GStep; $B = $B + $BStep; |
|
1078 | + $Color = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha); |
|
1079 | + $this->drawFilledRectangle($X1,$Y1,$X2,$Y2,$Color); |
|
1080 | + $LastY2 = max($LastY2,$Y2); |
|
1081 | + $Y1 = $Y2+1; |
|
1084 | 1082 | } |
1085 | - if ( $LastY2 < $EndY && isset($Color)) { for ($i=$LastY2+1;$i<=$EndY;$i++) { $this->drawLine($X1,$i,$X2,$i,$Color); } } |
|
1086 | - break; |
|
1087 | - |
|
1088 | - case DIRECTION_HORIZONTAL: |
|
1089 | - $StartX = $X1; $EndX = $X2; |
|
1090 | - for($i=0;$i<=$Step;$i++) |
|
1083 | + $R = $R + $RStep; $G = $G + $GStep; $B = $B + $BStep; |
|
1084 | + } |
|
1085 | + if ( $LastY2 < $EndY && isset($Color)) { for ($i=$LastY2+1;$i<=$EndY;$i++) { $this->drawLine($X1,$i,$X2,$i,$Color); } } |
|
1086 | + break; |
|
1087 | + |
|
1088 | + case DIRECTION_HORIZONTAL: |
|
1089 | + $StartX = $X1; $EndX = $X2; |
|
1090 | + for($i=0;$i<=$Step;$i++) |
|
1091 | + { |
|
1092 | + $X2 = floor($StartX + ($i * $StepSize)); |
|
1093 | + |
|
1094 | + if ($X2 > $EndX) { $X2 = $EndX; } |
|
1095 | + if (($X1 != $X2 && $X1 < $X2) || $X2 == $EndX) |
|
1091 | 1096 | { |
1092 | - $X2 = floor($StartX + ($i * $StepSize)); |
|
1093 | - |
|
1094 | - if ($X2 > $EndX) { $X2 = $EndX; } |
|
1095 | - if (($X1 != $X2 && $X1 < $X2) || $X2 == $EndX) |
|
1096 | - { |
|
1097 | - $Color = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha); |
|
1098 | - $this->drawFilledRectangle($X1,$Y1,$X2,$Y2,$Color); |
|
1099 | - $X1 = $X2+1; |
|
1100 | - } |
|
1101 | - $R = $R + $RStep; $G = $G + $GStep; $B = $B + $BStep; |
|
1097 | + $Color = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha); |
|
1098 | + $this->drawFilledRectangle($X1,$Y1,$X2,$Y2,$Color); |
|
1099 | + $X1 = $X2+1; |
|
1102 | 1100 | } |
1103 | - if ( $X2 < $EndX && isset($Color)) { $this->drawFilledRectangle($X2,$Y1,$EndX,$Y2,$Color); } |
|
1104 | - break; |
|
1101 | + $R = $R + $RStep; $G = $G + $GStep; $B = $B + $BStep; |
|
1102 | + } |
|
1103 | + if ( $X2 < $EndX && isset($Color)) { $this->drawFilledRectangle($X2,$Y1,$EndX,$Y2,$Color); } |
|
1104 | + break; |
|
1105 | 1105 | } |
1106 | 1106 | |
1107 | 1107 | $this->Shadow = $Shadow; |
@@ -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); } |