From 2557245a41579a15dd960e2033f4d5f39ff566ac Mon Sep 17 00:00:00 2001 From: Kevin Jardine Date: Mon, 29 Aug 2011 20:59:54 +0200 Subject: first step in rewrite for Elgg 1.8 --- views/default/event_calendar/calendar.php | 19 ++++++-- views/default/event_calendar/css.php | 23 ++++----- views/default/event_calendar/filter_menu.php | 54 ++++++++++++++++++++++ views/default/event_calendar/group_module.php | 43 +++++++++++++++++ .../event_calendar/groupprofile_calendar.php | 4 +- views/default/event_calendar/show_events.php | 33 ++++++------- 6 files changed, 141 insertions(+), 35 deletions(-) create mode 100644 views/default/event_calendar/filter_menu.php create mode 100644 views/default/event_calendar/group_module.php (limited to 'views/default/event_calendar') 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//// +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 .= '
'; $body .= ''; $body .= '
'; 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: ; +} + .river_object_event_calendar_create { background: url(mod/event_calendar/images/river_icon_event.gif) no-repeat left -1px; } @@ -59,7 +56,7 @@ td.ui-datepicker-unselectable { background: 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 @@ + 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 @@ +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 = '

' . elgg_echo('event_calendar:no_events_found') . '

'; +} + +$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 = ''; - } ?> - - - -
-
+
+
'.$event_list; +echo $event_list; ?>
-
+
-
+ + \ No newline at end of file -- cgit v1.2.3