You are here

function notifications_format_items in Notifications 7

Format items according to predefined formats

1 call to notifications_format_items()
Notifications_Field::format in ./notifications.field.inc
Format title and value

File

./notifications.module, line 75
Notifications module

Code

function notifications_format_items($items, $format = NOTIFICATIONS_FORMAT_LIST) {
  if (!($format & NOTIFICATIONS_FORMAT_HTML)) {
    $items = array_map('check_plain', $items);
  }
  if ($format & NOTIFICATIONS_FORMAT_LIST) {
    return theme('item_list', $items);
  }
  elseif ($format & NOTIFICATIONS_FORMAT_TABLE) {

    // @todo Return as table row ?
  }
  elseif ($format & NOTIFICATIONS_FORMAT_INLINE) {
    return implode(', ', $items);
  }
  else {
    return $items;
  }
}