Пример #1
0
function sched_conf_entity_menu_setup($hook, $type, $return, $params)
{
    if (elgg_in_context('widgets')) {
        return $return;
    }
    elgg_load_library('elgg:sched_conf');
    $entity = $params['entity'];
    $entity = sched_conf_get_event_for_conference($entity->guid);
    $handler = elgg_extract('handler', $params, false);
    if ($handler != 'sched_conf') {
        return $return;
    }
    $user_guid = elgg_get_logged_in_user_guid();
    if (event_calendar_personal_can_manage($entity, $user_guid)) {
        if (event_calendar_has_personal_event($entity->guid, $user_guid)) {
            $options = array('name' => 'personal_calendar', 'text' => elgg_echo('event_calendar:remove_from_the_calendar_menu_text'), 'title' => elgg_echo('event_calendar:remove_from_my_calendar'), 'href' => elgg_add_action_tokens_to_url("action/event_calendar/remove_personal?guid={$entity->guid}"), 'priority' => 150);
            $return[] = ElggMenuItem::factory($options);
        } else {
            if (!event_calendar_is_full($entity->guid) && !event_calendar_has_collision($entity->guid, $user_guid)) {
                $options = array('name' => 'personal_calendar', 'text' => elgg_echo('event_calendar:add_to_the_calendar_menu_text'), 'title' => elgg_echo('event_calendar:add_to_my_calendar'), 'href' => elgg_add_action_tokens_to_url("action/event_calendar/add_personal?guid={$entity->guid}"), 'priority' => 150);
                $return[] = ElggMenuItem::factory($options);
            }
        }
    } else {
        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'), 'title' => elgg_echo('event_calendar:make_request_title'), 'href' => elgg_add_action_tokens_to_url("action/event_calendar/request_personal_calendar?guid={$entity->guid}"), 'priority' => 150);
            $return[] = ElggMenuItem::factory($options);
        }
    }
    $count = event_calendar_get_users_for_event($entity->guid, 0, 0, true);
    if ($count == 1) {
        $calendar_text = elgg_echo('event_calendar:personal_event_calendars_link_one');
    } else {
        $calendar_text = elgg_echo('event_calendar:personal_event_calendars_link', array($count));
    }
    $options = array('name' => 'calendar_listing', 'text' => $calendar_text, '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;
}
Пример #2
0
<?php

$event = $vars['event'];
$users = event_calendar_get_users_for_event($event->guid, 0);
$guids = array();
foreach ($users as $user) {
    $guids[] = $user->guid;
}
// TODO: if the event container is a group need to restrict user picker to the members of the group?
$content = elgg_view('input/userpicker', array('values' => $guids));
$content .= '<br /><br />';
$content .= elgg_view('input/hidden', array('name' => 'event_guid', 'value' => $event->guid));
$content .= elgg_view('input/submit', array('value' => elgg_echo('submit'), 'name' => 'submit_manage_subscribers', 'id' => 'submit-manage-subscribers'));
echo $content;
Пример #3
0
<?php

echo '<section class="panel panel-default mrgn-tp-xl">
	<header class="panel-heading">
	<h3 class="panel-title">Additional info</h3>
	</header>
	<div class="panel-body"><p>';
$count = event_calendar_get_users_for_event($vars['entity']->guid, 0, 0, true);
if ($count == 1) {
    //$calendar_text = '<i class="fa fa-calendar fa-lg icon-unsel"><span class="wb-inv"></span></i> (1)';
    $calendar_text = elgg_echo('event_calendar:personal_event_calendars_link_one');
} else {
    $calendar_text = elgg_echo('event_calendar:personal_event_calendars_link', array($count));
    //$number = $count;
    //$calendar_text = '<i class="fa fa-calendar fa-lg icon-unsel"><span class="wb-inv"></span></i> ('. $number.')';
}
echo '<a href="../../../event_calendar/display_users/' . $vars["entity"]->guid . '"> ' . $calendar_text . ' </a><br><br>';
echo '<b>Organizer:</b> ' . $vars['entity']->contact . '<br>';
echo '<b>Email:</b> ' . $vars['entity']->contact_email . '<br>';
echo '<b>Phone:</b> ' . $vars['entity']->contact_phone . '<br>';
echo '<b>Fees:</b> ' . $vars['entity']->fees . '<br>';
echo '<b>Language:</b> ' . $vars['entity']->language . '<br>';
echo '</p></div>
</section>';
Пример #4
0
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);
}
Пример #5
0
/**
 * Add particular event calendar links/info to entity menu
 */
