From 03965f3c21b258462bd928c1956e6cf0f874d295 Mon Sep 17 00:00:00 2001 From: pjohans Date: Tue, 18 Aug 2015 13:53:50 +0200 Subject: [PATCH] Issue 774 by Pjohans: Show creator and materialtype on loans-list --- plugins/content_types/loans.inc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/plugins/content_types/loans.inc b/plugins/content_types/loans.inc index b3eff4c..7eb6b3c 100644 --- a/plugins/content_types/loans.inc +++ b/plugins/content_types/loans.inc @@ -126,10 +126,30 @@ function ding_loan_loans_form($form, &$form_state, $account, $loans = array()) { $title = l($entity->getTitle(), $uri['path']); } + // Add creator(s). + $creators = $entity->creators; + if(!is_array($creators)){ + $creators = array($creators); + } + + $creator_string = ''; + if(!empty($creators)) { + foreach ($creators as $creator) { + if (!empty($creator_string)) { + $creator_string .= ', '; + } + $creator_string .= $creator; + } + $creator_string .= ' :'; + } + // Add type. + $mat_type = $entity->type; $item = array( '#type' => 'material_item', '#id' => $loan->id, + '#creators' => $creator_string, + '#material_type' => $mat_type, '#title' => $title, '#cover' => field_view_field('ting_object', $entity, 'ting_cover', 'user_list'), '#information' => array(