aboutsummaryrefslogtreecommitdiff
path: root/views/default/event_calendar/full_calendar_view.php
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/event_calendar/full_calendar_view.php')
-rw-r--r--views/default/event_calendar/full_calendar_view.php81
1 files changed, 54 insertions, 27 deletions
diff --git a/views/default/event_calendar/full_calendar_view.php b/views/default/event_calendar/full_calendar_view.php
index 3e0c583ce..1a58321b5 100644
--- a/views/default/event_calendar/full_calendar_view.php
+++ b/views/default/event_calendar/full_calendar_view.php
@@ -1,7 +1,7 @@
<?php
elgg_load_js('elgg.full_calendar');
-elgg_load_js('lightbox');
-elgg_load_css('lightbox');
+
+$timeformat = elgg_get_plugin_setting('timeformat', 'event_calendar') == 24 ? 'H(:mm)' : 'h(:mm)t';
// TODO: is there an easy way to avoid embedding JS?
?>
@@ -11,13 +11,8 @@ var goToDateFlag = 0;
handleEventClick = function(event) {
if (event.url) {
- if (event.is_event_poll) {
- window.location.href = event.url;
- } else {
- //window.location.href = event.url;
- $.fancybox({'href':event.url});
- }
- return false;
+ window.location.href = event.url;
+ event.preventDefault();
}
};
@@ -149,25 +144,57 @@ handleViewDisplay = function(view) {
//$(".fc-widget-content[data-date='20120105']")
}
-$(document).ready(function() {
- $('#calendar').fullCalendar({
- header: {
- left: 'prev,next today',
- center: 'title',
- right: 'month,agendaWeek,agendaDay'
- },
- month: <?php echo date('n',strtotime($vars['start_date']))-1; ?>,
- ignoreTimezone: true,
- editable: true,
- slotMinutes: 15,
- eventRender: handleEventRender,
- eventDrop: handleEventDrop,
- eventClick: handleEventClick,
- dayClick: handleDayClick,
- events: handleGetEvents,
- viewDisplay: handleViewDisplay,
+fullcalendarInit = function() {
+
+ var loadFullCalendar = function() {
+ var locale = $.datepicker.regional[elgg.get_language()];
+ if (!locale) {
+ locale = $.datepicker.regional[''];
+ }
+ $('#calendar').fullCalendar({
+ header: {
+ left: 'prev,next today',
+ center: 'title',
+ right: 'month,agendaWeek,agendaDay'
+ },
+ month: <?php echo date('n',strtotime($vars['start_date']))-1; ?>,
+ ignoreTimezone: true,
+ editable: true,
+ slotMinutes: 15,
+ eventRender: handleEventRender,
+ eventDrop: handleEventDrop,
+ eventClick: handleEventClick,
+ dayClick: handleDayClick,
+ events: handleGetEvents,
+ viewDisplay: handleViewDisplay,
+
+ isRTL: locale.isRTL,
+ firstDay: locale.firstDay,
+ monthNames: locale.monthNames,
+ monthNamesShort: locale.monthNamesShort,
+ dayNames: locale.dayNames,
+ dayNamesShort: locale.dayNamesShort,
+ buttonText: {
+ today: locale.currentText,
+ month: elgg.echo('event_calendar:month_label'),
+ week: elgg.echo('event_calendar:week_label'),
+ day: elgg.echo('event_calendar:day_label')
+ },
+ timeFormat: "<?php echo $timeformat; ?>",
+ });
+ }
+
+ elgg.get({
+ url: elgg.config.wwwroot + 'vendors/jquery/i18n/jquery.ui.datepicker-'+ elgg.get_language() +'.js',
+ dataType: "script",
+ cache: true,
+ success: loadFullCalendar,
+ error: loadFullCalendar, // english language is already loaded.
});
-});
+}
+
+elgg.register_hook_handler('init', 'system', fullcalendarInit);
+
</script>
<div id='calendar'></div>
<input type="hidden" id="event-calendar-selected-date" />