From 29792a9858484266952a53268e4fd0dd29b2f4a5 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Tue, 28 Jun 2011 18:12:41 -0400 Subject: moved the code into the base directory so that it is easier to work with --- views/default/event_calendar/agenda_footer.php | 5 + views/default/event_calendar/agenda_header.php | 12 + views/default/event_calendar/agenda_item_view.php | 26 ++ views/default/event_calendar/agenda_view.php | 34 ++ views/default/event_calendar/calendar.php | 61 ++++ views/default/event_calendar/css.php | 150 +++++++++ .../event_calendar/entities/entity_list.php | 66 ++++ views/default/event_calendar/entities/gallery.php | 44 +++ .../event_calendar/entities/gallery_item.php | 63 ++++ .../default/event_calendar/forms/add_to_group.php | 64 ++++ .../event_calendar/forms/delete_confirm.php | 13 + .../default/event_calendar/forms/manage_event.php | 22 ++ .../event_calendar/forms/manage_event_content.php | 254 ++++++++++++++ .../event_calendar/groupprofile_calendar.php | 42 +++ views/default/event_calendar/input/longtext.php | 25 ++ views/default/event_calendar/metatags.php | 2 + views/default/event_calendar/nav.php | 38 +++ views/default/event_calendar/paged_footer.php | 4 + views/default/event_calendar/paged_header.php | 15 + views/default/event_calendar/paged_item_view.php | 29 ++ views/default/event_calendar/paged_view.php | 51 +++ .../default/event_calendar/personal_toggle_js.php | 20 ++ views/default/event_calendar/region_select.php | 23 ++ views/default/event_calendar/review_requests.php | 25 ++ views/default/event_calendar/show_events.php | 53 +++ views/default/event_calendar/strapline.php | 18 + views/default/icon/object/event_calendar/small.php | 3 + views/default/input/datepicker_inline.php | 52 +++ views/default/input/datepicker_popup.php | 30 ++ views/default/input/timepicker.php | 38 +++ views/default/object/event_calendar.php | 66 ++++ .../default/river/object/event_calendar/create.php | 12 + .../default/river/object/event_calendar/update.php | 12 + views/default/settings/event_calendar/edit.php | 363 +++++++++++++++++++++ views/default/widgets/event_calendar/edit.php | 35 ++ views/default/widgets/event_calendar/view.php | 39 +++ 36 files changed, 1809 insertions(+) create mode 100644 views/default/event_calendar/agenda_footer.php create mode 100644 views/default/event_calendar/agenda_header.php create mode 100644 views/default/event_calendar/agenda_item_view.php create mode 100644 views/default/event_calendar/agenda_view.php create mode 100644 views/default/event_calendar/calendar.php create mode 100644 views/default/event_calendar/css.php create mode 100644 views/default/event_calendar/entities/entity_list.php create mode 100644 views/default/event_calendar/entities/gallery.php create mode 100644 views/default/event_calendar/entities/gallery_item.php create mode 100644 views/default/event_calendar/forms/add_to_group.php create mode 100644 views/default/event_calendar/forms/delete_confirm.php create mode 100644 views/default/event_calendar/forms/manage_event.php create mode 100644 views/default/event_calendar/forms/manage_event_content.php create mode 100644 views/default/event_calendar/groupprofile_calendar.php create mode 100644 views/default/event_calendar/input/longtext.php create mode 100644 views/default/event_calendar/metatags.php create mode 100644 views/default/event_calendar/nav.php create mode 100644 views/default/event_calendar/paged_footer.php create mode 100644 views/default/event_calendar/paged_header.php create mode 100644 views/default/event_calendar/paged_item_view.php create mode 100644 views/default/event_calendar/paged_view.php create mode 100644 views/default/event_calendar/personal_toggle_js.php create mode 100644 views/default/event_calendar/region_select.php create mode 100644 views/default/event_calendar/review_requests.php create mode 100644 views/default/event_calendar/show_events.php create mode 100644 views/default/event_calendar/strapline.php create mode 100644 views/default/icon/object/event_calendar/small.php create mode 100644 views/default/input/datepicker_inline.php create mode 100644 views/default/input/datepicker_popup.php create mode 100644 views/default/input/timepicker.php create mode 100644 views/default/object/event_calendar.php create mode 100644 views/default/river/object/event_calendar/create.php create mode 100644 views/default/river/object/event_calendar/update.php create mode 100644 views/default/settings/event_calendar/edit.php create mode 100644 views/default/widgets/event_calendar/edit.php create mode 100644 views/default/widgets/event_calendar/view.php (limited to 'views/default') 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 @@ +'; + +?> \ 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 @@ +'; +$header .= '
'.$vars['date'].'
'; +$header .= ''; +$header .= ''; +$header .= ''; +$header .= ''; +$header .= ''; + +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 @@ +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 = ''; +$info .= ''; +$info .= ''; +$info .= ''; +$info .= ''; +if (trim($event->description)) { + $info .= ''; + $info .= ''; + $info .= ''; +} + +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 @@ + $_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.'
'.$html.'
'.$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 @@ + '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 .= '
'; +$body .= ''; +$body .= '
'; +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 @@ + + +/* 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: ; +} + + +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: ; +} + +td.ui-datepicker-unselectable { + background-color: #FFFFFF !important; + color: #888888 !important; +} + +.river_object_event_calendar_create { + background: url(mod/event_calendar/images/river_icon_event.gif) no-repeat left -1px; +} +.river_object_event_calendar_update { + background: 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 @@ + + * @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 @@ + 0) { + +?> + +
'.elgg_echo('event_calendar:agenda:column:time').''.elgg_echo('event_calendar:agenda:column:session').''.elgg_echo('event_calendar:agenda:column:venue').'
'.$time_bit.''.$event->title.''.$event->venue.'
 '.$event->description.'
