You are here

function notifications_ui_block in Notifications 5

Same name and namespace in other branches
  1. 6.4 notifications_ui/notifications_ui.module \notifications_ui_block()
  2. 6 notifications_ui/notifications_ui.module \notifications_ui_block()
  3. 6.2 notifications_ui/notifications_ui.module \notifications_ui_block()
  4. 6.3 notifications_ui/notifications_ui.module \notifications_ui_block()

Implementation of hook_block()

File

notifications_ui/notifications_ui.module, line 301
User Interface for subscriptions modules

Code

function notifications_ui_block($op = 'list', $delta = 0) {
  if ($op == 'list') {
    $blocks[0]['info'] = t('Subscriptions');
    return $blocks;
  }
  else {
    if ($op == 'view') {
      if (arg(0) == 'node' && is_numeric(arg(1)) && ($node = node_load(arg(1))) && notifications_ui_type_options($node->type, 'block')) {
        $block['subject'] = t('Subscriptions');
        $block['content'] = drupal_get_form('notifications_ui_node_form', $node, FALSE);
        return $block;
      }
    }
  }
}