aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/actions/groups/featured.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-04-20 14:59:56 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-04-20 14:59:56 +0000
commit34625fc95c5e2250ed68abd94c28dccd16438759 (patch)
tree0474c955adee014d40a1ccaf7e383ad6b88dbc26 /mod/groups/actions/groups/featured.php
parentd928588805375e7190ab393e2def555b39701a27 (diff)
downloadelgg-34625fc95c5e2250ed68abd94c28dccd16438759.tar.gz
elgg-34625fc95c5e2250ed68abd94c28dccd16438759.tar.bz2
Fixes #3364: Added action tokens and fixed guids for featuring/unfeaturing groups. Cleaned up language for result messages.
git-svn-id: http://code.elgg.org/elgg/trunk@9006 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/actions/groups/featured.php')
-rw-r--r--mod/groups/actions/groups/featured.php21
1 files changed, 11 insertions, 10 deletions
diff --git a/mod/groups/actions/groups/featured.php b/mod/groups/actions/groups/featured.php
index 2d623b1e4..4cb9f8122 100644
--- a/mod/groups/actions/groups/featured.php
+++ b/mod/groups/actions/groups/featured.php
@@ -10,17 +10,18 @@ $action = get_input('action_type');
$group = get_entity($group_guid);
-if ($group) {
- //get the action, is it to feature or unfeature
- if ($action == "feature") {
- $group->featured_group = "yes";
- system_message(elgg_echo('groups:featuredon'));
- }
+if (!elgg_instanceof($group, 'group')) {
+ register_error(elgg_echo('groups:featured_error'));
+ forward(REFERER);
+}
- if ($action == "unfeature") {
- $group->featured_group = "no";
- system_message(elgg_echo('groups:unfeatured'));
- }
+//get the action, is it to feature or unfeature
+if ($action == "feature") {
+ $group->featured_group = "yes";
+ system_message(elgg_echo('groups:featuredon', array($group->name)));
+} else {
+ $group->featured_group = "no";
+ system_message(elgg_echo('groups:unfeatured', array($group->name)));
}
forward(REFERER);