3 * StatusNet, the distributed open-source microblogging tool
6 * LICENCE: This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 * @copyright 2010 StatusNet, Inc.
21 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
22 * @link http://status.net/
25 if (!defined('STATUSNET') && !defined('LACONICA')) {
29 class AddMirrorForm extends Form
34 * Sub-classes should overload this with the name of their form.
43 * Visible or invisible data elements
45 * Display the form fields that make up the data of the form.
46 * Sub-classes should overload this to show their data.
52 $this->out->hidden('provider', 'feed');
53 $this->out->elementStart('fieldset');
55 $this->out->elementStart('ul');
58 $this->doInput('addmirror-feedurl',
60 // TRANS: Field label.
61 _m('Web page or feed URL:'),
62 $this->out->trimmed('feedurl'));
66 // TRANS: Button text for adding a feed.
67 $this->out->submit('addmirror-save', _m('BUTTON','Add feed'));
69 $this->out->elementEnd('ul');
70 $this->out->elementEnd('fieldset');
73 protected function doInput($id, $name, $label, $value=null, $instructions=null)
75 $this->out->element('label', array('for' => $id), $label);
76 $attrs = array('name' => $name,
79 'style' => 'width: 80%');
81 $attrs['value'] = $value;
83 $this->out->element('input', $attrs);
85 $this->out->element('p', 'form_guide', $instructions);
90 * Buttons for form actions
92 * Submit and cancel buttons (or whatever)
93 * Sub-classes should overload this to show their own buttons.
97 function formActions()
104 * Should be unique on the page. Sub-classes should overload this
105 * to show their own IDs.
107 * @return string ID of the form
111 return 'add-mirror-form';
115 * Action of the form.
117 * URL to post to. Should be overloaded by subclasses to give
118 * somewhere to post to.
120 * @return string URL to post to
124 return common_local_url('addmirror');
130 * @return string the form's class
134 return 'form_settings';