diff options
33 files changed, 596 insertions, 619 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 0a484cebe..269ede4ae 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,8 @@ CHANGE LOG +0.85 + +First version for Elgg 1.8 + 0.84 Fixed tag search so it works for Elgg 1.7.x. diff --git a/actions/event_calendar/add_to_group.php b/actions/event_calendar/add_to_group.php new file mode 100644 index 000000000..b8c18ebb0 --- /dev/null +++ b/actions/event_calendar/add_to_group.php @@ -0,0 +1,11 @@ +<?php +$event_id = get_input("event_id",0); +$group_id = get_input("group_id",0); +$event = get_entity($event_id); +$group = get_entity($group_id); +if ($group && $group->canEdit()) { + add_entity_relationship($event_id, "display_on_group", $group_id ); + system_message(elgg_echo('event_calendar:add_to_group:success')); +} +forward($event->getUrl()); +?>
\ No newline at end of file diff --git a/actions/event_calendar/addtocalendar.php b/actions/event_calendar/addtocalendar.php new file mode 100644 index 000000000..e5b689d73 --- /dev/null +++ b/actions/event_calendar/addtocalendar.php @@ -0,0 +1,33 @@ +<?php +// this action allows an admin or event owner to approve a calendar request + +elgg_load_library('elgg:event_calendar'); + +$user_guid = get_input('user_guid', elgg_get_logged_in_user_guid()); +$event_guid = get_input('event_guid'); + +$user = get_entity($user_guid); +$event = get_entity($event_guid); + +if (elgg_instanceof($event, 'object', 'event_calendar') + && elgg_instanceof($user, 'user') + && event_calendar_personal_can_manage($event,$user_guid) + && check_entity_relationship($user_guid, 'event_calendar_request', $event_guid)) { + + if (event_calendar_add_personal_event($event_guid,$user_guid)) { + remove_entity_relationship($user_guid, 'event_calendar_request', $event_guid); + notify_user($user_guid, $CONFIG->site->guid, elgg_echo('event_calendar:add_users_notify:subject'), + sprintf( + elgg_echo('event_calendar:add_users_notify:body'), + $user->name, + $event->title, + $event->getURL() + ) + ); + system_message(elgg_echo('event_calendar:request_approved')); + } +} else { + register_error(elgg_echo('event_calendar:review_requests:error:approve')); +} + +forward(REFERER); diff --git a/actions/event_calendar/edit.php b/actions/event_calendar/edit.php index 2365d3965..0cc956d73 100644 --- a/actions/event_calendar/edit.php +++ b/actions/event_calendar/edit.php @@ -29,9 +29,9 @@ if ($event) { } else { $event_calendar_autopersonal = elgg_get_plugin_setting('autopersonal', 'event_calendar'); if (!$event_calendar_autopersonal || ($event_calendar_autopersonal == 'yes')) { - event_calendar_add_personal_event($event_guid,$user_guid); + event_calendar_add_personal_event($event->guid,$user_guid); } - add_to_river('river/object/event_calendar/create','create',$user_guid,$event_guid); + add_to_river('river/object/event_calendar/create','create',$user_guid,$event->guid); system_message(elgg_echo('event_calendar:add_event_response')); } diff --git a/actions/event_calendar/killrequest.php b/actions/event_calendar/killrequest.php new file mode 100644 index 000000000..b58e804cd --- /dev/null +++ b/actions/event_calendar/killrequest.php @@ -0,0 +1,23 @@ +<?php +// this action allows an admin or event owner to reject a calendar request + +elgg_load_library('elgg:event_calendar'); + +$user_guid = get_input('user_guid', elgg_get_logged_in_user_guid()); +$event_guid = get_input('event_guid'); + +$user = get_entity($user_guid); +$event = get_entity($event_guid); + +if (elgg_instanceof($event, 'object', 'event_calendar') + && elgg_instanceof($user, 'user') + && event_calendar_personal_can_manage($event,$user_guid) + && check_entity_relationship($user_guid, 'event_calendar_request', $event_guid)) { + + remove_entity_relationship($user->guid, 'event_calendar_request', $event_guid); + system_message(elgg_echo('event_calendar:requestkilled')); +} else { + register_error(elgg_echo('event_calendar:review_requests:error:reject')); +} + +forward(REFERER); diff --git a/actions/event_calendar/remove_from_group.php b/actions/event_calendar/remove_from_group.php new file mode 100644 index 000000000..4a7185245 --- /dev/null +++ b/actions/event_calendar/remove_from_group.php @@ -0,0 +1,8 @@ +<?php +$event_id = get_input("event_id",0); +$group_id = get_input("group_id",0); +$event = get_entity($event_id); +remove_entity_relationship($event_id, "display_on_group", $group_id ); +system_message(elgg_echo('event_calendar:remove_from_group:success')); +forward($event->getUrl()); +?>
\ No newline at end of file diff --git a/actions/event_calendar/toggle_personal_calendar.php b/actions/event_calendar/toggle_personal_calendar.php new file mode 100644 index 000000000..26192953f --- /dev/null +++ b/actions/event_calendar/toggle_personal_calendar.php @@ -0,0 +1,32 @@ +<?php +elgg_load_library('elgg:event_calendar'); +$event_guid = get_input('event_guid',0); +$user_guid = get_input('user_id',elgg_get_logged_in_user_guid()); +$other = get_input('other',''); +if ($other) { + $remove_response = elgg_echo('event_calendar:added_to_the_calendar'); + $add_response = elgg_echo('event_calendar:removed_from_the_calendar'); + $add_error = elgg_echo('event_calendar:add_to_the_calendar_error'); +} else { + $remove_response = elgg_echo('event_calendar:remove_from_my_calendar_response'); + $add_response = elgg_echo('event_calendar:add_to_my_calendar_response'); + $add_error = elgg_echo('event_calendar:add_to_my_calendar_error'); +} +// three character prefix to indicate success or failure + +if (event_calendar_has_personal_event($event_guid,$user_guid)) { + $button_text = elgg_echo('event_calendar:add_to_the_calendar'); + event_calendar_remove_personal_event($event_guid,$user_guid); + $response = array('success'=>TRUE, 'message' => $remove_response, 'button_text'=>$button_text); +} else { + if (event_calendar_add_personal_event($event_guid,$user_guid)) { + $button_text = elgg_echo('event_calendar:remove_from_the_calendar_button'); + $response = array('success'=>TRUE, 'message' => $add_response, 'button_text'=>$button_text); + } else { + $response = array('success'=>FALSE, 'message' =>$add_error); + } +} + +echo json_encode($response); + +exit; diff --git a/delete_confirm.php b/delete_confirm.php deleted file mode 100644 index 81bcd9118..000000000 --- a/delete_confirm.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -/** - * Show event - * - * @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/ - * - */ - -// Load Elgg engine -require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); - -// Define context -set_context('event_calendar'); - -global $CONFIG; - -$event_id = get_input('event_id',0); -if ($event_id && ($event = get_entity($event_id))) { - set_page_owner($event->container_guid); - if (page_owner_entity() instanceOf ElggGroup) { - // Re-define context - set_context('groups'); - } - $body = elgg_view('event_calendar/forms/delete_confirm',array('event_id'=>$event_id,'title'=>$event->title)); - $title = elgg_echo('event_calendar:delete_confirm_title'); - page_draw($title,elgg_view_layout("two_column_left_sidebar", '', elgg_view_title($title) . $body)); -} else { - register_error('event_calendar:error_nosuchevent'); - forward(); -} -?>
\ No newline at end of file diff --git a/display_event_users.php b/display_event_users.php deleted file mode 100644 index c5d06cd8f..000000000 --- a/display_event_users.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * Display users who have added a given event to their personal calendars - * - * @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/ - * - */ - -// Load Elgg engine -require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); - -// Load event calendar model -require_once(dirname(__FILE__) . "/models/model.php"); - -set_context('event_calendar'); -$limit = get_input('limit', 12); -$offset = get_input('offset', 0); -if (($event_id = get_input('event_id', 0)) && $event = get_entity($event_id)) { - $event_container = get_entity($event->container_guid); - if ($event_container instanceOf ElggGroup) { - // Re-define context - set_context('groups'); - set_page_owner($event_container->getGUID()); - } - set_input('search_viewtype','gallery'); - $count = event_calendar_get_users_for_event($event_id,$limit,$offset,true); - $users = event_calendar_get_users_for_event($event_id,$limit,$offset,false); - $body = event_calendar_view_entity_list($users, $count, $offset, $limit, true, false); - - $body .= elgg_view('event_calendar/personal_toggle_js'); - - $title = sprintf(elgg_echo('event_calendar:users_for_event_title'),$event->title); - page_draw($title,elgg_view_layout("two_column_left_sidebar", '', elgg_view_title($title) . $body)); -} else { - register_error('event_calendar:error_nosuchevent'); - forward(); -} -?>
\ No newline at end of file diff --git a/languages/en.php b/languages/en.php index 26312af25..5aa96adee 100644 --- a/languages/en.php +++ b/languages/en.php @@ -74,14 +74,19 @@ ."(Perhaps the event is full or is scheduled at the same time as another event in your personal calendar?)", 'event_calendar:remove_from_my_calendar_response' => "This event has been removed from your personal calendar.", 'event_calendar:add_to_the_calendar' => "Add to calendar", - 'event_calendar:remove_from_the_calendar' => "Remove from calendar", + 'event_calendar:remove_from_the_calendar' => "Remove", + 'event_calendar:remove_from_the_calendar_button' => "Remove from calendar", + 'event_calendar:added_to_the_calendar' => "Added to calendar", + 'event_calendar:removed_from_the_calendar' => "Removed calendar", 'event_calendar:add_to_the_calendar_response' => "Event added to this person's calendar.", 'event_calendar:add_to_the_calendar_error' => "This event could not added to this person's calendar. " ."(Perhaps the event is full or is scheduled at the same time as another event in this person's calendar?)", 'event_calendar:remove_from_the_calendar_response' => "Event removed from this person's calendar.", - 'event_calendar:users_for_event_title' => "People interested in event \"%s\"", - 'event_calendar:personal_event_calendars_link' => "Personal event calendars (%s)", + 'event_calendar:users_for_event_menu_title' => "People listing this event on their personal calendars", + 'event_calendar:users_for_event_title' => "Personal calendars for \"%s'\"", + 'event_calendar:personal_event_calendars_link' => "Calendars (%s)", + 'event_calendar:users_for_event_breadcrumb' => "Personal calendars", 'event_calendar:settings:group_profile_display:title' => "Group calendar profile display (if group calendars are enabled)", 'event_calendar:settings:group_profile_display_option:left' => "left column", 'event_calendar:settings:group_profile_display_option:right' => "right column", @@ -112,7 +117,7 @@ 'event_calendar:type_label' => "Type of event", 'event_calendar:type_description' => "Select the type of event.", 'event_calendar:all' => "All", - 'event_calendar:region_filter_by_label' => "Filter by region:", + 'event_calendar:region_filter_by_label' => "Filter by region: ", 'event_calendar:settings:first_date:title' => "First allowable date (in YYYY-MM-DD format)", 'event_calendar:settings:last_date:title' => "Last allowable date (in YYYY-MM-DD format)", 'event_calendar:enable_event_calendar' => "Enable group event calendar", @@ -125,6 +130,7 @@ 'event_calendar:agenda:column:venue' => "Location", 'event_calendar:upcoming_events_title' => "Upcoming events", 'event_calendar:settings:paged' => "paged", + 'event_calendar:settings:agenda' => "agenda", 'event_calendar:settings:month' => "by month", 'event_calendar:settings:listing_format:title' => "Event listing format", 'event_calendar:paged:column:date' => "Date", @@ -158,23 +164,31 @@ 'event_calendar:request_event_response' => "Your request to be added to this event has been sent.", 'event_calendar:request_event_error' => "Error: Could not send your request to be added to this event.", 'event_calendar:request_subject' => "You have received an event request", - 'event_calendar:request_message' => " %s has asked to have the event \"%s\", here: - - %s - - added to his/her personal calendar. - - You can manage calendar requests here: - - %s", + 'event_calendar:request_message' => "%s has asked to have the event \"%s\", here: + +%s + +added to his/her personal calendar. + +You can manage calendar requests for this event here: + +%s +", 'event_calendar:review_requests_error' => "This event either does not exist or you do not have the authority to approve requests for it.", 'event_calendar:review_requests_request_none' => "There are no requests to review for this event.", 'event_calendar:request:remove:check' => 'Are you sure you want to reject this request?', - 'event_calendar:requestkilled' => 'The request has been removed.', + 'event_calendar:requestkilled' => 'This request has been rejected.', 'event_calendar:request_approved' => "This request has been approved.", - 'event_calendar:review_requests_title' => 'Review requests', + 'event_calendar:review_requests_title' => "Review requests for \"%s\"", + 'event_calendar:review_requests_menu_title' => "Review requests", 'event_calendar:make_request_title' => 'Request this event', + 'event_calendar:review_requests:reject' => "Reject", + 'event_calendar:review_requests:reject:title' => "Reject this request", + 'event_calendar:review_requests:accept' => "Accept", + 'event_calendar:review_requests:accept:title' => "Accept this request", + 'event_calendar:review_requests:error:approve' => "Error: could not approve this request.", + 'event_calendar:review_requests:error:reject' => "Error: could not reject this request.", 'event_calendar:settings:hide_access:title' => "Hide event access drop down", 'event_calendar:settings:default_access:title' => "If the event access is hidden, what should it default to?", @@ -200,6 +214,9 @@ **/ //generic terms to use + + 'river:update:object:event_calendar' => "%s updated the event %s", + 'river:create:object:event_calendar' => "%s added the event %s", 'event_calendar:river:created' => "%s added", 'event_calendar:river:updated' => "%s updated", 'event_calendar:river:annotated1' => "%s added", diff --git a/manage_event.php b/manage_event.php deleted file mode 100644 index 0464a31df..000000000 --- a/manage_event.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -/** - * Manage event - * - * @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/ - * - */ - -// Load Elgg engine -require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); - -// Load event calendar model -require_once(dirname(__FILE__) . "/models/model.php"); - -// Define context -set_context('event_calendar'); - -global $CONFIG; - -gatekeeper(); - -$event = ''; - -$group_guid = (int) get_input('group_guid',0); - -if ($event_id = get_input('event_id',0)) { - $event = event_calendar_get_event_for_edit($event_id); - if (!$event) { - register_error(elgg_echo('event_calendar:no_such_event_edit_error')); - forward(); - } else { - set_page_owner($event->container_guid); - if (page_owner_entity() instanceof ElggGroup) { - set_context('groups'); - } - } - - $title = elgg_echo('event_calendar:manage_event_title'); -} else { - $title = elgg_echo('event_calendar:add_event_title'); - if ($group_guid && $group = get_entity($group_guid)) { - // redefine context - set_context('groups'); - set_page_owner($group_guid); - } -} - -$body = elgg_view('event_calendar/forms/manage_event', array('event'=>$event,'event_id'=>$event_id,'group_guid'=>$group_guid)); - -page_draw($title,elgg_view_layout("two_column_left_sidebar", '', elgg_view_title($title) . $body)); - -?>
\ No newline at end of file diff --git a/manifest.xml b/manifest.xml index dcbebc48a..62cfeacf9 100644 --- a/manifest.xml +++ b/manifest.xml @@ -1,10 +1,18 @@ <?xml version="1.0" encoding="UTF-8"?> -<plugin_manifest> - <field key="author" value="Kevin Jardine <kevin@radagast.biz>" /> - <field key="version" value="0.81" /> - <field key="description" value="Elgg event calendar plugin" /> - <field key="website" value="http://radagast.biz/" /> - <field key="copyright" value="(C) Radagast Solutions 2009-2011" /> - <field key="licence" value="GNU Public License version 2" /> - <field key="elgg_version" value="2009030101" /> -</plugin_manifest> +<plugin_manifest xmlns="http://www.elgg.org/plugin_manifest/1.8"> + <name>Event Calendar</name> + <author>Kevin Jardine <kevin@radagast.biz></author> + <version>0.85</version> + <category>third-party</category> + <category>content</category> + <category>widget</category> + <blurb>Event calendar</blurb> + <description>Adds configurable group and/or site-wide event calendars.</description> + <website>http://radagast.biz/</website> + <copyright>(C) Radagast Solutions 2009-2011</copyright> + <license>GNU Public License version 2</license> + <requires> + <type>elgg_version</type> + <version>2010030101</version> + </requires> +</plugin_manifest>
\ No newline at end of file diff --git a/models/model.php b/models/model.php index 52fd472b3..c887cc7b0 100644 --- a/models/model.php +++ b/models/model.php @@ -78,7 +78,7 @@ function event_calendar_set_event_from_form($event_guid,$group_guid) { $event->description = get_input('description'); $event->venue = get_input('venue'); $event->start_date = get_input('start_date'); - $event->end_date = get_input('end_date'); + $event->end_date = get_input('end_date',''); if ($event_calendar_times == 'yes') { $sh = get_input('start_time_h',''); @@ -1004,17 +1004,16 @@ function event_calendar_personal_can_manage($event,$user_id) { return $authorised; } -function event_calendar_send_event_request($event,$user_id) { - global $CONFIG; +function event_calendar_send_event_request($event,$user_guid) { $result = FALSE; - if(add_entity_relationship($user_id, 'event_calendar_request', $event->guid)) { + if(add_entity_relationship($user_guid, 'event_calendar_request', $event->guid)) { $subject = elgg_echo('event_calendar:request_subject'); - $name = get_entity($user_id)->name; + $name = get_entity($user_guid)->name; $title = $event->title; $url = $event->getUrl(); - $link = $CONFIG->wwwroot.'pg/event_calendar/review_requests/'.$event->guid; + $link = elgg_get_site_url().'event_calendar/review_requests/'.$event->guid; $message = sprintf(elgg_echo('event_calendar:request_message'),$name,$title,$url,$link); - notify_user($event->owner_guid,$CONFIG->site->guid,$subject,$message); + notify_user($event->owner_guid,elgg_get_site_entity()->guid,$subject,$message); $result = TRUE; } return $result; @@ -1033,7 +1032,7 @@ function event_calendar_get_page_content_list($page_type,$group_guid,$start_date $user_guid = elgg_get_logged_in_user_guid(); $group_calendar = elgg_get_plugin_setting('group_calendar', 'event_calendar'); if (!$group_calendar || $group_calendar == 'members') { - if (elgg_get_page_owner()->canWriteToContainer($user_guid)){ + if (elgg_get_page_owner_entity()->canWriteToContainer($user_guid)){ elgg_register_menu_item('title', array( 'name' => 'add', 'href' => "event_calendar/add/".$group_guid, @@ -1339,6 +1338,7 @@ function event_calendar_get_page_content_view($event_guid) { $content = elgg_echo('event_calendar:error_nosuchevent'); $title = elgg_echo('event_calendar:generic_error_title'); } else { + event_calendar_handle_menu($event_guid); $title = htmlspecialchars($event->title); $event_container = get_entity($event->container_guid); if (elgg_instanceof($event_container, 'group')) { @@ -1362,6 +1362,100 @@ function event_calendar_get_page_content_view($event_guid) { return elgg_view_page($title,$body); } +function event_calendar_get_page_content_display_users($event_guid) { + elgg_load_js('elgg.event_calendar'); + $event = get_entity($event_guid); + + if (!elgg_instanceof($event, 'object', 'event_calendar')) { + $content = elgg_echo('event_calendar:error_nosuchevent'); + $title = elgg_echo('event_calendar:generic_error_title'); + } else { + event_calendar_handle_menu($event_guid); + $title = elgg_echo('event_calendar:users_for_event_title',array(htmlspecialchars($event->title))); + $event_container = get_entity($event->container_guid); + if (elgg_instanceof($event_container, 'group')) { + elgg_push_context('groups'); + elgg_set_page_owner_guid($event->container_guid); + elgg_push_breadcrumb(elgg_echo('event_calendar:group_breadcrumb'), 'event_calendar/group/'.$event->container_guid); + } else { + elgg_push_breadcrumb(elgg_echo('event_calendar:show_events_title'),'event_calendar/list'); + } + elgg_push_breadcrumb($event->title,$event->getURL()); + elgg_push_breadcrumb(elgg_echo('event_calendar:users_for_event_breadcrumb')); + $limit = 12; + $offset = get_input('offset', 0); + $users = event_calendar_get_users_for_event($event_guid,$limit,$offset,false); + $options = array( + 'full_view' => FALSE, + 'list_type_toggle' => FALSE, + 'limit'=>$limit, + 'event_calendar_event'=>$event, + ); + elgg_extend_view('user/default','event_calendar/calendar_toggle'); + $content = elgg_view_entity_list($users,$options); + } + $params = array('title' => $title, 'content' => $content,'filter' => ''); + + $body = elgg_view_layout("content", $params); + + return elgg_view_page($title,$body); +} + +function event_calendar_get_page_content_review_requests($event_guid) { + $event = get_entity($event_guid); + + if (!elgg_instanceof($event, 'object', 'event_calendar')) { + $content = elgg_echo('event_calendar:error_nosuchevent'); + $title = elgg_echo('event_calendar:generic_error_title'); + } else { + event_calendar_handle_menu($event_guid); + $title = elgg_echo('event_calendar:review_requests_title',array(htmlspecialchars($event->title))); + $event_container = get_entity($event->container_guid); + if (elgg_instanceof($event_container, 'group')) { + elgg_push_context('groups'); + elgg_set_page_owner_guid($event->container_guid); + elgg_push_breadcrumb(elgg_echo('event_calendar:group_breadcrumb'), 'event_calendar/group/'.$event->container_guid); + } else { + elgg_push_breadcrumb(elgg_echo('event_calendar:show_events_title'),'event_calendar/list'); + } + elgg_push_breadcrumb($event->title,$event->getURL()); + elgg_push_breadcrumb(elgg_echo('event_calendar:review_requests_menu_title')); + $user_guid = elgg_get_logged_in_user_guid(); + + if (event_calendar_personal_can_manage($event,$user_guid)) { + $requests = elgg_get_entities_from_relationship( + array( + 'relationship' => 'event_calendar_request', + 'relationship_guid' => $event_guid, + 'inverse_relationship' => TRUE, + 'limit' => 0) + ); + if ($requests) { + $content = elgg_view('event_calendar/review_requests',array('requests' => $requests, 'entity' => $event)); + } else { + $content = elgg_echo('event_calendar:review_requests_request_none'); + } + } else { + $content = elgg_echo('event_calendar:review_requests_error'); + } + } + $params = array('title' => $title, 'content' => $content,'filter' => ''); + + $body = elgg_view_layout("content", $params); + + return elgg_view_page($title,$body); +} + +function event_calendar_handle_menu($event_guid) { + $event_calendar_personal_manage = elgg_get_plugin_setting('personal_manage', 'event_calendar'); + if ($event_calendar_personal_manage == 'no') { + $url = "event_calendar/review_requests/$event_guid"; + $item = new ElggMenuItem('event-calendar-menu', elgg_echo('event_calendar:review_requests_menu_title'), $url); + elgg_register_menu_item('page', $item); + //add_submenu_item(elgg_echo('event_calendar:review_requests_title'), $CONFIG->wwwroot . "pg/event_calendar/review_requests/".$event_id, '0eventcalendaradmin'); + } +} + function getLastDayOfMonth($month,$year) { return idate('d', mktime(0, 0, 0, ($month + 1), 0, $year)); } diff --git a/pages/review_requests.php b/pages/review_requests.php deleted file mode 100644 index fc6c3726a..000000000 --- a/pages/review_requests.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -gatekeeper(); - -$event_id = get_input('event_id',0); - -$title = elgg_echo('event_calendar:review_requests_title'); - -$event = get_entity($event_id); -$user_id = get_loggedin_userid(); - -if (event_calendar_personal_can_manage($event,$user_id)) { - $requests = elgg_get_entities_from_relationship( - array( - 'relationship' => 'event_calendar_request', - 'relationship_guid' => $event_id, - 'inverse_relationship' => TRUE, - 'limit' => 9999) - ); - if ($requests) { - $body = elgg_view('event_calendar/review_requests',array('requests' => $requests, 'entity' => $event)); - //$body = elgg_view('page_elements/contentwrapper',array('body'=>$body)); - } else { - $body = elgg_view('page_elements/contentwrapper',array('body'=>elgg_echo('event_calendar:review_requests_request_none'))); - } -} else { - $body = elgg_view('page_elements/contentwrapper',array('body'=>elgg_echo('event_calendar:review_requests_error'))); -} - -$body = elgg_view_layout('two_column_left_sidebar', '', elgg_view_title($title).$body); - -page_draw($title, $body); -?>
\ No newline at end of file diff --git a/show_event.php b/show_event.php deleted file mode 100644 index f2869c36d..000000000 --- a/show_event.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php - -/** - * Show event - * - * @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/ - * - */ - -// Load Elgg engine -require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); - -// Load event calendar model -require_once(dirname(__FILE__) . "/models/model.php"); - -// Define context -set_context('event_calendar'); - -global $CONFIG; - -$event_id = get_input('event_id',0); -if ($event_id && ($event = get_entity($event_id))) { - $event_container = get_entity($event->container_guid); - if ($event_container instanceOf ElggGroup) { - // Re-define context - set_context('groups'); - set_page_owner($event_container->getGUID()); - } - $count = event_calendar_get_users_for_event($event_id,0,0,true); - if ($count > 0) { - add_submenu_item(sprintf(elgg_echo('event_calendar:personal_event_calendars_link'),$count), $CONFIG->url . "mod/event_calendar/display_event_users.php?event_id=".$event_id, '0eventnonadmin'); - } - if (isloggedin()) { - $user_id = get_loggedin_userid(); - if (event_calendar_personal_can_manage($event,$user_id)) { - if (event_calendar_has_personal_event($event_id,$user_id)) { - add_submenu_item(elgg_echo('event_calendar:remove_from_my_calendar'), $CONFIG->url . "action/event_calendar/manage?event_action=remove_personal&event_id=".$event_id.'&'.event_calendar_security_fields(), '0eventnonadmin'); - } else { - if (!event_calendar_is_full($event_id) && !event_calendar_has_collision($event_id,$user_id)) { - add_submenu_item(elgg_echo('event_calendar:add_to_my_calendar'), $CONFIG->url . "action/event_calendar/manage?event_action=add_personal&event_id=".$event_id.'&'.event_calendar_security_fields(), '0eventnonadmin'); - } - } - } else { - if (!check_entity_relationship($user_id, 'event_calendar_request', $event_id)) { - add_submenu_item(elgg_echo('event_calendar:make_request_title'), $CONFIG->url . "action/event_calendar/request_personal_calendar?event_id=".$event_id.'&'.event_calendar_security_fields(), '0eventnonadmin'); - } - } - } - $body = elgg_view('object/event_calendar',array('entity'=>$event,'full'=>true)); - $title = $event->title; - page_draw($title,elgg_view_layout("two_column_left_sidebar", '', elgg_view_title($title) . $body)); -} else { - register_error('event_calendar:error_nosuchevent'); - forward(); -} -?>
\ No newline at end of file diff --git a/show_events.php b/show_events.php deleted file mode 100644 index d3cd8c76a..000000000 --- a/show_events.php +++ /dev/null @@ -1,213 +0,0 @@ -<?php - -/** - * Show events - * - * @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/ - * - */ - -// Load Elgg engine -require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); - -// Load event model -require_once(dirname(__FILE__) . "/models/model.php"); - -// Define context -set_context('event_calendar'); - -global $CONFIG; - -global $autofeed; -$autofeed = true; - -$event = ''; - -$event_calendar_listing_format = get_plugin_setting('listing_format', 'event_calendar'); -$event_calendar_spots_display = trim(get_plugin_setting('spots_display', 'event_calendar')); -$event_calendar_first_date = trim(get_plugin_setting('first_date', 'event_calendar')); -$event_calendar_last_date = trim(get_plugin_setting('last_date', 'event_calendar')); - -$original_start_date = get_input('start_date',date('Y-m-d')); -if ( $event_calendar_first_date && ($original_start_date < $event_calendar_first_date) ) { - $original_start_date = $event_calendar_first_date; -} -if ( $event_calendar_last_date && ($original_start_date > $event_calendar_last_date) ) { - $original_start_date = $event_calendar_first_date; -} - -if ($event_calendar_listing_format == 'paged') { - $start_ts = strtotime($original_start_date); - $start_date = $original_start_date; - if ($event_calendar_last_date) { - $end_ts = strtotime($event_calendar_last_date); - } else { - // set to a large number - $end_ts = 2000000000; - } -} else { - - // the default interval is one month - $day = 60*60*24; - $week = 7*$day; - $month = 31*$day; - - $mode = trim(get_input('mode','')); - - if ($mode == "day") { - $start_date = $original_start_date; - $end_date = $start_date; - $start_ts = strtotime($start_date); - $end_ts = strtotime($end_date)+$day-1; - } else if ($mode == "week") { - // need to adjust start_date to be the beginning of the week - $start_ts = strtotime($original_start_date); - $start_ts -= date("w",$start_ts)*$day; - $end_ts = $start_ts + 6*$day; - - $start_date = date('Y-m-d',$start_ts); - $end_date = date('Y-m-d',$end_ts); - } else { - $start_ts = strtotime($original_start_date); - $month = date('m',$start_ts); - $year = date('Y',$start_ts); - $start_date = $year.'-'.$month.'-1'; - $end_date = $year.'-'.$month.'-'.getLastDayOfMonth($month,$year); - //$subtitle = elgg_echo('event_calendar:month_label').': '.date('F Y',$start_ts); - // RIBA wants month prefix removed - } - - if ($event_calendar_first_date && ($start_date < $event_calendar_first_date)) { - $start_date = $event_calendar_first_date; - } - - if ($event_calendar_last_date && ($end_date > $event_calendar_last_date)) { - $end_date = $event_calendar_last_date; - } - - $start_ts = strtotime($start_date); - - if ($mode == "day") { - $end_ts = strtotime($end_date)+$day-1; - $subtitle = elgg_echo('event_calendar:day_label').': '.date('j F Y',strtotime($start_date)); - } else if ($mode == "week") { - $end_ts = $start_ts + 6*$day; - $subtitle = elgg_echo('event_calendar:week_label').': '.date('j F',$start_ts) . ' - '.date('j F Y',$end_ts); - } else { - //$subtitle = elgg_echo('event_calendar:month_label').': '.date('F Y',$start_ts); - // RIBA wants month prefix removed - $end_ts = strtotime($end_date); - $subtitle = date('F Y',$start_ts); - } -} - -$group_guid = (int) get_input('group_guid',0); -if ($group_guid && $group = get_entity($group_guid)) { - // redefine context - set_context('groups'); - set_page_owner($group_guid); - $group_calendar = get_plugin_setting('group_calendar', 'event_calendar'); - if (!$group_calendar || $group_calendar == 'members') { - if (page_owner_entity()->canWriteToContainer($_SESSION['user'])){ - add_submenu_item(elgg_echo('event_calendar:new'), $CONFIG->url . "pg/event_calendar/new/?group_guid=" . page_owner(), '1eventcalendaradmin'); - } - } else if ($group_calendar == 'admin') { - if (isadminloggedin() || ($group->owner_guid == get_loggedin_userid())) { - add_submenu_item(elgg_echo('event_calendar:new'), $CONFIG->url . "pg/event_calendar/new/?group_guid=" . page_owner(), '1eventcalendaradmin'); - } - } -} - -$offset = get_input('offset'); - -if ($offset != NULL) { - // don't allow ajax magic during pagination - $offset = (int) $offset; - $callback=''; -} else { - $offset = 0; - $callback = get_input('callback',''); -} - -$limit = 15; -if ($event_calendar_spots_display == 'yes') { - $filter = get_input('filter','open'); -} else { - $filter = get_input('filter','all'); -} -$region = get_input('region','-'); -if ($filter == 'all') { - $count = event_calendar_get_events_between($start_ts,$end_ts,true,$limit,$offset,$group_guid,$region); - $events = event_calendar_get_events_between($start_ts,$end_ts,false,$limit,$offset,$group_guid,$region); -} else if ($filter == 'open') { - $count = event_calendar_get_open_events_between($start_ts,$end_ts,true,$limit,$offset,$group_guid,$region); - $events = event_calendar_get_open_events_between($start_ts,$end_ts,false,$limit,$offset,$group_guid,$region); -} else if ($filter == 'friends') { - $user_guid = get_loggedin_userid(); - $count = event_calendar_get_events_for_friends_between($start_ts,$end_ts,true,$limit,$offset,$user_guid,$group_guid,$region); - $events = event_calendar_get_events_for_friends_between($start_ts,$end_ts,false,$limit,$offset,$user_guid,$group_guid,$region); -} else if ($filter == 'mine') { - $user_guid = get_loggedin_userid(); - $count = event_calendar_get_events_for_user_between($start_ts,$end_ts,true,$limit,$offset,$user_guid,$group_guid,$region); - $events = event_calendar_get_events_for_user_between($start_ts,$end_ts,false,$limit,$offset,$user_guid,$group_guid,$region); -} - -elgg_extend_view('metatags','event_calendar/metatags'); - -$vars = array( 'original_start_date' => $original_start_date, - 'start_date' => $start_date, - 'end_date' => $end_date, - 'first_date' => $event_calendar_first_date, - 'last_date' => $event_calendar_last_date, - 'mode' => $mode, - 'events' => $events, - 'count' => $count, - 'offset' => $offset, - 'limit' => $limit, - 'group_guid' => $group_guid, - 'filter' => $filter, - 'region' => $region, - 'listing_format' => $event_calendar_listing_format, -); - -if ($callback) { - if (isloggedin()) { - $nav = elgg_view('event_calendar/nav',$vars); - } else { - $nav = ''; - } - if ($events) { - if (get_plugin_setting('agenda_view', 'event_calendar') == 'yes') { - $event_list = elgg_view('event_calendar/agenda_view',$vars); - } else { - $event_list = elgg_view_entity_list($events, $count, $offset, $limit, false, false); - } - } else { - $event_list = '<p>'.elgg_echo('event_calendar:no_events_found').'</p>'; - } - echo $nav.'<br />'.$event_list; -} else { - - $body = elgg_view('event_calendar/show_events', $vars); - - if ($event_calendar_listing_format == 'paged') { - $title = elgg_echo('event_calendar:upcoming_events_title'); - } else { - $title = elgg_echo('event_calendar:show_events_title'). ' ('.$subtitle.')'; - } - - $body = elgg_view('page_elements/contentwrapper',array('body' =>$body, 'subclass' => 'events')); - - page_draw($title,elgg_view_layout("two_column_left_sidebar", '', elgg_view_title($title).$body)); -} - -function getLastDayOfMonth($month,$year) { - return idate('d', mktime(0, 0, 0, ($month + 1), 0, $year)); -} - - -?>
\ No newline at end of file @@ -40,17 +40,23 @@ function event_calendar_init() { if (function_exists('elgg_register_tag_metadata_name')) { elgg_register_tag_metadata_name('event_tags'); } + + // register the plugin's JavaScript + $plugin_js = elgg_get_simplecache_url('js', 'event_calendar/event_calendar'); + elgg_register_js('elgg.event_calendar', $plugin_js); //add to group profile page // TODO - are the left and right values still relevant for Elgg 1.8? $group_calendar = elgg_get_plugin_setting('group_calendar', 'event_calendar'); if (!$group_calendar || $group_calendar != 'no') { + // add blog link to + elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'event_calendar_owner_block_menu'); $group_profile_display = elgg_get_plugin_setting('group_profile_display', 'event_calendar'); if (!$group_profile_display || $group_profile_display == 'right') { //elgg_extend_view('groups/right_column', 'event_calendar/groupprofile_calendar'); - elgg_extend_view('groups/tool_latest', 'event_calendar/groupprofile_calendar'); + elgg_extend_view('groups/tool_latest', 'event_calendar/group_module'); } else if ($group_profile_display == 'left') { - elgg_extend_view('groups/tool_latest', 'event_calendar/groupprofile_calendar'); + elgg_extend_view('groups/tool_latest', 'event_calendar/group_module'); //elgg_extend_view('groups/left_column', 'event_calendar/groupprofile_calendar'); } } @@ -94,6 +100,21 @@ function event_calendar_init() { } +/** + * Add a menu item to an ownerblock + */ +function event_calendar_owner_block_menu($hook, $type, $return, $params) { + if (elgg_instanceof($params['entity'], 'group')) { + if ($params['entity']->event_calendar_enable != "no") { + $url = "event_calendar/group/{$params['entity']->guid}"; + $item = new ElggMenuItem('event_calendar', elgg_echo('event_calendar:group'), $url); + $return[] = $item; + } + } + + return $return; +} + // TODO: delete this once everything is recoded function event_calendar_pagesetup() { @@ -156,13 +177,14 @@ function event_calendar_url($entity) { * Dispatches event calendar pages. * * URLs take the form of - * Site event calendar: event_calendar/list/<start_date>/<display_mode>/<filter_context>/<region> - * Single event: event_calendar/view/<event_guid>/<title> - * New event: event_calendar/add - * Edit event: event_calendar/edit/<event_guid> - * Group event calendar: event_calendar/group/<group_guid>/<start_date>/<display_mode> - * Add group event: event_calendar/add/<group_guid> - * Review requests: event_calendar/review_requests/<event_guid> + * Site event calendar: event_calendar/list/<start_date>/<display_mode>/<filter_context>/<region> + * Single event: event_calendar/view/<event_guid>/<title> + * New event: event_calendar/add + * Edit event: event_calendar/edit/<event_guid> + * Group event calendar: event_calendar/group/<group_guid>/<start_date>/<display_mode>/<filter_context>/<region> + * Add group event: event_calendar/add/<group_guid> + * Review requests: event_calendar/review_requests/<event_guid> + * Display event subscribers: event_calendar/display_users/<event_guid> * * Title is ignored * @@ -200,6 +222,9 @@ function event_calendar_page_handler($page) { case 'view': echo event_calendar_get_page_content_view($page[1]); break; + case 'display_users': + echo event_calendar_get_page_content_display_users($page[1]); + break; case 'add': if (isset($page[1])) { group_gatekeeper(); @@ -221,7 +246,17 @@ function event_calendar_page_handler($page) { if (isset($page[2])) { $start_date = $page[2]; if (isset($page[3])) { - $display_mode = $page[3]; + $display_mode = $page[2]; + if (isset($page[3])) { + $filter_mode = $page[3]; + if (isset($page[4])) { + $region = $page[4]; + } else { + $region = ''; + } + } else { + $filter_mode = ''; + } } else { $display_mode = ''; } @@ -231,11 +266,11 @@ function event_calendar_page_handler($page) { } else { $group_guid = 0; } - echo event_calendar_get_page_content_list($page_type,$group_guid,$start_date,$display_mode,''); + echo event_calendar_get_page_content_list($page_type,$group_guid,$start_date,$display_mode,$filter_mode,$region); break; case 'review_requests': gatekeeper(); - $params = event_calendar_get_page_content_review_requests($page_type, $page[1], $page[2]); + echo event_calendar_get_page_content_review_requests($page[1]); break; } } @@ -276,7 +311,7 @@ function event_calendar_entity_menu_setup($hook, $type, $return, $params) { $return[] = ElggMenuItem::factory($options); } } } else { - if (!check_entity_relationship($user_guid, 'event_calendar_request', $entity->guid)) { + if (!event_calendar_has_personal_event($entity->guid,$user_guid) && !check_entity_relationship($user_guid, 'event_calendar_request', $entity->guid)) { $options = array( 'name' => 'personal_calendar', 'text' => elgg_echo('event_calendar:make_request_title'), @@ -287,6 +322,23 @@ function event_calendar_entity_menu_setup($hook, $type, $return, $params) { $return[] = ElggMenuItem::factory($options); } } + + $options = array( + 'name' => 'calendar_listing', + 'text' => elgg_echo('event_calendar:personal_event_calendars_link',array(event_calendar_get_users_for_event($entity->guid,0,0,true))), + 'title' => elgg_echo('event_calendar:users_for_event_menu_title'), + 'href' => "event_calendar/display_users/{$entity->guid}", + 'priority' => 150, + ); + $return[] = ElggMenuItem::factory($options); + + /*if (elgg_is_admin_logged_in() && (elgg_get_plugin_setting('allow_featured', 'event_calendar') == 'yes')) { + if ($event->featured) { + add_submenu_item(elgg_echo('event_calendar:unfeature'), $CONFIG->url . "action/event_calendar/unfeature?event_id=".$event_id.'&'.event_calendar_security_fields(), 'eventcalendaractions'); + } else { + add_submenu_item(elgg_echo('event_calendar:feature'), $CONFIG->url . "action/event_calendar/feature?event_id=".$event_id.'&'.event_calendar_security_fields(), 'eventcalendaractions'); + } + }*/ return $return; } 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 @@ +<?php +$event = $vars['event_calendar_event']; +$user = $vars['entity']; +$container = get_entity($event->container_guid); + +if ($container->canEdit()) { + $link = '<p class="event-calendar-personal-calendar-toggle"><a href="javascript:void(0);" '; + $link .= 'onclick="javascript:event_calendar_personal_toggle('.$event->guid.','.$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>'; + + $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 '<div class="event-calendar-personal-calendar-toggle-wrapper">'.$button.'<div>'; 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 = '<p>' . elgg_echo('event_calendar:no_events_found') . '</p>'; +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 '<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>"; } } 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 @@ +<?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/ + * + */ + +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 '<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 (elgg_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/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 = '<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 .= '<td class="event_calendar_paged_calendar"><input class="event_calendar_paged_checkbox" id="event_calendar_paged_checkbox_'.$event->guid.'" '.$calendar_bit.' type="checkbox" /></td>'; } $info .= '</tr>'; 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 @@ <?php +elgg_load_js('elgg.event_calendar'); $nav = elgg_view('navigation/pagination',array( // 'baseurl' => $_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 = '<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/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 @@ <?php -$region_list = trim(get_plugin_setting('region_list', 'event_calendar')); +$region_list = trim(elgg_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); @@ -11,13 +11,11 @@ if ($region_list) { $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 .= 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 .= '<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 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 .= '<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, + '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 .= '<a href="'.$url.'" class="add_topic_button">'.elgg_echo('accept').'</a>'; - 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 = '<p>'.elgg_echo('event_calendar:no_events_found').'</p>'; diff --git a/views/default/js/event_calendar/event_calendar.php b/views/default/js/event_calendar/event_calendar.php new file mode 100644 index 000000000..f3f5b68c8 --- /dev/null +++ b/views/default/js/event_calendar/event_calendar.php @@ -0,0 +1,69 @@ +//<script type="text/javascript"> +elgg.provide('elgg.event_calendar'); + +elgg.event_calendar.init = function () { + $('.event_calendar_paged_checkbox').click(elgg.event_calendar.handlePagedPersonalCalendarToggle); + $('.event-calendar-personal-calendar-toggle').click(elgg.event_calendar.handleDisplayPagePersonalCalendarToggle); + $('#event-calendar-region').change(elgg.event_calendar.handleRegionChange); +} + +elgg.event_calendar.handleRegionChange = function(e) { + url = $('#event-calendar-region-url-start').val()+"/"+escape($('#event-calendar-region').val()); + elgg.forward(url); +} + +elgg.event_calendar.handlePagedPersonalCalendarToggle = function() { + guid = parseInt($(this).attr('id').substring('event_calendar_paged_checkbox_'.length)); + elgg.event_calendar.togglePagedPersonalCalendar(guid); +} +elgg.event_calendar.togglePagedPersonalCalendar = function(guid) { + elgg.action('event_calendar/toggle_personal_calendar', + { + data: {event_guid: guid}, + success: function (res) { + var success = res.success; + var msg = res.message; + if (success) { + elgg.system_message(msg,2000); + } else { + elgg.register_error(msg,2000); + } + //$('#event_calendar_paged_messages').html(msg); + if (!success) { + // action failed so toggle checkbox + $("#event_calendar_paged_checkbox_"+guid).attr('checked',!$("#event_calendar_paged_checkbox_"+guid).attr('checked')); + } + } + } + ); +} + +elgg.event_calendar.handleDisplayPagePersonalCalendarToggle = function() { + var guidBit = $(this).attr('id').substring('event_calendar_user_data_'.length); + var guids = guidBit.split('_'); + var event_guid = parseInt(guids[0]); + var user_guid = parseInt(guids[1]); + elgg.event_calendar.toggleDisplayPagePersonalCalendar(event_guid,user_guid); +} + +elgg.event_calendar.toggleDisplayPagePersonalCalendar = function(event_guid,user_guid) { + elgg.action('event_calendar/toggle_personal_calendar', + { + data: {event_guid: event_guid,user_guid: user_guid, other: 'yes'}, + success: function (res) { + var success = res.success; + var msg = res.message; + if (success) { + var button_text = res.button_text; + $('#event_calendar_user_data_'+event_guid+'_'+user_guid).val(button_text); + //elgg.system_message(msg,2000); + } else { + elgg.register_error(msg,2000); + } + } + } + ); +} + +elgg.register_hook_handler('init', 'system', elgg.event_calendar.init); +//</script>
\ No newline at end of file diff --git a/views/default/object/event_calendar.php b/views/default/object/event_calendar.php index 43e7847dc..c3c18cc92 100644 --- a/views/default/object/event_calendar.php +++ b/views/default/object/event_calendar.php @@ -12,8 +12,9 @@ */ $event = $vars['entity']; +$full = elgg_extract('full_view', $vars, FALSE); -if ($vars['full']) { +if ($full) { $body = elgg_view('event_calendar/strapline',$vars); $event_items = event_calendar_get_formatted_full_items($event); $body .= '<br />'; diff --git a/views/default/river/object/event_calendar/create.php b/views/default/river/object/event_calendar/create.php index f144ca610..e74a8f891 100644 --- a/views/default/river/object/event_calendar/create.php +++ b/views/default/river/object/event_calendar/create.php @@ -1,12 +1,22 @@ <?php - $performed_by = get_entity($vars['item']->subject_guid); + /*$performed_by = get_entity($vars['item']->subject_guid); $object = get_entity($vars['item']->object_guid); $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>"; $string = sprintf(elgg_echo("event_calendar:river:created"),$url) . " "; - $string .= elgg_echo("event_calendar:river:create")." <a href=\"" . $object->getURL() . "\">" . $object->title . "</a>"; + $string .= elgg_echo("event_calendar:river:create")." <a href=\"" . $object->getURL() . "\">" . $object->title . "</a>";*/ -?> +/** + * Event calendar river view. + */ -<?php echo $string; ?>
\ No newline at end of file +$object = $vars['item']->getObjectEntity(); +$excerpt = strip_tags($object->description); +$vars['excerpt'] = elgg_get_excerpt($excerpt); + +echo elgg_view('page/components/image_block', array( + 'image' => '<img src="'.$vars['url'] . 'mod/event_calendar/images/event_icon.gif" />', + 'body' => elgg_view('river/elements/body', $vars), + 'class' => 'elgg-river-item', +));
\ 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 index 5a5d376b1..f4526cd2a 100644 --- a/views/default/river/object/event_calendar/update.php +++ b/views/default/river/object/event_calendar/update.php @@ -1,12 +1,16 @@ <?php - $performed_by = get_entity($vars['item']->subject_guid); + /*$performed_by = get_entity($vars['item']->subject_guid); $object = get_entity($vars['item']->object_guid); $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>"; $string = sprintf(elgg_echo("event_calendar:river:updated"),$url) . " "; - $string .= elgg_echo("event_calendar:river:the_event")." <a href=\"" . $object->getURL() . "\">" . $object->title . "</a>"; + $string .= elgg_echo("event_calendar:river:the_event")." <a href=\"" . $object->getURL() . "\">" . $object->title . "</a>";*/ -?> +$object = $vars['item']->getObjectEntity(); -<?php echo $string; ?>
\ No newline at end of file +echo elgg_view('page/components/image_block', array( + 'image' => '<img src="'.$vars['url'] . 'mod/event_calendar/images/event_icon.gif" />', + 'body' => elgg_view('river/elements/body', $vars), + 'class' => 'elgg-river-item', +)); diff --git a/views/default/settings/event_calendar/edit.php b/views/default/settings/event_calendar/edit.php index 429a85b26..51bd2c49f 100644 --- a/views/default/settings/event_calendar/edit.php +++ b/views/default/settings/event_calendar/edit.php @@ -10,12 +10,13 @@ $access_options = array( ACCESS_PRIVATE => elgg_echo("PRIVATE"), // 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:agenda')=>'agenda', elgg_echo('event_calendar:settings:month')=>'month', ); $body = ''; -$event_calendar_hide_access = get_plugin_setting('hide_access', 'event_calendar'); +$event_calendar_hide_access = elgg_get_plugin_setting('hide_access', 'event_calendar'); if (!$event_calendar_hide_access) { $event_calendar_hide_access = 'no'; } @@ -26,7 +27,7 @@ $body .= elgg_view('input/radio',array('internalname'=>'params[hide_access]','va $body .= '<br />'; -$event_calendar_default_access = get_plugin_setting('default_access', 'event_calendar'); +$event_calendar_default_access = elgg_get_plugin_setting('default_access', 'event_calendar'); if (!$event_calendar_default_access) { $event_calendar_default_access = ACCESS_LOGGED_IN; } @@ -37,7 +38,7 @@ $body .= elgg_view('input/pulldown',array('internalname'=>'params[default_access $body .= '<br /><br />'; -$event_calendar_hide_end = get_plugin_setting('hide_end', 'event_calendar'); +$event_calendar_hide_end = elgg_get_plugin_setting('hide_end', 'event_calendar'); if (!$event_calendar_hide_end) { $event_calendar_hide_end = 'no'; } @@ -48,7 +49,7 @@ $body .= elgg_view('input/radio',array('internalname'=>'params[hide_end]','value $body .= '<br />'; -$event_calendar_listing_format = get_plugin_setting('listing_format', 'event_calendar'); +$event_calendar_listing_format = elgg_get_plugin_setting('listing_format', 'event_calendar'); if (!$event_calendar_listing_format) { $event_calendar_listing_format = 'month'; } @@ -59,7 +60,7 @@ $body .= elgg_view('input/radio',array('internalname'=>'params[listing_format]', $body .= '<br />'; -$event_calendar_times = get_plugin_setting('times', 'event_calendar'); +$event_calendar_times = elgg_get_plugin_setting('times', 'event_calendar'); if (!$event_calendar_times) { $event_calendar_times = 'no'; } @@ -70,7 +71,7 @@ $body .= elgg_view('input/radio',array('internalname'=>'params[times]','value'=> $body .= '<br />'; -$event_calendar_autopersonal = get_plugin_setting('autopersonal', 'event_calendar'); +$event_calendar_autopersonal = elgg_get_plugin_setting('autopersonal', 'event_calendar'); if (!$event_calendar_autopersonal) { $event_calendar_autopersonal = 'yes'; } @@ -81,7 +82,7 @@ $body .= elgg_view('input/radio',array('internalname'=>'params[autopersonal]','v $body .= '<br />'; -$event_calendar_autogroup = get_plugin_setting('autogroup', 'event_calendar'); +$event_calendar_autogroup = elgg_get_plugin_setting('autogroup', 'event_calendar'); if (!$event_calendar_autogroup) { $event_calendar_autogroup = 'no'; } @@ -92,7 +93,7 @@ $body .= elgg_view('input/radio',array('internalname'=>'params[autogroup]','valu $body .= '<br />'; -$event_calendar_add_to_group_calendar = get_plugin_setting('add_to_group_calendar', 'event_calendar'); +$event_calendar_add_to_group_calendar = elgg_get_plugin_setting('add_to_group_calendar', 'event_calendar'); if (!$event_calendar_add_to_group_calendar) { $event_calendar_add_to_group_calendar = 'no'; } @@ -103,7 +104,9 @@ $body .= elgg_view('input/radio',array('internalname'=>'params[add_to_group_cale $body .= '<br />'; -$event_calendar_agenda_view = get_plugin_setting('agenda_view', 'event_calendar'); +// agenda view is now handled in the listing area + +/*$event_calendar_agenda_view = get_plugin_setting('agenda_view', 'event_calendar'); if (!$event_calendar_agenda_view) { $event_calendar_agenda_view = 'no'; } @@ -112,9 +115,9 @@ $body .= elgg_echo('event_calendar:settings:agenda_view:title'); $body .= '<br />'; $body .= elgg_view('input/radio',array('internalname'=>'params[agenda_view]','value'=>$event_calendar_agenda_view,'options'=>$yn_options)); -$body .= '<br />'; +$body .= '<br />';*/ -$event_calendar_venue_view = get_plugin_setting('venue_view', 'event_calendar'); +$event_calendar_venue_view = elgg_get_plugin_setting('venue_view', 'event_calendar'); if (!$event_calendar_venue_view) { $event_calendar_venue_view = 'no'; } @@ -130,7 +133,7 @@ $options = array(elgg_echo('event_calendar:settings:no')=>'no', elgg_echo('event_calendar:settings:site_calendar:loggedin')=>'loggedin', ); -$event_calendar_site_calendar = get_plugin_setting('site_calendar', 'event_calendar'); +$event_calendar_site_calendar = elgg_get_plugin_setting('site_calendar', 'event_calendar'); if (!$event_calendar_site_calendar) { $event_calendar_site_calendar = 'admin'; } @@ -145,7 +148,7 @@ $options = array(elgg_echo('event_calendar:settings:no')=>'no', elgg_echo('event_calendar:settings:group_calendar:members')=>'members', ); -$event_calendar_group_calendar = get_plugin_setting('group_calendar', 'event_calendar'); +$event_calendar_group_calendar = elgg_get_plugin_setting('group_calendar', 'event_calendar'); if (!$event_calendar_group_calendar) { $event_calendar_group_calendar = 'members'; } @@ -159,7 +162,7 @@ $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'); +$event_calendar_group_default = elgg_get_plugin_setting('group_default', 'event_calendar'); if (!$event_calendar_group_default) { $event_calendar_group_default = 'yes'; } @@ -170,7 +173,7 @@ $body .= elgg_view('input/radio',array('internalname'=>'params[group_default]',' $body .= '<br />'; -$event_calendar_group_always_display = get_plugin_setting('group_always_display', 'event_calendar'); +$event_calendar_group_always_display = elgg_get_plugin_setting('group_always_display', 'event_calendar'); if (!$event_calendar_group_always_display) { $event_calendar_group_always_display = 'no'; } @@ -181,12 +184,14 @@ $body .= elgg_view('input/radio',array('internalname'=>'params[group_always_disp $body .= '<br />'; -$options = array(elgg_echo('event_calendar:settings:group_profile_display_option:left')=>'left', +// There does not seem to be a way to determine where the group calendar box will appear in Elgg 1.8 + +/*$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'); +$event_calendar_group_profile_display = elgg_get_plugin_setting('group_profile_display', 'event_calendar'); if (!$event_calendar_group_profile_display) { $event_calendar_group_profile_display = 'right'; } @@ -194,9 +199,9 @@ if (!$event_calendar_group_profile_display) { $body .= elgg_echo('event_calendar:settings:group_profile_display:title').'<br />'; $body .= elgg_view('input/radio',array('internalname'=>'params[group_profile_display]','value'=>$event_calendar_group_profile_display,'options'=>$options)); -$body .= '<br />'; +$body .= '<br />';*/ -$event_calendar_add_users = get_plugin_setting('add_users', 'event_calendar'); +$event_calendar_add_users = elgg_get_plugin_setting('add_users', 'event_calendar'); if (!$event_calendar_add_users) { $event_calendar_add_users = 'no'; } @@ -207,7 +212,7 @@ $body .= elgg_view('input/radio',array('internalname'=>'params[add_users]','valu $body .= '<br />'; -$event_calendar_add_users_notify = get_plugin_setting('add_users_notify', 'event_calendar'); +$event_calendar_add_users_notify = elgg_get_plugin_setting('add_users_notify', 'event_calendar'); if (!$event_calendar_add_users_notify) { $event_calendar_add_users_notify = 'no'; } @@ -218,7 +223,7 @@ $body .= elgg_view('input/radio',array('internalname'=>'params[add_users_notify] $body .= '<br />'; -$event_calendar_personal_manage = get_plugin_setting('personal_manage', 'event_calendar'); +$event_calendar_personal_manage = elgg_get_plugin_setting('personal_manage', 'event_calendar'); if (!$event_calendar_personal_manage) { $event_calendar_personal_manage = 'yes'; } @@ -229,7 +234,7 @@ $body .= elgg_view('input/radio',array('internalname'=>'params[personal_manage]' $body .= '<br />'; -$event_calendar_spots_display = get_plugin_setting('spots_display', 'event_calendar'); +$event_calendar_spots_display = elgg_get_plugin_setting('spots_display', 'event_calendar'); if (!$event_calendar_spots_display) { $event_calendar_spots_display = 'no'; } @@ -240,7 +245,7 @@ $body .= elgg_view('input/radio',array('internalname'=>'params[spots_display]',' $body .= '<br />'; -$event_calendar_no_collisions = get_plugin_setting('no_collisions', 'event_calendar'); +$event_calendar_no_collisions = elgg_get_plugin_setting('no_collisions', 'event_calendar'); if (!$event_calendar_no_collisions) { $event_calendar_no_collisions = 'no'; } @@ -251,7 +256,7 @@ $body .= elgg_view('input/radio',array('internalname'=>'params[no_collisions]',' $body .= '<br />'; -$event_calendar_collision_length = get_plugin_setting('collision_length', 'event_calendar'); +$event_calendar_collision_length = elgg_get_plugin_setting('collision_length', 'event_calendar'); if (!$event_calendar_collision_length) { $event_calendar_collision_length = '3600'; } @@ -262,7 +267,7 @@ $body .= elgg_view('input/text',array('internalname'=>'params[collision_length]' $body .= '<br /><br />'; -$event_calendar_region_display = get_plugin_setting('region_display', 'event_calendar'); +$event_calendar_region_display = elgg_get_plugin_setting('region_display', 'event_calendar'); if (!$event_calendar_region_display) { $event_calendar_region_display = 'no'; } @@ -273,7 +278,7 @@ $body .= elgg_view('input/radio',array('internalname'=>'params[region_display]', $body .= '<br />'; -$event_calendar_region_list = get_plugin_setting('region_list', 'event_calendar'); +$event_calendar_region_list = elgg_get_plugin_setting('region_list', 'event_calendar'); if (!$event_calendar_region_list) { $event_calendar_region_list = ''; } @@ -284,7 +289,7 @@ $body .= elgg_view('event_calendar/input/longtext',array('internalname'=>'params $body .= '<br />'; -$event_calendar_region_list_handles = get_plugin_setting('region_list_handles', 'event_calendar'); +$event_calendar_region_list_handles = elgg_get_plugin_setting('region_list_handles', 'event_calendar'); if (!$event_calendar_region_list_handles) { $event_calendar_region_list_handles = 'no'; } @@ -295,7 +300,7 @@ $body .= elgg_view('input/radio',array('internalname'=>'params[region_list_handl $body .= '<br />'; -$event_calendar_type_display = get_plugin_setting('type_display', 'event_calendar'); +$event_calendar_type_display = elgg_get_plugin_setting('type_display', 'event_calendar'); if (!$event_calendar_type_display) { $event_calendar_type_display = 'no'; } @@ -306,7 +311,7 @@ $body .= elgg_view('input/radio',array('internalname'=>'params[type_display]','v $body .= '<br />'; -$event_calendar_type_list = get_plugin_setting('type_list', 'event_calendar'); +$event_calendar_type_list = elgg_get_plugin_setting('type_list', 'event_calendar'); if (!$event_calendar_type_list) { $event_calendar_type_list = ''; } @@ -317,7 +322,7 @@ $body .= elgg_view('event_calendar/input/longtext',array('internalname'=>'params $body .= '<br />'; -$event_calendar_type_list_handles = get_plugin_setting('type_list_handles', 'event_calendar'); +$event_calendar_type_list_handles = elgg_get_plugin_setting('type_list_handles', 'event_calendar'); if (!$event_calendar_type_list_handles) { $event_calendar_type_list_handles = 'no'; } @@ -328,7 +333,7 @@ $body .= elgg_view('input/radio',array('internalname'=>'params[type_list_handles $body .= '<br />'; -$event_calendar_first_date = get_plugin_setting('first_date', 'event_calendar'); +$event_calendar_first_date = elgg_get_plugin_setting('first_date', 'event_calendar'); if (!$event_calendar_first_date) { $event_calendar_first_date = ''; } @@ -339,7 +344,7 @@ $body .= elgg_view('input/text',array('internalname'=>'params[first_date]','valu $body .= '<br /><br />'; -$event_calendar_last_date = get_plugin_setting('last_date', 'event_calendar'); +$event_calendar_last_date = elgg_get_plugin_setting('last_date', 'event_calendar'); if (!$event_calendar_last_date) { $event_calendar_last_date = ''; } @@ -350,7 +355,7 @@ $body .= elgg_view('input/text',array('internalname'=>'params[last_date]','value $body .= '<br /><br />'; -$event_calendar_more_required = get_plugin_setting('more_required', 'event_calendar'); +$event_calendar_more_required = elgg_get_plugin_setting('more_required', 'event_calendar'); if (!$event_calendar_more_required) { $event_calendar_more_required = 'no'; } |