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