From 640444e38d4e3a6c88b182464071944627b4e11e Mon Sep 17 00:00:00 2001 From: kevinjardine Date: Mon, 9 Mar 2009 11:07:05 +0000 Subject: Introducing the add_group_tool_option function. git-svn-id: https://code.elgg.org/elgg/trunk@3130 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/group.php | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/engine/lib/group.php b/engine/lib/group.php index 28f6eaa10..9863a7b7b 100644 --- a/engine/lib/group.php +++ b/engine/lib/group.php @@ -262,8 +262,8 @@ public function delete() { if (parent::delete()) - return delete_group_entity($this->get('guid')); - + return delete_group_entity($this->get('guid')); + return false; } @@ -821,6 +821,31 @@ } + /** + * Manages group tool options + * + * @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 + * + **/ + + function add_group_tool_option($name,$label,$default_on=true) { + global $CONFIG; + + if (!isset($CONFIG->group_tool_options)) { + $CONFIG->group_tool_options = array(); + } + + $group_tool_option = new stdClass; + + $group_tool_option->name = $name; + $group_tool_option->label = $label; + $group_tool_option->default_on = $default_on; + + $CONFIG->group_tool_options[] = $group_tool_option; + } + /** * Performs initialisation functions for groups * -- cgit v1.2.3