You are here

function subscriptions_ui_block in Subscriptions 6

Same name and namespace in other branches
  1. 5.2 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 40
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');
      $blocks[0]['cache'] = BLOCK_CACHE_PER_PAGE;
      $blocks[0]['region'] = 'content';
      return $blocks;
    case 'view':
      $op2 = subscriptions_arg(2);
      if (subscriptions_ui_can_subscribe() && 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')) {
        return array(
          'subject' => t('Subscriptions'),
          'content' => drupal_get_form('subscriptions_ui_node_form', menu_get_object()),
        );
      }
  }
}