aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Jardine <kevinjardine@yahoo.com>2012-05-29 12:35:20 +0200
committerKevin Jardine <kevinjardine@yahoo.com>2012-05-29 12:35:20 +0200
commitf22f6fd7a985b773bce95accf5172cdc2524575c (patch)
treee2c26e20d53772895cff9fb1128b12185b1ae90a
parentb8c3767f8c790febb35141919936d616d3ebe2d4 (diff)
downloadelgg-f22f6fd7a985b773bce95accf5172cdc2524575c.tar.gz
elgg-f22f6fd7a985b773bce95accf5172cdc2524575c.tar.bz2
added lightbox support for full calendar events
-rw-r--r--models/model.php20
-rw-r--r--start.php3
-rw-r--r--views/default/event_calendar/full_calendar_view.php5
3 files changed, 19 insertions, 9 deletions
diff --git a/models/model.php b/models/model.php
index 7de514802..b53471a44 100644
--- a/models/model.php
+++ b/models/model.php
@@ -1855,7 +1855,7 @@ function event_calendar_generate_listing_params($page_type,$container_guid,$orig
return $params;
}
-function event_calendar_get_page_content_view($event_guid) {
+function event_calendar_get_page_content_view($event_guid,$light_box = FALSE) {
// add personal calendar button and links
elgg_push_context('event_calendar:view');
$event = get_entity($event_guid);
@@ -1885,12 +1885,16 @@ function event_calendar_get_page_content_view($event_guid) {
$content .= elgg_view_comments($event);
}
}
-
- $params = array('title' => $title, 'content' => $content,'filter' => '');
-
- $body = elgg_view_layout("content", $params);
-
- return elgg_view_page($title,$body);
+
+ if ($light_box) {
+ return '<div class="event-calendar-lightbox">'.elgg_view_title($title).$content.'</div>';
+ } else {
+ $params = array('title' => $title, 'content' => $content,'filter' => '');
+
+ $body = elgg_view_layout("content", $params);
+
+ return elgg_view_page($title,$body);
+ }
}
function event_calendar_get_page_content_display_users($event_guid) {
@@ -2135,7 +2139,7 @@ function event_calendar_get_page_content_fullcalendar_events($start_date,$end_da
'id' => $event->guid,
'guid' => $event->guid,
'title' => $event->title,
- 'url' => $event->getURL(),
+ 'url' => elgg_get_site_url().'event_calendar/view_light_box/'.$event->guid,
'start' => date('c',$ed['start_time']),
'end' => date('c',$ed['end_time']),
);
diff --git a/start.php b/start.php
index c9f95c8d6..9d3d45e4d 100644
--- a/start.php
+++ b/start.php
@@ -184,6 +184,9 @@ function event_calendar_page_handler($page) {
case 'view':
echo event_calendar_get_page_content_view($page[1]);
break;
+ case 'view_light_box':
+ echo event_calendar_get_page_content_view($page[1],TRUE);
+ break;
case 'display_users':
echo event_calendar_get_page_content_display_users($page[1]);
break;
diff --git a/views/default/event_calendar/full_calendar_view.php b/views/default/event_calendar/full_calendar_view.php
index 5fffff624..d7b6d97a2 100644
--- a/views/default/event_calendar/full_calendar_view.php
+++ b/views/default/event_calendar/full_calendar_view.php
@@ -1,5 +1,7 @@
<?php
elgg_load_js('elgg.full_calendar');
+elgg_load_js('lightbox');
+elgg_load_css('lightbox');
// TODO: is there an easy way to avoid embedding JS?
?>
@@ -7,7 +9,8 @@ elgg_load_js('elgg.full_calendar');
handleEventClick = function(event) {
if (event.url) {
- window.location.href = event.url;
+ //window.location.href = event.url;
+ $.fancybox({'href':event.url});
return false;
}
};