function library_item_in_library in Library 6
Same name and namespace in other branches
- 5.2 library.module \library_item_in_library()
- 6.2 library.module \library_item_in_library()
Check whether a given item (based on its item type) is part of the library @returns Boolean
2 calls to library_item_in_library()
- library_history in ./
library.pages.inc - Menu callback; show the transaction history of a single node.
- library_nodeapi in ./
library.module - Implementation of hook_nodeapi()
File
- ./
library.module, line 916
Code
function library_item_in_library($node = NULL, $item_id = NULL) {
if ($node && variable_get('library_' . $node->type, LIBRARY_ITEM_NOT_IN_LIBRARY) == LIBRARY_ITEM_IN_LIBRARY) {
return TRUE;
}
elseif ($item_id && db_result(db_query("SELECT COUNT(*) FROM {library} WHERE id = %d", $item_id))) {
return TRUE;
}
else {
return FALSE;
}
}