function drupalforfirebug_array_highlight_code in Drupal For Firebug 7
Same name and namespace in other branches
- 5 drupalforfirebug.module \drupalforfirebug_array_highlight_code()
- 6 drupalforfirebug.module \drupalforfirebug_array_highlight_code()
- 7.2 drupalforfirebug.module \drupalforfirebug_array_highlight_code()
Specialized Array Data Style Function
2 calls to drupalforfirebug_array_highlight_code()
- drupalforfirebug_array_compare in ./
drupalforfirebug.module - Generalized Array Comparision Function
- drupalforfirebug_array_row_build in ./
drupalforfirebug.module - Specialized Function to Return an Array Row
File
- ./
drupalforfirebug.module, line 462
Code
function drupalforfirebug_array_highlight_code($data, $depth = 0) {
// Smartly Handling Recursion for Objects
if (is_object($data)) {
$data = (array) $data;
static $refChain = array();
foreach ($refChain as $refVal) {
if ($refVal === $data) {
$data = array(
'**' . t('Recursion Detected') . '**',
);
}
}
array_push($refChain, $data);
}
$output = '';
foreach ($data as $key => $value) {
if ((string) $key != '#firebug_style') {
if (isset($data['#firebug_style']) && isset($data['#firebug_style'][$key])) {
$output .= drupalforfirebug_array_row_build($key, $value, $data['#firebug_style'][$key], $depth);
}
}
}
return $output;
}