diff options
-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 |