3 if (!defined('GNUSOCIAL')) { exit(1); }
5 class PollPrefsForm extends Form
7 function __construct(Action $out, User_poll_prefs $prefs=null)
9 parent::__construct($out);
10 $this->prefs = $prefs;
14 * Visible or invisible data elements
16 * Display the form fields that make up the data of the form.
17 * Sub-classes should overload this to show their data.
24 $this->elementStart('fieldset');
25 $this->elementStart('ul', 'form_data');
26 $this->elementStart('li');
27 $this->checkbox('hide_responses',
28 _('Do not deliver poll responses to my home timeline'),
29 ($this->prefs instanceof User_poll_prefs && $this->prefs->hide_responses));
30 $this->elementEnd('li');
31 $this->elementEnd('ul');
32 $this->elementEnd('fieldset');
36 * Buttons for form actions
38 * Submit and cancel buttons (or whatever)
39 * Sub-classes should overload this to show their own buttons.
44 function formActions()
46 $this->submit('submit', _('Save'));
52 * Should be unique on the page. Sub-classes should overload this
53 * to show their own IDs.
55 * @return int ID of the form
60 return 'form_poll_prefs';
66 * URL to post to. Should be overloaded by subclasses to give
67 * somewhere to post to.
69 * @return string URL to post to
74 return common_local_url('pollsettings');
78 * Class of the form. May include space-separated list of multiple classes.
80 * @return string the form's class
85 return 'form_settings';