]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Show a little indicator for private-only groups
authorEvan Prodromou <evan@status.net>
Mon, 7 Feb 2011 19:21:54 +0000 (14:21 -0500)
committerEvan Prodromou <evan@status.net>
Mon, 7 Feb 2011 19:21:54 +0000 (14:21 -0500)
plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php

index 7598b3f2b70aae76b0230fb850933d338de15a17..e086fe91dc17f506d52b2103e71c44e8220ca9a4 100644 (file)
@@ -457,7 +457,27 @@ class GroupPrivateMessagePlugin extends Plugin
         
         return true;
     }
+
+    /**
+     * Show an indicator that the group is (essentially) private on the group page
+     *
+     * @param Action     $action The action being shown
+     * @param User_group $group  The group being shown
+     *
+     * @return boolean hook value
+     */
+
+    function onEndGroupProfileElements($action, $group)
+    {
+        $gps = Group_privacy_settings::forGroup($group);
+        
+        if ($gps->allow_privacy == Group_privacy_settings::ALWAYS) {
+            $action->element('p', 'privategroupindicator', _('Private'));
+        }
+
+        return true;
+    }
+
     function onPluginVersion(&$versions)
     {
         $versions[] = array('name' => 'GroupPrivateMessage',