-
Notifications
You must be signed in to change notification settings - Fork 0
/
fullcalendar-sameWindow-1050530-14-d6.patch
60 lines (60 loc) · 2.42 KB
/
fullcalendar-sameWindow-1050530-14-d6.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
diff --git fullcalendar.module fullcalendar.module
index 16594bb..60389ae 100644
--- fullcalendar.module
+++ fullcalendar.module
@@ -185,6 +185,7 @@ function template_preprocess_views_view_fullcalendar(&$vars) {
'firstDay' => $vars['options']['display']['fc_firstday'],
'weekMode' => $vars['options']['display']['fc_weekmode'],
'theme' => $vars['options']['modules']['fc_theme'],
+ 'sameWindow' => $vars['options']['modules']['fc_window'],
'colorbox' => $vars['options']['modules']['fc_url_colorbox'],
'left' => $vars['options']['header']['fc_left'],
'center' => $vars['options']['header']['fc_center'],
diff --git fullcalendar.views.js fullcalendar.views.js
index 29b36bb..7eded21 100644
--- fullcalendar.views.js
+++ fullcalendar.views.js
@@ -16,11 +16,15 @@ Drupal.behaviors.fullCalendar = function(context) {
// Open in colorbox if exists, else open in new window.
if ($.colorbox) {
$.colorbox({href:calEvent.url, iframe:true, width:'80%', height:'80%'});
- } else {
+ }
+ }
+ else {
+ if (Drupal.settings.fullcalendar.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 7dd8500..5db6419 100644
--- views_plugin_style_fullcalendar.inc
+++ views_plugin_style_fullcalendar.inc
@@ -20,6 +20,7 @@ class views_plugin_style_fullcalendar extends views_plugin_style {
'contains' => array(
'fc_theme' => array('default' => FALSE),
'fc_url_colorbox' => array('default' => FALSE),
+ 'fc_window' => array('default' => FALSE),
),
);
$options['header'] = array(
@@ -201,5 +202,12 @@ class views_plugin_style_fullcalendar extends views_plugin_style {
'#default_value' => $this->options['modules']['fc_url_colorbox'],
'#description' => t('If checked, each event will open in colorbox (if it is installed).'),
);
+ $form['modules']['fc_window'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Open events in same window'),
+ '#default_value' => $this->options['modules']['fc_window'],
+ '#process' => array('views_process_dependency'),
+ '#dependency' => array('edit-style-options-modules-fc-url-colorbox' => array(0)),
+ );
}
}