From 204b5e8a63e98d143a9f1f37e7c90fbfdbed8a10 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 7 Feb 2011 14:21:54 -0500 Subject: [PATCH] Show a little indicator for private-only groups --- .../GroupPrivateMessagePlugin.php | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php b/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php index 7598b3f2b7..e086fe91dc 100644 --- a/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php +++ b/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php @@ -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', -- 2.39.5