You are here

function agenda_block_view in Agenda 7.2

Same name and namespace in other branches
  1. 7 agenda.module \agenda_block_view()

Implements hook_block_view().

File

./agenda.module, line 158

Code

function agenda_block_view($delta) {
  if (!user_access('access agenda content')) {
    return FALSE;
  }

  // Load the block and do a sanity check
  $markup = agenda_display_block($delta);
  if (!$markup) {
    return FALSE;
  }

  // Render it
  $basepath = drupal_get_path('module', 'agenda');
  return array(
    'subject' => t('Agenda'),
    'content' => array(
      '#contextual_links' => array(
        'agenda' => array(
          'admin/config/services/agenda',
          array(
            $delta,
          ),
        ),
      ),
      '#markup' => $markup,
      '#attached' => array(
        'css' => array(
          $basepath . '/agenda.css',
        ),
        'js' => array(
          $basepath . '/agenda.js',
        ),
      ),
    ),
  );
}