From e0e9ff33a7f5fc334af8127fc8680925ce967d14 Mon Sep 17 00:00:00 2001
From: Kevin Jardine
Date: Thu, 2 Feb 2012 16:19:37 +0100
Subject: added support for new personal calendar management options
---
views/default/forms/event_calendar/edit.php | 30 ++++++++++++++++++++++++++---
1 file changed, 27 insertions(+), 3 deletions(-)
(limited to 'views/default/forms')
diff --git a/views/default/forms/event_calendar/edit.php b/views/default/forms/event_calendar/edit.php
index a84a79407..1830ef168 100644
--- a/views/default/forms/event_calendar/edit.php
+++ b/views/default/forms/event_calendar/edit.php
@@ -2,6 +2,12 @@
$event = $vars['event'];
$fd = $vars['form_data'];
+$personal_manage_options = array(
+ elgg_echo('event_calendar:personal_manage:open') => 'open',
+ elgg_echo('event_calendar:personal_manage:closed') => 'closed',
+ elgg_echo('event_calendar:personal_manage:private') => 'private',
+);
+
$event_calendar_times = elgg_get_plugin_setting('times', 'event_calendar');
$event_calendar_region_display = elgg_get_plugin_setting('region_display', 'event_calendar');
$event_calendar_type_display = elgg_get_plugin_setting('type_display', 'event_calendar');
@@ -10,6 +16,7 @@ $event_calendar_spots_display = elgg_get_plugin_setting('spots_display', 'event_
$event_calendar_hide_access = elgg_get_plugin_setting('hide_access', 'event_calendar');
$event_calendar_hide_end = elgg_get_plugin_setting('hide_end', 'event_calendar');
$event_calendar_more_required = elgg_get_plugin_setting('more_required', 'event_calendar');
+$event_calendar_personal_manage = elgg_get_plugin_setting('personal_manage', 'event_calendar');
if ($event_calendar_more_required == 'yes') {
$required_fields = array('title','venue','start_date','start_time',
@@ -20,7 +27,8 @@ if ($event_calendar_more_required == 'yes') {
}
$all_fields = array('title','venue','start_time','start_date','end_time','end_date',
'brief_description','region','event_type','fees','contact','organiser','event_tags',
- 'long_description','spots');
+ 'long_description','spots','personal_manage');
+
$prefix = array();
foreach ($all_fields as $fn) {
if (in_array($fn,$required_fields)) {
@@ -64,6 +72,12 @@ if ($event) {
$start_time = $event->start_time;
$end_time = $event->end_time;
}
+ if ($event_calendar_personal_manage == 'by_event') {
+ $personal_manage = $event->personal_manage;
+ if (!$personal_manage) {
+ $personal_manage = 'open';
+ }
+ }
$event_action = 'manage_event';
$event_guid = $event->guid;
} else {
@@ -91,6 +105,9 @@ if ($event) {
$start_time = $fd['start_time'];
$end_time = $fd['end_time'];
}
+ if ($event_calendar_personal_manage == 'by_event') {
+ $personal_manage = $fd['personal_manage'];
+ }
$event_action = 'add_event';
$event_guid = 0;
}
@@ -175,7 +192,7 @@ if ($event_calendar_region_display == 'yes') {
}
}
$body .= '';
$body .= ''.$prefix['region'].elgg_echo('event_calendar:region_description').'
';
}
@@ -199,7 +216,7 @@ if ($event_calendar_type_display == 'yes') {
}
}
$body .= '';
$body .= ''.$prefix['event_type'].elgg_echo('event_calendar:type_description').'
';
}
@@ -220,6 +237,13 @@ $body .= elgg_view("input/text",array('name' => 'organiser','value'=>$organiser)
$body .= '
';
$body .= ''.$prefix['organiser'].elgg_echo('event_calendar:organiser_description').'
';
+if ($event_calendar_personal_manage == 'by_event') {
+ $body .= '';
+ $body .= ''.$prefix['personal_manage'].elgg_echo('event_calendar:personal_manage:description').'
';
+}
+
$body .= '';
--
cgit v1.2.3