You are here

function subscriptions_ui_block in Subscriptions 5.2

Same name and namespace in other branches
  1. 6 subscriptions_ui.module \subscriptions_ui_block()

Implementation of hook_block().

Define the Subscriptions Interface block for node pages (depending on the Display Settings).

File

./subscriptions_ui.module, line 39
Provides a user interface for Subscriptions.

Code

function subscriptions_ui_block($op = 'list', $delta = 0) {
  switch ($op) {
    case 'list':
      $blocks[0]['info'] = t('Subscriptions interface');
      return $blocks;
    case 'view':
      if (subscriptions_ui_can_subscribe() && variable_get('subscriptions_form_in_block', 0) && (!variable_get('subscriptions_form_link_only', 0) && (!arg(2) || arg(2) == 'view') || variable_get('subscriptions_form_link_only', 0) && arg(2) == 'subscribe')) {
        return array(
          'subject' => t('Subscriptions'),
          'content' => drupal_get_form('subscriptions_ui_node_form', node_load(arg(1))),
        );
      }
  }
}