function dashboard_admin in Drupal 7
Page callback: Displays the dashboard.
Parameters
$launch_customize: Whether to launch in customization mode right away. TRUE or FALSE.
2 string references to 'dashboard_admin'
- dashboard_is_visible in modules/
dashboard/ dashboard.module - Determines if the dashboard should be displayed on the current page.
- dashboard_menu in modules/
dashboard/ dashboard.module - Implements hook_menu().
File
- modules/
dashboard/ dashboard.module, line 275 - Provides a dashboard page in the administrative interface.
Code
function dashboard_admin($launch_customize = FALSE) {
$js_settings = array(
'dashboard' => array(
'drawer' => url('admin/dashboard/drawer'),
'blockContent' => url('admin/dashboard/block-content'),
'updatePath' => url('admin/dashboard/update'),
'formToken' => drupal_get_token('dashboard-update'),
'launchCustomize' => $launch_customize,
'dashboard' => url('admin/dashboard'),
'emptyBlockText' => t('(empty)'),
'emptyRegionTextInactive' => t('This dashboard region is empty. Click <em>Customize dashboard</em> to add blocks to it.'),
'emptyRegionTextActive' => t('DRAG HERE'),
),
);
$build = array(
'#theme' => 'dashboard_admin',
'#message' => t('To customize the dashboard page, move blocks to the dashboard regions on the <a href="@dashboard">Dashboard administration page</a>, or enable JavaScript on this page to use the drag-and-drop interface.', array(
'@dashboard' => url('admin/dashboard/configure'),
)),
'#access' => user_access('administer blocks'),
'#attached' => array(
'js' => array(
drupal_get_path('module', 'dashboard') . '/dashboard.js',
array(
'data' => $js_settings,
'type' => 'setting',
),
),
'library' => array(
array(
'system',
'ui.sortable',
),
),
),
);
return $build;
}