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/calendar.php19
-rw-r--r--views/default/event_calendar/css.php23
-rw-r--r--views/default/event_calendar/filter_menu.php54
-rw-r--r--views/default/event_calendar/group_module.php43
-rw-r--r--views/default/event_calendar/groupprofile_calendar.php4
-rw-r--r--views/default/event_calendar/show_events.php33
6 files changed, 141 insertions, 35 deletions
diff --git a/views/default/event_calendar/calendar.php b/views/default/event_calendar/calendar.php
index ebf4aa589..ea12ff603 100644
--- a/views/default/event_calendar/calendar.php
+++ b/views/default/event_calendar/calendar.php
@@ -4,7 +4,15 @@ if ($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=';
+
+# event_calendar/list/<start_date>/<display_mode>/<filter_context>/<region>
+if ($vars['group_guid']) {
+ $link_bit = $vars['url']."event_calendar/group/{$vars['group_guid']}/{$vars['original_start_date']}/%s";
+} else {
+ $link_bit = $vars['url']."event_calendar/list/{$vars['original_start_date']}/%s/{$vars['filter']}";
+}
+
+#$link_bit = "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'];
@@ -27,7 +35,7 @@ if ($first_date || $last_date) {
$body .= elgg_view("input/datepicker_inline",
array(
- 'internalname' => 'my_datepicker',
+ 'name' => 'my_datepicker',
'mode' => $vars['mode']?$vars['mode']:'month',
'start_date' => $vars['start_date'],
'end_date' => $vars['end_date'],
@@ -35,6 +43,7 @@ $body .= elgg_view("input/datepicker_inline",
'range_bit' => $range_bit,
)
);
+
$body .= '<div id="calendarmenucontainer">';
$body .= '<ul id="calendarmenu">';
if ($mode == 'day') {
@@ -42,19 +51,19 @@ if ($mode == 'day') {
} else {
$link_class = '';
}
-$body .= '<li'.$link_class.'><a href="'.$link_bit.'day">'.elgg_echo('event_calendar:day_label').'</a></li>';
+$body .= '<li'.$link_class.'><a href="'.sprintf($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>';
+$body .= '<li'.$link_class.'><a href="'.sprintf($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 .= '<li'.$link_class.'><a href="'.sprintf($link_bit,'month').'">'.elgg_echo('event_calendar:month_label').'</a></li>';
$body .= '</ul>';
$body .= '</div>';
echo $body;
diff --git a/views/default/event_calendar/css.php b/views/default/event_calendar/css.php
index 359fd1e13..7e399c547 100644
--- a/views/default/event_calendar/css.php
+++ b/views/default/event_calendar/css.php
@@ -6,18 +6,9 @@ $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;
+#calendarmenucontainer {
+ position:relative;
+ left: 40px;
}
ul#calendarmenu li {
@@ -52,6 +43,12 @@ td.ui-datepicker-unselectable {
color: #888888 !important;
}
+#my_datepicker .week-highlight a {
+ text-decoration: none;
+ color: #FFFFFF;
+ background: <?php echo $highlight_colour; ?>;
+}
+
.river_object_event_calendar_create {
background: url(<?php echo $vars['url']; ?>mod/event_calendar/images/river_icon_event.gif) no-repeat left -1px;
}
@@ -59,7 +56,7 @@ td.ui-datepicker-unselectable {
background: url(<?php echo $vars['url']; ?>mod/event_calendar/images/river_icon_event.gif) no-repeat left -1px;
}
#event_list {
- width:440px;
+ width:510px;
margin:0;
float:left;
padding:5px 0 0 0;
diff --git a/views/default/event_calendar/filter_menu.php b/views/default/event_calendar/filter_menu.php
new file mode 100644
index 000000000..62d38939b
--- /dev/null
+++ b/views/default/event_calendar/filter_menu.php
@@ -0,0 +1,54 @@
+<?php
+// generate a list of filter tabs
+$group_guid = $vars['group_guid'];
+$filter_context = $vars['filter'];
+if ($group_guid) {
+ $url_start = "event_calendar/group/{$group_guid}/{$vars['start_date']}/{$vars['mode']}";
+} else {
+ $url_start = "event_calendar/list/{$vars['start_date']}/{$vars['mode']}";
+}
+
+$tabs = array(
+ 'all' => array(
+ 'text' => elgg_echo('all'),
+ 'href' => "$url_start/all",
+ 'selected' => ($filter_context == 'all'),
+ 'priority' => 200,
+ ),
+ 'mine' => array(
+ 'text' => elgg_echo('mine'),
+ 'href' => "$url_start/mine",
+ 'selected' => ($filter_context == 'mine'),
+ 'priority' => 300,
+ ),
+ 'friend' => array(
+ 'text' => elgg_echo('friends'),
+ 'href' => "$url_start/friends",
+ 'selected' => ($filter_context == 'friends'),
+ 'priority' => 400,
+ ),
+);
+
+$event_calendar_spots_display = elgg_get_plugin_setting('spots_display', 'event_calendar');
+if ($event_calendar_spots_display == "yes") {
+ $tabs['open'] = array(
+ 'text' => elgg_echo('event_calendar:open'),
+ 'href' => "$url_start/open",
+ 'selected' => ($filter_context == 'open'),
+ 'priority' => 100,
+ );
+}
+
+foreach ($tabs as $name => $tab) {
+ $tab['name'] = $name;
+
+ elgg_register_menu_item('filter', $tab);
+}
+
+echo elgg_view_menu('filter', array('sort_by' => 'priority', 'class' => 'elgg-menu-hz'));
+
+$event_calendar_region_display = elgg_get_plugin_setting('region_display', 'event_calendar');
+if ($event_calendar_region_display == 'yes') {
+ $url_start .= "/$filter_context";
+ 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/group_module.php b/views/default/event_calendar/group_module.php
new file mode 100644
index 000000000..5fc644e8b
--- /dev/null
+++ b/views/default/event_calendar/group_module.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Group event calendar module
+ */
+
+$group = elgg_get_page_owner_entity();
+
+if ($group->event_calendar_enable == "no") {
+ return true;
+}
+
+$all_link = elgg_view('output/url', array(
+ 'href' => "event_calendar/group/$group->guid/all",
+ 'text' => elgg_echo('link:view:all'),
+));
+
+elgg_push_context('widgets');
+$options = array(
+ 'type' => 'object',
+ 'subtype' => 'event_calendar',
+ 'container_guid' => elgg_get_page_owner_guid(),
+ 'limit' => 6,
+ 'full_view' => false,
+ 'pagination' => false,
+);
+$content = elgg_list_entities($options);
+elgg_pop_context();
+
+if (!$content) {
+ $content = '<p>' . elgg_echo('event_calendar:no_events_found') . '</p>';
+}
+
+$new_link = elgg_view('output/url', array(
+ 'href' => "event_calendar/add/$group->guid",
+ 'text' => elgg_echo('event_calendar:new'),
+));
+
+echo elgg_view('groups/profile/module', array(
+ 'title' => elgg_echo('event_calendar:group'),
+ 'content' => $content,
+ 'all_link' => $all_link,
+ 'add_link' => $new_link,
+));
diff --git a/views/default/event_calendar/groupprofile_calendar.php b/views/default/event_calendar/groupprofile_calendar.php
index 175098e0c..826fafa67 100644
--- a/views/default/event_calendar/groupprofile_calendar.php
+++ b/views/default/event_calendar/groupprofile_calendar.php
@@ -11,7 +11,9 @@
*
*/
-$page_owner_entity = page_owner_entity();
+elgg_load_library('elgg:event_calendar');
+
+$page_owner_entity = elgg_get_page_owner_entity();
if (event_calendar_activated_for_group($page_owner_entity)) {
$num = 5;
diff --git a/views/default/event_calendar/show_events.php b/views/default/event_calendar/show_events.php
index 31771f43d..580fb5a45 100644
--- a/views/default/event_calendar/show_events.php
+++ b/views/default/event_calendar/show_events.php
@@ -13,13 +13,22 @@
$listing_format = $vars['listing_format'];
if ($vars['events']) {
- if (get_plugin_setting('agenda_view', 'event_calendar') == 'yes') {
+ if (elgg_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);
+ $options = array(
+ 'list_class' => 'elgg-list-entity',
+ 'full_view' => FALSE,
+ 'pagination' => TRUE,
+ 'list_type' => 'listing',
+ 'list_type_toggle' => FALSE,
+ 'offset' => $vars['offset'],
+ 'limit' => $vars['limit'],
+ );
+ $event_list = elgg_view_entity_list($vars['events'], $options);
}
}
} else {
@@ -28,26 +37,18 @@ if ($vars['events']) {
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">
+<div style="width:100%">
+<div id="event_list" style="float:left;">
<?php
-echo $nav.'<br />'.$event_list;
+echo $event_list;
?>
</div>
-</td>
-<td align="right">
+<div style="float:right;">
<?php
echo elgg_view('event_calendar/calendar',$vars);
?>
-</td></tr>
-</table>
+</div>
+</div>
<?php
}
-?> \ No newline at end of file