You are here

function jcalendar_views_pre_view in Calendar 6.2

Same name and namespace in other branches
  1. 5.2 jcalendar/jcalendar.module \jcalendar_views_pre_view()

Override the calendar view to inject javascript.

Parameters

view Which view we are using.:

Return value

unknown as of yet.

File

jcalendar/jcalendar.module, line 61
jQuery Calendar UI features.

Code

function jcalendar_views_pre_view(&$view, &$display_id) {
  static $js_added = false;
  if ($js_added) {
    return;
  }
  foreach ($view->display as $display) {
    if ($display->display_plugin == 'calendar') {
      $js_added = true;
      $path = drupal_get_path('module', 'jcalendar');
      $settings['jcalendar']['path'] = base_path() . $path;
      drupal_add_js($settings, 'setting');
      drupal_add_js($path . '/jcalendar.js');
      drupal_add_css($path . '/jcalendar.css');
    }
  }
}