You are here

function _domain_block_print_array in Domain Access 6.2

Same name and namespace in other branches
  1. 7.3 domain.blocks.inc \_domain_block_print_array()
  2. 7.2 domain.blocks.inc \_domain_block_print_array()

Prints array data for the server block.

Parameters

$array: An array of data. Note that we support two levels of nesting.

Return value

A suitable output string.

1 call to _domain_block_print_array()
domain_block in ./domain.module
Implement hook_block()

File

./domain.module, line 440
Core module functions for the Domain Access suite.

Code

function _domain_block_print_array($array) {
  $items = array();
  foreach ($array as $key => $val) {
    $value = 'array';
    if (!is_array($val)) {
      $value = check_plain($val);
    }
    else {
      $list = array();
      foreach ($val as $k => $v) {
        $list[] = t('@key : @value', array(
          '@key' => $k,
          '@value' => $v,
        ));
      }
      $value = implode('<br />', $list);
    }
    $items[] = t('@key : !value', array(
      '@key' => $key,
      '!value' => $value,
    ));
  }
  return theme('item_list', $items);
}