aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-10-02 18:42:20 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-10-02 18:42:20 +0000
commitc5a9e171256127a155d8094f7b95cb5bba2b435d (patch)
tree94173d1395f4e8cb5944b301664f5da6702cb12d /mod
parentc09b9f69c9ee875aba0b82c94d2e3e038d7087ef (diff)
downloadelgg-c5a9e171256127a155d8094f7b95cb5bba2b435d.tar.gz
elgg-c5a9e171256127a155d8094f7b95cb5bba2b435d.tar.bz2
Fitter, happier group links
git-svn-id: https://code.elgg.org/elgg/trunk@2163 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod')
-rw-r--r--mod/groups/start.php54
1 files changed, 22 insertions, 32 deletions
diff --git a/mod/groups/start.php b/mod/groups/start.php
index 593f70f14..51fcf9fda 100644
--- a/mod/groups/start.php
+++ b/mod/groups/start.php
@@ -93,47 +93,37 @@
$page_owner = page_owner_entity();
// Submenu items for all group pages
- /*if ($page_owner instanceof ElggGroup) {
- if ($page_owner->canEdit()) {
- add_submenu_item(elgg_echo('groups:edit'),$CONFIG->wwwroot . "mod/groups/edit.php?group_guid=" . $page_owner->getGUID(), '1groupsactions');
- add_submenu_item(elgg_echo('groups:invite'),$CONFIG->wwwroot . "mod/groups/invite.php?group_guid={$page_owner->getGUID()}", '1groupsactions');
- }
- if ($page_owner->isMember($_SESSION['user'])) {
- add_submenu_item(elgg_echo('groups:leave'), $CONFIG->wwwroot . "action/groups/leave?group_guid=" . $page_owner->getGUID(), '1groupsactions');
- } else {
- if ($page_owner->isPublicMembership())
- {
- add_submenu_item(elgg_echo('groups:join'),$CONFIG->wwwroot . "action/groups/join?group_guid={$page_owner->getGUID()}", '1groupsactions');
+ if ($page_owner instanceof ElggGroup && get_context() == 'groups') {
+ if (isloggedin()) {
+ if ($page_owner->canEdit()) {
+ add_submenu_item(elgg_echo('groups:edit'),$CONFIG->wwwroot . "mod/groups/edit.php?group_guid=" . $page_owner->getGUID(), '1groupsactions');
+ add_submenu_item(elgg_echo('groups:invite'),$CONFIG->wwwroot . "mod/groups/invite.php?group_guid={$page_owner->getGUID()}", '1groupsactions');
}
- else
- {
- add_submenu_item(elgg_echo('groups:joinrequest'),$CONFIG->wwwroot . "action/groups/joinrequest?group_guid={$page_owner->getGUID()}", '1groupsactions');
+ if ($page_owner->isMember($_SESSION['user'])) {
+ add_submenu_item(elgg_echo('groups:leave'), $CONFIG->wwwroot . "action/groups/leave?group_guid=" . $page_owner->getGUID(), '1groupsactions');
+ } else {
+ if ($page_owner->isPublicMembership())
+ {
+ add_submenu_item(elgg_echo('groups:join'),$CONFIG->wwwroot . "action/groups/join?group_guid={$page_owner->getGUID()}", '1groupsactions');
+ }
+ else
+ {
+ add_submenu_item(elgg_echo('groups:joinrequest'),$CONFIG->wwwroot . "action/groups/joinrequest?group_guid={$page_owner->getGUID()}", '1groupsactions');
+ }
}
}
add_submenu_item(elgg_echo('groups:forum'),$CONFIG->wwwroot . "pg/groups/forum/{$page_owner->getGUID()}/", '1groupslinks');
- }*/
+ }
// Add submenu options
- if ($page_owner instanceof ElggGroup && get_context() == 'groups') {
- if ((page_owner() == $_SESSION['guid'] || !page_owner()) && isloggedin()) {
- // add_submenu_item(elgg_echo('groups:new'), $CONFIG->wwwroot."pg/groups/new/", '1groupslinks');
- // add_submenu_item(elgg_echo('groups:owned'), $CONFIG->wwwroot . "pg/groups/owned/" . $_SESSION['user']->username, '1groupslinks');
- // add_submenu_item(elgg_echo('groups:yours'), $CONFIG->wwwroot . "pg/groups/member/" . $_SESSION['user']->username, '1groupslinks');
- // add_submenu_item(elgg_echo('groups:all'), $CONFIG->wwwroot . "pg/groups/world/", '1groupslinks');
- add_submenu_item(elgg_echo('groups:forum'),$CONFIG->wwwroot . "pg/groups/forum/{$page_owner->getGUID()}/", '1groupslinks');
- } else if (page_owner()) {
- $page_owner = page_owner_entity();
- if (isloggedin()) add_submenu_item(elgg_echo('groups:yours'), $CONFIG->wwwroot . "pg/groups/owned/" . $_SESSION['user']->username, '1groupslinks');
- add_submenu_item(elgg_echo('groups:all'), $CONFIG->wwwroot . "pg/groups/world/", '1groupslinks');
- } else {
- add_submenu_item(elgg_echo('groups:all'), $CONFIG->wwwroot . "pg/groups/world/", '1groupslinks');
+ if (get_context() == 'groups' && !($page_owner instanceof ElggGroup)) {
+ if (isloggedin()) {
+ add_submenu_item(elgg_echo('groups:new'), $CONFIG->wwwroot."pg/groups/new/", '1groupslinks');
+ add_submenu_item(elgg_echo('groups:owned'), $CONFIG->wwwroot . "pg/groups/owned/" . $_SESSION['user']->username, '1groupslinks');
+ add_submenu_item(elgg_echo('groups:yours'), $CONFIG->wwwroot . "pg/groups/member/" . $_SESSION['user']->username, '1groupslinks');
}
- } else if (get_context() == 'groups') {
- add_submenu_item(elgg_echo('groups:new'), $CONFIG->wwwroot."pg/groups/new/", '1groupslinks');
- add_submenu_item(elgg_echo('groups:owned'), $CONFIG->wwwroot . "pg/groups/owned/" . $_SESSION['user']->username, '1groupslinks');
- add_submenu_item(elgg_echo('groups:yours'), $CONFIG->wwwroot . "pg/groups/member/" . $_SESSION['user']->username, '1groupslinks');
add_submenu_item(elgg_echo('groups:all'), $CONFIG->wwwroot . "pg/groups/world/", '1groupslinks');
}