]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php
Merge branch 'testing' of gitorious.org:statusnet/mainline into testing
[quix0rs-gnu-social.git] / plugins / GroupPrivateMessage / GroupPrivateMessagePlugin.php
index 9468423bed55498f34d3d42f138e49774bc3c49e..09fd1d7bfa19cd496fa8b20802b9dc2095ddb7c2 100644 (file)
@@ -459,7 +459,39 @@ 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 onStartShowExportData($action)
+    {
+        if ($action instanceof ShowgroupAction) {
+            $gps = Group_privacy_settings::forGroup($action->group);
+        
+            if ($gps->allow_privacy == Group_privacy_settings::ALWAYS) {
+                return false;
+            }
+        }
+        return true;
+    }
+
     function onPluginVersion(&$versions)
     {
         $versions[] = array('name' => 'GroupPrivateMessage',