You are here

function library_handler_field_library_status::render in Library 7

Same name and namespace in other branches
  1. 6.2 includes/views/handlers/library_handler_field_library_status.inc \library_handler_field_library_status::render()
  2. 6 includes/views/handlers/library_handler_field_library_status.inc \library_handler_field_library_status::render()

Implements render().

Overrides views_handler_field::render

File

includes/views/handlers/library_handler_field_library_status.inc, line 33
Field handler for library item status

Class

library_handler_field_library_status
Display a node's status in the library as a whole

Code

function render($values) {
  $lid = $values->library_id;
  $nid = $values->nid;

  // @todo This handler could be simpler and not require node_load,
  // see filter_library_status.
  $node = node_load($nid);
  foreach ($node->library_items as $item) {
    if ($item['id'] == $lid) {
      $status = library_get_status_item($item);
      return library_get_status_text($status);
    }
  }
  return '';
}