Skip to content

Commit

Permalink
Fix a bunch of missing or invalid error messages. Fixes ticket #1232.
Browse files Browse the repository at this point in the history
  • Loading branch information
bharat committed Jul 20, 2010
1 parent 1895188 commit e5b1a4f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions modules/user/controllers/admin_users.php
Expand Up @@ -281,7 +281,8 @@ static function _get_user_edit_form_admin($user) {
"admin/users/edit_user/$user->id", "", "post", array("id" => "g-edit-user-form"));
$group = $form->group("edit_user")->label(t("Edit user"));
$group->input("name")->label(t("Username"))->id("g-username")->value($user->name)
->error_messages("conflict", t("There is already a user with that username"));
->error_messages("conflict", t("There is already a user with that username"))
->error_messages("length", t("This name is too long"));
$group->input("full_name")->label(t("Full name"))->id("g-fullname")->value($user->full_name)
->error_messages("length", t("This name is too long"));
$group->password("password")->label(t("Password"))->id("g-password")
Expand Down Expand Up @@ -370,11 +371,13 @@ private function _get_user_delete_form_admin($user) {
private function _get_group_edit_form_admin($group) {
$form = new Forge("admin/users/edit_group/$group->id", "", "post", array("id" => "g-edit-group-form"));
$form_group = $form->group("edit_group")->label(t("Edit group"));
$form_group->input("name")->label(t("Name"))->id("g-name")->value($group->name);
$form_group->input("name")->label(t("Name"))->id("g-name")->value($group->name)
->error_messages("required", t("A name is required"));
$form_group->inputs["name"]->error_messages("conflict", t("There is already a group with that name"))
->error_messages("required", t("You must enter a group name"))
->error_messages("length", t("The group name must be at least %min_length characters",
array("min_length" => 4)));
->error_messages("length",
t("The group name must be between %min_length and %max_length characters",
array("min_length" => 4, "max_length" => 255)));
$form_group->submit("")->value(t("Save"));
return $form;
}
Expand Down

0 comments on commit e5b1a4f

Please sign in to comment.