You are here

function theme_noderelationships_erd_entity in Node Relationships 6

Render an entity in the ERD.

2 theme calls to theme_noderelationships_erd_entity()
theme_noderelationships_erd_current in ./noderelationships.admin.inc
Render the current entity in the ERD.
theme_noderelationships_erd_group in ./noderelationships.admin.inc
Render a group of entities in the ERD.

File

./noderelationships.admin.inc, line 175
Implementation of the administration pages of the module.

Code

function theme_noderelationships_erd_entity($label, $items = NULL) {
  $output = '<div class="noderelationships-erd-entity">';
  if (!is_array($label)) {
    $label = array(
      'data' => $label,
    );
  }
  $output .= '<div class="noderelationships-erd-entity-caption">';
  $output .= '<h2' . (isset($label['attributes']) ? drupal_attributes($label['attributes']) : '') . '>' . $label['data'] . '</h2>';
  $output .= '</div>';
  $output .= '<div class="noderelationships-erd-fields">';
  if (empty($items)) {
    $output .= '&nbsp;';
  }
  else {
    foreach ($items as $key => $item) {
      if (!is_array($item)) {
        $item = array(
          'data' => $item,
        );
      }
      $items[$key] = '<li' . (isset($item['attributes']) ? drupal_attributes($item['attributes']) : '') . '>' . $item['data'] . '</li>';
    }
    $output .= '<ul>' . implode('', $items) . '</ul>';
  }
  $output .= '</div>';
  $output .= '</div>' . "\n";
  return $output;
}