deletenotice.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. if (!defined('GNUSOCIAL')) { exit(1); }
  3. class DeletenoticeForm extends Form
  4. {
  5. protected $notice = null;
  6. function __construct(HTMLOutputter $out=null, array $formOpts=array())
  7. {
  8. if (!array_key_exists('notice', $formOpts) || !$formOpts['notice'] instanceof Notice) {
  9. throw new ServerException('No notice provided to DeletenoticeForm');
  10. }
  11. parent::__construct($out);
  12. $this->notice = $formOpts['notice'];
  13. }
  14. function id()
  15. {
  16. return 'form_notice_delete-' . $this->notice->getID();
  17. }
  18. function formClass()
  19. {
  20. return 'form_settings';
  21. }
  22. function action()
  23. {
  24. return common_local_url('deletenotice', array('notice' => $this->notice->getID()));
  25. }
  26. function formLegend()
  27. {
  28. $this->out->element('legend', null, _('Delete notice'));
  29. }
  30. function formData()
  31. {
  32. $this->out->element('p', null, _('Are you sure you want to delete this notice?'));
  33. }
  34. /**
  35. * Action elements
  36. *
  37. * @return void
  38. */
  39. function formActions()
  40. {
  41. $this->out->submit('form_action-no',
  42. // TRANS: Button label on the delete notice form.
  43. _m('BUTTON','No'),
  44. 'submit form_action-primary',
  45. 'no',
  46. // TRANS: Submit button title for 'No' when deleting a notice.
  47. _('Do not delete this notice.'));
  48. $this->out->submit('form_action-yes',
  49. // TRANS: Button label on the delete notice form.
  50. _m('BUTTON','Yes'),
  51. 'submit form_action-secondary',
  52. 'yes',
  53. // TRANS: Submit button title for 'Yes' when deleting a notice.
  54. _('Delete this notice.'));
  55. }
  56. }