You are here

function context_ui_admin in Context 6

Same name and namespace in other branches
  1. 5 context_ui/context_ui_admin.inc \context_ui_admin()

Page callback for context_ui admin landing page.

1 string reference to 'context_ui_admin'
context_ui_menu in context_ui/context_ui.module
Implementation of hook_menu().

File

context_ui/context_ui.admin.inc, line 6

Code

function context_ui_admin() {

  // Add css
  drupal_add_css(drupal_get_path("module", "context_ui") . "/context_ui.css");

  // rebuild blocks
  _block_rehash();

  // rebuild context cache
  context_invalidate_cache();

  // user defined contexts
  $output = "<h3>" . t('Context definitions') . "</h3>";
  $normal = context_contexts();
  if ($normal) {
    ksort($normal);
    $output .= theme('context_ui_admin', $normal);
  }
  else {
    $output .= "<p>" . t('Please !add_context to get started.', array(
      '!add_context' => l(t('add a context'), 'admin/build/context/add'),
    )) . "</p>";
  }
  return $output;
}