3 * Laconica, the distributed open-source microblogging tool
5 * Form for editing a group
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.
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.
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/>.
24 * @author Evan Prodromou <evan@controlyourself.ca>
25 * @author Sarven Capadisli <csarven@controlyourself.ca>
26 * @copyright 2009 Control Yourself, Inc.
27 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
28 * @link http://laconi.ca/
31 if (!defined('LACONICA')) {
35 require_once INSTALLDIR.'/lib/form.php';
38 * Form for editing a group
42 * @author Evan Prodromou <evan@controlyourself.ca>
43 * @author Sarven Capadisli <csarven@controlyourself.ca>
44 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
45 * @link http://laconi.ca/
47 * @see UnsubscribeForm
50 class GroupEditForm extends Form
53 * group for user to join
61 * @param Action $out output channel
62 * @param User_group $group group to join
65 function __construct($out=null, $group=null)
67 parent::__construct($out);
69 $this->group = $group;
75 * @return string ID of the form
81 return 'form_group_edit-' . $this->group->id;
83 return 'form_group_add';
90 * @return string of the form class
95 return 'form_settings';
101 * @return string URL of the action
107 return common_local_url('editgroup',
108 array('nickname' => $this->group->nickname));
110 return common_local_url('newgroup');
121 function formLegend()
123 $this->out->element('legend', null, _('Create a new group'));
127 * Data elements of the form
135 $id = $this->group->id;
136 $nickname = $this->group->nickname;
137 $fullname = $this->group->fullname;
138 $homepage = $this->group->homepage;
139 $description = $this->group->description;
140 $location = $this->group->location;
150 $this->out->elementStart('ul', 'form_data');
151 $this->out->elementStart('li');
152 $this->out->hidden('groupid', $id);
153 $this->out->input('nickname', _('Nickname'),
154 ($this->out->arg('nickname')) ? $this->out->arg('nickname') : $nickname,
155 _('1-64 lowercase letters or numbers, no punctuation or spaces'));
156 $this->out->elementEnd('li');
157 $this->out->elementStart('li');
158 $this->out->input('fullname', _('Full name'),
159 ($this->out->arg('fullname')) ? $this->out->arg('fullname') : $fullname);
160 $this->out->elementEnd('li');
161 $this->out->elementStart('li');
162 $this->out->input('homepage', _('Homepage'),
163 ($this->out->arg('homepage')) ? $this->out->arg('homepage') : $homepage,
164 _('URL of the homepage or blog of the group or topic'));
165 $this->out->elementEnd('li');
166 $this->out->elementStart('li');
167 $this->out->textarea('description', _('Description'),
168 ($this->out->arg('description')) ? $this->out->arg('description') : $description,
169 _('Describe the group or topic in 140 chars'));
170 $this->out->elementEnd('li');
171 $this->out->elementStart('li');
172 $this->out->input('location', _('Location'),
173 ($this->out->arg('location')) ? $this->out->arg('location') : $location,
174 _('Location for the group, if any, like "City, State (or Region), Country"'));
175 $this->out->elementEnd('li');
176 $this->out->elementEnd('ul');
185 function formActions()
187 $this->out->submit('submit', _('Save'));