123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260 |
- <?php
- defined('GNUSOCIAL') || die();
- class VersionAction extends Action
- {
- public $pluginVersions = [];
-
- public function isReadOnly($args)
- {
- return true;
- }
-
- public function title()
- {
-
- return sprintf(_('%1$s %2$s'), GNUSOCIAL_ENGINE, GNUSOCIAL_VERSION);
- }
-
- protected function prepare(array $args = [])
- {
- parent::prepare($args);
- $this->pluginVersions = PluginList::getActivePluginVersions();
- return true;
- }
-
- protected function handle()
- {
- parent::handle();
- $this->showPage();
- }
-
- public function showContentBlock()
- {
- $this->elementStart('div', ['id' => 'content', 'class' => 'h-entry']);
- $this->showPageTitle();
- $this->showPageNoticeBlock();
- $this->elementStart('div', ['id' => 'content_inner',
- 'class' => 'e-content']);
-
- $this->showContent();
- $this->elementEnd('div');
- $this->elementEnd('div');
- }
-
- public function showPageTitle()
- {
- $this->element('h1', ['class' => 'entry-title'], $this->title());
- }
-
- public function showContent()
- {
- $this->elementStart('p');
-
-
- $this->raw(sprintf(
- _('This site is powered by %1$s version %2$s, ' .
- 'Copyright 2010 Free Software Foundation, Inc.'),
- XMLStringer::estring(
- 'a',
- ['href' => GNUSOCIAL_ENGINE_URL],
-
- GNUSOCIAL_ENGINE
- ),
- GNUSOCIAL_VERSION
- ));
- $this->elementEnd('p');
-
- $this->element('h2', null, _('Contributors'));
- $this->elementStart('p');
- $this->raw(sprintf(
- 'See %s for a full list of contributors.',
- XMLStringer::estring(
- 'a',
- ['href' => 'https://notabug.org/diogo/gnu-social/src/nightly/CREDITS.md'],
- 'https://notabug.org/diogo/gnu-social/src/nightly/CREDITS.md'
- )
- ));
- $this->elementEnd('p');
-
- $this->element('h2', null, _('License'));
- $this->element(
- 'p',
- null,
-
- sprintf(_('%1$s is free software: you can redistribute it and/or modify ' .
- 'it under the terms of the GNU Affero General Public License as published by ' .
- 'the Free Software Foundation, either version 3 of the License, or ' .
- '(at your option) any later version.'), GNUSOCIAL_ENGINE)
- );
- $this->element(
- 'p',
- null,
-
- _('This program is distributed in the hope that it will be useful, ' .
- 'but WITHOUT ANY WARRANTY; without even the implied warranty of ' .
- 'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' .
- 'GNU Affero General Public License for more details.')
- );
- $this->elementStart('p');
-
-
- $this->raw(sprintf(
- _('You should have received a copy of the GNU Affero General Public License ' .
- 'along with this program. If not, see %s.'),
- XMLStringer::estring(
- 'a',
- ['href' => 'https://www.gnu.org/licenses/agpl.html'],
- 'https://www.gnu.org/licenses/agpl.html'
- )
- ));
- $this->elementEnd('p');
-
- if (count($this->pluginVersions)) {
-
- $this->element('h2', null, _('Plugins'));
- $this->elementStart('table', ['id' => 'plugins_enabled']);
- $this->elementStart('thead');
- $this->elementStart('tr');
-
- $this->element('th', ['id' => 'plugin_name'], _m('HEADER', 'Name'));
-
- $this->element('th', ['id' => 'plugin_version'], _m('HEADER', 'Version'));
-
- $this->element('th', ['id' => 'plugin_authors'], _m('HEADER', 'Author(s)'));
-
- $this->element('th', ['id' => 'plugin_description'], _m('HEADER', 'Description'));
- $this->elementEnd('tr');
- $this->elementEnd('thead');
- $this->elementStart('tbody');
- foreach ($this->pluginVersions as $plugin) {
- $this->elementStart('tr');
- if (array_key_exists('homepage', $plugin)) {
- $this->elementStart('th');
- $this->element(
- 'a',
- ['href' => $plugin['homepage']],
- $plugin['name']
- );
- $this->elementEnd('th');
- } else {
- $this->element('th', null, $plugin['name']);
- }
- $this->element('td', null, $plugin['version']);
- if (array_key_exists('author', $plugin)) {
- $this->element('td', null, $plugin['author']);
- }
- if (array_key_exists('rawdescription', $plugin)) {
- $this->elementStart('td');
- $this->raw($plugin['rawdescription']);
- $this->elementEnd('td');
- } elseif (array_key_exists('description', $plugin)) {
- $this->element('td', null, $plugin['description']);
- }
- $this->elementEnd('tr');
- }
- $this->elementEnd('tbody');
- $this->elementEnd('table');
- }
- }
- }
|