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 * @author Craig Andrews <candrews@integralblue.com>
45 * @copyright 2009 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/
50 class VersionAction extends Action
52 var $pluginVersions = array();
55 * Return true since we're read-only.
57 * @param array $args other arguments
59 * @return boolean is read only action?
62 function isReadOnly($args)
68 * Returns the page title
70 * @return string page title
75 return sprintf(_("StatusNet %s"), STATUSNET_VERSION);
81 * Fire off an event to let plugins report their
84 * @param array $args array misc. arguments
86 * @return boolean true
89 function prepare($args)
91 parent::prepare($args);
93 Event::handle('PluginVersion', array(&$this->pluginVersions));
101 * Shows a page with the version information in the
104 * @param array $args ignored.
109 function handle($args)
111 parent::handle($args);
117 * Override to add hentry, and content-inner classes
121 function showContentBlock()
123 $this->elementStart('div', array('id' => 'content', 'class' => 'hentry'));
124 $this->showPageTitle();
125 $this->showPageNoticeBlock();
126 $this->elementStart('div', array('id' => 'content_inner',
127 'class' => 'entry-content'));
128 // show the actual content (forms, lists, whatever)
129 $this->showContent();
130 $this->elementEnd('div');
131 $this->elementEnd('div');
136 * Overrride to add entry-title class
140 function showPageTitle() {
141 $this->element('h1', array('class' => 'entry-title'), $this->title());
146 * Show version information
151 function showContent()
153 $this->elementStart('p');
155 $this->raw(sprintf(_('This site is powered by %1$s version %2$s, '.
156 'Copyright 2008-2010 StatusNet, Inc. '.
157 'and contributors.'),
158 XMLStringer::estring('a', array('href' => 'http://status.net/'),
161 $this->elementEnd('p');
163 $this->element('h2', null, _('Contributors'));
165 $this->element('p', null, implode(', ', $this->contributors));
167 $this->element('h2', null, _('License'));
169 $this->element('p', null,
170 _('StatusNet is free software: you can redistribute it and/or modify '.
171 'it under the terms of the GNU Affero General Public License as published by '.
172 'the Free Software Foundation, either version 3 of the License, or '.
173 '(at your option) any later version. '));
175 $this->element('p', null,
176 _('This program is distributed in the hope that it will be useful, '.
177 'but WITHOUT ANY WARRANTY; without even the implied warranty of '.
178 'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the '.
179 'GNU Affero General Public License for more details. '));
181 $this->elementStart('p');
182 $this->raw(sprintf(_('You should have received a copy of the GNU Affero General Public License '.
183 'along with this program. If not, see %s.'),
184 XMLStringer::estring('a', array('href' => 'http://www.gnu.org/licenses/agpl.html'),
185 'http://www.gnu.org/licenses/agpl.html')));
186 $this->elementEnd('p');
188 // XXX: Theme information?
190 if (count($this->pluginVersions)) {
191 $this->element('h2', null, _('Plugins'));
193 $this->elementStart('table', array('id' => 'plugins_enabled'));
195 $this->elementStart('thead');
196 $this->elementStart('tr');
197 $this->element('th', array('id' => 'plugin_name'), _('Name'));
198 $this->element('th', array('id' => 'plugin_version'), _('Version'));
199 $this->element('th', array('id' => 'plugin_authors'), _('Author(s)'));
200 $this->element('th', array('id' => 'plugin_description'), _('Description'));
201 $this->elementEnd('tr');
202 $this->elementEnd('thead');
204 $this->elementStart('tbody');
205 foreach ($this->pluginVersions as $plugin) {
206 $this->elementStart('tr');
207 if (array_key_exists('homepage', $plugin)) {
208 $this->elementStart('th');
209 $this->element('a', array('href' => $plugin['homepage']),
211 $this->elementEnd('th');
213 $this->element('th', null, $plugin['name']);
216 $this->element('td', null, $plugin['version']);
218 if (array_key_exists('author', $plugin)) {
219 $this->element('td', null, $plugin['author']);
222 if (array_key_exists('rawdescription', $plugin)) {
223 $this->elementStart('td');
224 $this->raw($plugin['rawdescription']);
225 $this->elementEnd('td');
226 } else if (array_key_exists('description', $plugin)) {
227 $this->element('td', null, $plugin['description']);
229 $this->elementEnd('tr');
231 $this->elementEnd('tbody');
232 $this->elementEnd('table');
237 var $contributors = array('Evan Prodromou (StatusNet)',
238 'Zach Copley (StatusNet)',
239 'Earle Martin (StatusNet)',
240 'Marie-Claude Doyon (StatusNet)',
241 'Sarven Capadisli (StatusNet)',
242 'Robin Millette (StatusNet)',
253 'Tryggvi Björgvinsson',
257 'Leslie Michael Orchard',
261 'Tobias Diekershoff',