You are here

function add_to_head_overview in Add To Head 6

Same name and namespace in other branches
  1. 7 add_to_head.admin.inc \add_to_head_overview()

Overview page - provides a list of existing add to head profiles

1 string reference to 'add_to_head_overview'
add_to_head_menu in ./add_to_head.module
Implementation of hook_menu().

File

./add_to_head.admin.inc, line 12
This file contains all the admin-related callbacks

Code

function add_to_head_overview() {
  $settings = variable_get('add_to_head_profiles', array());
  $rows = array();
  $headers = array(
    t('Title'),
    t('Paths'),
    t('Visibility'),
    t('Scope'),
    t('Ops'),
  );
  foreach ($settings as $delta => $settings) {
    $rows[] = array(
      check_plain($settings['name']),
      nl2br(check_plain($settings['paths'])),
      $settings['path_visibility'] == 0 ? t('Exclude') : t('Include'),
      drupal_ucfirst($settings['scope']),
      implode(' | ', array(
        l(t('Edit'), 'admin/settings/add-to-head/' . $delta),
        l(t('Delete'), 'admin/settings/add-to-head/' . $delta . '/delete'),
      )),
    );
  }
  if (empty($rows)) {
    $prompt = t('No profiles configured yet. !link', array(
      '!link' => l(t('Add one now'), 'admin/settings/add-to-head/add'),
    ));
  }
  else {
    $prompt = l(t('Add another profile'), 'admin/settings/add-to-head/add');
  }
  $rows[] = array(
    array(
      'colspan' => count($headers),
      'data' => $prompt,
    ),
  );
  return theme('table', $headers, $rows);
}