]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Poll/newpollform.php
Merge branch 'master' into 1.0.x
[quix0rs-gnu-social.git] / plugins / Poll / newpollform.php
index 73e516c891c39770101038581e205b87a438e24a..309125a68621eddf22a4581976438dfb0cbe91b0 100644 (file)
@@ -44,10 +44,8 @@ if (!defined('STATUSNET')) {
  * @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();
 
@@ -58,7 +56,6 @@ class NewpollForm extends Form
      *
      * @return void
      */
-
     function __construct($out=null, $question=null, $options=null)
     {
         parent::__construct($out);
@@ -69,7 +66,6 @@ class NewpollForm extends Form
      *
      * @return int ID of the form
      */
-
     function id()
     {
         return 'newpoll-form';
@@ -80,7 +76,6 @@ class NewpollForm extends Form
      *
      * @return string class of the form
      */
-
     function formClass()
     {
         return 'form_settings ajax-notice';
@@ -91,7 +86,6 @@ class NewpollForm extends Form
      *
      * @return string URL of the action
      */
-
     function action()
     {
         return common_local_url('newpoll');
@@ -102,7 +96,6 @@ class NewpollForm extends Form
      *
      * @return void
      */
-
     function formData()
     {
         $this->out->elementStart('fieldset', array('id' => 'newpoll-data'));
@@ -110,8 +103,10 @@ class NewpollForm extends Form
 
         $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();
 
@@ -127,13 +122,23 @@ class NewpollForm extends Form
                 $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');
     }
 
@@ -142,9 +147,9 @@ class NewpollForm extends Form
      *
      * @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');
     }
 }