From 2b6c87dac7970fd44b7216c23c9279c37c463942 Mon Sep 17 00:00:00 2001 From: brettp Date: Mon, 22 Nov 2010 02:19:23 +0000 Subject: Refs #2660: Merged r7409's remove_group_tool_option() to trunk. git-svn-id: http://code.elgg.org/elgg/trunk@7411 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/group.php | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) (limited to 'engine') diff --git a/engine/lib/group.php b/engine/lib/group.php index dd2eff7f8..3e2cc715b 100644 --- a/engine/lib/group.php +++ b/engine/lib/group.php @@ -645,11 +645,13 @@ function group_gatekeeper($forward = true) { } /** - * Manages group tool options + * Adds a group tool option * - * @param string $name Name of the group tool option - * @param string $label Used for the group edit form - * @param boolean $default_on True if this option should be active by default + * @see remove_group_tool_option(). + * + * @param string $name Name of the group tool option + * @param string $label Used for the group edit form + * @param bool $default_on True if this option should be active by default * * @return void */ @@ -669,6 +671,30 @@ function add_group_tool_option($name, $label, $default_on = true) { $CONFIG->group_tool_options[] = $group_tool_option; } +/** + * Removes a group tool option based on name + * + * @see add_group_tool_option() + * + * @param string $name Name of the group tool option + * + * @return void + */ +function remove_group_tool_option($name) { + global $CONFIG; + + if (!isset($CONFIG->group_tool_options)) { + return; + } + + foreach ($CONFIG->group_tool_options as $i => $option) { + if ($option->name == $name) { + unset($CONFIG->group_tool_options[$i]); + } + } +} + + /** * Searches for a group based on a complete or partial name or description * -- cgit v1.2.3