Skip to content

Commit

Permalink
Merge 3290-overdue-loans-empty into vejlebib
Browse files Browse the repository at this point in the history
  • Loading branch information
holt83 committed Apr 20, 2020
2 parents 2de686b + fc3e2f4 commit 16e26bb
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion modules/ding_loan/plugins/content_types/loans.inc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ function ding_loan_loans_content_type_render($subtype, $conf, $panel_args, $cont
$block->module = 'ding_loan';
$block->delta = 'loans';
$block->title = t('Loan list');
$block->content = t('You do not currently have any loans.');

// Get loans from the provider.
$account = isset($context->data) ? $context->data : NULL;
Expand Down Expand Up @@ -72,6 +71,17 @@ function ding_loan_loans_content_type_render($subtype, $conf, $panel_args, $cont
if (!empty($loans)) {
$block->content = ding_provider_get_form('ding_loan_loans_form', $account, $loans);
}
// If we only show either regular or overdue loans, override the standard
// empty message with a more specific one.
elseif ($conf['overdue'] && !$conf['regular']) {
$block->content = t('You do not currently have any overdue loans.');
}
elseif ($conf['regular'] && !$conf['overdue']) {
$block->content = t('You do not currently have any regular loans.');
}
else {
$block->content = t('You do not currently have any loans.');
}

return $block;
}
Expand Down

0 comments on commit 16e26bb

Please sign in to comment.