From 250e367c61b55ee4399e2b4ee49b940512b24b53 Mon Sep 17 00:00:00 2001 From: cash Date: Wed, 23 Mar 2011 00:02:33 +0000 Subject: 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 --- mod/blog/languages/en.php | 2 +- mod/blog/lib/blog.php | 17 ++--------------- mod/bookmarks/pages/bookmarks/all.php | 2 -- mod/bookmarks/start.php | 4 ++++ mod/file/pages/file/owner.php | 12 ------------ mod/groups/languages/en.php | 4 ++-- mod/pages/languages/en.php | 2 +- 7 files changed, 10 insertions(+), 33 deletions(-) (limited to 'mod') 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', -- cgit v1.2.3