You are here

function spaces_dashboard_block in Spaces 6.3

Implementation of hook_block().

File

spaces_dashboard/spaces_dashboard.module, line 280

Code

function spaces_dashboard_block($op, $delta = null) {
  if ($op == 'list') {
    return array(
      'editor' => array(
        'info' => t('Dashboard'),
        'admin' => true,
      ),
    );
  }
  elseif ($op == 'view' && $delta == 'editor') {

    // Ensure that the dashboard editor does not appear on the same page as
    // the context editor. The two will collide.
    $editor = FALSE;
    $context = context_get('spaces', 'dashboard') ? context_get('context', context_get('spaces', 'dashboard')) : FALSE;
    if (spaces_dashboard_access('admin') && $context) {
      return array(
        'subject' => t('Dashboard'),
        'content' => drupal_get_form('spaces_dashboard_editor', array(
          $context,
        )),
      );
    }
  }
}