aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/default/event_calendar/agenda_footer.php5
-rw-r--r--views/default/event_calendar/agenda_header.php12
-rw-r--r--views/default/event_calendar/agenda_item_view.php26
-rw-r--r--views/default/event_calendar/agenda_view.php34
-rw-r--r--views/default/event_calendar/calendar.php61
-rw-r--r--views/default/event_calendar/css.php150
-rw-r--r--views/default/event_calendar/entities/entity_list.php66
-rw-r--r--views/default/event_calendar/entities/gallery.php44
-rw-r--r--views/default/event_calendar/entities/gallery_item.php63
-rw-r--r--views/default/event_calendar/forms/add_to_group.php64
-rw-r--r--views/default/event_calendar/forms/delete_confirm.php13
-rw-r--r--views/default/event_calendar/forms/manage_event.php22
-rw-r--r--views/default/event_calendar/forms/manage_event_content.php254
-rw-r--r--views/default/event_calendar/groupprofile_calendar.php42
-rw-r--r--views/default/event_calendar/input/longtext.php25
-rw-r--r--views/default/event_calendar/metatags.php2
-rw-r--r--views/default/event_calendar/nav.php38
-rw-r--r--views/default/event_calendar/paged_footer.php4
-rw-r--r--views/default/event_calendar/paged_header.php15
-rw-r--r--views/default/event_calendar/paged_item_view.php29
-rw-r--r--views/default/event_calendar/paged_view.php51
-rw-r--r--views/default/event_calendar/personal_toggle_js.php20
-rw-r--r--views/default/event_calendar/region_select.php23
-rw-r--r--views/default/event_calendar/review_requests.php25
-rw-r--r--views/default/event_calendar/show_events.php53
-rw-r--r--views/default/event_calendar/strapline.php18
-rw-r--r--views/default/icon/object/event_calendar/small.php3
-rw-r--r--views/default/input/datepicker_inline.php52
-rw-r--r--views/default/input/datepicker_popup.php30
-rw-r--r--views/default/input/timepicker.php38
-rw-r--r--views/default/object/event_calendar.php66
-rw-r--r--views/default/river/object/event_calendar/create.php12
-rw-r--r--views/default/river/object/event_calendar/update.php12
-rw-r--r--views/default/settings/event_calendar/edit.php363
-rw-r--r--views/default/widgets/event_calendar/edit.php35
-rw-r--r--views/default/widgets/event_calendar/view.php39
-rw-r--r--views/rss/event_calendar/show_events.php16
-rw-r--r--views/rss/object/event_calendar.php60
38 files changed, 1885 insertions, 0 deletions
diff --git a/views/default/event_calendar/agenda_footer.php b/views/default/event_calendar/agenda_footer.php
new file mode 100644
index 000000000..8749ebe08
--- /dev/null
+++ b/views/default/event_calendar/agenda_footer.php
@@ -0,0 +1,5 @@
+<?php
+
+echo '</tbody></table></div>';
+
+?> \ No newline at end of file
diff --git a/views/default/event_calendar/agenda_header.php b/views/default/event_calendar/agenda_header.php
new file mode 100644
index 000000000..712dbed8d
--- /dev/null
+++ b/views/default/event_calendar/agenda_header.php
@@ -0,0 +1,12 @@
+<?php
+
+$header .= '<div class="event_calendar_agenda_date_section">';
+$header .= '<div class="event_calendar_agenda_date">'.$vars['date'].'</div>';
+$header .= '<table><thead><tr>';
+$header .= '<th class="agenda_header">'.elgg_echo('event_calendar:agenda:column:time').'</th>';
+$header .= '<th class="agenda_header">'.elgg_echo('event_calendar:agenda:column:session').'</th>';
+$header .= '<th class="agenda_header">'.elgg_echo('event_calendar:agenda:column:venue').'</th>';
+$header .= '</td></thead><tbody>';
+
+echo $header;
+?> \ No newline at end of file
diff --git a/views/default/event_calendar/agenda_item_view.php b/views/default/event_calendar/agenda_item_view.php
new file mode 100644
index 000000000..727b559ec
--- /dev/null
+++ b/views/default/event_calendar/agenda_item_view.php
@@ -0,0 +1,26 @@
+<?php
+$event = $vars['event'];
+$times = $vars['times'];
+$time_bit = '';
+if ($times) {
+ if (is_numeric($event->start_time)) {
+ $time_bit = event_calendar_convert_time($event->start_time);
+ }
+ if (is_numeric($event->end_time)) {
+ $time_bit .= " - ".event_calendar_convert_time($event->end_time);
+ }
+ $time_bit .= ' ';
+}
+$info = '<tr>';
+$info .= '<td class="event_calendar_agenda_time">'.$time_bit.'</td>';
+$info .= '<td class="event_calendar_agenda_title"><a href="'.$event->getUrl().'">'.$event->title.'</a></td>';
+$info .= '<td class="event_calendar_agenda_venue">'.$event->venue.'</td>';
+$info .= '</tr>';
+if (trim($event->description)) {
+ $info .= '<tr class="event_calendar_agenda_description">';
+ $info .= '<td class="event_calendar_agenda_time">&nbsp;</td>';
+ $info .= '<td colspan="2">'.$event->description.'</td></tr>';
+}
+
+echo $info;
+?> \ No newline at end of file
diff --git a/views/default/event_calendar/agenda_view.php b/views/default/event_calendar/agenda_view.php
new file mode 100644
index 000000000..bb693def0
--- /dev/null
+++ b/views/default/event_calendar/agenda_view.php
@@ -0,0 +1,34 @@
+<?php
+$nav = elgg_view('navigation/pagination',array(
+
+// 'baseurl' => $_SERVER['REQUEST_URI'],
+ 'baseurl' => $_SERVER['SCRIPT_NAME'].'/?'.$_SERVER['QUERY_STRING'],
+ 'offset' => $vars['offset'],
+ 'count' => $vars['count'],
+ 'limit' => $vars['limit'],
+
+ ));
+$event_calendar_times = get_plugin_setting('times', 'event_calendar');
+$events = $vars['events'];
+$html = '';
+$date_format = 'j M Y';
+$current_date = '';
+if ($events) {
+ foreach($events as $event) {
+ $date = date($date_format,$event->start_date);
+ if ($date != $current_date) {
+ if ($html) {
+ $html .= elgg_view('event_calendar/agenda_footer');
+ }
+ $html .= elgg_view('event_calendar/agenda_header',array('date'=>$date));
+
+ $current_date = $date;
+ }
+ $html .= elgg_view('event_calendar/agenda_item_view',array('event'=>$event,'times'=>$event_calendar_times));
+ }
+ $html .= elgg_view('event_calendar/agenda_footer');
+}
+$html = $nav.'<div class="event_calendar_agenda">'.$html.'</div>'.$nav;
+
+echo $html;
+?> \ No newline at end of file
diff --git a/views/default/event_calendar/calendar.php b/views/default/event_calendar/calendar.php
new file mode 100644
index 000000000..ebf4aa589
--- /dev/null
+++ b/views/default/event_calendar/calendar.php
@@ -0,0 +1,61 @@
+<?php
+if ($vars['mode']) {
+ $mode = $vars['mode'];
+} else {
+ $mode = 'month';
+}
+$link_bit = $vars['url'].'mod/event_calendar/show_events.php?start_date='.$vars['original_start_date'].'&group_guid='.$vars['group_guid'].'&filter='.$vars['filter'].'&mode=';
+
+$range_bit = '';
+$first_date = $vars['first_date'];
+if ($first_date) {
+ $range_bit .= 'minDate: $.datepicker.parseDate("yy-mm-dd", "'.$first_date.'"),'."\n";
+}
+$last_date = $vars['last_date'];
+if ($last_date) {
+ $range_bit .= 'maxDate: $.datepicker.parseDate("yy-mm-dd", "'.$last_date.'"),'."\n";
+}
+if ($first_date || $last_date) {
+ if (substr($first_date,0,7) == substr($last_date,0,7)) {
+ $range_bit .= "changeMonth: false,\n";
+ }
+
+ if (substr($first_date,0,4) == substr($last_date,0,4)) {
+ $range_bit .= "changeYear: false,\n";
+ }
+}
+
+$body .= elgg_view("input/datepicker_inline",
+ array(
+ 'internalname' => 'my_datepicker',
+ 'mode' => $vars['mode']?$vars['mode']:'month',
+ 'start_date' => $vars['start_date'],
+ 'end_date' => $vars['end_date'],
+ 'group_guid' => $vars['group_guid'],
+ 'range_bit' => $range_bit,
+ )
+);
+$body .= '<div id="calendarmenucontainer">';
+$body .= '<ul id="calendarmenu">';
+if ($mode == 'day') {
+ $link_class = ' class="sys_selected"';
+} else {
+ $link_class = '';
+}
+$body .= '<li'.$link_class.'><a href="'.$link_bit.'day">'.elgg_echo('event_calendar:day_label').'</a></li>';
+if ($mode == 'week') {
+ $link_class = ' class="sys_selected"';
+} else {
+ $link_class = '';
+}
+$body .= '<li'.$link_class.'><a href="'.$link_bit.'week">'.elgg_echo('event_calendar:week_label').'</a></li>';
+if ($mode == 'month') {
+ $link_class = ' class="sys_selected sys_calmenu_last"';
+} else {
+ $link_class = ' class="sys_calmenu_last"';
+}
+$body .= '<li'.$link_class.'><a href="'.$link_bit.'month">'.elgg_echo('event_calendar:month_label').'</a></li>';
+$body .= '</ul>';
+$body .= '</div>';
+echo $body;
+?> \ No newline at end of file
diff --git a/views/default/event_calendar/css.php b/views/default/event_calendar/css.php
new file mode 100644
index 000000000..359fd1e13
--- /dev/null
+++ b/views/default/event_calendar/css.php
@@ -0,0 +1,150 @@
+<?php
+//$background_colour = '#EBF1EB';
+//$highlight_colour = '#478787';
+
+$background_colour = '#F5F5F5';
+$highlight_colour = '#3874B7';
+?>
+
+/* hide Today as it is not working as expected */
+.ui-datepicker-current { visibility:hidden }
+
+div#calendarmenucontainer {
+ position: relative;
+}
+
+ul#calendarmenu {
+ list-style: none;
+ position: absolute;
+ top: 0px;
+ left: -15px;
+}
+
+ul#calendarmenu li {
+ float: left;
+ border-top: 1px solid #969696;
+ border-left: 1px solid #969696;
+ border-bottom: 1px solid #969696;
+ background-color: <?php echo $background_colour; ?>;
+}
+
+
+ul#calendarmenu li.sys_calmenu_last {
+ border-right: 1px solid #969696;
+}
+
+ul#calendarmenu li a {
+ text-decoration: none;
+ padding: 4px 12px;
+ float: left;
+}
+
+ul#calendarmenu li a:hover, ul#calendarmenu li.sys_selected a{
+ text-decoration: none;
+ padding: 4px 12px;
+ float: left;
+ color: #FFFFFF;
+ background: <?php echo $highlight_colour; ?>;
+}
+
+td.ui-datepicker-unselectable {
+ background-color: #FFFFFF !important;
+ color: #888888 !important;
+}
+
+.river_object_event_calendar_create {
+ background: url(<?php echo $vars['url']; ?>mod/event_calendar/images/river_icon_event.gif) no-repeat left -1px;
+}
+.river_object_event_calendar_update {
+ background: url(<?php echo $vars['url']; ?>mod/event_calendar/images/river_icon_event.gif) no-repeat left -1px;
+}
+#event_list {
+ width:440px;
+ margin:0;
+ float:left;
+ padding:5px 0 0 0;
+}
+#event_list .search_listing {
+ border:2px solid #cccccc;
+ margin:0 0 5px 0;
+}
+
+.events {
+ min-height: 300px;
+}
+
+div.event_calendar_agenda_date_section {
+ margin-bottom: 10px;
+}
+
+.event_calendar_agenda_date {
+ font-size: 1.3em;
+ font-weight: bold;
+ margin-bottom: 3px;
+}
+
+th.agenda_header {
+ font-weight: bold;
+}
+
+td.event_calendar_agenda_time {
+ width: 120px;
+}
+
+.event_calendar_agenda_title a {
+ font-weight: bold;
+}
+
+td.event_calendar_agenda_title {
+ width: 180px;
+}
+
+.event_calendar_agenda_venue {
+ margin-bottom: 5px;
+}
+
+.event_calendar_paged_month {
+ font-size: 1.3em;
+ font-weight: bold;
+ margin-bottom: 5px;
+ text-transform:uppercase;
+}
+
+td.event_calendar_paged_date {
+ width: 80px;
+}
+td.event_calendar_paged_time {
+ width: 60px;
+}
+td.event_calendar_paged_title {
+ width: 280px;
+}
+
+table.event_calendar_paged_table {
+ width:100%;
+ border-collapse:collapse;
+ border-bottom-width:1px;
+ border-bottom-style:solid;
+ border-bottom-color:#bfbfbf;
+ margin-bottom: 5px;
+}
+
+table.event_calendar_paged_table td {
+ border-width:1px 0 0 0;
+ border-style:solid;
+ border-color:#bfbfbf;
+}
+
+table.event_calendar_paged_table th {
+ font-family:verdana, helvetica, arial, sans-serif;
+ font-size:9pt;
+ color:#183e76;
+ background-color:#ececec;
+ font-weight:bold;
+ text-transform:none;
+ padding:3px 3px 3px 3px;
+}
+
+.event_calendar_strapline {
+ font-size: 85%;
+} \ No newline at end of file
diff --git a/views/default/event_calendar/entities/entity_list.php b/views/default/event_calendar/entities/entity_list.php
new file mode 100644
index 000000000..84c2c0b7d
--- /dev/null
+++ b/views/default/event_calendar/entities/entity_list.php
@@ -0,0 +1,66 @@
+<?php
+/**
+ * View a list of entities
+ *
+ * @package Elgg
+ * @author Curverider Ltd <info@elgg.com>
+ * @link http://elgg.com/
+ *
+ */
+
+$context = $vars['context'];
+$offset = $vars['offset'];
+$entities = $vars['entities'];
+$limit = $vars['limit'];
+$count = $vars['count'];
+$baseurl = $vars['baseurl'];
+$context = $vars['context'];
+$viewtype = $vars['viewtype'];
+$pagination = $vars['pagination'];
+$fullview = $vars['fullview'];
+
+$html = "";
+$nav = "";
+
+if (isset($vars['viewtypetoggle'])) {
+ $viewtypetoggle = $vars['viewtypetoggle'];
+} else {
+ $viewtypetoggle = true;
+}
+
+if ($context == "search" && $count > 0 && $viewtypetoggle) {
+ $nav .= elgg_view('navigation/viewtype', array(
+ 'baseurl' => $baseurl,
+ 'offset' => $offset,
+ 'count' => $count,
+ 'viewtype' => $viewtype,
+ ));
+}
+
+if ($pagination) {
+ $nav .= elgg_view('navigation/pagination',array(
+ 'baseurl' => $baseurl,
+ 'offset' => $offset,
+ 'count' => $count,
+ 'limit' => $limit,
+ ));
+}
+
+$html .= $nav;
+if ($viewtype == 'list') {
+ if (is_array($entities) && sizeof($entities) > 0) {
+ foreach($entities as $entity) {
+ $html .= elgg_view_entity($entity, $fullview);
+ }
+ }
+} else {
+ if (is_array($entities) && sizeof($entities) > 0) {
+ $html .= elgg_view('event_calendar/entities/gallery', array('entities' => $entities));
+ }
+}
+
+if ($count) {
+ $html .= $nav;
+}
+
+echo $html; \ No newline at end of file
diff --git a/views/default/event_calendar/entities/gallery.php b/views/default/event_calendar/entities/gallery.php
new file mode 100644
index 000000000..a12dfa84a
--- /dev/null
+++ b/views/default/event_calendar/entities/gallery.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Elgg gallery view
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ */
+
+$entities = $vars['entities'];
+if (is_array($entities) && sizeof($entities) > 0) {
+
+?>
+
+<table class="entity_gallery">
+
+<?php
+
+ $col = 0;
+ foreach($entities as $entity) {
+ if ($col == 0) {
+
+ echo "<tr>";
+
+ }
+ echo "<td class=\"entity_gallery_item\">";
+ echo elgg_view('event_calendar/entities/gallery_item',array('entity'=>$entity));
+ echo "</td>";
+ $col++;
+ if ($col > 3) {
+ echo "</tr>";
+ $col = 0;
+ }
+ }
+ if ($col > 0) echo "</tr>";
+
+?>
+
+</table>
+
+<?php
+
+} \ No newline at end of file
diff --git a/views/default/event_calendar/entities/gallery_item.php b/views/default/event_calendar/entities/gallery_item.php
new file mode 100644
index 000000000..eb67cc772
--- /dev/null
+++ b/views/default/event_calendar/entities/gallery_item.php
@@ -0,0 +1,63 @@
+<?php
+
+ /**
+ * Elgg user display (gallery)
+ *
+ * @package ElggProfile
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ *
+ * @uses $vars['entity'] The user entity
+ */
+
+$icon = elgg_view(
+ "profile/icon", array(
+ 'entity' => $vars['entity'],
+ 'size' => 'medium',
+ )
+ );
+
+$banned = $vars['entity']->isBanned();
+
+$rel = "";
+if (page_owner() == $vars['entity']->guid)
+ $rel = 'me';
+else if (check_entity_relationship(page_owner(), 'friend', $vars['entity']->guid))
+ $rel = 'friend';
+
+if (!$banned)
+ $info .= "<p><b><a href=\"" . $vars['entity']->getUrl() . "\" rel=\"$rel\">" . $vars['entity']->name . "</a></b></p>";
+else
+ $info .= "<p><b><strike>" . $vars['entity']->name . "</b></strike><br />".elgg_echo('profile:banned')."</p>";
+
+// TODO: look into a way to pass $authorised and $event_id in $vars
+$authorised = FALSE;
+$event_id = get_input('event_id', 0);
+if ($event_id) {
+ if(isadminloggedin()) {
+ $authorised = TRUE;
+ } else {
+ // load the event from the database
+ $event = get_entity($event_id);
+ $user_id = get_loggedin_userid();
+ if ($event && ($event->owner_guid == $user_id)) {
+ $authorised = TRUE;
+ }
+ }
+}
+
+if ($authorised) {
+ $link = '<p><a href="#" ';
+ $link .= 'onclick="javascript:event_calendar_personal_toggle('.$event_id.','.$vars['entity']->guid.'); return false;" ';
+ $link .= ' >';
+ $link .= '<span id="event_calendar_user_data_'.$vars['entity']->guid.'">'.elgg_echo('event_calendar:remove_from_the_calendar').'</span>';
+ $link .= '</a></p>';
+ $info .= $link;
+}
+
+// echo elgg_view_listing($icon, $info);
+echo elgg_view('search/gallery_listing',array('icon' => $icon, 'info' => $info));
+
+?> \ No newline at end of file
diff --git a/views/default/event_calendar/forms/add_to_group.php b/views/default/event_calendar/forms/add_to_group.php
new file mode 100644
index 000000000..fc77495e1
--- /dev/null
+++ b/views/default/event_calendar/forms/add_to_group.php
@@ -0,0 +1,64 @@
+<?php
+// Game plan - display two drop downs: one with a list of groups
+// without this event, one with - can add using one and remove using
+// the other
+// the user must have the authority to edit the groups
+
+$event_id = $vars['event']->guid;
+$event_container = $vars['event']->container_guid;
+
+// get the list of all groups:
+
+if (isadminloggedin()) {
+ $groups = get_entities("group","",0,"",5000);
+} else {
+ $groups = get_entities("group","",get_loggedin_userid(),"",5000);
+}
+
+// split the group list into two lists
+
+$add_options = array();
+$remove_options = array();
+$remove_group = get_entities_from_relationship("display_on_group",$event_id,FALSE,"","",0,"",5000);
+$remove_group_ids = array();
+foreach ($remove_group as $group) {
+ $remove_group_ids[] = $group->guid;
+ if ($group->guid != $event_container && $group->canEdit()) {
+ $remove_options[$group->guid] = $group->name;
+ }
+}
+
+if ($remove_group) {
+ foreach($groups as $group) {
+ if (($group->guid != $event_container) && !in_array($group->guid,$remove_group_ids)) {
+ $add_options[$group->guid] = $group->name;
+ }
+ }
+} else {
+ foreach($groups as $group) {
+ if ($group->guid != $event_container && $group->canEdit()) {
+ $add_options[$group->guid] = $group->name;
+ }
+ }
+}
+
+if ($add_options || $remove_options) {
+ echo '<div class="contentWrapper" >';
+ $event_bit = elgg_view('input/hidden', array("internalname" => "event_id","value" => $event_id));
+ if ($add_options) {
+ echo "<h4>".elgg_echo('event_calendar:add_to_group:add_group_title')."</h4>";
+ $add_pulldown = elgg_view("input/pulldown",array("internalname" => "group_id","options_values" => $add_options));
+ $submit_button = "<p>".elgg_view("input/submit",array("value"=>elgg_echo('event_calendar:add_to_group:add_group_button')))."</p>";
+ echo elgg_view ('input/form',array("body" => $event_bit.$add_pulldown.$submit_button,"action" => $vars['url']."action/event_calendar/add_to_group"));
+ }
+
+ if ($remove_options) {
+ echo "<h4>".elgg_echo('event_calendar:add_to_group:remove_group_title')."</h4>";
+ $remove_pulldown = elgg_view("input/pulldown",array("internalname" => "group_id","options_values" => $remove_options));
+ $submit_button = "<p>".elgg_view("input/submit",array("value"=>elgg_echo('event_calendar:add_to_group:remove_group_button')))."</p>";
+ echo elgg_view ('input/form',array("body" => $event_bit.$remove_pulldown.$submit_button,"action" => $vars['url']."action/event_calendar/remove_from_group"));
+ }
+ echo '</div>';
+}
+
+?> \ No newline at end of file
diff --git a/views/default/event_calendar/forms/delete_confirm.php b/views/default/event_calendar/forms/delete_confirm.php
new file mode 100644
index 000000000..37134e695
--- /dev/null
+++ b/views/default/event_calendar/forms/delete_confirm.php
@@ -0,0 +1,13 @@
+<?php
+
+$body = '<p class="description">'.sprintf(elgg_echo('event_calendar:delete_confirm_description'),$vars['title']).'</p>';
+
+$body .= '<form action="'.$vars['url'].'action/event_calendar/manage" method="post" >';
+$body .= elgg_view('input/securitytoken');
+$body .= elgg_view('input/hidden',array('internalname'=>'event_action', 'value'=>'delete_event'));
+$body .= elgg_view('input/hidden',array('internalname'=>'event_id', 'value'=>$vars['event_id']));
+$body .= elgg_view('input/submit', array('internalname'=>'submit','value'=>elgg_echo('event_calendar:submit')));
+$body .= '</form>';
+
+echo elgg_view('page_elements/contentwrapper', array('body'=>$body));
+?> \ No newline at end of file
diff --git a/views/default/event_calendar/forms/manage_event.php b/views/default/event_calendar/forms/manage_event.php
new file mode 100644
index 000000000..35b9dba71
--- /dev/null
+++ b/views/default/event_calendar/forms/manage_event.php
@@ -0,0 +1,22 @@
+<?php
+
+/**
+ * Elgg manage event view
+ *
+ * @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/
+ *
+ */
+
+extend_view('metatags','event_calendar/metatags');
+
+$body = elgg_view('event_calendar/forms/manage_event_content',$vars);
+
+$body .= elgg_view('input/submit', array('internalname'=>'submit','value'=>elgg_echo('event_calendar:submit')));
+$form = elgg_view('input/form',array('action'=>$vars['url'].'action/event_calendar/manage','body'=>$body));
+
+print elgg_view('page_elements/contentwrapper',array('body'=>$form));
+?> \ No newline at end of file
diff --git a/views/default/event_calendar/forms/manage_event_content.php b/views/default/event_calendar/forms/manage_event_content.php
new file mode 100644
index 000000000..59498e861
--- /dev/null
+++ b/views/default/event_calendar/forms/manage_event_content.php
@@ -0,0 +1,254 @@
+<?php
+$event = $vars['event'];
+$event_id = $vars['event_id'];
+$event_calendar_times = get_plugin_setting('times', 'event_calendar');
+$event_calendar_region_display = get_plugin_setting('region_display', 'event_calendar');
+$event_calendar_type_display = get_plugin_setting('type_display', 'event_calendar');
+$event_calendar_spots_display = get_plugin_setting('spots_display', 'event_calendar');
+$event_calendar_add_users = get_plugin_setting('add_users', 'event_calendar');
+$event_calendar_hide_access = get_plugin_setting('hide_access', 'event_calendar');
+$event_calendar_hide_end = get_plugin_setting('hide_end', 'event_calendar');
+$event_calendar_more_required = get_plugin_setting('more_required', 'event_calendar');
+
+if ($event_calendar_more_required == 'yes') {
+ $required_fields = array('title','venue','start_date','start_time',
+ 'brief_description','region','event_type','fees','contact','organiser',
+ 'event_tags','spots');
+} else {
+ $required_fields = array('title','venue','start_date');
+}
+$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');
+$prefix = array();
+foreach ($all_fields as $fn) {
+ if (in_array($fn,$required_fields)) {
+ $prefix[$fn] = elgg_echo('event_calendar:required').' ';
+ } else {
+ $prefix[$fn] = elgg_echo('event_calendar:optional').' ';
+ }
+}
+
+if ($event) {
+ $title = $event->title;
+ $brief_description = $event->description;
+ $venue = $event->venue;
+ if ($event->form_data) {
+ // this is a form redisplay, so take the values as submitted
+ $start_date = $event->start_date;
+ $end_date = $event->end_date;
+ } else {
+ // the values are from the database,
+ // so convert
+ $start_date = date("l, F j, Y",$event->start_date);
+ if ($event->end_date) {
+ $end_date = date("l, F j, Y",$event->end_date);
+ } else {
+ $end_date = '';
+ }
+ }
+
+ if ($event_calendar_region_display) {
+ $region = $event->region;
+ if (!$region) {
+ $region = '-';
+ }
+ }
+
+ if ($event_calendar_spots_display) {
+ $spots = trim($event->spots);
+ }
+ if ($event_calendar_type_display) {
+ $event_type = $event->event_type;
+ if (!$event_type) {
+ $event_type = '-';
+ }
+ }
+ $fees = $event->fees;
+ $contact = $event->contact;
+ $organiser = $event->organiser;
+ $event_tags = $event->event_tags;
+ $long_description = $event->long_description;
+ $access = $event->access_id;
+ if ($event_calendar_times == 'yes') {
+ $start_time = $event->start_time;
+ $end_time = $event->end_time;
+ }
+ $event_action = 'manage_event';
+} else {
+ $event_id = 0;
+ $title = '';
+ $brief_description = '';
+ $venue = '';
+ $start_date = '';
+ $end_date = '';
+ $fees = '';
+ if ($event_calendar_spots_display) {
+ $spots = '';
+ }
+ if ($event_calendar_region_display) {
+ $region = '-';
+ }
+ if ($event_calendar_type_display) {
+ $event_type = '-';
+ }
+ $contact = '';
+ $organiser = '';
+ $event_tags = '';
+ $long_description = '';
+ $access = get_default_access();
+ if ($event_calendar_times == 'yes') {
+ $start_time = '';
+ $end_time = '';
+ }
+ $event_action = 'add_event';
+}
+$body = '';
+
+$body .= elgg_view('input/hidden',array('internalname'=>'event_action', 'value'=>$event_action));
+$body .= elgg_view('input/hidden',array('internalname'=>'event_id', 'value'=>$event_id));
+$body .= elgg_view('input/hidden',array('internalname'=>'group_guid', 'value'=>$vars['group_guid']));
+
+$body .= '<p><label>'.elgg_echo("event_calendar:title_label").'<br />';
+$body .= elgg_view("input/text",array('internalname' => 'title','value'=>$title));
+$body .= '</label></p>';
+$body .= '<p class="description">'.$prefix['title'].elgg_echo('event_calendar:title_description').'</p>';
+
+$body .= '<p><label>'.elgg_echo("event_calendar:venue_label").'<br />';
+$body .= elgg_view("input/text",array('internalname' => 'venue','value'=>$venue));
+$body .= '</label></p>';
+$body .= '<p class="description">'.$prefix['venue'].elgg_echo('event_calendar:venue_description').'</p>';
+
+if ($event_calendar_times == 'yes') {
+ $body .= '<p><label>'.elgg_echo("event_calendar:start_time_label").'</label><br />';
+ $body .= elgg_view("input/timepicker",array('internalname' => 'start_time','value'=>$start_time));
+ $body .= '</p>';
+ $body .= '<p class="description">'.$prefix['start_time'].elgg_echo('event_calendar:start_time_description').'</p>';
+}
+
+$body .= '<p><label>'.elgg_echo("event_calendar:start_date_label").'<br />';
+$body .= elgg_view("input/datepicker_popup",array('internalname' => 'start_date','value'=>$start_date));
+$body .= '</label></p>';
+$body .= '<p class="description">'.$prefix['start_date'].elgg_echo('event_calendar:start_date_description').'</p>';
+
+if ($event_calendar_hide_end != 'yes') {
+ if ($event_calendar_times == 'yes') {
+ $body .= '<p><label>'.elgg_echo("event_calendar:end_time_label").'</label><br />';
+ $body .= elgg_view("input/timepicker",array('internalname' => 'end_time','value'=>$end_time));
+ $body .= '</p>';
+ $body .= '<p class="description">'.$prefix['end_time'].elgg_echo('event_calendar:end_time_description').'</p>';
+ }
+
+ $body .= '<p><label>'.elgg_echo("event_calendar:end_date_label").'<br />';
+ $body .= elgg_view("input/datepicker_popup",array('internalname' => 'end_date','value'=>$end_date));
+ $body .= '</label></p>';
+ $body .= '<p class="description">'.$prefix['end_date'].elgg_echo('event_calendar:end_date_description').'</p>';
+}
+
+if ($event_calendar_spots_display == 'yes') {
+ $body .= '<p><label>'.elgg_echo("event_calendar:spots_label").'<br />';
+ $body .= elgg_view("input/text",array('internalname' => 'spots','value'=>$spots));
+ $body .= '</label></p>';
+ $body .= '<p class="description">'.$prefix['spots'].elgg_echo('event_calendar:spots_description').'</p>';
+}
+
+if ($event_calendar_add_users == 'yes') {
+ $body .= '<p><label>'.elgg_echo("event_calendar:add_user_label").'<br />';
+ $body .= elgg_view("input/adduser",array('internalname' => 'adduser','internalid' => 'do_adduser','width'=> 200, 'minChars'=>2));
+ $body .= '</label></p><br /><br />';
+ $body .= '<p class="description">'.elgg_echo('event_calendar:add_user_description').'</p>';
+}
+
+$body .= '<p><label>'.elgg_echo("event_calendar:brief_description_label").'<br />';
+$body .= elgg_view("input/text",array('internalname' => 'brief_description','value'=>$brief_description));
+$body .= '</label></p>';
+$body .= '<p class="description">'.$prefix['brief_description'].elgg_echo('event_calendar:brief_description_description').'</p>';
+
+if ($event_calendar_region_display == 'yes') {
+ $region_list = trim(get_plugin_setting('region_list', 'event_calendar'));
+ $region_list_handles = get_plugin_setting('region_list_handles', 'event_calendar');
+ // make sure that we are using Unix line endings
+ $region_list = str_replace("\r\n","\n",$region_list);
+ $region_list = str_replace("\r","\n",$region_list);
+ if ($region_list) {
+ $options = array();
+ $options[] = '-';
+ foreach(explode("\n",$region_list) as $region_item) {
+ $region_item = trim($region_item);
+ if ($region_list_handles == 'yes') {
+ $options[$region_item] = elgg_echo('event_calendar:region:'.$region_item);
+ } else {
+ $options[$region_item] = $region_item;
+ }
+ }
+ $body .= '<p><label>'.elgg_echo("event_calendar:region_label").'<br />';
+ $body .= elgg_view("input/pulldown",array('internalname' => 'region','value'=>$region,'options_values'=>$options));
+ $body .= '</label></p>';
+ $body .= '<p class="description">'.$prefix['region'].elgg_echo('event_calendar:region_description').'</p>';
+ }
+}
+
+if ($event_calendar_type_display == 'yes') {
+ $type_list = trim(get_plugin_setting('type_list', 'event_calendar'));
+ $type_list_handles = get_plugin_setting('type_list_handles', 'event_calendar');
+ // make sure that we are using Unix line endings
+ $type_list = str_replace("\r\n","\n",$type_list);
+ $type_list = str_replace("\r","\n",$type_list);
+ if ($type_list) {
+ $options = array();
+ $options[] = '-';
+ foreach(explode("\n",$type_list) as $type_item) {
+ $type_item = trim($type_item);
+ if ($type_list_handles == 'yes') {
+ $options[$type_item] = elgg_echo('event_calendar:type:'.$type_item);
+ } else {
+ $options[$type_item] = $type_item;
+ }
+ }
+ $body .= '<p><label>'.elgg_echo("event_calendar:type_label").'<br />';
+ $body .= elgg_view("input/pulldown",array('internalname' => '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>';
+ }
+}
+
+$body .= '<p><label>'.elgg_echo("event_calendar:fees_label").'<br />';
+$body .= elgg_view("input/text",array('internalname' => 'fees','value'=>$fees));
+$body .= '</label></p>';
+$body .= '<p class="description">'.$prefix['fees'].elgg_echo('event_calendar:fees_description').'</p>';
+
+$body .= '<p><label>'.elgg_echo("event_calendar:contact_label").'<br />';
+$body .= elgg_view("input/text",array('internalname' => 'contact','value'=>$contact));
+$body .= '</label></p>';
+$body .= '<p class="description">'.$prefix['contact'].elgg_echo('event_calendar:contact_description').'</p>';
+
+$body .= '<p><label>'.elgg_echo("event_calendar:organiser_label").'<br />';
+$body .= elgg_view("input/text",array('internalname' => 'organiser','value'=>$organiser));
+$body .= '</label></p>';
+$body .= '<p class="description">'.$prefix['organiser'].elgg_echo('event_calendar:organiser_description').'</p>';
+
+$body .= '<p><label>'.elgg_echo("event_calendar:event_tags_label").'<br />';
+$body .= elgg_view("input/tags",array('internalname' => 'event_tags','value'=>$event_tags));
+$body .= '</label></p>';
+$body .= '<p class="description">'.$prefix['event_tags'].elgg_echo('event_calendar:event_tags_description').'</p>';
+
+$body .= '<p><label>'.elgg_echo("event_calendar:long_description_label").'<br />';
+$body .= elgg_view("input/longtext",array('internalname' => 'long_description','value'=>$long_description));
+$body .= '</label></p>';
+$body .= '<p class="description">'.$prefix['long_description'].elgg_echo('event_calendar:long_description_description').'</p>';
+
+if($event_calendar_hide_access == 'yes') {
+ $event_calendar_default_access = get_plugin_setting('default_access', 'event_calendar');
+ if($event_calendar_default_access) {
+ $body .= elgg_view("input/hidden",array('internalname' => 'access','value'=>$event_calendar_default_access));
+ } else {
+ $body .= elgg_view("input/hidden",array('internalname' => 'access','value'=>ACCESS_PRIVATE));
+ }
+} else {
+ $body .= '<p><label>'.elgg_echo("access").'<br />';
+ $body .= elgg_view("input/access",array('internalname' => 'access','value'=>$access));
+ $body .= '</label></p>';
+}
+
+print $body;
+?> \ No newline at end of file
diff --git a/views/default/event_calendar/groupprofile_calendar.php b/views/default/event_calendar/groupprofile_calendar.php
new file mode 100644
index 000000000..175098e0c
--- /dev/null
+++ b/views/default/event_calendar/groupprofile_calendar.php
@@ -0,0 +1,42 @@
+<?php
+
+/**
+ * Elgg event_calendar group profile content
+ *
+ * @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/
+ *
+ */
+
+$page_owner_entity = page_owner_entity();
+
+if (event_calendar_activated_for_group($page_owner_entity)) {
+ $num = 5;
+ // Get the upcoming events
+ $start_date = time(); // now
+ $end_date = $start_date + 60*60*24*365*2; // maximum is two years from now
+ $events = event_calendar_get_events_between($start_date,$end_date,false,$num,0,page_owner());
+
+ // If there are any events to view, view them
+ if (is_array($events) && sizeof($events) > 0) {
+
+ echo '<div id="group_pages_widget">';
+ echo '<h2>'.elgg_echo("event_calendar:groupprofile").'</h2>';
+ foreach($events as $event) {
+ echo elgg_view("object/event_calendar",array('entity' => $event));
+ }
+ echo '<div class="forum_latest"><a href="'.$vars['url'].'pg/event_calendar/group/'.page_owner().'">'.elgg_echo('event_calendar:view_calendar').'</a></div>';
+ echo "</div>";
+
+ } else if (get_plugin_setting('group_always_display', 'event_calendar') == 'yes') {
+ echo '<div id="group_pages_widget">';
+ echo '<h2>'.elgg_echo("event_calendar:groupprofile").'</h2>';
+ echo '<div class="forum_latest">'.elgg_echo('event_calendar:no_events_found').'</div>';
+ echo "</div>";
+ }
+}
+
+?> \ No newline at end of file
diff --git a/views/default/event_calendar/input/longtext.php b/views/default/event_calendar/input/longtext.php
new file mode 100644
index 000000000..86b0f3fc4
--- /dev/null
+++ b/views/default/event_calendar/input/longtext.php
@@ -0,0 +1,25 @@
+<?php
+
+ /**
+ * Elgg long text input
+ * Displays a long text input field
+ *
+ * @package Elgg
+ * @subpackage Core
+
+ * @author Curverider Ltd
+
+ * @link http://elgg.org/
+ *
+ * @uses $vars['value'] The current value, if any
+ * @uses $vars['js'] Any Javascript to enter into the input tag
+ * @uses $vars['internalname'] The name of the input field
+ *
+ */
+
+ $class = $vars['class'];
+ if (!$class) $class = "input-textarea";
+
+?>
+
+<textarea class="<?php echo $class; ?>" name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?>><?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?></textarea> \ No newline at end of file
diff --git a/views/default/event_calendar/metatags.php b/views/default/event_calendar/metatags.php
new file mode 100644
index 000000000..8375ef118
--- /dev/null
+++ b/views/default/event_calendar/metatags.php
@@ -0,0 +1,2 @@
+<link rel="stylesheet" href="<?php echo $vars['url']; ?>mod/event_calendar/datepicker.css" type="text/css" media="screen" title="Flora (Default)">
+<script type="text/javascript" src="<?php echo $vars['url']; ?>mod/event_calendar/ui.datepicker.js"></script>
diff --git a/views/default/event_calendar/nav.php b/views/default/event_calendar/nav.php
new file mode 100644
index 000000000..ceedfd485
--- /dev/null
+++ b/views/default/event_calendar/nav.php
@@ -0,0 +1,38 @@
+<?php
+$allselect = ''; $friendsselect = ''; $mineselect = '';
+switch($vars['filter']) {
+ case 'all': $allselect = 'class="selected"';
+ break;
+ case 'friends': $friendsselect = 'class="selected"';
+ break;
+ case 'mine': $mineselect = 'class="selected"';
+ break;
+ case 'open': $openselect = 'class="selected"';
+ break;
+}
+
+$url_start = $vars['url'].'mod/event_calendar/show_events.php?group_guid='.$vars['group_guid'].'&amp;mode='.$vars['mod'].'&amp;start_date='.$vars['start_date'];
+
+?>
+<div id="elgg_horizontal_tabbed_nav">
+ <ul>
+<?php
+$event_calendar_spots_display = get_plugin_setting('spots_display', 'event_calendar');
+if ($event_calendar_spots_display == "yes") {
+?>
+ <li <?php echo $openselect; ?> ><a onclick="javascript:$('#event_list').load('<?php echo $url_start; ?>&amp;filter=open&amp;callback=true'); return false;" href="<?php echo $url_start; ?>&amp;filter=open&amp;callback=true"><?php echo elgg_echo('event_calendar:open'); ?></a></li>
+<?php
+}
+?>
+ <li <?php echo $allselect; ?> ><a onclick="javascript:$('#event_list').load('<?php echo $url_start; ?>&amp;filter=all&amp;callback=true'); return false;" href="<?php echo $url_start; ?>&amp;filter=all&amp;callback=true"><?php echo elgg_echo('all'); ?></a></li>
+ <li <?php echo $friendsselect; ?> ><a onclick="javascript:$('#event_list').load('<?php echo $url_start; ?>&amp;filter=friends&amp;callback=true'); return false;" href="<?php echo $url_start; ?>&amp;filter=friends&amp;callback=true"><?php echo elgg_echo('friends'); ?></a></li>
+ <li <?php echo $mineselect; ?> ><a onclick="javascript:$('#event_list').load('<?php echo $url_start; ?>&amp;filter=mine&amp;callback=true'); return false;" href="<?php echo $url_start; ?>&amp;filter=mine&amp;callback=true"><?php echo elgg_echo('event_calendar:mine'); ?></a></li>
+ </ul>
+</div>
+<?php
+$event_calendar_region_display = get_plugin_setting('region_display', 'event_calendar');
+if ($event_calendar_region_display == 'yes') {
+ $url_start .= '&amp;filter='.$vars['filter'];
+ echo elgg_view('event_calendar/region_select',array('url_start'=>$url_start,'region'=>$vars['region']));
+}
+?> \ No newline at end of file
diff --git a/views/default/event_calendar/paged_footer.php b/views/default/event_calendar/paged_footer.php
new file mode 100644
index 000000000..954769104
--- /dev/null
+++ b/views/default/event_calendar/paged_footer.php
@@ -0,0 +1,4 @@
+<?php
+echo '</tbody></table></div>';
+?>
+
diff --git a/views/default/event_calendar/paged_header.php b/views/default/event_calendar/paged_header.php
new file mode 100644
index 000000000..5f4b8e59c
--- /dev/null
+++ b/views/default/event_calendar/paged_header.php
@@ -0,0 +1,15 @@
+<?php
+$header .= '<div class="event_calendar_paged_header_section">';
+$header .= '<div class="event_calendar_paged_month">'.$vars['date'].'</div>';
+$header .= '<table class="event_calendar_paged_table"><thead><tr>';
+$header .= '<th class="paged_header">'.elgg_echo('event_calendar:paged:column:date').'</th>';
+$header .= '<th class="paged_header">'.elgg_echo('event_calendar:paged:column:time').'</th>';
+$header .= '<th class="paged_header">'.elgg_echo('event_calendar:paged:column:event').'</th>';
+$header .= '<th class="paged_header">'.elgg_echo('event_calendar:paged:column:venue').'</th>';
+if ($vars['personal_manage'] != 'no') {
+ $header .= '<th class="paged_header">'.elgg_echo('event_calendar:paged:column:calendar').'</th>';
+}
+$header .= '</td></thead><tbody>';
+
+echo $header;
+?> \ No newline at end of file
diff --git a/views/default/event_calendar/paged_item_view.php b/views/default/event_calendar/paged_item_view.php
new file mode 100644
index 000000000..77c8bed4e
--- /dev/null
+++ b/views/default/event_calendar/paged_item_view.php
@@ -0,0 +1,29 @@
+<?php
+$event = $vars['event'];
+$time_bit = '';
+if (is_numeric($event->start_time)) {
+ $time_bit = event_calendar_convert_time($event->start_time);
+}
+
+$date_bit = event_calendar_get_formatted_date($event->start_date);
+
+if (event_calendar_has_personal_event($event->guid,get_loggedin_userid())) {
+ $calendar_bit = 'checked = "checked"';
+} else {
+ $calendar_bit = '';
+}
+
+$calendar_bit .= ' onclick="javascript:event_calendar_personal_toggle('.$event->guid.'); return true;" ';
+
+$info = '<tr>';
+$info .= '<td class="event_calendar_paged_date">'.$date_bit.'</td>';
+$info .= '<td class="event_calendar_paged_time">'.$time_bit.'</td>';
+$info .= '<td class="event_calendar_paged_title"><a href="'.$event->getUrl().'">'.$event->title.'</a></td>';
+$info .= '<td class="event_calendar_paged_venue">'.$event->venue.'</td>';
+if ($vars['personal_manage'] != 'no') {
+ $info .= '<td class="event_calendar_paged_calendar"><input id="event_calendar_paged_checkbox_'.$event->guid.'" type="checkbox" '.$calendar_bit.' /></td>';
+}
+$info .= '</tr>';
+
+echo $info;
+?> \ No newline at end of file
diff --git a/views/default/event_calendar/paged_view.php b/views/default/event_calendar/paged_view.php
new file mode 100644
index 000000000..7c2ea2eaa
--- /dev/null
+++ b/views/default/event_calendar/paged_view.php
@@ -0,0 +1,51 @@
+<?php
+$nav = elgg_view('navigation/pagination',array(
+
+// 'baseurl' => $_SERVER['REQUEST_URI'],
+ 'baseurl' => $_SERVER['SCRIPT_NAME'].'/?'.$_SERVER['QUERY_STRING'],
+ 'offset' => $vars['offset'],
+ 'count' => $vars['count'],
+ 'limit' => $vars['limit'],
+
+ ));
+$event_calendar_times = get_plugin_setting('times', 'event_calendar');
+$event_calendar_personal_manage = get_plugin_setting('personal_manage', 'event_calendar');
+$events = $vars['events'];
+$html = '';
+$date_format = 'F Y';
+$current_month = '';
+if ($events) {
+ foreach($events as $event) {
+ $month = date($date_format,$event->start_date);
+ if ($month != $current_month) {
+ if ($html) {
+ $html .= elgg_view('event_calendar/paged_footer');
+ }
+ $html .= elgg_view('event_calendar/paged_header',array('date'=>$month,'personal_manage'=>$event_calendar_personal_manage));
+
+ $current_month = $month;
+ }
+ $html .= elgg_view('event_calendar/paged_item_view',array('event'=>$event,'times'=>$event_calendar_times,'personal_manage'=>$event_calendar_personal_manage));
+ }
+ $html .= elgg_view('event_calendar/paged_footer');
+}
+$msgs = '<div id="event_calendar_paged_messages"></div>';
+$html = $msgs.$nav.'<div class="event_calendar_paged">'.$html.'</div>'.$nav;
+
+echo $html;
+?>
+<script type="text/javascript">
+function event_calendar_personal_toggle(guid) {
+ $.get("<?php echo $vars['url'].'action/event_calendar/toggle_personal_calendar?'.event_calendar_security_fields().'&event_id='; ?>"+guid,
+ function (res) {
+ var flag = res.substring(0,3);
+ var msg = res.substring(3);
+ $('#event_calendar_paged_messages').html(msg);
+ if (flag == '@f@') {
+ // action failed so toggle checkbox
+ $("#event_calendar_paged_checkbox_"+guid).attr('checked',!$("#event_calendar_paged_checkbox_"+guid).attr('checked'));
+ }
+ }
+ );
+}
+</script> \ No newline at end of file
diff --git a/views/default/event_calendar/personal_toggle_js.php b/views/default/event_calendar/personal_toggle_js.php
new file mode 100644
index 000000000..c0611e45c
--- /dev/null
+++ b/views/default/event_calendar/personal_toggle_js.php
@@ -0,0 +1,20 @@
+<?php
+// TODO: put the rest into a JS function
+
+$elgg_ts = time();
+$elgg_token = generate_action_token($elgg_ts);
+$tokens = "&__elgg_ts=$elgg_ts&__elgg_token=$elgg_token";
+?>
+<script type="text/javascript">
+function event_calendar_personal_toggle(event_id,user_id) {
+
+ var link = "<?php echo $vars['url']; ?>action/event_calendar/toggle_personal_calendar?";
+ link += "user_id="+user_id+"&event_id="+event_id+"&other=true";
+ link += "<?php echo $tokens; ?>";
+ $.get(link,
+ function (res) {
+ $('#event_calendar_user_data_'+user_id).html(res);
+ }
+ );
+}
+</script> \ No newline at end of file
diff --git a/views/default/event_calendar/region_select.php b/views/default/event_calendar/region_select.php
new file mode 100644
index 000000000..81407b27d
--- /dev/null
+++ b/views/default/event_calendar/region_select.php
@@ -0,0 +1,23 @@
+<?php
+
+$region_list = trim(get_plugin_setting('region_list', 'event_calendar'));
+// make sure that we are using Unix line endings
+$region_list = str_replace("\r\n","\n",$region_list);
+$region_list = str_replace("\r","\n",$region_list);
+if ($region_list) {
+ $body = '';
+ $options_values = array('-' =>elgg_echo('event_calendar:all'));
+ foreach(explode("\n",$region_list) as $region_item) {
+ $region_item = trim($region_item);
+ $options_values[$region_item] = $region_item;
+ }
+ $js = "onchange=\"javascript:$('#event_list').load('".$vars['url_start']
+ ."&amp;callback=true&region='+escape($('#region').val() ));\"";
+ //$js = "onchange=\"javascript:$('#event_list').load('".$vars['url_start']."&amp;callback=true&region='+$('#region').val());\"";
+ $body .= elgg_echo('event_calendar:region_filter_by_label');
+ $body .= elgg_view("input/pulldown",array('internalid' => 'region','js'=>$js,'value'=>$vars['region'],'options_values'=>$options_values));
+ $body .= '<br />';
+}
+
+echo $body;
+?> \ No newline at end of file
diff --git a/views/default/event_calendar/review_requests.php b/views/default/event_calendar/review_requests.php
new file mode 100644
index 000000000..e1866a32b
--- /dev/null
+++ b/views/default/event_calendar/review_requests.php
@@ -0,0 +1,25 @@
+<?php
+
+foreach($vars['requests'] as $request) {
+ if ($request instanceof ElggUser) {
+ $icon = elgg_view("profile/icon", array(
+ 'entity' => $request,
+ 'size' => 'small'
+ ));
+ $info = '<a href="' . $request->getURL() . '" >'.$request->name.'</a>';
+ $info .= '<div style="margin-top: 5px;" ></div>';
+ $info .= elgg_view('output/confirmlink',
+ array(
+ 'class' => "cancel_button",
+ 'href' => $vars['url'] . 'action/event_calendar/killrequest?user_guid='.$request->guid.'&event_id=' . $vars['entity']->guid,
+ 'confirm' => elgg_echo('event_calendar:request:remove:check'),
+ 'text' => elgg_echo('delete'),
+ ));
+ $info .= '&nbsp;&nbsp;';
+ $url = elgg_add_action_tokens_to_url("{$vars['url']}action/event_calendar/addtocalendar?user_guid={$request->guid}&event_id={$vars['entity']->guid}");
+ $info .= '<a href="'.$url.'" class="add_topic_button">'.elgg_echo('accept').'</a>';
+ echo elgg_view_listing($icon,$info);
+ }
+}
+
+?>
diff --git a/views/default/event_calendar/show_events.php b/views/default/event_calendar/show_events.php
new file mode 100644
index 000000000..31771f43d
--- /dev/null
+++ b/views/default/event_calendar/show_events.php
@@ -0,0 +1,53 @@
+<?php
+/**
+ * Elgg show events view
+ *
+ * @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/
+ *
+ */
+
+$listing_format = $vars['listing_format'];
+
+if ($vars['events']) {
+ if (get_plugin_setting('agenda_view', 'event_calendar') == 'yes') {
+ $event_list = elgg_view('event_calendar/agenda_view',$vars);
+ } else {
+ if ($listing_format == 'paged') {
+ $event_list = elgg_view('event_calendar/paged_view',$vars);
+ } else {
+ $event_list = elgg_view_entity_list($vars['events'], $vars['count'], $vars['offset'], $vars['limit'], false, false);
+ }
+ }
+} else {
+ $event_list = '<p>'.elgg_echo('event_calendar:no_events_found').'</p>';
+}
+if ($listing_format == 'paged') {
+ echo $event_list;
+} else {
+ if (isloggedin()) {
+ $nav = elgg_view('event_calendar/nav',$vars);
+ } else {
+ $nav = '';
+ }
+?>
+<table width="100%">
+<tr><td>
+<div id="event_list">
+<?php
+echo $nav.'<br />'.$event_list;
+?>
+</div>
+</td>
+<td align="right">
+<?php
+echo elgg_view('event_calendar/calendar',$vars);
+?>
+</td></tr>
+</table>
+<?php
+}
+?> \ No newline at end of file
diff --git a/views/default/event_calendar/strapline.php b/views/default/event_calendar/strapline.php
new file mode 100644
index 000000000..15c7c98d9
--- /dev/null
+++ b/views/default/event_calendar/strapline.php
@@ -0,0 +1,18 @@
+<div class="contentWrapper">
+<span class="event_calendar_strapline">
+<?php
+
+ $event = $vars['entity'];
+
+ $time_updated = $event->time_created;
+ $owner_guid = $event->owner_guid;
+ $owner = get_entity($owner_guid);
+
+ echo sprintf(elgg_echo('event_calendar:strapline'),
+ friendly_time($time_updated),
+ "<a href=\"" . $owner->getURL() . "\">" . $owner->name ."</a>"
+ );
+
+?>
+</span>
+</div> \ No newline at end of file
diff --git a/views/default/icon/object/event_calendar/small.php b/views/default/icon/object/event_calendar/small.php
new file mode 100644
index 000000000..d30d14453
--- /dev/null
+++ b/views/default/icon/object/event_calendar/small.php
@@ -0,0 +1,3 @@
+<?php
+ echo $vars['url'] . "mod/event_calendar/images/event_icon.gif";
+?> \ No newline at end of file
diff --git a/views/default/input/datepicker_inline.php b/views/default/input/datepicker_inline.php
new file mode 100644
index 000000000..560074a2d
--- /dev/null
+++ b/views/default/input/datepicker_inline.php
@@ -0,0 +1,52 @@
+<?php
+
+/**
+ * JQuery data picker(inline version)
+ *
+ * @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/
+ *
+ */
+?>
+
+<script language="javascript">
+$(document).ready(function(){
+var done_loading = false;
+$("#<?php echo $vars['internalname']; ?>").datepicker({
+ onChangeMonthYear: function(year, month, inst) {
+ if(inst.onChangeToday){
+ day=inst.selectedDay;
+ }else{
+ day=1;
+ }
+ if (done_loading) {
+ // in this case the mode is forced to month
+ document.location.href = "<?php echo $vars['url'].'mod/event_calendar/show_events.php?mode=month&group_guid='.$vars['group_guid'].'&start_date='; ?>" + year+'-'+month+'-1';
+ }
+ },
+ onSelect: function(date) {
+ // jump to the new page
+ document.location.href = "<?php echo $vars['url'].'mod/event_calendar/show_events.php?mode='.$vars['mode'].'&group_guid='.$vars['group_guid'].'&start_date='; ?>" + date.substring(0,10);
+ },
+ dateFormat: "yy-mm-dd",
+ <?php echo $vars['range_bit']; ?>
+ hideIfNoPrevNext: true,
+ defaultDate: "<?php echo $vars['start_date'] .' - '.$vars['end_date']; ?>",
+ <?php if ($vars['mode'] == 'week') echo 'highlightWeek: true,'; ?>
+ rangeSelect: true
+});
+var start_date = $.datepicker.parseDate("yy-mm-dd", "<?php echo $vars['start_date']; ?>");
+var end_date = $.datepicker.parseDate("yy-mm-dd", "<?php echo $vars['end_date']; ?>");
+// not sure why this is necessary, but it seems to be
+if ("<?php echo $vars['mode'] ?>" == "month") {
+ end_date += 1;
+}
+$("#<?php echo $vars['internalname']; ?>").datepicker("setDate", start_date, end_date);
+var done_loading = true;
+});
+</script>
+<div id="<?php echo $vars['internalname']; ?>" ></div>
+<p style="clear: both;"><!-- See day-by-day example for highlighting days code --></p> \ No newline at end of file
diff --git a/views/default/input/datepicker_popup.php b/views/default/input/datepicker_popup.php
new file mode 100644
index 000000000..8e1120ce7
--- /dev/null
+++ b/views/default/input/datepicker_popup.php
@@ -0,0 +1,30 @@
+<?php
+
+/**
+ * JQuery data picker
+ *
+ * @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/
+ *
+ */
+if ($vars['dateformat']) {
+ $date_format = $vars['dateformat'];
+} else {
+ $date_format = "DD, MM d, yy";
+}
+?>
+
+<script language="javascript">
+$(document).ready(function(){
+$("#<?php echo $vars['internalname']; ?>").datepicker({
+ dateFormat: "<?php echo $date_format; ?>",
+ showOn: "both",
+ buttonImage: "<?php echo $vars['url']; ?>mod/event_calendar/images/calendar.gif",
+ buttonImageOnly: true
+})
+});
+</script>
+<input type="text" size="30" value="<?php echo $vars['value']; ?>" name="<?php echo $vars['internalname']; ?>" id="<?php echo $vars['internalname']; ?>"/> \ No newline at end of file
diff --git a/views/default/input/timepicker.php b/views/default/input/timepicker.php
new file mode 100644
index 000000000..35fa5ac98
--- /dev/null
+++ b/views/default/input/timepicker.php
@@ -0,0 +1,38 @@
+<?php
+
+$time_format = get_plugin_setting('timeformat', 'event_calendar');
+if (!$time_format) {
+ $time_format = 24;
+}
+
+$value = $vars['value'];
+if (is_numeric($value)) {
+ $hour = floor($value/60);
+ $minute = ($value -60*$hour);
+
+ // add 1 to avoid pulldown 0 bug
+ $hour++;
+ $minute++;
+} else {
+ $hour = '-';
+ $minute = '-';
+}
+
+$hours = array();
+$hours['-'] = '-';
+
+for($i=0;$i<$time_format;$i++) {
+ $hours[$i+1] = $i;
+}
+
+$minutes = array();
+$minutes['-'] = '-';
+
+for($i=0;$i<60;$i=$i+5) {
+ $minutes[$i+1] = sprintf("%02d",$i);
+}
+
+echo elgg_view('input/pulldown',array('internalname'=>$vars['internalname'].'_h','value'=>$hour,'options_values'=>$hours));
+echo elgg_view('input/pulldown',array('internalname'=>$vars['internalname'].'_m','value'=>$minute,'options_values'=>$minutes));
+
+?> \ No newline at end of file
diff --git a/views/default/object/event_calendar.php b/views/default/object/event_calendar.php
new file mode 100644
index 000000000..70560bd2d
--- /dev/null
+++ b/views/default/object/event_calendar.php
@@ -0,0 +1,66 @@
+<?php
+
+/**
+ * Elgg event_calendar object view
+ *
+ * @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/
+ *
+ */
+
+$event = $vars['entity'];
+
+
+if ($vars['full']) {
+ $body = elgg_view('event_calendar/strapline',$vars);
+ $event_items = event_calendar_get_formatted_full_items($event);
+ $body .= '<div class="contentWrapper" >';
+
+ foreach($event_items as $item) {
+ $value = $item->value;
+ if (!empty($value)) {
+
+ //This function controls the alternating class
+ $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even';
+ $body .= "<p class=\"{$even_odd}\"><b>";
+ $body .= $item->title.':</b> ';
+ $body .= $item->value;
+
+ }
+ }
+ echo $body;
+ if ($event->long_description) {
+ echo '<p>'.$event->long_description.'</p>';
+ } else {
+ echo '<p>'.$event->description.'</p>';
+ }
+ echo '</div>';
+ if (get_plugin_setting('add_to_group_calendar', 'event_calendar') == 'yes') {
+ echo elgg_view('event_calendar/forms/add_to_group',array('event' => $event));
+ }
+} else {
+ $time_bit = event_calendar_get_formatted_time($event);
+ $icon = elgg_view(
+ "graphics/icon", array(
+ 'entity' => $vars['entity'],
+ 'size' => 'small',
+ )
+ );
+ $info .= '<p><b><a href="'.$event->getUrl().'">'.$event->title.'</a></b>';
+ $info .= '<br />'.$time_bit;
+ if ($event->description) {
+ $info .= '<br /><br />'.$event->description;
+ }
+
+ if ($event_calendar_venue_view = get_plugin_setting('venue_view', 'event_calendar') == 'yes') {
+ $info .= '<br />'.$event->venue;
+ }
+ $info .= '</p>';
+
+ echo elgg_view_listing($icon, $info);
+}
+
+?> \ No newline at end of file
diff --git a/views/default/river/object/event_calendar/create.php b/views/default/river/object/event_calendar/create.php
new file mode 100644
index 000000000..f144ca610
--- /dev/null
+++ b/views/default/river/object/event_calendar/create.php
@@ -0,0 +1,12 @@
+<?php
+
+ $performed_by = get_entity($vars['item']->subject_guid);
+ $object = get_entity($vars['item']->object_guid);
+
+ $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
+ $string = sprintf(elgg_echo("event_calendar:river:created"),$url) . " ";
+ $string .= elgg_echo("event_calendar:river:create")." <a href=\"" . $object->getURL() . "\">" . $object->title . "</a>";
+
+?>
+
+<?php echo $string; ?> \ No newline at end of file
diff --git a/views/default/river/object/event_calendar/update.php b/views/default/river/object/event_calendar/update.php
new file mode 100644
index 000000000..5a5d376b1
--- /dev/null
+++ b/views/default/river/object/event_calendar/update.php
@@ -0,0 +1,12 @@
+<?php
+
+ $performed_by = get_entity($vars['item']->subject_guid);
+ $object = get_entity($vars['item']->object_guid);
+
+ $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
+ $string = sprintf(elgg_echo("event_calendar:river:updated"),$url) . " ";
+ $string .= elgg_echo("event_calendar:river:the_event")." <a href=\"" . $object->getURL() . "\">" . $object->title . "</a>";
+
+?>
+
+<?php echo $string; ?> \ No newline at end of file
diff --git a/views/default/settings/event_calendar/edit.php b/views/default/settings/event_calendar/edit.php
new file mode 100644
index 000000000..429a85b26
--- /dev/null
+++ b/views/default/settings/event_calendar/edit.php
@@ -0,0 +1,363 @@
+<?php
+$yn_options = array(elgg_echo('event_calendar:settings:yes')=>'yes',
+ elgg_echo('event_calendar:settings:no')=>'no',
+);
+
+$access_options = array( ACCESS_PRIVATE => elgg_echo("PRIVATE"),
+ ACCESS_LOGGED_IN => elgg_echo("LOGGED_IN"),
+ ACCESS_PUBLIC => elgg_echo("PUBLIC"));
+
+// TODO - merge the agenda view into the list format options
+
+$listing_options = array(elgg_echo('event_calendar:settings:paged')=>'paged',
+ elgg_echo('event_calendar:settings:month')=>'month',
+);
+
+$body = '';
+
+$event_calendar_hide_access = get_plugin_setting('hide_access', 'event_calendar');
+if (!$event_calendar_hide_access) {
+ $event_calendar_hide_access = 'no';
+}
+
+$body .= elgg_echo('event_calendar:settings:hide_access:title');
+$body .= '<br />';
+$body .= elgg_view('input/radio',array('internalname'=>'params[hide_access]','value'=>$event_calendar_hide_access,'options'=>$yn_options));
+
+$body .= '<br />';
+
+$event_calendar_default_access = get_plugin_setting('default_access', 'event_calendar');
+if (!$event_calendar_default_access) {
+ $event_calendar_default_access = ACCESS_LOGGED_IN;
+}
+
+$body .= elgg_echo('event_calendar:settings:default_access:title');
+$body .= '<br />';
+$body .= elgg_view('input/pulldown',array('internalname'=>'params[default_access]','value'=>$event_calendar_default_access,'options_values'=>$access_options));
+
+$body .= '<br /><br />';
+
+$event_calendar_hide_end = get_plugin_setting('hide_end', 'event_calendar');
+if (!$event_calendar_hide_end) {
+ $event_calendar_hide_end = 'no';
+}
+
+$body .= elgg_echo('event_calendar:settings:hide_end:title');
+$body .= '<br />';
+$body .= elgg_view('input/radio',array('internalname'=>'params[hide_end]','value'=>$event_calendar_hide_end,'options'=>$yn_options));
+
+$body .= '<br />';
+
+$event_calendar_listing_format = get_plugin_setting('listing_format', 'event_calendar');
+if (!$event_calendar_listing_format) {
+ $event_calendar_listing_format = 'month';
+}
+
+$body .= elgg_echo('event_calendar:settings:listing_format:title');
+$body .= '<br />';
+$body .= elgg_view('input/radio',array('internalname'=>'params[listing_format]','value'=>$event_calendar_listing_format,'options'=>$listing_options));
+
+$body .= '<br />';
+
+$event_calendar_times = get_plugin_setting('times', 'event_calendar');
+if (!$event_calendar_times) {
+ $event_calendar_times = 'no';
+}
+
+$body .= elgg_echo('event_calendar:settings:times:title');
+$body .= '<br />';
+$body .= elgg_view('input/radio',array('internalname'=>'params[times]','value'=>$event_calendar_times,'options'=>$yn_options));
+
+$body .= '<br />';
+
+$event_calendar_autopersonal = get_plugin_setting('autopersonal', 'event_calendar');
+if (!$event_calendar_autopersonal) {
+ $event_calendar_autopersonal = 'yes';
+}
+
+$body .= elgg_echo('event_calendar:settings:autopersonal:title');
+$body .= '<br />';
+$body .= elgg_view('input/radio',array('internalname'=>'params[autopersonal]','value'=>$event_calendar_autopersonal,'options'=>$yn_options));
+
+$body .= '<br />';
+
+$event_calendar_autogroup = get_plugin_setting('autogroup', 'event_calendar');
+if (!$event_calendar_autogroup) {
+ $event_calendar_autogroup = 'no';
+}
+
+$body .= elgg_echo('event_calendar:settings:autogroup:title');
+$body .= '<br />';
+$body .= elgg_view('input/radio',array('internalname'=>'params[autogroup]','value'=>$event_calendar_autogroup,'options'=>$yn_options));
+
+$body .= '<br />';
+
+$event_calendar_add_to_group_calendar = get_plugin_setting('add_to_group_calendar', 'event_calendar');
+if (!$event_calendar_add_to_group_calendar) {
+ $event_calendar_add_to_group_calendar = 'no';
+}
+
+$body .= elgg_echo('event_calendar:settings:add_to_group_calendar:title');
+$body .= '<br />';
+$body .= elgg_view('input/radio',array('internalname'=>'params[add_to_group_calendar]','value'=>$event_calendar_add_to_group_calendar,'options'=>$yn_options));
+
+$body .= '<br />';
+
+$event_calendar_agenda_view = get_plugin_setting('agenda_view', 'event_calendar');
+if (!$event_calendar_agenda_view) {
+ $event_calendar_agenda_view = 'no';
+}
+
+$body .= elgg_echo('event_calendar:settings:agenda_view:title');
+$body .= '<br />';
+$body .= elgg_view('input/radio',array('internalname'=>'params[agenda_view]','value'=>$event_calendar_agenda_view,'options'=>$yn_options));
+
+$body .= '<br />';
+
+$event_calendar_venue_view = get_plugin_setting('venue_view', 'event_calendar');
+if (!$event_calendar_venue_view) {
+ $event_calendar_venue_view = 'no';
+}
+
+$body .= elgg_echo('event_calendar:settings:venue_view:title');
+$body .= '<br />';
+$body .= elgg_view('input/radio',array('internalname'=>'params[venue_view]','value'=>$event_calendar_venue_view,'options'=>$yn_options));
+
+$body .= '<br />';
+
+$options = array(elgg_echo('event_calendar:settings:no')=>'no',
+ elgg_echo('event_calendar:settings:site_calendar:admin')=>'admin',
+ elgg_echo('event_calendar:settings:site_calendar:loggedin')=>'loggedin',
+);
+
+$event_calendar_site_calendar = get_plugin_setting('site_calendar', 'event_calendar');
+if (!$event_calendar_site_calendar) {
+ $event_calendar_site_calendar = 'admin';
+}
+
+$body .= elgg_echo('event_calendar:settings:site_calendar:title').'<br />';
+$body .= elgg_view('input/radio',array('internalname'=>'params[site_calendar]','value'=>$event_calendar_site_calendar,'options'=>$options));
+
+$body .= '<br />';
+
+$options = array(elgg_echo('event_calendar:settings:no')=>'no',
+ elgg_echo('event_calendar:settings:group_calendar:admin')=>'admin',
+ elgg_echo('event_calendar:settings:group_calendar:members')=>'members',
+);
+
+$event_calendar_group_calendar = get_plugin_setting('group_calendar', 'event_calendar');
+if (!$event_calendar_group_calendar) {
+ $event_calendar_group_calendar = 'members';
+}
+
+$body .= elgg_echo('event_calendar:settings:group_calendar:title').'<br />';
+$body .= elgg_view('input/radio',array('internalname'=>'params[group_calendar]','value'=>$event_calendar_group_calendar,'options'=>$options));
+
+$body .= '<br />';
+
+$options = array(elgg_echo('event_calendar:settings:group_default:yes')=>'yes',
+ elgg_echo('event_calendar:settings:group_default:no')=>'no',
+);
+
+$event_calendar_group_default = get_plugin_setting('group_default', 'event_calendar');
+if (!$event_calendar_group_default) {
+ $event_calendar_group_default = 'yes';
+}
+
+$body .= elgg_echo('event_calendar:settings:group_default:title');
+$body .= '<br />';
+$body .= elgg_view('input/radio',array('internalname'=>'params[group_default]','value'=>$event_calendar_group_default,'options'=>$options));
+
+$body .= '<br />';
+
+$event_calendar_group_always_display = get_plugin_setting('group_always_display', 'event_calendar');
+if (!$event_calendar_group_always_display) {
+ $event_calendar_group_always_display = 'no';
+}
+
+$body .= elgg_echo('event_calendar:settings:group_always_display:title');
+$body .= '<br />';
+$body .= elgg_view('input/radio',array('internalname'=>'params[group_always_display]','value'=>$event_calendar_group_always_display,'options'=>$yn_options));
+
+$body .= '<br />';
+
+$options = array(elgg_echo('event_calendar:settings:group_profile_display_option:left')=>'left',
+ elgg_echo('event_calendar:settings:group_profile_display_option:right')=>'right',
+ elgg_echo('event_calendar:settings:group_profile_display_option:none')=>'none',
+);
+
+$event_calendar_group_profile_display = get_plugin_setting('group_profile_display', 'event_calendar');
+if (!$event_calendar_group_profile_display) {
+ $event_calendar_group_profile_display = 'right';
+}
+
+$body .= elgg_echo('event_calendar:settings:group_profile_display:title').'<br />';
+$body .= elgg_view('input/radio',array('internalname'=>'params[group_profile_display]','value'=>$event_calendar_group_profile_display,'options'=>$options));
+
+$body .= '<br />';
+
+$event_calendar_add_users = get_plugin_setting('add_users', 'event_calendar');
+if (!$event_calendar_add_users) {
+ $event_calendar_add_users = 'no';
+}
+
+$body .= elgg_echo('event_calendar:settings:add_users:title');
+$body .= '<br />';
+$body .= elgg_view('input/radio',array('internalname'=>'params[add_users]','value'=>$event_calendar_add_users,'options'=>$yn_options));
+
+$body .= '<br />';
+
+$event_calendar_add_users_notify = get_plugin_setting('add_users_notify', 'event_calendar');
+if (!$event_calendar_add_users_notify) {
+ $event_calendar_add_users_notify = 'no';
+}
+
+$body .= elgg_echo('event_calendar:settings:add_users_notify:title');
+$body .= '<br />';
+$body .= elgg_view('input/radio',array('internalname'=>'params[add_users_notify]','value'=>$event_calendar_add_users_notify,'options'=>$yn_options));
+
+$body .= '<br />';
+
+$event_calendar_personal_manage = get_plugin_setting('personal_manage', 'event_calendar');
+if (!$event_calendar_personal_manage) {
+ $event_calendar_personal_manage = 'yes';
+}
+
+$body .= elgg_echo('event_calendar:settings:personal_manage:title');
+$body .= '<br />';
+$body .= elgg_view('input/radio',array('internalname'=>'params[personal_manage]','value'=>$event_calendar_personal_manage,'options'=>$yn_options));
+
+$body .= '<br />';
+
+$event_calendar_spots_display = get_plugin_setting('spots_display', 'event_calendar');
+if (!$event_calendar_spots_display) {
+ $event_calendar_spots_display = 'no';
+}
+
+$body .= elgg_echo('event_calendar:settings:spots_display:title');
+$body .= '<br />';
+$body .= elgg_view('input/radio',array('internalname'=>'params[spots_display]','value'=>$event_calendar_spots_display,'options'=>$yn_options));
+
+$body .= '<br />';
+
+$event_calendar_no_collisions = get_plugin_setting('no_collisions', 'event_calendar');
+if (!$event_calendar_no_collisions) {
+ $event_calendar_no_collisions = 'no';
+}
+
+$body .= elgg_echo('event_calendar:settings:no_collisions:title');
+$body .= '<br />';
+$body .= elgg_view('input/radio',array('internalname'=>'params[no_collisions]','value'=>$event_calendar_no_collisions,'options'=>$yn_options));
+
+$body .= '<br />';
+
+$event_calendar_collision_length = get_plugin_setting('collision_length', 'event_calendar');
+if (!$event_calendar_collision_length) {
+ $event_calendar_collision_length = '3600';
+}
+
+$body .= elgg_echo('event_calendar:settings:collision_length:title');
+$body .= '<br />';
+$body .= elgg_view('input/text',array('internalname'=>'params[collision_length]','value'=>$event_calendar_collision_length));
+
+$body .= '<br /><br />';
+
+$event_calendar_region_display = get_plugin_setting('region_display', 'event_calendar');
+if (!$event_calendar_region_display) {
+ $event_calendar_region_display = 'no';
+}
+
+$body .= elgg_echo('event_calendar:settings:region_display:title');
+$body .= '<br />';
+$body .= elgg_view('input/radio',array('internalname'=>'params[region_display]','value'=>$event_calendar_region_display,'options'=>$yn_options));
+
+$body .= '<br />';
+
+$event_calendar_region_list = get_plugin_setting('region_list', 'event_calendar');
+if (!$event_calendar_region_list) {
+ $event_calendar_region_list = '';
+}
+
+$body .= elgg_echo('event_calendar:settings:region_list:title');
+$body .= '<br />';
+$body .= elgg_view('event_calendar/input/longtext',array('internalname'=>'params[region_list]','value'=>$event_calendar_region_list));
+
+$body .= '<br />';
+
+$event_calendar_region_list_handles = get_plugin_setting('region_list_handles', 'event_calendar');
+if (!$event_calendar_region_list_handles) {
+ $event_calendar_region_list_handles = 'no';
+}
+
+$body .= elgg_echo('event_calendar:settings:region_list_handles:title');
+$body .= '<br />';
+$body .= elgg_view('input/radio',array('internalname'=>'params[region_list_handles]','value'=>$event_calendar_region_list_handles,'options'=>$yn_options));
+
+$body .= '<br />';
+
+$event_calendar_type_display = get_plugin_setting('type_display', 'event_calendar');
+if (!$event_calendar_type_display) {
+ $event_calendar_type_display = 'no';
+}
+
+$body .= elgg_echo('event_calendar:settings:type_display:title');
+$body .= '<br />';
+$body .= elgg_view('input/radio',array('internalname'=>'params[type_display]','value'=>$event_calendar_type_display,'options'=>$yn_options));
+
+$body .= '<br />';
+
+$event_calendar_type_list = get_plugin_setting('type_list', 'event_calendar');
+if (!$event_calendar_type_list) {
+ $event_calendar_type_list = '';
+}
+
+$body .= elgg_echo('event_calendar:settings:type_list:title');
+$body .= '<br />';
+$body .= elgg_view('event_calendar/input/longtext',array('internalname'=>'params[type_list]','value'=>$event_calendar_type_list));
+
+$body .= '<br />';
+
+$event_calendar_type_list_handles = get_plugin_setting('type_list_handles', 'event_calendar');
+if (!$event_calendar_type_list_handles) {
+ $event_calendar_type_list_handles = 'no';
+}
+
+$body .= elgg_echo('event_calendar:settings:type_list_handles:title');
+$body .= '<br />';
+$body .= elgg_view('input/radio',array('internalname'=>'params[type_list_handles]','value'=>$event_calendar_type_list_handles,'options'=>$yn_options));
+
+$body .= '<br />';
+
+$event_calendar_first_date = get_plugin_setting('first_date', 'event_calendar');
+if (!$event_calendar_first_date) {
+ $event_calendar_first_date = '';
+}
+
+$body .= elgg_echo('event_calendar:settings:first_date:title');
+$body .= '<br />';
+$body .= elgg_view('input/text',array('internalname'=>'params[first_date]','value'=>$event_calendar_first_date));
+
+$body .= '<br /><br />';
+
+$event_calendar_last_date = get_plugin_setting('last_date', 'event_calendar');
+if (!$event_calendar_last_date) {
+ $event_calendar_last_date = '';
+}
+
+$body .= elgg_echo('event_calendar:settings:last_date:title');
+$body .= '<br />';
+$body .= elgg_view('input/text',array('internalname'=>'params[last_date]','value'=>$event_calendar_last_date));
+
+$body .= '<br /><br />';
+
+$event_calendar_more_required = get_plugin_setting('more_required', 'event_calendar');
+if (!$event_calendar_more_required) {
+ $event_calendar_more_required = 'no';
+}
+
+$body .= elgg_echo('event_calendar:settings:more_required:title');
+$body .= '<br />';
+$body .= elgg_view('input/radio',array('internalname'=>'params[more_required]','value'=>$event_calendar_more_required,'options'=>$yn_options));
+
+echo $body;
+?> \ No newline at end of file
diff --git a/views/default/widgets/event_calendar/edit.php b/views/default/widgets/event_calendar/edit.php
new file mode 100644
index 000000000..716920c8a
--- /dev/null
+++ b/views/default/widgets/event_calendar/edit.php
@@ -0,0 +1,35 @@
+<?php
+
+/**
+ * Elgg event_calendar group 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/
+ *
+ */
+
+if (!$vars['entity']->num_display) {
+ $num_display = 5;
+} else {
+ $num_display = $vars['entity']->num_display;
+}
+?>
+
+<p>
+ <?php echo elgg_echo("event_calendar:num_display"); ?>:
+ <select name="params[num_display]">
+ <option value="1" <?php if($num_display == 1) echo "SELECTED"; ?>>1</option>
+ <option value="2" <?php if($num_display == 2) echo "SELECTED"; ?>>2</option>
+ <option value="3" <?php if($num_display == 3) echo "SELECTED"; ?>>3</option>
+ <option value="4" <?php if($num_display == 4) echo "SELECTED"; ?>>4</option>
+ <option value="5" <?php if($num_display == 5) echo "SELECTED"; ?>>5</option>
+ <option value="6" <?php if($num_display == 6) echo "SELECTED"; ?>>6</option>
+ <option value="7" <?php if($num_display == 7) echo "SELECTED"; ?>>7</option>
+ <option value="8" <?php if($num_display == 8) echo "SELECTED"; ?>>8</option>
+ <option value="9" <?php if($num_display == 9) echo "SELECTED"; ?>>9</option>
+ <option value="10" <?php if($num_display == 10) echo "SELECTED"; ?>>10</option>
+ </select>
+</p>
diff --git a/views/default/widgets/event_calendar/view.php b/views/default/widgets/event_calendar/view.php
new file mode 100644
index 000000000..12fff6d60
--- /dev/null
+++ b/views/default/widgets/event_calendar/view.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
+ require_once(dirname(dirname(dirname(dirname(dirname(__FILE__)))))."/models/model.php");
+
+ //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(page_owner(),$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
diff --git a/views/rss/event_calendar/show_events.php b/views/rss/event_calendar/show_events.php
new file mode 100644
index 000000000..0b2fe5b70
--- /dev/null
+++ b/views/rss/event_calendar/show_events.php
@@ -0,0 +1,16 @@
+<?php
+/**
+ * Elgg show events RSS view
+ *
+ * @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 2009
+ * @link http://radagast.biz/
+ *
+ */
+
+if ($vars['events']) {
+ echo elgg_view_entity_list($vars['events'], $vars['count'], $vars['offset'], $vars['limit'], false, false);
+}
+?> \ No newline at end of file
diff --git a/views/rss/object/event_calendar.php b/views/rss/object/event_calendar.php
new file mode 100644
index 000000000..92f6fcc14
--- /dev/null
+++ b/views/rss/object/event_calendar.php
@@ -0,0 +1,60 @@
+<?php
+
+ /**
+ * Elgg default object view
+ *
+ * @package Elgg
+ * @subpackage Core
+
+ * @author Curverider Ltd
+
+ * @link http://elgg.org/
+ */
+
+ $title = $vars['entity']->title;
+
+ $event_items = event_calendar_get_formatted_full_items($vars['entity']);
+ $items = array();
+ foreach($event_items as $item) {
+ if (trim($item->value)) {
+ $items[] = '<b>'.$item->title.'</b>: '.$item->value;
+ }
+ }
+
+ $description = '<p>'.implode('<br />',$items).'</p>';
+
+ if ($vars['entity']->long_description) {
+ $description .= '<p>'.autop($vars['entity']->long_description).'</p>';
+ } else {
+ $description .= '<p>'.$vars['entity']->description.'</p>';
+ }
+
+?>
+
+ <item>
+ <guid isPermaLink='true'><?php echo htmlspecialchars($vars['entity']->getURL()); ?></guid>
+ <link><?php echo htmlspecialchars($vars['entity']->getURL()); ?></link>
+ <title><![CDATA[<?php echo $title; ?>]]></title>
+ <description><![CDATA[<?php echo $description; ?>]]></description>
+ <?php
+ $owner = $vars['entity']->getOwnerEntity();
+ if ($owner)
+ {
+?>
+ <dc:creator><?php echo $owner->name; ?></dc:creator>
+<?php
+ }
+ ?>
+ <?php
+ if (
+ ($vars['entity'] instanceof Locatable) &&
+ ($vars['entity']->getLongitude()) &&
+ ($vars['entity']->getLatitude())
+ ) {
+ ?>
+ <georss:point><?php echo $vars['entity']->getLatitude(); ?> <?php echo $vars['entity']->getLongitude(); ?></georss:point>
+ <?php
+ }
+ ?>
+ <?php echo elgg_view('extensions/item'); ?>
+ </item>