]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - actions/version.php
make a list of plugins
[quix0rs-gnu-social.git] / actions / version.php
1 <?php
2 /**
3  * StatusNet - the distributed open-source microblogging tool
4  * Copyright (C) 2008, 2009, StatusNet, Inc.
5  *
6  * Show version information for this software and plugins
7  *
8  * PHP version 5
9  *
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.
14  *
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.
19  *
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/>.
22  *
23  * @category Info
24  * @package  StatusNet
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/
28  */
29
30 if (!defined('STATUSNET')) {
31     exit(1);
32 }
33
34 /**
35  * Version info page
36  *
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.
40  *
41  * @category Info
42  * @package  StatusNet
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/
46  */
47
48 class VersionAction extends Action
49 {
50     var $pluginVersions = array();
51
52     /**
53      * Return true since we're read-only.
54      *
55      * @param array $args other arguments
56      *
57      * @return boolean is read only action?
58      */
59
60     function isReadOnly($args)
61     {
62         return true;
63     }
64
65     /**
66      * Returns the page title
67      *
68      * @return string page title
69      */
70
71     function title()
72     {
73         return sprintf(_("StatusNet %s"), STATUSNET_VERSION);
74     }
75
76     /**
77      * Prepare to run
78      *
79      * Fire off an event to let plugins report their
80      * versions.
81      *
82      * @param array $args array misc. arguments
83      *
84      * @return boolean true
85      */
86
87     function prepare($args)
88     {
89         parent::prepare($args);
90
91         Event::handle('PluginVersion', array(&$this->pluginVersions));
92
93         return true;
94     }
95
96     /**
97      * Execute the action
98      *
99      * Shows a page with the version information in the
100      * content area.
101      *
102      * @param array $args ignored.
103      *
104      * @return void
105      */
106
107     function handle($args)
108     {
109         parent::handle($args);
110         $this->showPage();
111     }
112
113     /**
114      * Show version information
115      *
116      * @return void
117      */
118
119     function showContent()
120     {
121         $this->elementStart('p');
122
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/'),
127                                                 _('StatusNet')),
128                            STATUSNET_VERSION));
129         $this->elementEnd('p');
130
131         $this->element('h2', null, _('Contributors'));
132
133         $this->element('p', null, implode(', ', $this->contributors));
134
135         $this->element('h2', null, _('License'));
136
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. '));
142
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. '));
148
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');
155
156         // XXX: Theme information?
157
158         if (count($this->pluginVersions)) {
159             $this->element('h2', null, _('Plugins'));
160
161             $this->elementStart('ul');
162
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']),
170                                    $plugin['name']);
171                     $this->elementEnd('dd');
172                 } else {
173                     $this->element('dd', null, $plugin['name']);
174                 }
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']);
180                 }
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']);
189                 }
190                 $this->elementEnd('dl');
191                 $this->elementEnd('li');
192             }
193             $this->elementEnd('ul');
194         }
195
196     }
197
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)',
204                               'Ciaran Gultnieks',
205                               'Michael Landers',
206                               'Ori Avtalion',
207                               'Garret Buell',
208                               'Mike Cochrane',
209                               'Matthew Gregg',
210                               'Florian Biree',
211                               'Erik Stambaugh',
212                               'drry',
213                               'Gina Haeussge',
214                               'Tryggvi Björgvinsson',
215                               'Adrian Lang',
216                               'Meitar Moscovitz',
217                               'Sean Murphy',
218                               'Leslie Michael Orchard',
219                               'Eric Helgeson',
220                               'Ken Sedgwick',
221                               'Brian Hendrickson',
222                               'Tobias Diekershoff',
223                               'Dan Moore',
224                               'Fil',
225                               'Jeff Mitchell',
226                               'Brenda Wallace',
227                               'Jeffery To',
228                               'Federico Marani',
229                               'Craig Andrews',
230                               'mEDI',
231                               'Brett Taylor');
232 }