Пример #1
0
/**
 * Groups page handler
 *
 * URLs take the form of
 *  All groups:           groups/all
 *  User's owned groups:  groups/owner/<username>
 *  User's member groups: groups/member/<username>
 *  Group profile:        groups/profile/<guid>/<title>
 *  New group:            groups/add/<guid>
 *  Edit group:           groups/edit/<guid>
 *  Group invitations:    groups/invitations/<username>
 *  Invite to group:      groups/invite/<guid>
 *  Membership requests:  groups/requests/<guid>
 *  Group activity:       groups/activity/<guid>
 *  Group members:        groups/members/<guid>
 *
 * @param array $page Array of url segments for routing
 */
function groups_page_handler($page)
{
    elgg_load_library('elgg:groups');
    elgg_push_breadcrumb(elgg_echo('groups'), "groups/all");
    switch ($page[0]) {
        case 'all':
            groups_handle_all_page();
            break;
        case 'search':
            groups_search_page();
            break;
        case 'owner':
            groups_handle_owned_page();
            break;
        case 'member':
            set_input('username', $page[1]);
            groups_handle_mine_page();
            break;
        case 'invitations':
            set_input('username', $page[1]);
            groups_handle_invitations_page();
            break;
        case 'add':
            groups_handle_edit_page('add');
            break;
        case 'edit':
            groups_handle_edit_page('edit', $page[1]);
            break;
        case 'profile':
            groups_handle_profile_page($page[1]);
            break;
        case 'activity':
            groups_handle_activity_page($page[1]);
            break;
        case 'members':
            groups_handle_members_page($page[1]);
            break;
        case 'invite':
            groups_handle_invite_page($page[1]);
            break;
        case 'requests':
            groups_handle_requests_page($page[1]);
            break;
    }
}
Пример #2
0
/**
 * Groups page handler
 *
 * URLs take the form of
 *  All groups:           groups/all
 *  User's owned groups:  groups/owner/<username>
 *  User's member groups: groups/member/<username>
 *  Group profile:        groups/profile/<guid>/<title>
 *  New group:            groups/add/<guid>
 *  Edit group:           groups/edit/<guid>
 *  Group invitations:    groups/invitations/<username>
 *  Invite to group:      groups/invite/<guid>
 *  Membership requests:  groups/requests/<guid>
 *  Group activity:       groups/activity/<guid>
 *  Group members:        groups/members/<guid>
 *
 * @param array $page Array of url segments for routing
 * @return bool
 */
function groups_page_handler($page)
{
    // forward old profile urls
    if (is_numeric($page[0])) {
        $group = get_entity($page[0]);
        if (elgg_instanceof($group, 'group', '', 'ElggGroup')) {
            system_message(elgg_echo('changebookmark'));
            forward($group->getURL());
        }
    }
    elgg_load_library('elgg:groups');
    if (!isset($page[0])) {
        $page[0] = 'all';
    }
    elgg_push_breadcrumb(elgg_echo('groups'), "groups/all");
    switch ($page[0]) {
        case 'all':
            groups_handle_all_page();
            break;
        case 'search':
            groups_search_page();
            break;
        case 'owner':
            groups_handle_owned_page();
            break;
        case 'member':
            set_input('username', $page[1]);
            groups_handle_mine_page();
            break;
        case 'invitations':
            set_input('username', $page[1]);
            groups_handle_invitations_page();
            break;
        case 'add':
            groups_handle_edit_page('add');
            break;
        case 'edit':
            groups_handle_edit_page('edit', $page[1]);
            break;
        case 'profile':
            groups_handle_profile_page($page[1]);
            break;
        case 'activity':
            groups_handle_activity_page($page[1]);
            break;
        case 'members':
            groups_handle_members_page($page[1]);
            break;
        case 'invite':
            groups_handle_invite_page($page[1]);
            break;
        case 'requests':
            groups_handle_requests_page($page[1]);
            break;
        default:
            return false;
    }
    return true;
}
Пример #3
0
/**
 * Groups page handler
 *
 * URLs take the form of
 *  All groups:           groups/all
 *  User's owned groups:  groups/owner/<username>
 *  User's member groups: groups/member/<username>
 *  Group profile:        groups/profile/<guid>/<title>
 *  New group:            groups/add/<guid>
 *  Edit group:           groups/edit/<guid>
 *  Group invitations:    groups/invitations/<username>
 *  Invite to group:      groups/invite/<guid>
 *  Membership requests:  groups/requests/<guid>
 *  Group activity:       groups/activity/<guid>
 *  Group members:        groups/members/<guid>
 *
 * @param array $page Array of url segments for routing
 * @return bool
 */
function groups_page_handler($page)
{
    elgg_load_library('elgg:groups');
    if (!isset($page[0])) {
        $page[0] = 'all';
    }
    elgg_push_breadcrumb(elgg_echo('groups'), "groups/all");
    switch ($page[0]) {
        case 'all':
            groups_handle_all_page();
            break;
        case 'search':
            groups_search_page();
            break;
        case 'owner':
            groups_handle_owned_page();
            break;
        case 'member':
            set_input('username', $page[1]);
            groups_handle_mine_page();
            break;
        case 'invitations':
            set_input('username', $page[1]);
            groups_handle_invitations_page();
            break;
        case 'add':
            groups_handle_edit_page('add');
            break;
        case 'edit':
            groups_handle_edit_page('edit', $page[1]);
            break;
        case 'manage':
            /* custom */
            groups_handle_manage_page('manage', $page[1]);
            break;
        case 'groupbalance':
            groups_handle_groupbalance_page('groupbalance', $page[1]);
            break;
            /* custom */
        /* custom */
        case 'profile':
            groups_handle_profile_page($page[1]);
            break;
        case 'activity':
            groups_handle_activity_page($page[1]);
            break;
        case 'members':
            groups_handle_members_page($page[1]);
            break;
        case 'invite':
            groups_handle_invite_page($page[1]);
            break;
        case 'requests':
            groups_handle_requests_page($page[1]);
            break;
        default:
            return false;
    }
    return true;
}