You are here

function user_dashboard_page in UserDashboard 7

Dashboard page callback.

@returns array Array with settings in order to theme the page.

Parameters

bool $launch_customize: Whether to launch in customization mode right away. TRUE or FALSE.

1 string reference to 'user_dashboard_page'
user_dashboard_menu in ./user_dashboard.module
Implements hook_menu().

File

./user_dashboard.module, line 435
The User Dashboard module forks Drupal 7's awesome Dashboard module to provide an individual dashboard for each user on the site.

Code

function user_dashboard_page($launch_customize = FALSE) {
  $js_settings = array(
    'dashboard' => array(
      'drawer' => url('user/' . arg(1) . '/dashboard/drawer'),
      'blockContent' => url('user/' . arg(1) . '/dashboard/block-content'),
      'updatePath' => url('user/' . arg(1) . '/dashboard/update'),
      'formToken' => drupal_get_token('user-dashboard-update'),
      'launchCustomize' => $launch_customize,
      'dashboard' => url('user/' . arg(1) . '/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' => 'user_dashboard_page',
    '#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' => 1,
    '#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;
}