commit | author | age
|
45fa64
|
1 |
<?php |
A |
2 |
|
|
3 |
/* |
|
4 |
+-----------------------------------------------------------------------+ |
|
5 |
| program/steps/settings/about.inc | |
|
6 |
| | |
|
7 |
| This file is part of the Roundcube Webmail client | |
|
8 |
| Copyright (C) 2005-2011, The Roundcube Dev Team | |
|
9 |
| Copyright (C) 2011, Kolab Systems AG | |
7fe381
|
10 |
| | |
T |
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. | |
45fa64
|
14 |
| | |
A |
15 |
| PURPOSE: | |
|
16 |
| Display license information about program and enabled plugins | |
|
17 |
| | |
|
18 |
+-----------------------------------------------------------------------+ |
|
19 |
| Author: Aleksander Machniak <alec@alec.pl> | |
|
20 |
+-----------------------------------------------------------------------+ |
|
21 |
*/ |
|
22 |
|
ce22f1
|
23 |
|
T |
24 |
function rcmail_supportlink($attrib) |
|
25 |
{ |
|
26 |
global $RCMAIL; |
c33dc1
|
27 |
|
ce22f1
|
28 |
if ($url = $RCMAIL->config->get('support_url')) { |
c33dc1
|
29 |
$label = $attrib['label'] ? $attrib['label'] : 'support'; |
ce22f1
|
30 |
$attrib['href'] = $url; |
T |
31 |
return html::a($attrib, rcube_label($label)); |
|
32 |
} |
|
33 |
} |
|
34 |
|
45fa64
|
35 |
function rcmail_plugins_list($attrib) |
A |
36 |
{ |
|
37 |
global $RCMAIL; |
|
38 |
|
|
39 |
if (!$attrib['id']) |
|
40 |
$attrib['id'] = 'rcmpluginlist'; |
|
41 |
|
|
42 |
$plugins = array_filter((array) $RCMAIL->config->get('plugins')); |
378d6c
|
43 |
$plugin_info = array(); |
45fa64
|
44 |
|
378d6c
|
45 |
foreach ($plugins as $name) { |
TB |
46 |
if ($info = $RCMAIL->plugins->get_info($name)) |
|
47 |
$plugin_info[$name] = $info; |
45fa64
|
48 |
} |
A |
49 |
|
378d6c
|
50 |
// load info from required plugins, too |
TB |
51 |
foreach ($plugin_info as $name => $info) { |
|
52 |
if (is_array($info['required']) && !empty($info['required'])) { |
|
53 |
foreach ($info['required'] as $req_name) { |
|
54 |
if (!isset($plugin_info[$req_name]) && ($req_info = $RCMAIL->plugins->get_info($req_name))) |
|
55 |
$plugin_info[$req_name] = $req_info; |
|
56 |
} |
|
57 |
} |
|
58 |
} |
|
59 |
|
|
60 |
if (empty($plugin_info)) { |
45fa64
|
61 |
return ''; |
A |
62 |
} |
|
63 |
|
378d6c
|
64 |
ksort($plugin_info, SORT_LOCALE_STRING); |
45fa64
|
65 |
|
A |
66 |
$table = new html_table($attrib); |
|
67 |
|
|
68 |
// add table header |
|
69 |
$table->add_header('name', rcube_label('plugin')); |
|
70 |
$table->add_header('version', rcube_label('version')); |
|
71 |
$table->add_header('license', rcube_label('license')); |
|
72 |
$table->add_header('source', rcube_label('source')); |
|
73 |
|
378d6c
|
74 |
foreach ($plugin_info as $name => $data) { |
TB |
75 |
$uri = $data['src_uri'] ? $data['src_uri'] : $data['uri']; |
1911cc
|
76 |
if ($uri && stripos($uri, 'http') !== 0) { |
A |
77 |
$uri = 'http://' . $uri; |
|
78 |
} |
c1a057
|
79 |
|
45fa64
|
80 |
$table->add_row(); |
A |
81 |
$table->add('name', Q($data['name'] ? $data['name'] : $name)); |
|
82 |
$table->add('version', Q($data['version'])); |
|
83 |
$table->add('license', $data['license_uri'] ? html::a(array('target' => '_blank', href=> Q($data['license_uri'])), |
|
84 |
Q($data['license'])) : $data['license']); |
1911cc
|
85 |
$table->add('source', $uri ? html::a(array('target' => '_blank', href=> Q($uri)), |
ce22f1
|
86 |
Q(rcube_label('download'))) : ''); |
45fa64
|
87 |
} |
A |
88 |
|
|
89 |
return $table->show(); |
1911cc
|
90 |
} |
A |
91 |
|
|
92 |
|
45fa64
|
93 |
$OUTPUT->set_pagetitle(rcube_label('about')); |
A |
94 |
|
ce22f1
|
95 |
$OUTPUT->add_handler('supportlink', 'rcmail_supportlink'); |
45fa64
|
96 |
$OUTPUT->add_handler('pluginlist', 'rcmail_plugins_list'); |
A |
97 |
|
|
98 |
$OUTPUT->send('about'); |