events for modifying group edit form

This commit is contained in:
Evan Prodromou 2011-01-26 18:21:43 -07:00
parent edeaf8a2f8
commit 5fee38b025
3 changed files with 155 additions and 141 deletions

View File

@ -1057,3 +1057,9 @@ StartCloseNoticeListItemElement: Before the closing </li> of a notice list eleme
EndCloseNoticeListItemElement: After the closing </li> of a notice list element
- $nli: The notice list item being shown
StartGroupEditFormData: Beginning the group edit form entries
- $form: The form widget being shown
EndGroupEditFormData: Ending the group edit form entries
- $form: The form widget being shown

View File

@ -177,6 +177,8 @@ class EditgroupAction extends GroupDesignAction
return;
}
if (Event::handle('StartGroupSaveForm', array($this))) {
$nickname = Nickname::normalize($this->trimmed('nickname'));
$fullname = $this->trimmed('fullname');
$homepage = $this->trimmed('homepage');
@ -287,6 +289,9 @@ class EditgroupAction extends GroupDesignAction
$this->group->query('COMMIT');
Event::handle('EndGroupSaveForm', array($this));
}
if ($this->group->nickname != $orig->nickname) {
common_redirect(common_local_url('editgroup',
array('nickname' => $nickname)),

View File

@ -147,6 +147,7 @@ class GroupEditForm extends Form
}
$this->out->elementStart('ul', 'form_data');
if (Event::handle('StartGroupEditFormData', array($this))) {
$this->out->elementStart('li');
$this->out->hidden('groupid', $id);
$this->out->input('nickname', _('Nickname'),
@ -193,6 +194,8 @@ class GroupEditForm extends Form
common_config('group', 'maxaliases')));;
$this->out->elementEnd('li');
}
Event::handle('EndGroupEditFormData', array($this));
}
$this->out->elementEnd('ul');
}