+ +"; + + } + echo ""; + $col++; + if ($col > 3) { + echo ""; + $col = 0; + } + } + if ($col > 0) echo ""; + +?> + + + + + * @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 .= "

getUrl() . "\" rel=\"$rel\">" . $vars['entity']->name . "

"; +else + $info .= "

" . $vars['entity']->name . "
".elgg_echo('profile:banned')."

"; + +// 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 = '

guid.'); return false;" '; + $link .= ' >'; + $link .= ''.elgg_echo('event_calendar:remove_from_the_calendar').''; + $link .= '

'; + $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 @@ +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 '
'; + $event_bit = elgg_view('input/hidden', array("internalname" => "event_id","value" => $event_id)); + if ($add_options) { + echo "

".elgg_echo('event_calendar:add_to_group:add_group_title')."

"; + $add_pulldown = elgg_view("input/pulldown",array("internalname" => "group_id","options_values" => $add_options)); + $submit_button = "

".elgg_view("input/submit",array("value"=>elgg_echo('event_calendar:add_to_group:add_group_button')))."

"; + 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 "

".elgg_echo('event_calendar:add_to_group:remove_group_title')."

"; + $remove_pulldown = elgg_view("input/pulldown",array("internalname" => "group_id","options_values" => $remove_options)); + $submit_button = "

".elgg_view("input/submit",array("value"=>elgg_echo('event_calendar:add_to_group:remove_group_button')))."

"; + echo elgg_view ('input/form',array("body" => $event_bit.$remove_pulldown.$submit_button,"action" => $vars['url']."action/event_calendar/remove_from_group")); + } + echo '
'; +} + +?> \ 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 @@ +'.sprintf(elgg_echo('event_calendar:delete_confirm_description'),$vars['title']).'

'; + +$body .= '
'; +$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 .= '
'; + +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 @@ + + * @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 @@ +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 .= '

'; +$body .= '

'.$prefix['title'].elgg_echo('event_calendar:title_description').'

'; + +$body .= '

'; +$body .= '

'.$prefix['venue'].elgg_echo('event_calendar:venue_description').'

'; + +if ($event_calendar_times == 'yes') { + $body .= '


'; + $body .= elgg_view("input/timepicker",array('internalname' => 'start_time','value'=>$start_time)); + $body .= '

'; + $body .= '

'.$prefix['start_time'].elgg_echo('event_calendar:start_time_description').'

'; +} + +$body .= '

'; +$body .= '

'.$prefix['start_date'].elgg_echo('event_calendar:start_date_description').'

