diff options
Diffstat (limited to 'modules/gallery/helpers/group.php')
-rw-r--r-- | modules/gallery/helpers/group.php | 57 |
1 files changed, 55 insertions, 2 deletions
diff --git a/modules/gallery/helpers/group.php b/modules/gallery/helpers/group.php index dbfa03fe..3369b5ab 100644 --- a/modules/gallery/helpers/group.php +++ b/modules/gallery/helpers/group.php @@ -125,7 +125,7 @@ class group_Core { $form_group->inputs["name"]->error_messages( "in_use", t("There is already a group with that name")); $form_group->submit("")->value(t("Save")); - $form->add_rules_from($group); + $form->add_rules_from(self::get_edit_rules()); return $form; } @@ -138,7 +138,7 @@ class group_Core { "in_use", t("There is already a group with that name")); $form_group->submit("")->value(t("Add Group")); $group = ORM::factory("group"); - $form->add_rules_from($group); + $form->add_rules_from(self::get_edit_rules()); return $form; } @@ -150,4 +150,57 @@ class group_Core { $form_group->submit("")->value(t("Delete")); return $form; } + + /** + * @see Identity_Driver::create. + */ + static function create($name) { + return Identity::instance()->create_group($name); + } + + /** + * @see Identity_Driver::everbody. + */ + static function everybody() { + return Identity::instance()->everybody(); + } + + /** + * @see Identity_Driver::registered_users. + */ + static function registered_users() { + return Identity::instance()->everybody(); + } + + /** + * Look up a group by id. + * @param integer $id the user id + * @return Group_Definition the group object, or null if the id was invalid. + */ + static function lookup($id) { + return Identity::instance()->lookup_group_by_field("id", $id); + } + + /** + * Look up a group by name. + * @param integer $id the group name + * @return Group_Definition the group object, or null if the name was invalid. + */ + static function lookup_by_name($name) { + return Identity::instance()->lookup_group_by_field("name", $name); + } + + /** + * @see Identity_Driver::get_group_list. + */ + static function get_group_list($filter=array()) { + return Identity::instance()->get_group_list($filter); + } + + /** + * @see Identity_Driver::get_edit_rules. + */ + static function get_edit_rules() { + return Identity::instance()->get_edit_rules("group"); + } } |