summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/group.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-10-05 17:08:27 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-10-05 17:08:27 -0700
commitca17727478b44b8bec6bb7f8ed1c8c688818b8f6 (patch)
tree7e2318f601f593974957a32ae6e0460a2ef79676 /modules/gallery/helpers/group.php
parent194cc3b27a73afe5119da9f09407c1e068dc6fa3 (diff)
Access the form validation rules via the API for groups and users
Diffstat (limited to 'modules/gallery/helpers/group.php')
-rw-r--r--modules/gallery/helpers/group.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/modules/gallery/helpers/group.php b/modules/gallery/helpers/group.php
index e0182f9f..074a7b83 100644
--- a/modules/gallery/helpers/group.php
+++ b/modules/gallery/helpers/group.php
@@ -31,7 +31,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;
}
@@ -44,7 +44,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;
}
@@ -111,4 +111,13 @@ class group_Core {
static function groups($filter=array()) {
return Identity::instance()->list_groups($filter);
}
+
+ /**
+ * Return the edit rules associated with an group.
+ *
+ * @return stdClass containing the rules
+ */
+ static function get_edit_rules() {
+ return Identity::instance()->get_edit_rules("group");
+ }
}