dashboard_admin_blocks

function dashboard_admin_blocks

dashboard_admin_blocks()

Page callback: Builds the page for administering dashboard blocks.

This page reuses the Block module's administration form but limits editing to blocks that are available to appear on the dashboard.

See also

block_admin_display()

block_admin_display_form()

dashboard_form_dashboard_admin_display_form_alter()

template_preprocess_dashboard_admin_display_form()

File

modules/dashboard/dashboard.module, line 315
Provides a dashboard page in the administrative interface.

Code

function dashboard_admin_blocks() {
  global $theme_key;
  drupal_theme_initialize();
  module_load_include('inc', 'block', 'block.admin');

  // Prepare the blocks for the current theme, and remove those that are
  // currently displayed in non-dashboard regions.
  // @todo This assumes the current page is being displayed using the same
  //   theme that the dashboard is displayed in.
  $blocks = block_admin_display_prepare_blocks($theme_key);
  $dashboard_regions = dashboard_region_descriptions();
  $regions_to_remove = array_diff_key(system_region_list($theme_key, REGIONS_VISIBLE), $dashboard_regions);
  foreach ($blocks as $id => $block) {
    if (isset($regions_to_remove[$block['region']])) {
      unset($blocks[$id]);
    }
  }

  // Pass in the above blocks and dashboard regions to the form, so that only
  // dashboard-related regions will be displayed.
  return drupal_get_form('dashboard_admin_display_form', $blocks, $theme_key, $dashboard_regions);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!dashboard!dashboard.module/function/dashboard_admin_blocks/7.x

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部