You are here

function simplenews_subscription_list_export in Simplenews 5

Same name and namespace in other branches
  1. 6.2 includes/simplenews.admin.inc \simplenews_subscription_list_export()
  2. 6 simplenews.admin.inc \simplenews_subscription_list_export()
  3. 7.2 includes/simplenews.admin.inc \simplenews_subscription_list_export()
  4. 7 includes/simplenews.admin.inc \simplenews_subscription_list_export()
1 string reference to 'simplenews_subscription_list_export'
simplenews_menu in ./simplenews.module
Implementation of hook_menu().

File

./simplenews.module, line 2164

Code

function simplenews_subscription_list_export() {
  $tree = taxonomy_get_tree(variable_get('simplenews_vid', ''));
  $form['simplenews_status'] = array(
    '#type' => 'fieldset',
    '#title' => t('Status'),
    '#description' => t('Select at least 1 status'),
    '#collapsible' => FALSE,
  );
  $form['simplenews_status']['active'] = array(
    '#type' => 'checkbox',
    '#title' => t('Active users'),
    '#return_value' => 1,
  );
  $form['simplenews_status']['inactive'] = array(
    '#type' => 'checkbox',
    '#title' => t('Inactive users'),
    '#return_value' => 1,
  );
  if ($tree) {
    $form['simplenews_newsletter'] = array(
      '#type' => 'fieldset',
      '#title' => t('Subscribed to'),
      '#description' => t('Select at least 1 newsletter'),
      '#collapsible' => FALSE,
    );
    foreach ($tree as $newsletter) {
      $form['simplenews_newsletter']['tid_' . $newsletter->tid] = array(
        '#type' => 'checkbox',
        '#title' => check_plain($newsletter->name),
        '#return_value' => 1,
      );
    }
  }
  $form['emails'] = array(
    '#type' => 'textarea',
    '#title' => t('E-mail addresses'),
    '#cols' => 60,
    '#rows' => 5,
    '#default_value' => t('No search performed'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Export'),
  );
  $form['#after_build'] = array(
    'simplenews_admin_export_after_build',
  );
  $form['#redirect'] = FALSE;
  return $form;
}