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 $needPost = true; // At least for now, until repeat interface is available
45 protected $notice = null; // Notice that is being repeated.
46 protected $repeat = null; // The resulting repeat object/notice.
48 protected function prepare(array $args=array())
50 parent::prepare($args);
52 $id = $this->trimmed('notice');
55 // TRANS: Client error displayed when trying to repeat a notice while not providing a notice ID.
56 $this->clientError(_('No notice specified.'));
59 $this->notice = Notice::getKV('id', $id);
61 if (!$this->notice instanceof Notice) {
62 // TRANS: Client error displayed when trying to repeat a non-existing notice.
63 $this->clientError(_('Notice not found.'));
66 $this->repeat = $this->notice->repeat($this->scoped, 'web');
67 if (!$this->repeat instanceof Notice) {
68 // TRANS: Error when unable to repeat a notice for unknown reason.
69 $this->clientError(_('Could not repeat notice for unknown reason. Please contact the webmaster!'));
78 * @param array $args query arguments
82 protected function showContent()
84 $this->element('p', array('id' => 'repeat_response',
85 'class' => 'repeated'),
86 // TRANS: Confirmation text after repeating a notice.