From 804dfcf6c4b5b6380d607c8ec6b843d56ac82247 Mon Sep 17 00:00:00 2001 From: Kevin Jardine Date: Mon, 26 Sep 2011 12:42:11 +0200 Subject: major changes for Elgg 1.8 --- views/default/event_calendar/calendar_toggle.php | 20 +++++++++ views/default/event_calendar/css.php | 15 ++++++- views/default/event_calendar/filter_menu.php | 1 + views/default/event_calendar/group_module.php | 48 ++++++++++------------ .../event_calendar/groupprofile_calendar.php | 11 +---- .../groupprofile_calendar_deprecated.php | 44 ++++++++++++++++++++ views/default/event_calendar/paged_item_view.php | 6 +-- views/default/event_calendar/paged_view.php | 21 ++-------- views/default/event_calendar/region_select.php | 10 ++--- views/default/event_calendar/review_requests.php | 21 ++++++---- views/default/event_calendar/show_events.php | 28 ++++++------- 11 files changed, 136 insertions(+), 89 deletions(-) create mode 100644 views/default/event_calendar/calendar_toggle.php create mode 100644 views/default/event_calendar/groupprofile_calendar_deprecated.php (limited to 'views/default/event_calendar') diff --git a/views/default/event_calendar/calendar_toggle.php b/views/default/event_calendar/calendar_toggle.php new file mode 100644 index 000000000..7180dec75 --- /dev/null +++ b/views/default/event_calendar/calendar_toggle.php @@ -0,0 +1,20 @@ +container_guid); + +if ($container->canEdit()) { + $link = '

guid.','.$vars['entity']->guid.'); return false;" '; + $link .= ' >'; + $link .= ''.elgg_echo('event_calendar:remove_from_the_calendar').''; + $link .= '

'; + + $button = elgg_view('input/button',array( + 'id'=>'event_calendar_user_data_'.$event->guid.'_'.$user->guid, + 'class' => "event-calendar-personal-calendar-toggle", + 'value' => elgg_echo('event_calendar:remove_from_the_calendar_button'), + )); +} + +echo '
'.$button.'
'; diff --git a/views/default/event_calendar/css.php b/views/default/event_calendar/css.php index 7e399c547..2059a3ea9 100644 --- a/views/default/event_calendar/css.php +++ b/views/default/event_calendar/css.php @@ -8,7 +8,7 @@ $highlight_colour = '#3874B7'; #calendarmenucontainer { position:relative; - left: 40px; + left: 25px; } ul#calendarmenu li { @@ -117,6 +117,10 @@ td.event_calendar_paged_title { width: 280px; } +td.event_calendar_paged_calendar { + padding-left: 30px; +} + table.event_calendar_paged_table { width:100%; border-collapse:collapse; @@ -144,4 +148,13 @@ table.event_calendar_paged_table th { .event_calendar_strapline { font-size: 85%; +} + +.event-calendar-personal-calendar-toggle-wrapper { + width: 100%; + margin-bottom: 30px; +} + +.event-calendar-personal-calendar-toggle { + float: right; } \ No newline at end of file diff --git a/views/default/event_calendar/filter_menu.php b/views/default/event_calendar/filter_menu.php index 62d38939b..2d4805bd4 100644 --- a/views/default/event_calendar/filter_menu.php +++ b/views/default/event_calendar/filter_menu.php @@ -49,6 +49,7 @@ echo elgg_view_menu('filter', array('sort_by' => 'priority', 'class' => 'elgg-me $event_calendar_region_display = elgg_get_plugin_setting('region_display', 'event_calendar'); if ($event_calendar_region_display == 'yes') { + elgg_load_js("elgg.event_calendar"); $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 index 5fc644e8b..b1c1567e7 100644 --- a/views/default/event_calendar/group_module.php +++ b/views/default/event_calendar/group_module.php @@ -9,35 +9,29 @@ 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); +$content = elgg_view('event_calendar/groupprofile_calendar'); elgg_pop_context(); -if (!$content) { - $content = '

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

'; +if (!$content) { + if (elgg_get_plugin_setting('group_always_display', 'event_calendar') == 'yes') { + $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, -)); +if ($content) { + $all_link = elgg_view('output/url', array( + 'href' => "event_calendar/group/$group->guid", + 'text' => elgg_echo('link:view:all'), + )); + $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 826fafa67..7ee09104f 100644 --- a/views/default/event_calendar/groupprofile_calendar.php +++ b/views/default/event_calendar/groupprofile_calendar.php @@ -20,24 +20,15 @@ if (event_calendar_activated_for_group($page_owner_entity)) { // 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()); + $events = event_calendar_get_events_between($start_date,$end_date,false,$num,0,elgg_get_page_owner_guid()); // If there are any events to view, view them if (is_array($events) && sizeof($events) > 0) { - echo '
'; - echo '

'.elgg_echo("event_calendar:groupprofile").'

'; foreach($events as $event) { echo elgg_view("object/event_calendar",array('entity' => $event)); } - echo ''; - echo "
"; - } else if (get_plugin_setting('group_always_display', 'event_calendar') == 'yes') { - echo '
'; - echo '

'.elgg_echo("event_calendar:groupprofile").'

'; - echo '
'.elgg_echo('event_calendar:no_events_found').'
'; - echo "
"; } } diff --git a/views/default/event_calendar/groupprofile_calendar_deprecated.php b/views/default/event_calendar/groupprofile_calendar_deprecated.php new file mode 100644 index 000000000..081a0eb2d --- /dev/null +++ b/views/default/event_calendar/groupprofile_calendar_deprecated.php @@ -0,0 +1,44 @@ + + * @copyright Radagast Solutions 2008 + * @link http://radagast.biz/ + * + */ + +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; + // 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,elgg_get_page_owner_guid()); + + // If there are any events to view, view them + if (is_array($events) && sizeof($events) > 0) { + + echo '
'; + echo '

'.elgg_echo("event_calendar:groupprofile").'

'; + foreach($events as $event) { + echo elgg_view("object/event_calendar",array('entity' => $event)); + } + echo ''; + echo "
"; + + } else if (elgg_get_plugin_setting('group_always_display', 'event_calendar') == 'yes') { + echo '
'; + echo '

'.elgg_echo("event_calendar:groupprofile").'

'; + echo '
'.elgg_echo('event_calendar:no_events_found').'
'; + echo "
"; + } +} + +?> \ 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 index 77c8bed4e..f2092bafc 100644 --- a/views/default/event_calendar/paged_item_view.php +++ b/views/default/event_calendar/paged_item_view.php @@ -7,21 +7,19 @@ if (is_numeric($event->start_time)) { $date_bit = event_calendar_get_formatted_date($event->start_date); -if (event_calendar_has_personal_event($event->guid,get_loggedin_userid())) { +if (event_calendar_has_personal_event($event->guid,elgg_get_logged_in_user_guid())) { $calendar_bit = 'checked = "checked"'; } else { $calendar_bit = ''; } -$calendar_bit .= ' onclick="javascript:event_calendar_personal_toggle('.$event->guid.'); return true;" '; - $info = ''; $info .= ''.$date_bit.''; $info .= ''.$time_bit.''; $info .= ''.$event->title.''; $info .= ''.$event->venue.''; if ($vars['personal_manage'] != 'no') { - $info .= ''; + $info .= ''; } $info .= ''; diff --git a/views/default/event_calendar/paged_view.php b/views/default/event_calendar/paged_view.php index 7c2ea2eaa..f8257792f 100644 --- a/views/default/event_calendar/paged_view.php +++ b/views/default/event_calendar/paged_view.php @@ -1,4 +1,5 @@ $_SERVER['REQUEST_URI'], @@ -8,8 +9,8 @@ $nav = elgg_view('navigation/pagination',array( 'limit' => $vars['limit'], )); -$event_calendar_times = get_plugin_setting('times', 'event_calendar'); -$event_calendar_personal_manage = get_plugin_setting('personal_manage', 'event_calendar'); +$event_calendar_times = elgg_get_plugin_setting('times', 'event_calendar'); +$event_calendar_personal_manage = elgg_get_plugin_setting('personal_manage', 'event_calendar'); $events = $vars['events']; $html = ''; $date_format = 'F Y'; @@ -33,19 +34,3 @@ $msgs = '
'; $html = $msgs.$nav.'
'.$html.'
'.$nav; echo $html; -?> - \ No newline at end of file diff --git a/views/default/event_calendar/region_select.php b/views/default/event_calendar/region_select.php index 81407b27d..a987171a2 100644 --- a/views/default/event_calendar/region_select.php +++ b/views/default/event_calendar/region_select.php @@ -1,6 +1,6 @@ 'region','js'=>$js,'value'=>$vars['region'],'options_values'=>$options_values)); + $body .= elgg_view('input/hidden',array('id'=>'event-calendar-region-url-start','value'=>$vars['url_start'])); + $body .= elgg_view("input/dropdown",array('id' => 'event-calendar-region','value'=>$vars['region'],'options_values'=>$options_values)); $body .= '
'; } 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 index e1866a32b..11916b4e3 100644 --- a/views/default/event_calendar/review_requests.php +++ b/views/default/event_calendar/review_requests.php @@ -10,16 +10,21 @@ foreach($vars['requests'] as $request) { $info .= '
'; $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, + 'class' => "elgg-button elgg-button-delete", + 'href' => 'action/event_calendar/killrequest?user_guid='.$request->guid.'&event_guid=' . $vars['entity']->guid, 'confirm' => elgg_echo('event_calendar:request:remove:check'), - 'text' => elgg_echo('delete'), + 'text' => elgg_echo('event_calendar:review_requests:reject'), + 'title' => elgg_echo('event_calendar:review_requests:reject:title'), )); $info .= '  '; - $url = elgg_add_action_tokens_to_url("{$vars['url']}action/event_calendar/addtocalendar?user_guid={$request->guid}&event_id={$vars['entity']->guid}"); - $info .= ''.elgg_echo('accept').''; - echo elgg_view_listing($icon,$info); + $info .= elgg_view('output/url', array( + 'text' => elgg_echo('event_calendar:review_requests:accept'), + 'title' => elgg_echo('event_calendar:review_requests:accept:title'), + 'href' => "action/event_calendar/addtocalendar?user_guid={$request->guid}&event_guid={$vars['entity']->guid}", + 'class' => "elgg-button elgg-button-submit", + 'is_action' => TRUE, + )); + //$url = elgg_add_action_tokens_to_url("{$vars['url']}action/event_calendar/addtocalendar?user_guid={$request->guid}&event_guid={$vars['entity']->guid}"); + echo elgg_view_image_block($icon,$info); } } - -?> diff --git a/views/default/event_calendar/show_events.php b/views/default/event_calendar/show_events.php index 580fb5a45..b51b1c05f 100644 --- a/views/default/event_calendar/show_events.php +++ b/views/default/event_calendar/show_events.php @@ -13,23 +13,21 @@ $listing_format = $vars['listing_format']; if ($vars['events']) { - if (elgg_get_plugin_setting('agenda_view', 'event_calendar') == 'yes') { + if ($listing_format == 'agenda') { $event_list = elgg_view('event_calendar/agenda_view',$vars); + } else if ($listing_format == 'paged') { + $event_list = elgg_view('event_calendar/paged_view',$vars); } else { - if ($listing_format == 'paged') { - $event_list = elgg_view('event_calendar/paged_view',$vars); - } else { - $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); - } + $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 { $event_list = '

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

'; -- cgit v1.2.3