You are here

function spaces_calendar_context_define in Spaces 5

Same name and namespace in other branches
  1. 5.2 spaces_calendar/spaces_calendar.module \spaces_calendar_context_define()

Implementation of hook_context_define()

File

spaces_calendar/spaces_calendar.module, line 42

Code

function spaces_calendar_context_define() {
  $items = array();
  if (_spaces_calendar_enabled()) {
    $items['calendar'] = array(
      'namespace' => 'spaces',
      'attribute' => 'feature',
      'value' => 'calendar',
      'views' => array(
        'spaces_calendar_upcoming',
        'spaces_calendar',
      ),
      'node' => array(
        variable_get('spaces_calendar_nodetype', ''),
      ),
      'block' => array(
        array(
          'module' => 'views',
          'delta' => 'spaces_calendar_upcoming',
          'region' => 'right',
          'weight' => -11,
        ),
      ),
      'menu' => array(
        'calendar',
      ),
      'spaces' => array(
        'label' => t('Calendar'),
        'description' => t('An event calendar with optional iCal integration.'),
        'options' => _spaces_group_options(),
      ),
    );
  }
  if (_spaces_calendar_ical_enabled()) {
    $items['calendar']['node'][] = variable_get('spaces_calendar_feed_nodetype', '');
    $items['calendar']['node'][] = variable_get('spaces_calendar_feed_itemtype', '');
    $items['calendar']['menu'][] = 'calendar/feeds';
    $items['calendar']['views'][] = 'spaces_calendar_feeds';
  }
  return $items;
}