You are here

function newsletter_exposed_lists in Newsletter 7

Same name and namespace in other branches
  1. 7.2 newsletter.module \newsletter_exposed_lists()

Return value

An array of newsletter list ids with exposed templates.

3 calls to newsletter_exposed_lists()
newsletter_add_js in ./newsletter.module
Add newsletter js file and settings.
newsletter_field_attach_form in ./newsletter.module
Implements hook_field_attach_form().
newsletter_field_attach_presave in ./newsletter.module
Implements hook_field_attach_presave().

File

./newsletter.module, line 1168
Defines menu items for newsletter administration, permissions and basic drupal hooks.

Code

function newsletter_exposed_lists() {
  $query = new EntityFieldQuery();
  $exposed_ntids = newsletter_exposed_templates();
  if (empty($exposed_ntids)) {
    return array();
  }
  $query
    ->entityCondition('entity_type', 'newsletter_list')
    ->fieldCondition('field_newsletter_template', 'target_id', $exposed_ntids, 'IN');
  $entities = $query
    ->execute();
  return isset($entities['newsletter_list']) ? array_keys($entities['newsletter_list']) : array();
}