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);
115 * Override to add hentry, and content-inner classes
119 function showContentBlock()
121 $this->elementStart('div', array('id' => 'content', 'class' => 'hentry'));
122 $this->showPageTitle();
123 $this->showPageNoticeBlock();
124 $this->elementStart('div', array('id' => 'content_inner',
125 'class' => 'entry-content'));
126 // show the actual content (forms, lists, whatever)
127 $this->showContent();
128 $this->elementEnd('div');
129 $this->elementEnd('div');
134 * Overrride to add entry-title class
138 function showPageTitle() {
139 $this->element('h1', array('class' => 'entry-title'), $this->title());
144 * Show version information
149 function showContent()
151 $this->elementStart('p');
153 $this->raw(sprintf(_('This site is powered by %1$s version %2$s, '.
154 'Copyright 2008-2010 StatusNet, Inc. '.
155 'and contributors.'),
156 XMLStringer::estring('a', array('href' => 'http://status.net/'),
159 $this->elementEnd('p');
161 $this->element('h2', null, _('Contributors'));
163 $this->element('p', null, implode(', ', $this->contributors));
165 $this->element('h2', null, _('License'));
167 $this->element('p', null,
168 _('StatusNet is free software: you can redistribute it and/or modify '.
169 'it under the terms of the GNU Affero General Public License as published by '.
170 'the Free Software Foundation, either version 3 of the License, or '.
171 '(at your option) any later version. '));
173 $this->element('p', null,
174 _('This program is distributed in the hope that it will be useful, '.
175 'but WITHOUT ANY WARRANTY; without even the implied warranty of '.
176 'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the '.
177 'GNU Affero General Public License for more details. '));
179 $this->elementStart('p');
180 $this->raw(sprintf(_('You should have received a copy of the GNU Affero General Public License '.
181 'along with this program. If not, see %s.'),
182 XMLStringer::estring('a', array('href' => 'http://www.gnu.org/licenses/agpl.html'),
183 'http://www.gnu.org/licenses/agpl.html')));
184 $this->elementEnd('p');
186 // XXX: Theme information?
188 if (count($this->pluginVersions)) {
189 $this->element('h2', null, _('Plugins'));
191 $this->elementStart('table', array('id' => 'plugins_enabled'));
193 $this->elementStart('thead');
194 $this->elementStart('tr');
195 $this->element('th', array('id' => 'plugin_name'), _('Name'));
196 $this->element('th', array('id' => 'plugin_version'), _('Version'));
197 $this->element('th', array('id' => 'plugin_authors'), _('Author(s)'));
198 $this->element('th', array('id' => 'plugin_description'), _('Description'));
199 $this->elementEnd('tr');
200 $this->elementEnd('thead');
202 $this->elementStart('tbody');
203 foreach ($this->pluginVersions as $plugin) {
204 $this->elementStart('tr');
205 if (array_key_exists('homepage', $plugin)) {
206 $this->elementStart('th');
207 $this->element('a', array('href' => $plugin['homepage']),
209 $this->elementEnd('th');
211 $this->element('th', null, $plugin['name']);
214 $this->element('td', null, $plugin['version']);
216 if (array_key_exists('author', $plugin)) {
217 $this->element('td', null, $plugin['author']);
220 if (array_key_exists('rawdescription', $plugin)) {
221 $this->elementStart('td');
222 $this->raw($plugin['rawdescription']);
223 $this->elementEnd('td');
224 } else if (array_key_exists('description', $plugin)) {
225 $this->element('td', null, $plugin['description']);
227 $this->elementEnd('tr');
229 $this->elementEnd('tbody');
230 $this->elementEnd('table');
235 var $contributors = array('Evan Prodromou (StatusNet)',
236 'Zach Copley (StatusNet)',
237 'Earle Martin (StatusNet)',
238 'Marie-Claude Doyon (StatusNet)',
239 'Sarven Capadisli (StatusNet)',
240 'Robin Millette (StatusNet)',
251 'Tryggvi Björgvinsson',
255 'Leslie Michael Orchard',
259 'Tobias Diekershoff',