- $this->elementStart('form', array('id' => 'form_notice_delete',
- 'class' => 'form_settings',
- 'method' => 'post',
- 'action' => common_local_url('deletenotice')));
- $this->elementStart('fieldset');
- // TRANS: Fieldset legend for the delete notice form.
- $this->element('legend', null, _('Delete notice'));
- $this->hidden('token', common_session_token());
- $this->hidden('notice', $this->trimmed('notice'));
- // TRANS: Message for the delete notice form.
- $this->element('p', null, _('Are you sure you want to delete this notice?'));
- $this->submit('form_action-no',
- // TRANS: Button label on the delete notice form.
- _m('BUTTON','No'),
- 'submit form_action-primary',
- 'no',
- // TRANS: Submit button title for 'No' when deleting a notice.
- _('Do not delete this notice.'));
- $this->submit('form_action-yes',
- // TRANS: Button label on the delete notice form.
- _m('BUTTON','Yes'),
- 'submit form_action-secondary',
- 'yes',
- // TRANS: Submit button title for 'Yes' when deleting a notice.
- _('Delete this notice.'));
- $this->elementEnd('fieldset');
- $this->elementEnd('form');
- }
-
- function deleteNotice()
- {
- // CSRF protection
- $token = $this->trimmed('token');
-
- if (!$token || $token != common_session_token()) {
- // TRANS: Client error displayed when the session token does not match or is not given.
- $this->showForm(_('There was a problem with your session token. ' .
- 'Try again, please.'));
- return;
- }
-