function library_get_due_date in Library 7
Same name and namespace in other branches
- 5.2 library.module \library_get_due_date()
- 6.2 library.module \library_get_due_date()
- 6 library.module \library_get_due_date()
Get the due date given a check out date.
Parameters
null|int $checkout_date: The date an item was made unavailable.
string $action: The clean name of the action performed.
string $type: The node type.
Return value
int|null A unix timestamp if due dates are enabled else it returns NULL.
2 calls to library_get_due_date()
- library_renew_action in ./
library.actions.inc - Implementation of a Drupal action.
- library_transaction_form_submit in ./
library.pages.inc - Handles transaction form submissions.
File
- ./
library.module, line 805
Code
function library_get_due_date($checkout_date = NULL, $action, $type) {
if (empty($checkout_date)) {
$checkout_date = REQUEST_TIME;
}
$allowed = variable_get('library_period_for_' . $type . '_' . $action, 0);
if ($allowed > 0) {
return $checkout_date + $allowed;
}
else {
return NULL;
}
}