3 * StatusNet - the distributed open-source microblogging tool
4 * Copyright (C) 2008, 2009, StatusNet, Inc.
6 * Show version information for this software and plugins
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU Affero General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Affero General Public License for more details.
20 * You should have received a copy of the GNU Affero General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 * @author Evan Prodromou <evan@status.net>
26 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
27 * @link http://status.net/
30 if (!defined('STATUSNET')) {
37 * A page that shows version information for this site. Helpful for
38 * debugging, for giving credit to authors, and for linking to more
39 * complete documentation for admins.
43 * @author Evan Prodromou <evan@status.net>
44 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
45 * @link http://status.net/
48 class VersionAction extends Action
50 var $pluginVersions = array();
53 * Return true since we're read-only.
55 * @param array $args other arguments
57 * @return boolean is read only action?
60 function isReadOnly($args)
66 * Returns the page title
68 * @return string page title
73 return sprintf(_("StatusNet %s"), STATUSNET_VERSION);
79 * Fire off an event to let plugins report their
82 * @param array $args array misc. arguments
84 * @return boolean true
87 function prepare($args)
89 parent::prepare($args);
91 Event::handle('PluginVersion', array(&$this->pluginVersions));
99 * Shows a page with the version information in the
102 * @param array $args ignored.
107 function handle($args)
109 parent::handle($args);
114 * Show version information
119 function showContent()
121 $this->elementStart('p');
123 $this->raw(sprintf(_('This site is powered by %s version %s, '.
124 'Copyright 2008-2010 StatusNet, Inc. '.
125 'and contributors.'),
126 XMLStringer::estring('a', array('href' => 'http://status.net/'),
129 $this->elementEnd('p');
131 $this->element('h2', null, _('Contributors'));
133 $this->element('p', null, implode(', ', $this->contributors));
135 $this->element('h2', null, _('License'));
137 $this->element('p', null,
138 _('StatusNet is free software: you can redistribute it and/or modify '.
139 'it under the terms of the GNU Affero General Public License as published by '.
140 'the Free Software Foundation, either version 3 of the License, or '.
141 '(at your option) any later version. '));
143 $this->element('p', null,
144 _('This program is distributed in the hope that it will be useful, '.
145 'but WITHOUT ANY WARRANTY; without even the implied warranty of '.
146 'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the '.
147 'GNU Affero General Public License for more details. '));
149 $this->elementStart('p');
150 $this->raw(sprintf(_('You should have received a copy of the GNU Affero General Public License '.
151 'along with this program. If not, see %s.'),
152 XMLStringer::estring('a', array('href' => 'http://www.gnu.org/licenses/agpl.html'),
153 'http://www.gnu.org/licenses/agpl.html')));
154 $this->elementEnd('p');
156 // XXX: Theme information?
158 if (count($this->pluginVersions)) {
159 $this->element('h2', null, _('Plugins'));
161 $this->elementStart('ul');
163 foreach ($this->pluginVersions as $plugin) {
164 $this->elementStart('li');
165 $this->elementStart('dl');
166 $this->element('dt', null, _('Name'));
167 if (array_key_exists('homepage', $plugin)) {
168 $this->elementStart('dd');
169 $this->element('a', array('href' => $plugin['homepage']),
171 $this->elementEnd('dd');
173 $this->element('dd', null, $plugin['name']);
175 $this->element('dt', null, _('Version'));
176 $this->element('dd', null, $plugin['version']);
177 if (array_key_exists('author', $plugin)) {
178 $this->element('dt', null, _('Author(s)'));
179 $this->element('dd', null, $plugin['author']);
181 if (array_key_exists('rawdescription', $plugin)) {
182 $this->element('dt', null, _('Description'));
183 $this->elementStart('dd');
184 $this->raw($plugin['rawdescription']);
185 $this->elementEnd('dd');
186 } else if (array_key_exists('description', $plugin)) {
187 $this->element('dt', null, _('Description'));
188 $this->element('dd', null, $plugin['description']);
190 $this->elementEnd('dl');
191 $this->elementEnd('li');
193 $this->elementEnd('ul');
198 var $contributors = array('Evan Prodromou (StatusNet)',
199 'Zach Copley (StatusNet)',
200 'Earle Martin (StatusNet)',
201 'Marie-Claude Doyon (StatusNet)',
202 'Sarven Capadisli (StatusNet)',
203 'Robin Millette (StatusNet)',
214 'Tryggvi Björgvinsson',
218 'Leslie Michael Orchard',
222 'Tobias Diekershoff',
232 'Brigitte Schuster');