123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <?php
- if (!defined('GNUSOCIAL')) { exit(1); }
- class RepeatAction extends FormAction
- {
- protected $needPost = true;
- protected $notice = null;
- protected $repeat = null;
- protected function prepare(array $args=array())
- {
- parent::prepare($args);
- $id = $this->trimmed('notice');
- if (empty($id)) {
-
- $this->clientError(_('No notice specified.'));
- }
- $this->notice = Notice::getKV('id', $id);
- if (!$this->notice instanceof Notice) {
-
- $this->clientError(_('Notice not found.'));
- }
- $this->repeat = $this->notice->repeat($this->scoped, 'web');
- if (!$this->repeat instanceof Notice) {
-
- $this->clientError(_('Could not repeat notice for unknown reason. Please contact the webmaster!'));
- }
- return true;
- }
-
- protected function showContent()
- {
- $this->element('p', array('id' => 'repeat_response',
- 'class' => 'repeated'),
-
- _('Repeated!'));
- }
- }
|