function library_actions in Library 5.2
Same name and namespace in other branches
- 6.2 library.module \library_actions()
- 6 library.module \library_actions()
- 7 library.module \library_actions()
Parameters
$excluded: (optional) Numeric status change type of actions to exclude
Return value
Array of actions
11 calls to library_actions()
- library_action_info in ./
library.actions.inc - Implementation of hook_action_info().
- library_admin_settings in ./
library.admin.inc - Menu callback: Edit Library Settings.
- library_admin_settings_overdue in ./
library.admin.inc - Menu callback: Edit Library Overdue Settings.
- library_admin_settings_overdue_validate in ./
library.admin.inc - library_get_action_links in ./
library.module
File
- ./
library.module, line 1099
Code
function library_actions($actions = array(), $account = NULL) {
if (!empty($actions)) {
$result = db_query("SELECT name, aid, status_change from {library_actions} WHERE aid IN(%s) ORDER BY name, aid, status_change", implode(', ', $actions));
}
else {
$result = db_query("SELECT name, aid, status_change from {library_actions} ORDER BY name, aid, status_change");
}
$user_all_library_actions = is_null($account) || user_access('administer transactions');
$actions = array();
while ($action = db_fetch_object($result)) {
if ($user_all_library_actions || user_access('submit library ' . $action->name)) {
$actions[$action->aid] = array(
'name' => t($action->name),
'status_change' => $action->status_change,
);
}
}
return array_filter($actions);
}