You are here

function simplenews_types_overview in Simplenews 6.2

Same name and namespace in other branches
  1. 5 simplenews.module \simplenews_types_overview()
  2. 6 simplenews.admin.inc \simplenews_types_overview()

Menu callback: newsletter admin form with list of available newsletter series.

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

File

includes/simplenews.admin.inc, line 115
Newsletter admin, subscription admin, simplenews settings

Code

function simplenews_types_overview() {
  $rows = array();
  $header = array(
    t('Newsletter name'),
    t('Subscribers'),
    t('Operations'),
  );
  foreach (simplenews_get_newsletters(variable_get('simplenews_vid', ''), TRUE) as $newsletter) {
    $count = simplenews_count_subscriptions($newsletter->tid);
    $rows[] = array(
      check_plain($newsletter->name),
      $count,
      l(t('edit newsletter'), 'admin/content/simplenews/types/edit/' . $newsletter->tid),
    );
  }
  if (count($rows) == 0) {
    $rows[] = array(
      array(
        'data' => t('There are currently no newsletter series.'),
        'colspan' => count($header),
      ),
    );
  }
  return theme('table', $header, $rows);
}