inviteform.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <?php
  2. /**
  3. * StatusNet, the distributed open-source microblogging tool
  4. *
  5. * Form for inviting collegues and friends
  6. *
  7. * PHP version 5
  8. *
  9. * LICENCE: This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Affero General Public License as published by
  11. * the Free Software Foundation, either version 3 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Affero General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Affero General Public License
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. *
  22. * @category Form
  23. * @package StatusNet
  24. * @author Zach Copley <zach@status.net>
  25. * @copyright 2011 StatusNet, Inc.
  26. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  27. * @link http://status.net/
  28. */
  29. if (!defined('STATUSNET')) {
  30. exit(1);
  31. }
  32. require_once INSTALLDIR . '/lib/util/form.php';
  33. /**
  34. * Form for inviting collegues and friends
  35. *
  36. * @category Form
  37. * @package StatusNet
  38. * @author Zach Copley <zach@status.net>
  39. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  40. * @link http://status.net/
  41. */
  42. class InviteForm extends Form
  43. {
  44. public $widgetOpts;
  45. public $scoped;
  46. /**
  47. * Constructor
  48. *
  49. * @param Action $out output channel
  50. */
  51. function __construct($out=null)
  52. {
  53. parent::__construct($out);
  54. }
  55. /**
  56. * ID of the form
  57. *
  58. * @return string ID of the form
  59. */
  60. function id()
  61. {
  62. return 'form_invite';
  63. }
  64. /**
  65. * Action of the form
  66. *
  67. * @return string URL of the action
  68. */
  69. function action()
  70. {
  71. return common_local_url('invite');
  72. }
  73. /**
  74. * Name of the form
  75. *
  76. * @return void
  77. */
  78. function formLegend()
  79. {
  80. // TRANS: Form legend.
  81. $this->out->element('legend', null, _('Invite collegues'));
  82. }
  83. /**
  84. * Data elements of the form
  85. *
  86. * @return void
  87. */
  88. function formData()
  89. {
  90. $this->out->elementStart('ul', 'form_data');
  91. $this->out->elementStart('li');
  92. $this->out->textarea(
  93. 'addresses',
  94. // TRANS: Field label for a list of e-mail addresses.
  95. _('Email addresses'),
  96. $this->out->trimmed('addresses'),
  97. // TRANS: Field title for a list of e-mail addresses.
  98. _('Addresses of friends to invite (one per line).')
  99. );
  100. $this->out->elementEnd('li');
  101. $this->out->elementStart('li');
  102. $this->out->textarea(
  103. // TRANS: Field label for a personal message to send to invitees.
  104. 'personal', _('Personal message'),
  105. $this->out->trimmed('personal'),
  106. // TRANS: Field title for a personal message to send to invitees.
  107. _('Optionally add a personal message to the invitation.')
  108. );
  109. $this->out->elementEnd('li');
  110. $this->out->elementEnd('ul');
  111. }
  112. /**
  113. * Action elements
  114. *
  115. * @return void
  116. */
  117. function formActions()
  118. {
  119. $this->out->submit(
  120. 'send',
  121. // TRANS: Send button for inviting friends
  122. _m('BUTTON','Send'), 'submit form_action-primary',
  123. 'send',
  124. // TRANS: Submit button title.
  125. _('Send invitations.')
  126. );
  127. }
  128. }