function context_ui_admin in Context 5
Same name and namespace in other branches
- 6 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 default contexts
context_ui_rebuild();
// User defined contexts
$output = "<h3>" . t('User context definitions') . "</h3>";
$contexts = context_ui_tree('ui');
if ($contexts) {
$output .= theme('context_ui_admin', $contexts);
}
else {
$output .= "<p>" . t('Please !add_context to get started.', array(
'!add_context' => l(t('add a context'), 'admin/build/context/add'),
)) . "</p>";
}
// Module defined contexts
$output .= "<h3>" . t('Module context definitions') . "</h3>";
$contexts = context_ui_tree('system');
if ($contexts) {
$output .= theme('context_ui_admin', $contexts);
}
else {
$output .= "<p>" . t('There are currently no module defined contexts.') . "</p>";
}
return $output;
}