diff --git a/calendar/inc/class.boicalendar.inc.php b/calendar/inc/class.boicalendar.inc.php index be87b8d886..dd62ff5158 100755 --- a/calendar/inc/class.boicalendar.inc.php +++ b/calendar/inc/class.boicalendar.inc.php @@ -1263,7 +1263,7 @@ class boicalendar } else { - $this->debug("Setting ".$type." = "._debug_array($value)); + $this->debug("Setting ".$type." = "._debug_array($value,False)); } } @@ -1411,7 +1411,7 @@ class boicalendar } elseif(ereg('(.*(\:\\\\)?.*):(.*)',$value,$temp)) { - $this->debug('Value : '._debug_array($temp)); + $this->debug('Value : '._debug_array($temp,False)); $this->debug('Param '.$majortype.' Value : '.$temp[3]); if($temp[3]) { @@ -1423,7 +1423,7 @@ class boicalendar } while(ereg('(([A-Z\-]*)[=]([[:alnum:] \_\)\(\/\$\.\,\:\\\|\*\&\^\%\#\!\~\"\?\&\@\<\>\-]*))([\;]?)(.*)',$value,$temp)) { - $this->debug('Value : '._debug_array($temp)); + $this->debug('Value : '._debug_array($temp,False)); $this->debug('Param '.$temp[2].' Value : '.$temp[3]); $return_value[] = Array( 'param' => $temp[2], @@ -1438,7 +1438,7 @@ class boicalendar { while(ereg('(([A-Z\-]*)[=]([[:alnum:] \_\)\(\/\$\.\,\:\\\|\*\&\^\%\#\!\~\"\?\&\@\<\>\-]*))([\;]?)(.*)',$value,$temp)) { - $this->debug('Value : '._debug_array($temp)); + $this->debug('Value : '._debug_array($temp,False)); $this->debug('Param '.$temp[2].' Value : '.$temp[3]); $return_value[] = Array( 'param' => $temp[2], @@ -1512,7 +1512,7 @@ class boicalendar { $this->set_var($event[$majortype],$param,$value); } - $this->debug('Event : '._debug_array($event)); + $this->debug('Event : '._debug_array($event,False)); break; } } @@ -1526,7 +1526,7 @@ class boicalendar $this->parse_parameters($var,$majortype,$value); if($this->property[$majortype][$mode]['multiples']) { - $this->debug(_debug_array($var)); + $this->debug(_debug_array($var,False)); $event[$majortype][] = $var; } else @@ -1543,7 +1543,7 @@ class boicalendar { $var[$key] = $val; } - $this->debug($majortype.' : '._debug_array($var)); + $this->debug($majortype.' : '._debug_array($var,False)); } $this->set_var($event,$majortype,$var); } @@ -2065,7 +2065,7 @@ class boicalendar } } } - $this->debug('DATETIME : '._debug_array($dtime)); + $this->debug('DATETIME : '._debug_array($dtime,False)); return $dtime; } elseif(is_array($var)) diff --git a/phpgwapi/inc/common_functions.inc.php b/phpgwapi/inc/common_functions.inc.php index 87c62e164f..f8256c5ca0 100755 --- a/phpgwapi/inc/common_functions.inc.php +++ b/phpgwapi/inc/common_functions.inc.php @@ -623,7 +623,7 @@ } /* Just a wrapper to my new print_r() function I added to the php3 support file. Seek3r */ - function _debug_array($array) + function _debug_array($array,$print=True) { $four = False; if(@floor(phpversion()) == 4) @@ -632,12 +632,23 @@ } if($four) { + if(!$print) + { + ob_start(); + } echo '
'; - } - print_r($array); - if($four) - { + print_r($array); echo ''; + if(!$print) + { + $v = ob_get_contents(); + ob_end_clean(); + return $v; + } + } + else + { + return print_r($array,False,$print); } } diff --git a/phpgwapi/inc/php3_support_functions.inc.php b/phpgwapi/inc/php3_support_functions.inc.php index e71298c4b2..6ea1ee62c4 100755 --- a/phpgwapi/inc/php3_support_functions.inc.php +++ b/phpgwapi/inc/php3_support_functions.inc.php @@ -275,31 +275,40 @@ } } - function print_r($array,$recursed=False) + function print_r($array,$recursed=False,$print=True) { + $str = ''; if(is_array($array) || is_object($array)) { if(!$recursed) { - echo '
'; + $str .= '
'; } - echo ucfirst(gettype($array)) . '(
=>
';
- print_r($subarray,True);
- echo '=>
';
+ $str .= print_r($subarray,True,$print);
+ $str .= '