function library_get_status_text in Library 5.2
Same name and namespace in other branches
- 6.2 library.module \library_get_status_text()
- 6 library.module \library_get_status_text()
- 7 library.module \library_get_status_text()
Get the text that corresponds to a given status
Parameters
$item: Array of values for a given library item
Return value
A string
2 calls to library_get_status_text()
File
- ./
library.module, line 1482
Code
function library_get_status_text($item) {
if ($item['in_circulation'] == LIBRARY_REFERENCE_ONLY) {
$text = variable_get('library_reference_only_text', 'REFERENCE ONLY');
}
elseif ($item['library_status'] == LIBRARY_ITEM_AVAILABLE) {
$text = variable_get('library_available_text', 'AVAILABLE');
}
elseif ($item['library_status'] == LIBRARY_ITEM_UNAVAILABLE && !empty($item['last_due_date'])) {
$duedate = format_date($item['last_due_date'], 'small');
$text = 'DUE ' . $duedate;
}
else {
$text = variable_get('library_unavailable_noduedates_text', 'UNAVAILABLE');
}
return $text;
}