function notifications_ui_node_options in Notifications 6
Same name and namespace in other branches
- 6.4 notifications_ui/notifications_ui.module \notifications_ui_node_options()
- 6.2 notifications_ui/notifications_ui.module \notifications_ui_node_options()
- 6.3 notifications_ui/notifications_ui.module \notifications_ui_node_options()
- 7 notifications_ui/notifications_ui.module \notifications_ui_node_options()
Get settings value for content types
Parameters
$type: Content type to get settings for
$option: Optional option to check (each option can be enabled or disabled)
4 calls to notifications_ui_node_options()
- notifications_ui_block in notifications_ui/
notifications_ui.module - Implementation of hook_block()
- notifications_ui_form_alter in notifications_ui/
notifications_ui.module - Implementation of hook_form_alter()
- notifications_ui_link in notifications_ui/
notifications_ui.module - Implementation of hook_link()
- notifications_ui_nodeapi in notifications_ui/
notifications_ui.module - Display a button + js overlay
File
- notifications_ui/
notifications_ui.module, line 533 - User Interface for subscriptions modules
Code
function notifications_ui_node_options($type = NULL, $option = NULL) {
// We can use global options or per content type options. The default setting will be 'links' = 1
$defaults = variable_get('notifications_ui_node', array(
'links',
));
if ($type && variable_get('notifications_ui_per_type', 0)) {
$settings = variable_get('notifications_node_ui_' . $type, $defaults);
}
else {
$settings = $defaults;
}
if ($option) {
return in_array($option, $settings, TRUE) ? TRUE : FALSE;
}
else {
return $settings;
}
}