Mercurial > hg > rc2
comparison program/steps/settings/about.inc @ 0:4681f974d28b
vanilla 1.3.3 distro, I hope
author | Charlie Root |
---|---|
date | Thu, 04 Jan 2018 15:52:31 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4681f974d28b |
---|---|
1 <?php | |
2 | |
3 /** | |
4 +-----------------------------------------------------------------------+ | |
5 | program/steps/settings/about.inc | | |
6 | | | |
7 | This file is part of the Roundcube Webmail client | | |
8 | Copyright (C) 2005-2013, The Roundcube Dev Team | | |
9 | Copyright (C) 2011-2013, Kolab Systems AG | | |
10 | | | |
11 | Licensed under the GNU General Public License version 3 or | | |
12 | any later version with exceptions for skins & plugins. | | |
13 | See the README file for a full license statement. | | |
14 | | | |
15 | PURPOSE: | | |
16 | Display license information about program and enabled plugins | | |
17 | | | |
18 +-----------------------------------------------------------------------+ | |
19 | Author: Aleksander Machniak <alec@alec.pl> | | |
20 +-----------------------------------------------------------------------+ | |
21 */ | |
22 | |
23 | |
24 $OUTPUT->set_pagetitle($RCMAIL->gettext('about')); | |
25 | |
26 $OUTPUT->add_handler('supportlink', 'rcmail_supportlink'); | |
27 $OUTPUT->add_handler('pluginlist', 'rcmail_plugins_list'); | |
28 | |
29 $OUTPUT->send('about'); | |
30 | |
31 | |
32 | |
33 function rcmail_supportlink($attrib) | |
34 { | |
35 global $RCMAIL; | |
36 | |
37 if ($url = $RCMAIL->config->get('support_url')) { | |
38 $label = $attrib['label'] ?: 'support'; | |
39 $attrib['href'] = $url; | |
40 | |
41 return html::a($attrib, $RCMAIL->gettext($label)); | |
42 } | |
43 } | |
44 | |
45 function rcmail_plugins_list($attrib) | |
46 { | |
47 global $RCMAIL; | |
48 | |
49 if (!$attrib['id']) { | |
50 $attrib['id'] = 'rcmpluginlist'; | |
51 } | |
52 | |
53 $plugins = array_filter($RCMAIL->plugins->active_plugins); | |
54 $plugin_info = array(); | |
55 | |
56 foreach ($plugins as $name) { | |
57 if ($info = $RCMAIL->plugins->get_info($name)) { | |
58 $plugin_info[$name] = $info; | |
59 } | |
60 } | |
61 | |
62 // load info from required plugins, too | |
63 foreach ($plugin_info as $name => $info) { | |
64 if (is_array($info['require']) && !empty($info['require'])) { | |
65 foreach ($info['require'] as $req_name) { | |
66 if (!isset($plugin_info[$req_name]) && ($req_info = $RCMAIL->plugins->get_info($req_name))) { | |
67 $plugin_info[$req_name] = $req_info; | |
68 } | |
69 } | |
70 } | |
71 } | |
72 | |
73 if (empty($plugin_info)) { | |
74 return ''; | |
75 } | |
76 | |
77 ksort($plugin_info, SORT_LOCALE_STRING); | |
78 | |
79 $table = new html_table($attrib); | |
80 | |
81 // add table header | |
82 $table->add_header('name', $RCMAIL->gettext('plugin')); | |
83 $table->add_header('version', $RCMAIL->gettext('version')); | |
84 $table->add_header('license', $RCMAIL->gettext('license')); | |
85 $table->add_header('source', $RCMAIL->gettext('source')); | |
86 | |
87 foreach ($plugin_info as $name => $data) { | |
88 $uri = $data['src_uri'] ?: $data['uri']; | |
89 if ($uri && stripos($uri, 'http') !== 0) { | |
90 $uri = 'http://' . $uri; | |
91 } | |
92 | |
93 $table->add_row(); | |
94 $table->add('name', rcube::Q($data['name'] ?: $name)); | |
95 $table->add('version', rcube::Q($data['version'])); | |
96 $table->add('license', $data['license_uri'] ? html::a(array('target' => '_blank', href=> rcube::Q($data['license_uri'])), | |
97 rcube::Q($data['license'])) : $data['license']); | |
98 $table->add('source', $uri ? html::a(array('target' => '_blank', href=> rcube::Q($uri)), | |
99 rcube::Q($RCMAIL->gettext('download'))) : ''); | |
100 } | |
101 | |
102 return $table->show(); | |
103 } |