function simplenews_subscribe_user_action_form in Simplenews 6.2
Same name and namespace in other branches
- 6 simplenews_action/simplenews_action.module \simplenews_subscribe_user_action_form()
Implementation of a configurable Drupal action.
File
- simplenews_action/
simplenews_action.module, line 223 - Provide actions for simplenews.
Code
function simplenews_subscribe_user_action_form($context) {
$tree = taxonomy_get_tree(variable_get('simplenews_vid', ''));
$terms = array();
foreach ($tree as $newsletter) {
$terms[$newsletter->tid] = $newsletter->name;
}
$form['tid'] = array(
'#title' => t('Newsletter'),
'#type' => 'select',
'#options' => $terms,
'#default_value' => isset($context['tid']) ? $context['tid'] : key($terms),
'#description' => t('The newsletter series the user will be subscribed to.'),
);
return $form;
}