]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #2077 added new blog post button to group blog - can be used as module for remia...
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 29 Dec 2010 21:51:56 +0000 (21:51 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 29 Dec 2010 21:51:56 +0000 (21:51 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7758 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/blog/lib/blog.php

index 8a4ab7644ce81a257bb1c1a4085a4489d780e27a..354bf561d0a5a7fb02e32227fcbfe11dd9266e3e 100644 (file)
@@ -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');