You are here

function mongodb_block_ui_admin_display in MongoDB 7

Menu callback for admin/structure/mongodb_block_ui.

Parameters

string $theme: The theme to display the administration page for. If not provided, defaults to the currently used theme.

1 string reference to 'mongodb_block_ui_admin_display'
mongodb_block_ui_menu in mongodb_block_ui/mongodb_block_ui.module
Implements hook_menu().

File

mongodb_block_ui/mongodb_block_ui.admin.inc, line 23
Admin page callbacks for the mongodb_block_ui module.

Code

function mongodb_block_ui_admin_display($theme = NULL) {
  global $theme_key;
  drupal_theme_initialize();
  if (!isset($theme)) {

    // If theme is not specifically set, rehash for the current theme.
    $theme = $theme_key;
  }

  // Fetch and sort mongodb_block_uis.
  $current_blocks = _mongodb_block_rehash($theme);
  $blocks = array();
  foreach ($current_blocks as $block) {
    $module = $block['module'];
    $delta = $block['delta'];
    $blocks[$module . '_' . $delta] = $block;
  }
  $compare_theme =& drupal_static('_mongodb_block_ui_compare:theme');
  $compare_theme = $theme;
  usort($blocks, '_mongodb_block_ui_compare');
  return drupal_get_form('mongodb_block_ui_admin_display_form', $blocks, $theme);
}