diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-03-23 00:02:33 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-03-23 00:02:33 +0000 |
commit | 250e367c61b55ee4399e2b4ee49b940512b24b53 (patch) | |
tree | 37c7d96f1d3ef1ab6ed9b9e0da533288b4abf0e5 | |
parent | 8f6acf45e0a371806424f51e19a08bc3edb44e75 (diff) | |
download | elgg-250e367c61b55ee4399e2b4ee49b940512b24b53.tar.gz elgg-250e367c61b55ee4399e2b4ee49b940512b24b53.tar.bz2 |
Fixes #3218 group content pages now use container method to determine who can add content
git-svn-id: http://code.elgg.org/elgg/trunk@8818 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | languages/en.php | 2 | ||||
-rw-r--r-- | mod/blog/languages/en.php | 2 | ||||
-rw-r--r-- | mod/blog/lib/blog.php | 17 | ||||
-rw-r--r-- | mod/bookmarks/pages/bookmarks/all.php | 2 | ||||
-rw-r--r-- | mod/bookmarks/start.php | 4 | ||||
-rw-r--r-- | mod/file/pages/file/owner.php | 12 | ||||
-rw-r--r-- | mod/groups/languages/en.php | 4 | ||||
-rw-r--r-- | mod/pages/languages/en.php | 2 | ||||
-rw-r--r-- | views/default/page/layouts/content/header.php | 21 |
9 files changed, 22 insertions, 44 deletions
diff --git a/languages/en.php b/languages/en.php index bd0247b8a..12e9782a5 100644 --- a/languages/en.php +++ b/languages/en.php @@ -318,7 +318,7 @@ $english = array( 'friends:remove:failure' => "We couldn't remove %s from your friends. Please try again.", 'friends:none' => "This user hasn't added anyone as a friend yet.", - 'friends:none:you' => "You haven't added anyone as a friend! Search for your interests to begin finding people to follow.", + 'friends:none:you' => "You don't have any friends yet.", 'friends:none:found' => "No friends were found.", diff --git a/mod/blog/languages/en.php b/mod/blog/languages/en.php index 126eff898..b626085d7 100644 --- a/mod/blog/languages/en.php +++ b/mod/blog/languages/en.php @@ -21,7 +21,7 @@ $english = array( 'blog:write' => 'Write a blog post', // Editing - 'blog:add' => 'New blog post', + 'blog:add' => 'Add blog post', 'blog:edit' => 'Edit blog post', 'blog:excerpt' => 'Excerpt', 'blog:body' => 'Body', diff --git a/mod/blog/lib/blog.php b/mod/blog/lib/blog.php index 83e6c84ee..e5a44a200 100644 --- a/mod/blog/lib/blog.php +++ b/mod/blog/lib/blog.php @@ -79,24 +79,11 @@ function blog_get_page_content_list($container_guid = NULL) { if ($container_guid == $loggedin_userid) { $return['filter_context'] = 'mine'; + } else if (elgg_instanceof($container, 'group')) { + $return['filter'] = false; } else { // do not show button or select a tab when viewing someone else's posts $return['filter_context'] = 'none'; - $return['buttons'] = ''; - } - - if (elgg_instanceof($container, 'group')) { - $return['filter'] = ''; - if ($container->canWriteToContainer()) { - $url = "blog/add/$container->guid"; - $params = array( - 'href' => $url, - 'text' => elgg_echo("blog:add"), - 'class' => 'elgg-button elgg-button-action', - ); - $buttons = elgg_view('output/url', $params); - $return['buttons'] = $buttons; - } } } else { $return['filter_context'] = 'all'; diff --git a/mod/bookmarks/pages/bookmarks/all.php b/mod/bookmarks/pages/bookmarks/all.php index e49b25b05..0978fd7fd 100644 --- a/mod/bookmarks/pages/bookmarks/all.php +++ b/mod/bookmarks/pages/bookmarks/all.php @@ -5,8 +5,6 @@ * @package ElggBookmarks */ -elgg_set_page_owner_guid(elgg_get_logged_in_user_guid()); - $offset = (int)get_input('offset', 0); $content = elgg_list_entities(array( 'type' => 'object', diff --git a/mod/bookmarks/start.php b/mod/bookmarks/start.php index 9d0aa362e..fa837c1d2 100644 --- a/mod/bookmarks/start.php +++ b/mod/bookmarks/start.php @@ -293,6 +293,10 @@ function bookmarks_page_menu($hook, $type, $return, $params) { // only show bookmarklet in bookmark pages if (elgg_in_context('bookmarks')) { $page_owner = elgg_get_page_owner_entity(); + if (!$page_owner) { + $page_owner = elgg_get_logged_in_user_entity(); + } + if ($page_owner instanceof ElggGroup) { $title = elgg_echo('bookmarks:bookmarklet:group'); } else { diff --git a/mod/file/pages/file/owner.php b/mod/file/pages/file/owner.php index b7bfb00f8..69ec30425 100644 --- a/mod/file/pages/file/owner.php +++ b/mod/file/pages/file/owner.php @@ -29,18 +29,6 @@ if ($owner->guid == elgg_get_logged_in_user_guid()) { // group files $title = elgg_echo("file:user", array($owner->name)); $params['filter'] = ''; - if ($owner->isMember(elgg_get_logged_in_user_entity())) { - $url = "file/add/$owner->guid"; - $vars = array( - 'href' => $url, - 'text' => elgg_echo("file:add"), - 'class' => 'elgg-button elgg-button-action', - ); - $button = elgg_view('output/url', $vars); - $params['buttons'] = $button; - } else { - $params['buttons'] = ''; - } } // List files diff --git a/mod/groups/languages/en.php b/mod/groups/languages/en.php index 50baeb8c7..b0c728b69 100644 --- a/mod/groups/languages/en.php +++ b/mod/groups/languages/en.php @@ -72,7 +72,7 @@ $english = array( 'item:object:groupforumtopic' => "Discussion topics", - 'groupforumtopic:new' => "New discussion post", + 'groupforumtopic:new' => "Add discussion post", 'groups:count' => "groups created", 'groups:open' => "open group", @@ -107,7 +107,7 @@ $english = array( Group discussion */ 'discussion' => 'Discussion', - 'discussion:add' => 'New discussion topic', + 'discussion:add' => 'Add discussion topic', 'discussion:latest' => 'Latest discussion', 'discussion:group' => 'Group discussion', diff --git a/mod/pages/languages/en.php b/mod/pages/languages/en.php index 1cb879edc..14de6d8bf 100644 --- a/mod/pages/languages/en.php +++ b/mod/pages/languages/en.php @@ -15,7 +15,7 @@ $english = array( 'pages:owner' => "%s's pages", 'pages:friends' => "Friends' pages", 'pages:all' => "All site pages", - 'pages:add' => "New page", + 'pages:add' => "Add page", 'pages:group' => "Group pages", 'groups:enablepages' => 'Enable group pages', diff --git a/views/default/page/layouts/content/header.php b/views/default/page/layouts/content/header.php index e9c099b70..4c63009f4 100644 --- a/views/default/page/layouts/content/header.php +++ b/views/default/page/layouts/content/header.php @@ -27,18 +27,19 @@ if ($context) { } else { if (elgg_is_logged_in() && $context) { $owner = elgg_get_page_owner_entity(); - if (elgg_instanceof($owner, 'group')) { + if (!$owner) { + // this is probably an all page + $owner = elgg_get_logged_in_user_entity(); + } + if ($owner && $owner->canWriteToContainer()) { $guid = $owner->getGUID(); - } else { - $guid = elgg_get_logged_in_user_guid(); + elgg_register_menu_item('title', array( + 'name' => 'add', + 'href' => elgg_extract('new_link', $vars, "$context/add/$guid"), + 'text' => elgg_echo("$context:add"), + 'class' => 'elgg-button elgg-button-action', + )); } - - elgg_register_menu_item('title', array( - 'name' => 'add', - 'href' => elgg_extract('new_link', $vars, "$context/add/$guid"), - 'text' => elgg_echo("$context:add"), - 'class' => 'elgg-button elgg-button-action', - )); } $buttons = elgg_view_menu('title', array('sort_by' => 'priority', 'class' => 'elgg-menu-hz')); |