You are here

function simplenews_subscription_list_export in Simplenews 6

Same name and namespace in other branches
  1. 5 simplenews.module \simplenews_subscription_list_export()
  2. 6.2 includes/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()

Menu callback: Export email address of subscriptions.

See also

simplenews_admin_export_after_build()

1 string reference to 'simplenews_subscription_list_export'
simplenews_menu in ./simplenews.module
Implementation of hook_menu().

File

./simplenews.admin.inc, line 478
Newsletter admin, subscription admin, simplenews settings

Code

function simplenews_subscription_list_export() {
  $form['states'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Status'),
    '#options' => array(
      'active' => t('Active users'),
      'inactive' => t('Inactive users'),
    ),
    '#description' => t('Subscriptions matching the selected states will be exported.'),
    '#required' => TRUE,
  );
  $newsletters = array();
  foreach (taxonomy_get_tree(variable_get('simplenews_vid', '')) as $newsletter) {
    $newsletters[$newsletter->tid] = check_plain($newsletter->name);
  }
  $form['newsletters'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Subscribed to'),
    '#options' => $newsletters,
    '#description' => t('Subscriptions matching the selected newsletters will be exported.'),
    '#required' => TRUE,
  );

  // Emails item is initially empty. It serves as place holder. Data is added by
  // simplenews_admin_export_after_build().
  $form['emails'] = array();
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Export'),
  );
  $form['#after_build'] = array(
    'simplenews_admin_export_after_build',
  );
  $form['#redirect'] = FALSE;
  return $form;
}