You are here

function constant_contact_get_lists in Constant Contact 7.3

Same name and namespace in other branches
  1. 5 constant_contact.module \constant_contact_get_lists()
  2. 6.3 constant_contact.module \constant_contact_get_lists()
  3. 6 constant_contact.module \constant_contact_get_lists()

Helper function to get contact lists.

14 calls to constant_contact_get_lists()
constant_contact_add_list_form_submit in ./admin.lists.inc
Submit handler for adding a new contact list.
constant_contact_block_configure in ./constant_contact.module
Implements hook_block_configure().
constant_contact_delete_list_form_submit in ./admin.lists.inc
Submit handler for deleting a contact list.
constant_contact_edit_list_form_submit in ./admin.lists.inc
Submit handler for contact lists form.
constant_contact_export in ./admin.export.inc
Displays the export page

... See full list

File

./constant_contact.module, line 1461

Code

function constant_contact_get_lists(&$cc, $exclude = 3, $bypass_cache = FALSE) {

  // If some cached data exists and we are not bypassing the cache use the
  // cached data.
  if (!$bypass_cache && ($cached = cache_get('cc_lists', 'cache'))) {
    return $cached->data;
  }
  $_lists = $cc
    ->get_all_lists('lists', $exclude, 'constant_contact_sort_lists');
  $lists = array();
  if ($_lists) {
    foreach ($_lists as $k => $v) {
      $lists[$v['id']] = $v['Name'];
    }
  }

  // Save to the cache.
  $expire = variable_get('cc_lists_cache_expire', CC_CONTACT_LISTS_CACHE_EXPIRE);
  cache_set('cc_lists', $lists, 'cache', time() + $expire);
  return $lists;
}