diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-22 02:19:23 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-22 02:19:23 +0000 |
commit | 2b6c87dac7970fd44b7216c23c9279c37c463942 (patch) | |
tree | 4de17b3d1e10aa900c6f44a28379c2a69f25d102 /engine/lib | |
parent | bf341b8a6164dad70ce289862bff828782c68213 (diff) | |
download | elgg-2b6c87dac7970fd44b7216c23c9279c37c463942.tar.gz elgg-2b6c87dac7970fd44b7216c23c9279c37c463942.tar.bz2 |
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
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/group.php | 34 |
1 files changed, 30 insertions, 4 deletions
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 */ @@ -670,6 +672,30 @@ function add_group_tool_option($name, $label, $default_on = true) { } /** + * 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 * * @param string $criteria The partial or full name or description |