Applies common formatting to a debug-mode table row.

Parameters

array $row: The row to format.

boolean $may_unpack: (optional) Indicates if $row['data'] needs be formatted rather than $row itself. Default is TRUE.

File

./devel_node_access.module, line 1415
Functions for debugging node access permissions.

Code

function _devel_node_access_format_row($row, $may_unpack = TRUE) {
  if ($may_unpack && isset($row['data'])) {
    $row['data'] = _devel_node_access_format_row($row['data'], FALSE);
    $row['class'][] = 'even';
    return $row;
  }
  if (count($row) == 1) {
    if (is_scalar($row['data'])) {
      $row['data'] = array(
        'data' => $row['data'],
      );
    }
    $row['data']['colspan'] = 9;
  }
  else {
    $row = array_values($row);
    foreach (array(
      0,
      1,
      4,
    ) as $j) {

      // node, prio, gid
      if (is_scalar($row[$j])) {
        $row[$j] = array(
          'data' => $row[$j],
        );
      }
      $row[$j]['style'][] = 'text-align: right;';
    }
  }
  return $row;
}