aboutsummaryrefslogtreecommitdiff
path: root/views/default
diff options
context:
space:
mode:
authorKevin Jardine <kevinjardine@yahoo.com>2012-02-02 16:19:37 +0100
committerKevin Jardine <kevinjardine@yahoo.com>2012-02-02 16:19:37 +0100
commite0e9ff33a7f5fc334af8127fc8680925ce967d14 (patch)
tree6384673db77ca63065fbf72cedf236ba5fb081c8 /views/default
parent5aadcdd48153b4197c44bdacfc504ebd7db34c3f (diff)
downloadelgg-e0e9ff33a7f5fc334af8127fc8680925ce967d14.tar.gz
elgg-e0e9ff33a7f5fc334af8127fc8680925ce967d14.tar.bz2
added support for new personal calendar management options
Diffstat (limited to 'views/default')
-rw-r--r--views/default/forms/event_calendar/edit.php30
-rw-r--r--views/default/plugins/event_calendar/settings.php16
-rw-r--r--views/default/widgets/event_calendar/content.php39
3 files changed, 77 insertions, 8 deletions
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 .= '<p><label>'.elgg_echo("event_calendar:region_label").'<br />';
- $body .= elgg_view("input/pulldown",array('name' => 'region','value'=>$region,'options_values'=>$options));
+ $body .= elgg_view("input/dropdown",array('name' => 'region','value'=>$region,'options_values'=>$options));
$body .= '</label></p>';
$body .= '<p class="description">'.$prefix['region'].elgg_echo('event_calendar:region_description').'</p>';
}
@@ -199,7 +216,7 @@ if ($event_calendar_type_display == 'yes') {
}
}
$body .= '<p><label>'.elgg_echo("event_calendar:type_label").'<br />';
- $body .= elgg_view("input/pulldown",array('name' => 'event_type','value'=>$event_type,'options_values'=>$options));
+ $body .= elgg_view("input/dropdown",array('name' => 'event_type','value'=>$event_type,'options_values'=>$options));
$body .= '</label></p>';
$body .= '<p class="description">'.$prefix['event_type'].elgg_echo('event_calendar:type_description').'</p>';
}
@@ -220,6 +237,13 @@ $body .= elgg_view("input/text",array('name' => 'organiser','value'=>$organiser)
$body .= '</label></p>';
$body .= '<p class="description">'.$prefix['organiser'].elgg_echo('event_calendar:organiser_description').'</p>';
+if ($event_calendar_personal_manage == 'by_event') {
+ $body .= '<p><label>'.elgg_echo('event_calendar:personal_manage:label').'<br />';
+ $body .= elgg_view("input/radio",array('name' => 'personal_manage','value'=>$personal_manage,'options'=>$personal_manage_options));
+ $body .= '</label></p>';
+ $body .= '<p class="description">'.$prefix['personal_manage'].elgg_echo('event_calendar:personal_manage:description').'</p>';
+}
+
$body .= '<p><label>'.elgg_echo("event_calendar:event_tags_label").'<br />';
$body .= elgg_view("input/tags",array('name' => 'tags','value'=>$event_tags));
$body .= '</label></p>';
diff --git a/views/default/plugins/event_calendar/settings.php b/views/default/plugins/event_calendar/settings.php
index 54ff5c1c3..963f64549 100644
--- a/views/default/plugins/event_calendar/settings.php
+++ b/views/default/plugins/event_calendar/settings.php
@@ -3,6 +3,13 @@ $yn_options = array(elgg_echo('event_calendar:settings:yes')=>'yes',
elgg_echo('event_calendar:settings:no')=>'no',
);
+$membership_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',
+ elgg_echo('event_calendar:personal_manage:by_event') => 'by_event',
+);
+
$access_options = array( ACCESS_PRIVATE => elgg_echo("PRIVATE"),
ACCESS_LOGGED_IN => elgg_echo("LOGGED_IN"),
ACCESS_PUBLIC => elgg_echo("PUBLIC"));
@@ -222,15 +229,14 @@ $body .= elgg_view('input/radio',array('name'=>'params[add_users_notify]','value
$body .= '<br />';
$event_calendar_personal_manage = elgg_get_plugin_setting('personal_manage', 'event_calendar');
-if (!$event_calendar_personal_manage) {
- $event_calendar_personal_manage = 'yes';
+if (!$event_calendar_personal_manage && $personal_manage == 'yes') {
+ $event_calendar_personal_manage = 'open';
}
$body .= elgg_echo('event_calendar:settings:personal_manage:title');
$body .= '<br />';
-$body .= elgg_view('input/radio',array('name'=>'params[personal_manage]','value'=>$event_calendar_personal_manage,'options'=>$yn_options));
-
-$body .= '<br />';
+$body .= elgg_view('input/radio',array('name'=>'params[personal_manage]','value'=>$event_calendar_personal_manage,'options'=>$membership_options));
+$body .= '<p>'.elgg_echo('event_calendar:settings:personal_manage:description').'</p>';
$event_calendar_spots_display = elgg_get_plugin_setting('spots_display', 'event_calendar');
if (!$event_calendar_spots_display) {
diff --git a/views/default/widgets/event_calendar/content.php b/views/default/widgets/event_calendar/content.php
new file mode 100644
index 000000000..329046cb0
--- /dev/null
+++ b/views/default/widgets/event_calendar/content.php
@@ -0,0 +1,39 @@
+<?php
+
+/**
+ * Elgg event calendar widget
+ *
+ * @package event_calendar
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Kevin Jardine <kevin@radagast.biz>
+ * @copyright Radagast Solutions 2008
+ * @link http://radagast.biz/
+ *
+ */
+
+ // Load event calendar model
+ elgg_load_library('elgg:event_calendar');
+
+ //the number of events to display
+ $num = (int) $vars['entity']->num_display;
+ if (!$num)
+ $num = 5;
+
+ // Get the events
+
+ $events = event_calendar_get_personal_events_for_user(elgg_get_page_owner_guid(),$num);
+
+ // If there are any events to view, view them
+ if (is_array($events) && sizeof($events) > 0) {
+
+ echo "<div id=\"widget_calendar\">";
+
+ foreach($events as $event) {
+ echo elgg_view("object/event_calendar",array('entity' => $event));
+ }
+
+ echo "</div>";
+
+ }
+
+?> \ No newline at end of file