You are here

function shouts_shout_form in Heartbeat 6.3

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

Show the shoutform

1 string reference to 'shouts_shout_form'
shouts_block in modules/shouts/shouts.module
Implementation of hook_block().

File

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

Code

function shouts_shout_form() {
  global $user;
  $form = array();
  $latest_shout = $user->latest_shout;
  $own_shout = true;
  drupal_add_js(drupal_get_path('module', 'shouts') . '/shouts.js', 'module');
  if (empty($latest_shout) || $latest_shout->cleared) {
    $latest_shout->message = t('Post new shout');
    $own_shout = false;
    $latest_shout->time = '';
  }
  $form['#prefix'] = theme('shoutform_message', $latest_shout->message, $own_shout, false, $latest_shout->time);
  $form['shout'] = array(
    '#type' => 'textfield',
    '#title' => t('Shout'),
    '#required' => TRUE,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Shout'),
    '#ahah' => array(
      'path' => 'shout/post',
      'wrapper' => 'shout-wrapper',
      'progress' => array(
        'type' => 'bar',
        'message' => t('Please wait...'),
      ),
    ),
  );
  return $form;
}