Example #1
0
/* Get the group template
* and set the templating engine
*/
$group_template = $group_template;
/*
* assign the group keywords
*/
$tpl->assign('group_keywords', $group_keywords);
error_log("istanbul guzeldir - 1");
/*
* Set the authentication variables if this is an
* authenticated user
*/
if ($access_isAuthenticated) {
    // $access_name = $access->getName(); // put user name if he/she is auth'd
    if (isGroupAdmin()) {
        $access_isGroupMember = true;
        $access_isGroupAdmin = true;
    } else {
        $access_isGroupMember = isGroupMember();
    }
}
$defmod = "people";
$function = "people";
if (isset($_GET['function'])) {
    $function = strtolower($_GET['function']);
}
$num_of_modules = 0;
$num_of_modules += intval($allow_wiki);
$num_of_modules += intval($allow_talks);
$no_menu = false;
Example #2
0
/**
 * Registers the buttons for title area of the group profile page
 *
 * @param ElggGroup $group
 */
function groups_register_profile_buttons($group)
{
    $actions = array();
    // group owners
    if ($group->canEdit()) {
        $isAdmin = false;
        if (isSubGroup($group)) {
            if ($group->owner_guid == elgg_get_logged_in_user_guid() || elgg_is_admin_logged_in()) {
                $isAdmin = true;
            } else {
                if (isGroupAdmin($group)) {
                    $isAdmin = true;
                }
            }
        } else {
            $isAdmin = true;
        }
        if ($isAdmin) {
            // edit and invite
            $url = elgg_get_site_url() . "groups/edit/{$group->getGUID()}";
            $actions[$url] = 'groups:edit';
            $url = elgg_get_site_url() . "groups/invite/{$group->getGUID()}";
            $actions[$url] = 'groups:invite';
            $url = elgg_get_site_url() . "groups/copy/{$group->getGUID()}";
            $actions[$url] = 'groups:copy';
        }
    }
    // group members
    if ($group->isMember(elgg_get_logged_in_user_entity())) {
        if ($group->getOwnerGUID() != elgg_get_logged_in_user_guid()) {
            // leave
            $url = elgg_get_site_url() . "action/groups/leave?group_guid={$group->getGUID()}";
            $url = elgg_add_action_tokens_to_url($url);
            $actions[$url] = 'groups:leave';
        }
    } elseif (elgg_is_logged_in()) {
        // join - admins can always join.
        $url = elgg_get_site_url() . "action/groups/join?group_guid={$group->getGUID()}";
        $url = elgg_add_action_tokens_to_url($url);
        if ($group->isPublicMembership() || $group->canEdit()) {
            $actions[$url] = 'groups:join';
        } else {
            // request membership
            $actions[$url] = 'groups:joinrequest';
        }
    }
    if ($actions) {
        foreach ($actions as $url => $text) {
            $confirm = '';
            if ($text == 'groups:leave') {
                $confirm = elgg_echo('groups:leave:warning');
            }
            elgg_register_menu_item('title', array('name' => $text, 'href' => $url, 'text' => elgg_echo($text), 'link_class' => 'elgg-button elgg-button-action', 'confirm' => $confirm));
        }
    }
}