You are here

function mailchimp_lists_fields_overview_page in Mailchimp 7.5

Same name and namespace in other branches
  1. 7.3 modules/mailchimp_lists/includes/mailchimp_lists.admin.inc \mailchimp_lists_fields_overview_page()
  2. 7.4 modules/mailchimp_lists/includes/mailchimp_lists.admin.inc \mailchimp_lists_fields_overview_page()

Administrative display showing existing lists/audiences and allowing edits/adds.

1 string reference to 'mailchimp_lists_fields_overview_page'
mailchimp_lists_menu in modules/mailchimp_lists/mailchimp_lists.module
Implements hook_menu().

File

modules/mailchimp_lists/includes/mailchimp_lists.admin.inc, line 72
mailchimp_lists module admin settings.

Code

function mailchimp_lists_fields_overview_page() {
  $fields = field_info_fields();
  $rows = array();
  foreach ($fields as $field) {
    if ($field['type'] == 'mailchimp_lists_subscription') {
      foreach ($field['bundles'] as $entity_type => $bundles) {
        foreach ($bundles as $bundle) {
          $link = 'admin/config/services/mailchimp/lists/update_mergevars/' . $entity_type . '/' . $bundle . '/' . $field['field_name'];
          $rows[] = array(
            $entity_type,
            $bundle,
            $field['field_name'],
            l(t('Update MailChimp Mergevar Values'), $link),
          );
        }
      }
    }
  }
  $table = array(
    'header' => array(
      t('Entity Type'),
      t('Bundle'),
      t('Field'),
      t('Batch Update'),
    ),
    'rows' => $rows,
  );
  $table['caption'] = t("This displays a list of all MailChimp Subscription Fields configured on your system, with a row for each unique Instance of that field.\n    To edit each field's settings, go to the Entity Bundle's configuration screen and use the Field UI.\n    When entities with MailChimp Subscription Fields are updated, the Merge Variables configured through Field UI are automatically updated if necessary.\n    However, if you have existing subscribers on MailChimp and matching Entities on Drupal when you configure your Merge Variables, the existing values are not synced automatically,\n    as this could be a slow process. You can manually force updates of all existing Merge Values to existing MailChimp subscribers for each field configuration using the 'Batch Update'\n    option on this table. The MailChimp Subscription Field is provided by the MailChimp Audiences (mailchimp_lists) module.<br/><br/>\n    The following MailChimp Subscription Field instances were found:");
  return theme('table', $table);
}