You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

about.inc 3.6KB

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