From 58126731fe957c604c1989d59d41534f8fbcf04b Mon Sep 17 00:00:00 2001 From: Kevin Jardine Date: Fri, 13 Apr 2012 17:20:49 +0200 Subject: added support for event polls (needs the event_poll plugin) --- start.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'start.php') diff --git a/start.php b/start.php index 523987154..86a94fbd9 100644 --- a/start.php +++ b/start.php @@ -64,7 +64,7 @@ function event_calendar_init() { elgg_extend_view('css/elgg', 'event_calendar/css'); $event_calendar_listing_format = elgg_get_plugin_setting('listing_format', 'event_calendar'); - if ($event_calendar_listing_format == 'full') { + if (elgg_plugin_exists('event_poll') || ($event_calendar_listing_format == 'full')) { elgg_extend_view('css/elgg', 'fullcalendar/css'); $plugin_js = elgg_get_simplecache_url('js', 'event_calendar/fullcalendar'); elgg_register_js('elgg.full_calendar', $plugin_js); @@ -287,6 +287,16 @@ function event_calendar_entity_menu_setup($hook, $type, $return, $params) { if ($handler != 'event_calendar') { return $return; } + if (elgg_plugin_exists('event_poll') && $entity->canEdit() && $entity->schedule_type == 'poll') { + $options = array( + 'name' => 'schedule', + 'text' => elgg_echo('event_poll:schedule_button'), + 'title' => elgg_echo('event_poll:schedule_button'), + 'href' => 'event_poll/schedule/'.$entity->guid, + 'priority' => 150, + ); + $return[] = ElggMenuItem::factory($options); + } $user_guid = elgg_get_logged_in_user_guid(); if ($user_guid) { $calendar_status = event_calendar_personal_can_manage($entity,$user_guid); -- cgit v1.2.3