You are here

function shouts_block in Heartbeat 6.4

Same name and namespace in other branches
  1. 6.3 modules/shouts/shouts.module \shouts_block()

Implementation of hook_block().

File

modules/shouts/shouts.module, line 37
Gives the possibility to the user to shout a message.

Code

function shouts_block($op = 'list', $delta = 0, $edit = array()) {
  if ($op == 'list') {
    $blocks[0]['info'] = t('Shout form');
    return $blocks;
  }
  elseif ($op == 'view' && $delta == 0) {
    $block['subject'] = t('Make shout');
    $block['content'] = drupal_get_form('shouts_shout_form', variable_get('show_latest_shout', 0));
    return $block;
  }
  elseif ($op == 'configure' && $delta == 0) {
    $form['show_latest_shout'] = array(
      '#type' => 'checkbox',
      '#title' => t('Show latest shout'),
      '#default_value' => variable_get('show_latest_shout', 0),
    );
    return $form;
  }
  elseif ($op == 'save') {
    variable_set('show_latest_shout', $edit['show_latest_shout']);
  }
}