You are here

function simplenews_newsletter_list in Simplenews 3.x

Same name and namespace in other branches
  1. 8.2 simplenews.module \simplenews_newsletter_list()
  2. 8 simplenews.module \simplenews_newsletter_list()
  3. 7.2 simplenews.module \simplenews_newsletter_list()

Get list of simplenews categories with translated names.

@todo Maybe refactor this method to simplenews_newsletter_name_list.

Return value

array array of newsletter names. Translated if required.

3 calls to simplenews_newsletter_list()
SubscriberExportForm::buildForm in src/Form/SubscriberExportForm.php
Form constructor.
SubscriberMassSubscribeForm::buildForm in src/Form/SubscriberMassSubscribeForm.php
Form constructor.
SubscriberMassUnsubscribeForm::buildForm in src/Form/SubscriberMassUnsubscribeForm.php
Form constructor.
3 string references to 'simplenews_newsletter_list'
simplenews_field_views_data in ./simplenews.views.inc
Implements hook_field_views_data().
simplenews_rules_rules_action_info in simplenews_rules/simplenews_rules.rules.inc
Implements hook_rules_action_info().
SubscriberViewsData::getViewsData in src/SubscriberViewsData.php
Returns views data for the entity type.

File

./simplenews.module, line 600
Simplenews node handling, sent email, newsletter block and general hooks.

Code

function simplenews_newsletter_list() {
  $newsletters = [];
  foreach (simplenews_newsletter_get_all() as $id => $newsletter) {
    $newsletters[$id] = Html::escape($newsletter
      ->label());
  }
  return $newsletters;
}