'; + +if ($event_calendar_hide_end != 'yes') { + if ($event_calendar_times == 'yes') { + $body .= '


'; + $body .= elgg_view("input/timepicker",array('internalname' => 'end_time','value'=>$end_time)); + $body .= '

'; + $body .= '

'.$prefix['end_time'].elgg_echo('event_calendar:end_time_description').'

'; + } + + $body .= '

'; + $body .= '

'.$prefix['end_date'].elgg_echo('event_calendar:end_date_description').'

'; +} + +if ($event_calendar_spots_display == 'yes') { + $body .= '

'; + $body .= '

'.$prefix['spots'].elgg_echo('event_calendar:spots_description').'

'; +} + +if ($event_calendar_add_users == 'yes') { + $body .= '



'; + $body .= '

'.elgg_echo('event_calendar:add_user_description').'

'; +} + +$body .= '

'; +$body .= '

'.$prefix['brief_description'].elgg_echo('event_calendar:brief_description_description').'

'; + +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 .= '

'; + $body .= '

'.$prefix['region'].elgg_echo('event_calendar:region_description').'

'; + } +} + +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 .= '

'; + $body .= '

'.$prefix['event_type'].elgg_echo('event_calendar:type_description').'

'; + } +} + +$body .= '

'; +$body .= '

'.$prefix['fees'].elgg_echo('event_calendar:fees_description').'

'; + +$body .= '

'; +$body .= '

'.$prefix['contact'].elgg_echo('event_calendar:contact_description').'

'; + +$body .= '

'; +$body .= '

'.$prefix['organiser'].elgg_echo('event_calendar:organiser_description').'

'; + +$body .= '

'; +$body .= '

'.$prefix['event_tags'].elgg_echo('event_calendar:event_tags_description').'

'; + +$body .= '

'; +$body .= '

'.$prefix['long_description'].elgg_echo('event_calendar:long_description_description').'

'; + +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 .= '

'; +} + +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 @@ + + * @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 '
'; + 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 "
"; + } +} + +?> \ 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 @@ + + + \ 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 @@ + + 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 @@ + +
+ +
+$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 @@ +'; +?> + 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 @@ +'; +$header .= '
'.$vars['date'].'
'; +$header .= ''; +$header .= ''; +$header .= ''; +$header .= ''; +$header .= ''; +if ($vars['personal_manage'] != 'no') { + $header .= ''; +} +$header .= ''; + +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 @@ +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 = ''; +$info .= ''; +$info .= ''; +$info .= ''; +$info .= ''; +if ($vars['personal_manage'] != 'no') { + $info .= ''; +} +$info .= ''; + +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 @@ + $_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 = '
'; +$html = $msgs.$nav.'
'.$html.'
'.$nav; + +echo $html; +?> + \ 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 @@ + + \ 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 @@ +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'] + ."&callback=true®ion='+escape($('#region').val() ));\""; + //$js = "onchange=\"javascript:$('#event_list').load('".$vars['url_start']."&callback=true®ion='+$('#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 .= '
'; +} + +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 @@ + $request, + 'size' => 'small' + )); + $info = ''.$request->name.''; + $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, + 'confirm' => elgg_echo('event_calendar:request:remove:check'), + 'text' => elgg_echo('delete'), + )); + $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); + } +} + +?> 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 @@ + + * @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 = '

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

'; +} +if ($listing_format == 'paged') { + echo $event_list; +} else { + if (isloggedin()) { + $nav = elgg_view('event_calendar/nav',$vars); + } else { + $nav = ''; + } +?> +
'.elgg_echo('event_calendar:paged:column:date').''.elgg_echo('event_calendar:paged:column:time').''.elgg_echo('event_calendar:paged:column:event').''.elgg_echo('event_calendar:paged:column:venue').''.elgg_echo('event_calendar:paged:column:calendar').'
'.$date_bit.''.$time_bit.''.$event->title.''.$event->venue.'
+ + +
+
+'.$event_list; +?> +
+
+ +
+ \ 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 @@ +
+ +time_created; + $owner_guid = $event->owner_guid; + $owner = get_entity($owner_guid); + + echo sprintf(elgg_echo('event_calendar:strapline'), + friendly_time($time_updated), + "getURL() . "\">" . $owner->name ."" + ); + +?> + +
\ 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 @@ + \ 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 @@ + + * @copyright Radagast Solutions 2008 + * @link http://radagast.biz/ + * + */ +?> + + +
+

