<?php

/**
 * @file
 * Module file. Defines module hooks.
 */

/**
 * Implements hook_views_api().
 */
function opigno_calendar_app_views_api() {
  return array('api' => '3.0');
}

/**
 * Implements hook_menu_local_tasks_alter().
 */
function opigno_calendar_app_menu_local_tasks_alter(&$data, $router_item, $root_path) {
  if (preg_match('/^opigno-calendar/', $root_path)) {
    $item = menu_get_item('node/add/calendar-event');
    if ($item['access']) {
      $item['title'] = t("Add a new event");
      $item['options']['attributes']['class'][] = $item['localized_options']['attributes']['class'][] = 'opigno-calendar-app-add-calendar-event';
      $data['actions']['output'][] = array(
        '#theme' => 'menu_local_action',
        '#link' => $item,
      );
    }
  }
}
