You are here

function simplenews_subscribe_user_action_form in Simplenews 6

Same name and namespace in other branches
  1. 6.2 simplenews_action/simplenews_action.module \simplenews_subscribe_user_action_form()

Implementation of a configurable Drupal action.

File

simplenews_action/simplenews_action.module, line 199
simplenews_action.inc Provide actions for simplenews.

Code

function simplenews_subscribe_user_action_form($context) {
  if (!isset($context['newsletter'])) {
    $context['newsletter'] = array();
  }
  $tree = taxonomy_get_tree(variable_get('simplenews_vid', ''));
  $terms = array();
  foreach ($tree as $newsletter) {
    $terms[$newsletter->tid] = $newsletter->name;
  }
  $form['newsletter'] = array(
    '#title' => t('Newsletter'),
    '#type' => 'select',
    '#options' => $terms,
    '#description' => t('The newsletter series the user will be subscribed to.'),
  );
  return $form;
}