function event_calendar_entity_menu_setup($hook, $type, $return, $params)
{
    if (elgg_in_context('widgets')) {
        return $return;
    }
    $entity = $params['entity'];
    $handler = elgg_extract('handler', $params, false);
    if ($handler != 'event_calendar') {
        return $return;
    }
    if (elgg_is_active_plugin('event_poll') && $entity->canEdit() && $entity->schedule_type == 'poll') {
        $options = array('name' => 'schedule', 'text' => elgg_echo('event_poll:schedule_button'), 'title' => elgg_echo('event_poll:schedule_button'), 'href' => 'event_poll/vote/' . $entity->guid, 'priority' => 150);
        $return[] = ElggMenuItem::factory($options);
    }
    $user_guid = elgg_get_logged_in_user_guid();
    if ($user_guid) {
        $calendar_status = event_calendar_personal_can_manage($entity, $user_guid);
        if ($calendar_status == 'open') {
            if (event_calendar_has_personal_event($entity->guid, $user_guid)) {
                $options = array('name' => 'personal_calendar', 'text' => elgg_echo('event_calendar:remove_from_the_calendar_menu_text'), 'title' => elgg_echo('event_calendar:remove_from_my_calendar'), 'href' => elgg_add_action_tokens_to_url("action/event_calendar/remove_personal?guid={$entity->guid}"), 'priority' => 150);
                $return[] = ElggMenuItem::factory($options);
            } else {
                if (!event_calendar_is_full($entity->guid) && !event_calendar_has_collision($entity->guid, $user_guid)) {
                    $options = array('name' => 'personal_calendar', 'text' => elgg_echo('event_calendar:add_to_the_calendar_menu_text'), 'title' => elgg_echo('event_calendar:add_to_my_calendar'), 'href' => elgg_add_action_tokens_to_url("action/event_calendar/add_personal?guid={$entity->guid}"), 'priority' => 150);
                    $return[] = ElggMenuItem::factory($options);
                }
            }
        } else {
            if ($calendar_status == 'closed') {
                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'), 'title' => elgg_echo('event_calendar:make_request_title'), 'href' => elgg_add_action_tokens_to_url("action/event_calendar/request_personal_calendar?guid={$entity->guid}"), 'priority' => 150);
                    $return[] = ElggMenuItem::factory($options);
                }
            }
        }
        $count = event_calendar_get_users_for_event($entity->guid, 0, 0, true);
        if ($count == 1) {
            $calendar_text = elgg_echo('event_calendar:personal_event_calendars_link_one');
        } else {
            $calendar_text = elgg_echo('event_calendar:personal_event_calendars_link', array($count));
        }
        $options = array('name' => 'calendar_listing', 'text' => $calendar_text, '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_get_plugin_setting('ical_import_export', 'event_calendar') == "yes") {
            $url = elgg_get_site_url() . 'action/event_calendar/export?filter=' . $entity->guid;
            $options = array('name' => 'ical_export', 'text' => elgg_view('output/img', array('src' => elgg_get_simplecache_url('event_calendar/ics.png'))), 'href' => elgg_add_action_tokens_to_url($url), 'priority' => 1000);
            $return[] = ElggMenuItem::factory($options);
        }
    }
    return $return;
}
Пример #6
0
function event_calendar_queue_reminder($e)
{
    elgg_load_library('elgg:message_queue');
    $subject = elgg_echo('event_calendar:reminder:subject', array($e->title));
    $time_string = event_calendar_get_formatted_time($e);
    $body = elgg_echo('event_calendar:reminder:body', array($e->title, $time_string, $e->getURL()));
    $m = message_queue_create_message($subject, $body);
    if ($m) {
        $users = event_calendar_get_users_for_event($e->guid, 0);
        foreach ($users as $u) {
            message_queue_add($m->guid, $u->guid);
        }
        message_queue_set_for_sending($m->guid);
    }
}