aboutsummaryrefslogtreecommitdiff
path: root/views/default/event_calendar
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/event_calendar')
-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
26 files changed, 1159 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