\ 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 @@ + + * @copyright Radagast Solutions 2008 + * @link http://radagast.biz/ + * + */ +if ($vars['dateformat']) { + $date_format = $vars['dateformat']; +} else { + $date_format = "DD, MM d, yy"; +} +?> + + + \ 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 @@ +$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 @@ + + * @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 .= '
'; + + 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 .= "

"; + $body .= $item->title.': '; + $body .= $item->value; + + } + } + echo $body; + if ($event->long_description) { + echo '

'.$event->long_description.'

'; + } else { + echo '

'.$event->description.'

'; + } + echo '
'; + 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 .= '

'.$event->title.''; + $info .= '
'.$time_bit; + if ($event->description) { + $info .= '

'.$event->description; + } + + if ($event_calendar_venue_view = get_plugin_setting('venue_view', 'event_calendar') == 'yes') { + $info .= '
'.$event->venue; + } + $info .= '

'; + + 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 @@ +subject_guid); + $object = get_entity($vars['item']->object_guid); + + $url = "getURL()}\">{$performed_by->name}"; + $string = sprintf(elgg_echo("event_calendar:river:created"),$url) . " "; + $string .= elgg_echo("event_calendar:river:create")." getURL() . "\">" . $object->title . ""; + +?> + + \ 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 @@ +subject_guid); + $object = get_entity($vars['item']->object_guid); + + $url = "getURL()}\">{$performed_by->name}"; + $string = sprintf(elgg_echo("event_calendar:river:updated"),$url) . " "; + $string .= elgg_echo("event_calendar:river:the_event")." getURL() . "\">" . $object->title . ""; + +?> + + \ 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 @@ +'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 .= '
'; +$body .= elgg_view('input/radio',array('internalname'=>'params[hide_access]','value'=>$event_calendar_hide_access,'options'=>$yn_options)); + +$body .= '
'; + +$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 .= '
'; +$body .= elgg_view('input/pulldown',array('internalname'=>'params[default_access]','value'=>$event_calendar_default_access,'options_values'=>$access_options)); + +$body .= '

