3 * StatusNet - the distributed open-source microblogging tool
4 * Copyright (C) 2008-2011, 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 * @author Craig Andrews <candrews@integralblue.com>
45 * @copyright 2009-2011 Free Software Foundation, Inc http://www.fsf.org
46 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
47 * @link http://status.net/
49 class VersionAction extends Action
51 var $pluginVersions = array();
54 * Return true since we're read-only.
56 * @param array $args other arguments
58 * @return boolean is read only action?
60 function isReadOnly($args)
66 * Returns the page title
68 * @return string page title
72 // TRANS: Title for version page. %s is the StatusNet version.
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
86 function prepare($args)
88 parent::prepare($args);
90 Event::handle('PluginVersion', array(&$this->pluginVersions));
98 * Shows a page with the version information in the
101 * @param array $args ignored.
105 function handle($args)
107 parent::handle($args);
113 * Override to add hentry, and content-inner classes
117 function showContentBlock()
119 $this->elementStart('div', array('id' => 'content', 'class' => 'hentry'));
120 $this->showPageTitle();
121 $this->showPageNoticeBlock();
122 $this->elementStart('div', array('id' => 'content_inner',
123 'class' => 'entry-content'));
124 // show the actual content (forms, lists, whatever)
125 $this->showContent();
126 $this->elementEnd('div');
127 $this->elementEnd('div');
131 * Overrride to add entry-title class
135 function showPageTitle() {
136 $this->element('h1', array('class' => 'entry-title'), $this->title());
141 * Show version information
145 function showContent()
147 $this->elementStart('p');
149 // TRANS: Content part of StatusNet version page.
150 // TRANS: %1$s is the engine name (StatusNet) and %2$s is the StatusNet version.
151 $this->raw(sprintf(_('This site is powered by %1$s version %2$s, '.
152 'Copyright 2008-2011 StatusNet, Inc. '.
153 'and contributors.'),
154 XMLStringer::estring('a', array('href' => 'http://status.net/'),
155 // TRANS: Engine name.
158 $this->elementEnd('p');
160 // TRANS: Header for StatusNet contributors section on the version page.
161 $this->element('h2', null, _('Contributors'));
163 sort($this->contributors);
164 $this->element('p', null, implode(', ', $this->contributors));
166 // TRANS: Header for StatusNet license section on the version page.
167 $this->element('h2', null, _('License'));
169 $this->element('p', null,
170 // TRANS: Content part of StatusNet version page.
171 _('StatusNet is free software: you can redistribute it and/or modify '.
172 'it under the terms of the GNU Affero General Public License as published by '.
173 'the Free Software Foundation, either version 3 of the License, or '.
174 '(at your option) any later version. '));
176 $this->element('p', null,
177 // TRANS: Content part of StatusNet version page.
178 _('This program is distributed in the hope that it will be useful, '.
179 'but WITHOUT ANY WARRANTY; without even the implied warranty of '.
180 'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the '.
181 'GNU Affero General Public License for more details. '));
183 $this->elementStart('p');
184 // TRANS: Content part of StatusNet version page.
185 // TRANS: %s is a link to the AGPL license with link description "http://www.gnu.org/licenses/agpl.html".
186 $this->raw(sprintf(_('You should have received a copy of the GNU Affero General Public License '.
187 'along with this program. If not, see %s.'),
188 XMLStringer::estring('a', array('href' => 'http://www.gnu.org/licenses/agpl.html'),
189 'http://www.gnu.org/licenses/agpl.html')));
190 $this->elementEnd('p');
192 // XXX: Theme information?
194 if (count($this->pluginVersions)) {
195 // TRANS: Header for StatusNet plugins section on the version page.
196 $this->element('h2', null, _('Plugins'));
198 $this->elementStart('table', array('id' => 'plugins_enabled'));
200 $this->elementStart('thead');
201 $this->elementStart('tr');
202 // TRANS: Column header for plugins table on version page.
203 $this->element('th', array('id' => 'plugin_name'), _m('HEADER','Name'));
204 // TRANS: Column header for plugins table on version page.
205 $this->element('th', array('id' => 'plugin_version'), _m('HEADER','Version'));
206 // TRANS: Column header for plugins table on version page.
207 $this->element('th', array('id' => 'plugin_authors'), _m('HEADER','Author(s)'));
208 // TRANS: Column header for plugins table on version page.
209 $this->element('th', array('id' => 'plugin_description'), _m('HEADER','Description'));
210 $this->elementEnd('tr');
211 $this->elementEnd('thead');
213 $this->elementStart('tbody');
214 foreach ($this->pluginVersions as $plugin) {
215 $this->elementStart('tr');
216 if (array_key_exists('homepage', $plugin)) {
217 $this->elementStart('th');
218 $this->element('a', array('href' => $plugin['homepage']),
220 $this->elementEnd('th');
222 $this->element('th', null, $plugin['name']);
225 $this->element('td', null, $plugin['version']);
227 if (array_key_exists('author', $plugin)) {
228 $this->element('td', null, $plugin['author']);
231 if (array_key_exists('rawdescription', $plugin)) {
232 $this->elementStart('td');
233 $this->raw($plugin['rawdescription']);
234 $this->elementEnd('td');
235 } else if (array_key_exists('description', $plugin)) {
236 $this->element('td', null, $plugin['description']);
238 $this->elementEnd('tr');
240 $this->elementEnd('tbody');
241 $this->elementEnd('table');
246 var $contributors = array('Evan Prodromou (StatusNet)',
247 'Zach Copley (StatusNet)',
248 'Earle Martin (StatusNet)',
249 'Marie-Claude Doyon (StatusNet)',
250 'Sarven Capadisli (StatusNet)',
251 'Robin Millette (StatusNet)',
262 'Tryggvi Björgvinsson',
266 'Leslie Michael Orchard',
270 'Tobias Diekershoff',
281 'Brion Vibber (StatusNet)',
283 'Samantha Doherty (StatusNet)');