inviteform.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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. /**
  45. * Constructor
  46. *
  47. * @param Action $out output channel
  48. */
  49. function __construct($out=null)
  50. {
  51. parent::__construct($out);
  52. }
  53. /**
  54. * ID of the form
  55. *
  56. * @return string ID of the form
  57. */
  58. function id()
  59. {
  60. return 'form_invite';
  61. }
  62. /**
  63. * Action of the form
  64. *
  65. * @return string URL of the action
  66. */
  67. function action()
  68. {
  69. return common_local_url('invite');
  70. }
  71. /**
  72. * Name of the form
  73. *
  74. * @return void
  75. */
  76. function formLegend()
  77. {
  78. // TRANS: Form legend.
  79. $this->out->element('legend', null, _('Invite collegues'));
  80. }
  81. /**
  82. * Data elements of the form
  83. *
  84. * @return void
  85. */
  86. function formData()
  87. {
  88. $this->out->elementStart('ul', 'form_data');
  89. $this->out->elementStart('li');
  90. $this->out->textarea(
  91. 'addresses',
  92. // TRANS: Field label for a list of e-mail addresses.
  93. _('Email addresses'),
  94. $this->out->trimmed('addresses'),
  95. // TRANS: Field title for a list of e-mail addresses.
  96. _('Addresses of friends to invite (one per line).')
  97. );
  98. $this->out->elementEnd('li');
  99. $this->out->elementStart('li');
  100. $this->out->textarea(
  101. // TRANS: Field label for a personal message to send to invitees.
  102. 'personal', _('Personal message'),
  103. $this->out->trimmed('personal'),
  104. // TRANS: Field title for a personal message to send to invitees.
  105. _('Optionally add a personal message to the invitation.')
  106. );
  107. $this->out->elementEnd('li');
  108. $this->out->elementEnd('ul');
  109. }
  110. /**
  111. * Action elements
  112. *
  113. * @return void
  114. */
  115. function formActions()
  116. {
  117. $this->out->submit(
  118. 'send',
  119. // TRANS: Send button for inviting friends
  120. _m('BUTTON','Send'), 'submit form_action-primary',
  121. 'send',
  122. // TRANS: Submit button title.
  123. _('Send invitations.')
  124. );
  125. }
  126. }