You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
roundcubemail/program/steps/settings/about.inc

112 lines
4.3 KiB
PHTML

<?php
10 years ago
/**
+-----------------------------------------------------------------------+
| program/steps/settings/about.inc |
| |
| This file is part of the Roundcube Webmail client |
11 years ago
| Copyright (C) 2005-2013, The Roundcube Dev Team |
| Copyright (C) 2011-2013, Kolab Systems AG |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
| See the README file for a full license statement. |
| |
| PURPOSE: |
| Display license information about program and enabled plugins |
| |
+-----------------------------------------------------------------------+
| Author: Aleksander Machniak <alec@alec.pl> |
+-----------------------------------------------------------------------+
*/
define('RC_COPYRIGHT', 'Copyright &copy; 2005-2019, The Roundcube Dev Team');
define('RC_LICENSE', 'This program is free software; you can redistribute it and/or modify it under the terms of the '
. '<a href="http://www.gnu.org/licenses/gpl.html" target="_blank">GNU General Public License</a> '
. 'as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.'
. '<br/>Some <a href="https://roundcube.net/license" target="_blank">exceptions</a> for skins &amp; plugins apply.');
11 years ago
$OUTPUT->set_pagetitle($RCMAIL->gettext('about'));
$OUTPUT->add_handlers(array(
'supportlink' => 'rcmail_supportlink',
'pluginlist' => 'rcmail_plugins_list',
'copyright' => function() { return RC_COPYRIGHT; },
'license' => function() { return RC_LICENSE; },
));
11 years ago
$OUTPUT->send('about');
function rcmail_supportlink($attrib)
{
11 years ago
global $RCMAIL;
11 years ago
if ($url = $RCMAIL->config->get('support_url')) {
$label = $attrib['label'] ?: 'support';
11 years ago
$attrib['href'] = $url;
return html::a($attrib, $RCMAIL->gettext($label));
}
}
function rcmail_plugins_list($attrib)
{
11 years ago
global $RCMAIL;
11 years ago
if (!$attrib['id']) {
$attrib['id'] = 'rcmpluginlist';
}
$plugins = array_filter($RCMAIL->plugins->active_plugins);
11 years ago
$plugin_info = array();
11 years ago
foreach ($plugins as $name) {
if ($info = $RCMAIL->plugins->get_info($name)) {
$plugin_info[$name] = $info;
}
}
11 years ago
// load info from required plugins, too
foreach ($plugin_info as $name => $info) {
if (is_array($info['require']) && !empty($info['require'])) {
foreach ($info['require'] as $req_name) {
11 years ago
if (!isset($plugin_info[$req_name]) && ($req_info = $RCMAIL->plugins->get_info($req_name))) {
$plugin_info[$req_name] = $req_info;
}
}
}
}
11 years ago
if (empty($plugin_info)) {
return '';
}
11 years ago
ksort($plugin_info, SORT_LOCALE_STRING);
$table = new html_table($attrib);
// add table header
$table->add_header('name', $RCMAIL->gettext('plugin'));
$table->add_header('version', $RCMAIL->gettext('version'));
$table->add_header('license', $RCMAIL->gettext('license'));
$table->add_header('source', $RCMAIL->gettext('source'));
foreach ($plugin_info as $name => $data) {
$uri = $data['src_uri'] ?: $data['uri'];
11 years ago
if ($uri && stripos($uri, 'http') !== 0) {
$uri = 'http://' . $uri;
}
$table->add_row();
$table->add('name', rcube::Q($data['name'] ?: $name));
11 years ago
$table->add('version', rcube::Q($data['version']));
$table->add('license', $data['license_uri'] ? html::a(array('target' => '_blank', 'href' => rcube::Q($data['license_uri'])),
11 years ago
rcube::Q($data['license'])) : $data['license']);
$table->add('source', $uri ? html::a(array('target' => '_blank', 'href' => rcube::Q($uri)),
11 years ago
rcube::Q($RCMAIL->gettext('download'))) : '');
}
11 years ago
return $table->show();
}