From d276934f6d90134a96b57d22d69ecedd29e6d03a Mon Sep 17 00:00:00 2001 From: cash Date: Wed, 29 Dec 2010 21:51:56 +0000 Subject: Refs #2077 added new blog post button to group blog - can be used as module for remianing group tools git-svn-id: http://code.elgg.org/elgg/trunk@7758 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/blog/lib/blog.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'mod/blog/lib/blog.php') diff --git a/mod/blog/lib/blog.php b/mod/blog/lib/blog.php index 8a4ab7644..354bf561d 100644 --- a/mod/blog/lib/blog.php +++ b/mod/blog/lib/blog.php @@ -80,10 +80,6 @@ function blog_get_page_content_list($container_guid = NULL) { $crumbs_title = elgg_echo('blog:owned_blogs', array($container->name)); elgg_push_breadcrumb($crumbs_title); - if (elgg_instanceof($container, 'group')) { - $return['filter'] = ''; - } - if ($container_guid == $loggedin_userid) { $return['filter_context'] = 'mine'; } else{ @@ -91,6 +87,20 @@ function blog_get_page_content_list($container_guid = NULL) { $return['filter_context'] = 'none'; $return['buttons'] = ''; } + + if (elgg_instanceof($container, 'group')) { + $return['filter'] = ''; + if ($container->isMember(get_loggedin_user())) { + $url = "pg/blog/new/$container->guid"; + $params = array( + 'href' => $url, + 'text' => elgg_echo("blog:new"), + 'class' => 'elgg-action-button', + ); + $buttons = elgg_view('output/url', $params); + $return['buttons'] = $buttons; + } + } } else { $return['filter_context'] = 'all'; $return['title'] = elgg_echo('blog:title:all_blogs'); -- cgit v1.2.3