function subscriptions_ui_nodeapi in Subscriptions 6
Same name and namespace in other branches
- 5.2 subscriptions_ui.module \subscriptions_ui_nodeapi()
Implementation of hook_nodeapi().
Inject the node subform into node pages (depending on the Display Settings).
File
- ./
subscriptions_ui.module, line 16 - Provides a user interface for Subscriptions.
Code
function subscriptions_ui_nodeapi(&$node, $op, $teaser) {
global $user;
if ($op == 'view' && $node->nid && !$teaser && subscriptions_ui_can_subscribe()) {
$op2 = subscriptions_arg(2);
if (!variable_get('subscriptions_form_in_block', 0) && (!variable_get('subscriptions_form_link_only', 0) && (!$op2 || $op2 == 'view') || variable_get('subscriptions_form_link_only', 0) && $op2 == 'subscribe')) {
if ($form = drupal_get_form('subscriptions_ui_node_form', $node)) {
$node->content['subscriptions_ui'] = array(
'#value' => $form,
'#weight' => 100,
);
}
}
}
}