You are here

function social_content_overview_types in Social Content 7

Menu callback for admin/config/services/social-content.

Displays a table with all social content types.

1 string reference to 'social_content_overview_types'
social_content_menu in ./social_content.module
Implements hook_menu().

File

./social_content.admin.inc, line 14
Social Content administration area. Provides menu callbacks for the Social Content administration area.

Code

function social_content_overview_types() {
  $types = social_content_get_types();
  $header = array(
    t('Name'),
    t('Enabled'),
    t('Run Import'),
    t('Settings'),
  );
  $rows = array();
  foreach ($types as $key => $type) {
    $settings = social_content_get_settings($type);
    $destination = drupal_get_destination();
    $run_link = l(t('Run import'), 'admin/config/services/social-content/' . $type['name'] . '/run', array(
      'query' => $destination,
    ));
    $edit_link = l(t('Edit'), 'admin/config/services/social-content/' . $type['name'] . '/edit', array(
      'query' => $destination,
    ));
    $rows[] = array(
      $type['title'],
      $settings['enabled'] ? t('Yes') : t('No'),
      $run_link,
      $edit_link,
    );
  }
  $build['node_table'] = array(
    '#theme' => 'table',
    '#header' => $header,
    '#rows' => $rows,
    '#empty' => t('No social content types enabled, you must enable a social content type module first.'),
  );
  return $build;
}