9 * @author Evan Prodromou <evan@status.net>
10 * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
11 * @link http://status.net/
13 * StatusNet - the distributed open-source microblogging tool
14 * Copyright (C) 2008, 2009, StatusNet, Inc.
16 * This program is free software: you can redistribute it and/or modify
17 * it under the terms of the GNU Affero General Public License as published by
18 * the Free Software Foundation, either version 3 of the License, or
19 * (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU Affero General Public License for more details.
26 * You should have received a copy of the GNU Affero General Public License
27 * along with this program. If not, see <http://www.gnu.org/licenses/>.
30 if (!defined('GNUSOCIAL')) { exit(1); }
37 * @author Evan Prodromou <evan@status.net>
38 * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
39 * @link http://status.net/
41 class RepeatAction extends FormAction
43 protected $notice = null; // Notice that is being repeated.
44 protected $repeat = null; // The resulting repeat object/notice.
48 return _m('TITLE', 'Repeat notice');
51 protected function doPreparation()
53 $id = $this->trimmed('notice');
56 // TRANS: Client error displayed when trying to repeat a notice while not providing a notice ID.
57 $this->clientError(_('No notice specified.'));
60 $this->notice = Notice::getKV('id', $id);
62 if (!$this->notice instanceof Notice) {
63 // TRANS: Client error displayed when trying to repeat a non-existing notice.
64 $this->clientError(_('Notice not found.'));
67 $this->repeat = $this->notice->repeat($this->scoped, 'web');
68 if (!$this->repeat instanceof Notice) {
69 // TRANS: Error when unable to repeat a notice for unknown reason.
70 $this->clientError(_('Could not repeat notice for unknown reason. Please contact the webmaster!'));
79 * @param array $args query arguments
83 protected function showContent()
85 $this->element('p', array('id' => 'repeat_response',
86 'class' => 'repeated'),
87 // TRANS: Confirmation text after repeating a notice.