diff --git fullcalendar.module fullcalendar.module index 5efbcde..feb2018 100644 --- fullcalendar.module +++ fullcalendar.module @@ -163,6 +163,7 @@ 'firstDay' => $options['display']['fc_firstday'], 'weekMode' => $options['display']['fc_weekmode'], 'theme' => $options['modules']['fc_theme'], + 'sameWindow' => $options['modules']['fc_window'], 'colorbox' => $options['modules']['fc_url_colorbox'], 'colorboxClass' => $options['modules']['fc_url_colorbox_class'], 'colorboxWidth' => $options['modules']['fc_url_colorbox_width'], diff --git fullcalendar.views.js fullcalendar.views.js index 4c7052b..29879f5 100644 --- fullcalendar.views.js +++ fullcalendar.views.js @@ -28,11 +28,15 @@ width: settings.colorboxWidth, height: settings.colorboxHeight }); - } else { + } + } + else { + if (settings.sameWindow) { + window.open(calEvent.url, '_self'); + } + else { window.open(calEvent.url); } - } else { - window.open(calEvent.url); } return false; }, diff --git views_plugin_style_fullcalendar.inc views_plugin_style_fullcalendar.inc index 7666cfb..540211d 100644 --- views_plugin_style_fullcalendar.inc +++ views_plugin_style_fullcalendar.inc @@ -21,7 +21,8 @@ 'fc_url_colorbox' => array('default' => FALSE), 'fc_url_colorbox_class' => array('default' => '#content'), 'fc_url_colorbox_width' => array('default' => '80%'), - 'fc_url_colorbox_height' => array('default' => '80%') + 'fc_url_colorbox_height' => array('default' => '80%'), + 'fc_window' => array('default' => FALSE), ), ); $options['header'] = array( @@ -195,5 +196,15 @@ '#dependency' => array('edit-style-options-modules-fc-url-colorbox' => array(1)), ); } + $form['modules']['fc_window'] = array( + '#type' => 'checkbox', + '#title' => t('Open events in same window'), + '#default_value' => $this->options['modules']['fc_window'], + ); + + if (module_exists('colorbox')) { + $form['modules']['fc_window']['#process'] = array('views_process_dependency'); + $form['modules']['fc_window']['#dependency'] = array('edit-style-options-modules-fc-url-colorbox' => array(0)); + } } }