function library_duedates_enabled in Library 6
Same name and namespace in other branches
- 5.2 library.module \library_duedates_enabled()
- 6.2 library.module \library_duedates_enabled()
- 7 library.module \library_duedates_enabled()
Check to see if due dates are enabled for any actions
@returns BOOLEAN
4 calls to library_duedates_enabled()
- library_cron in ./
library.module - Implementation of hook_cron().
- library_history in ./
library.pages.inc - Menu callback; show the transaction history of a single node.
- library_notify_overdue in ./
library.admin.inc - library_overdue_items in ./
library.pages.inc
File
- ./
library.module, line 978
Code
function library_duedates_enabled($type = NULL) {
if (is_null($type)) {
$duedates = 0;
foreach (library_get_item_types() as $type) {
if ($duedates == 0) {
$duedates = variable_get('library_' . $type . '_due_dates', 0);
if ($duedates > 0) {
return TRUE;
}
}
else {
return TRUE;
}
}
return FALSE;
}
else {
$duedates = variable_get('library_' . $type . '_due_dates', 0);
return $duedates > 0;
}
}