You are here

function title_override_config_overview in Title Override 7.2

Provides administration overview page for Title override

Return value

Ambigous <An, string>

1 string reference to 'title_override_config_overview'
title_override_menu in ./title_override.module
Implements hook_menu()

File

./title_override.admin.inc, line 12
Admin page implementations for Title Override.

Code

function title_override_config_overview() {
  $contexts = context_enabled_contexts(TRUE);
  $header = array(
    t('Name'),
    t('Paths'),
    t('Operations'),
  );
  $rows = array();
  foreach ($contexts as $name => $context) {

    // Show only contexts that have title_override reaction and paths conditions.
    if (isset($context->reactions['title_override']['admin']) && $context->reactions['title_override']['admin'] && isset($context->conditions['path']['values'])) {
      $ops = array(
        l('Edit', 'admin/config/user-interface/to_titles/' . $context->name, array(
          'query' => array(
            'destination' => 'admin/config/user-interface/to_titles',
          ),
        )),
        l('Delete', 'admin/config/user-interface/to_titles/' . $context->name . '/delete', array(
          'query' => array(
            'destination' => 'admin/config/user-interface/to_titles',
          ),
        )),
      );
      $rows[] = array(
        $context->name,
        htmlentities(implode(', ', $context->conditions['path']['values'])),
        implode(' | ', $ops),
      );
    }
  }
  return theme('table', array(
    'header' => $header,
    'rows' => $rows,
  ));
}