* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
-
class NewpollForm extends Form
{
-
protected $question = null;
protected $options = array();
*
* @return void
*/
-
function __construct($out=null, $question=null, $options=null)
{
parent::__construct($out);
*
* @return int ID of the form
*/
-
function id()
{
return 'newpoll-form';
*
* @return string class of the form
*/
-
function formClass()
{
return 'form_settings ajax-notice';
*
* @return string URL of the action
*/
-
function action()
{
return common_local_url('newpoll');
*
* @return void
*/
-
function formData()
{
$this->out->elementStart('fieldset', array('id' => 'newpoll-data'));
$this->li();
$this->out->input('question',
+ // TRANS: Field label on the page to create a poll.
_m('Question'),
$this->question,
+ // TRANS: Field title on the page to create a poll.
_m('What question are people answering?'));
$this->unli();
$default = '';
}
$this->li();
- $this->out->input('option' . ($i + 1),
+ $this->out->input('poll-option' . ($i + 1),
+ // TRANS: Field label for an answer option on the page to create a poll.
+ // TRANS: %d is the option number.
sprintf(_m('Option %d'), $i + 1),
- $default);
+ $default,
+ null,
+ 'option' . ($i + 1));
$this->unli();
}
$this->out->elementEnd('ul');
+
+ $toWidget = new ToSelector($this->out,
+ common_current_user(),
+ null);
+ $toWidget->show();
+
$this->out->elementEnd('fieldset');
}
*
* @return void
*/
-
function formActions()
{
- $this->out->submit('submit', _m('BUTTON', 'Save'));
+ // TRANS: Button text for saving a new poll.
+ $this->out->submit('poll-submit', _m('BUTTON', 'Save'), 'submit', 'submit');
}
}