'; + +$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 .= '
'; +$body .= elgg_view('input/radio',array('internalname'=>'params[hide_end]','value'=>$event_calendar_hide_end,'options'=>$yn_options)); + +$body .= '
'; + +$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 .= '
'; +$body .= elgg_view('input/radio',array('internalname'=>'params[listing_format]','value'=>$event_calendar_listing_format,'options'=>$listing_options)); + +$body .= '
'; + +$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 .= '
'; +$body .= elgg_view('input/radio',array('internalname'=>'params[times]','value'=>$event_calendar_times,'options'=>$yn_options)); + +$body .= '
'; + +$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 .= '
'; +$body .= elgg_view('input/radio',array('internalname'=>'params[autopersonal]','value'=>$event_calendar_autopersonal,'options'=>$yn_options)); + +$body .= '
'; + +$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 .= '
'; +$body .= elgg_view('input/radio',array('internalname'=>'params[autogroup]','value'=>$event_calendar_autogroup,'options'=>$yn_options)); + +$body .= '
'; + +$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 .= '
'; +$body .= elgg_view('input/radio',array('internalname'=>'params[add_to_group_calendar]','value'=>$event_calendar_add_to_group_calendar,'options'=>$yn_options)); + +$body .= '
'; + +$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 .= '
'; +$body .= elgg_view('input/radio',array('internalname'=>'params[agenda_view]','value'=>$event_calendar_agenda_view,'options'=>$yn_options)); + +$body .= '
'; + +$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 .= '
'; +$body .= elgg_view('input/radio',array('internalname'=>'params[venue_view]','value'=>$event_calendar_venue_view,'options'=>$yn_options)); + +$body .= '
'; + +$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').'
'; +$body .= elgg_view('input/radio',array('internalname'=>'params[site_calendar]','value'=>$event_calendar_site_calendar,'options'=>$options)); + +$body .= '
'; + +$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').'
'; +$body .= elgg_view('input/radio',array('internalname'=>'params[group_calendar]','value'=>$event_calendar_group_calendar,'options'=>$options)); + +$body .= '
'; + +$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 .= '
'; +$body .= elgg_view('input/radio',array('internalname'=>'params[group_default]','value'=>$event_calendar_group_default,'options'=>$options)); + +$body .= '
'; + +$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 .= '
'; +$body .= elgg_view('input/radio',array('internalname'=>'params[group_always_display]','value'=>$event_calendar_group_always_display,'options'=>$yn_options)); + +$body .= '
'; + +$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').'
'; +$body .= elgg_view('input/radio',array('internalname'=>'params[group_profile_display]','value'=>$event_calendar_group_profile_display,'options'=>$options)); + +$body .= '
'; + +$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 .= '
'; +$body .= elgg_view('input/radio',array('internalname'=>'params[add_users]','value'=>$event_calendar_add_users,'options'=>$yn_options)); + +$body .= '
'; + +$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 .= '
'; +$body .= elgg_view('input/radio',array('internalname'=>'params[add_users_notify]','value'=>$event_calendar_add_users_notify,'options'=>$yn_options)); + +$body .= '
'; + +$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 .= '
'; +$body .= elgg_view('input/radio',array('internalname'=>'params[personal_manage]','value'=>$event_calendar_personal_manage,'options'=>$yn_options)); + +$body .= '
'; + +$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 .= '
'; +$body .= elgg_view('input/radio',array('internalname'=>'params[spots_display]','value'=>$event_calendar_spots_display,'options'=>$yn_options)); + +$body .= '
'; + +$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 .= '
'; +$body .= elgg_view('input/radio',array('internalname'=>'params[no_collisions]','value'=>$event_calendar_no_collisions,'options'=>$yn_options)); + +$body .= '
'; + +$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 .= '
'; +$body .= elgg_view('input/text',array('internalname'=>'params[collision_length]','value'=>$event_calendar_collision_length)); + +$body .= '

'; + +$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 .= '
'; +$body .= elgg_view('input/radio',array('internalname'=>'params[region_display]','value'=>$event_calendar_region_display,'options'=>$yn_options)); + +$body .= '
'; + +$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 .= '
'; +$body .= elgg_view('event_calendar/input/longtext',array('internalname'=>'params[region_list]','value'=>$event_calendar_region_list)); + +$body .= '
'; + +$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 .= '
'; +$body .= elgg_view('input/radio',array('internalname'=>'params[region_list_handles]','value'=>$event_calendar_region_list_handles,'options'=>$yn_options)); + +$body .= '
'; + +$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 .= '
'; +$body .= elgg_view('input/radio',array('internalname'=>'params[type_display]','value'=>$event_calendar_type_display,'options'=>$yn_options)); + +$body .= '
'; + +$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 .= '
'; +$body .= elgg_view('event_calendar/input/longtext',array('internalname'=>'params[type_list]','value'=>$event_calendar_type_list)); + +$body .= '
'; + +$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 .= '
'; +$body .= elgg_view('input/radio',array('internalname'=>'params[type_list_handles]','value'=>$event_calendar_type_list_handles,'options'=>$yn_options)); + +$body .= '
'; + +$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 .= '
'; +$body .= elgg_view('input/text',array('internalname'=>'params[first_date]','value'=>$event_calendar_first_date)); + +$body .= '

'; + +$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 .= '
'; +$body .= elgg_view('input/text',array('internalname'=>'params[last_date]','value'=>$event_calendar_last_date)); + +$body .= '

'; + +$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 .= '
'; +$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 @@ + + * @copyright Radagast Solutions 2008 + * @link http://radagast.biz/ + * + */ + +if (!$vars['entity']->num_display) { + $num_display = 5; +} else { + $num_display = $vars['entity']->num_display; +} +?> + +

+ : + +

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 @@ + + * @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 "
"; + + foreach($events as $event) { + echo elgg_view("object/event_calendar",array('entity' => $event)); + } + + echo "
"; + + } + +?> \ No newline at end of file -- cgit v1.2.3