diff options
Diffstat (limited to 'program/steps/settings')
-rw-r--r-- | program/steps/settings/about.inc | 67 | ||||
-rw-r--r-- | program/steps/settings/edit_folder.inc | 2 | ||||
-rw-r--r-- | program/steps/settings/func.inc | 11 | ||||
-rw-r--r-- | program/steps/settings/save_prefs.inc | 3 |
4 files changed, 32 insertions, 51 deletions
diff --git a/program/steps/settings/about.inc b/program/steps/settings/about.inc index 9b13402f1..0fdefddda 100644 --- a/program/steps/settings/about.inc +++ b/program/steps/settings/about.inc @@ -40,17 +40,28 @@ function rcmail_plugins_list($attrib) $attrib['id'] = 'rcmpluginlist'; $plugins = array_filter((array) $RCMAIL->config->get('plugins')); - $plugins = array_flip($plugins); + $plugin_info = array(); - foreach ($plugins as $name => $plugin) { - rcube_plugin_data($name, $plugins); + foreach ($plugins as $name) { + if ($info = $RCMAIL->plugins->get_info($name)) + $plugin_info[$name] = $info; } - if (empty($plugins)) { + // load info from required plugins, too + foreach ($plugin_info as $name => $info) { + if (is_array($info['required']) && !empty($info['required'])) { + foreach ($info['required'] as $req_name) { + if (!isset($plugin_info[$req_name]) && ($req_info = $RCMAIL->plugins->get_info($req_name))) + $plugin_info[$req_name] = $req_info; + } + } + } + + if (empty($plugin_info)) { return ''; } - ksort($plugins, SORT_LOCALE_STRING); + ksort($plugin_info, SORT_LOCALE_STRING); $table = new html_table($attrib); @@ -60,8 +71,8 @@ function rcmail_plugins_list($attrib) $table->add_header('license', rcube_label('license')); $table->add_header('source', rcube_label('source')); - foreach ($plugins as $name => $data) { - $uri = $data['srcuri'] ? $data['srcuri'] : $data['uri']; + foreach ($plugin_info as $name => $data) { + $uri = $data['src_uri'] ? $data['src_uri'] : $data['uri']; if ($uri && stripos($uri, 'http') !== 0) { $uri = 'http://' . $uri; } @@ -78,48 +89,6 @@ function rcmail_plugins_list($attrib) return $table->show(); } -function rcube_plugin_data($name, &$plugins = array()) -{ - // XPaths of plugin metadata elements - $metadata = array( - 'name' => 'string(//rc:package/rc:name)', - 'version' => 'string(//rc:package/rc:version/rc:release)', - 'license' => 'string(//rc:package/rc:license)', - 'license_uri' => 'string(//rc:package/rc:license/@uri)', - 'srcuri' => 'string(//rc:package/rc:srcuri)', - 'uri' => 'string(//rc:package/rc:uri)', - ); - - $package = INSTALL_PATH . "/plugins/$name/package.xml"; - if (file_exists($package) && ($file = file_get_contents($package))) { - $doc = new DOMDocument(); - $doc->loadXML($file); - $xpath = new DOMXPath($doc); - $xpath->registerNamespace('rc', "http://pear.php.net/dtd/package-2.0"); - $data = array(); - - foreach ($metadata as $key => $path) { - $data[$key] = $xpath->evaluate($path); - } - - $plugins[$name] = $data; - - // dependent required plugins (can be used, but not included in config) - $deps = $xpath->evaluate('//rc:package/rc:dependencies/rc:required/rc:package/rc:name'); - $cnt = $deps->length; - - for ($i=0; $i<$cnt; $i++) { - $dn = $deps->item($i)->nodeValue; - if (!array_key_exists($dn, $plugins)) { - rcube_plugin_data($dn, $plugins); - } - } - } - else { - unset($plugins[$name]); - } -} - $OUTPUT->set_pagetitle(rcube_label('about')); diff --git a/program/steps/settings/edit_folder.inc b/program/steps/settings/edit_folder.inc index cd2372790..fdb38e602 100644 --- a/program/steps/settings/edit_folder.inc +++ b/program/steps/settings/edit_folder.inc @@ -78,7 +78,7 @@ function rcmail_folder_form($attrib) // Location (name) if ($options['protected']) { - $foldername = Q(str_replace($delimiter, ' » ', rcmail_localize_folderpath($mbox_imap))); + $foldername = str_replace($delimiter, ' » ', Q(rcmail_localize_folderpath($mbox_imap))); } else if ($options['norename']) { $foldername = Q($folder); diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc index 319c58db9..860f36c35 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -418,6 +418,17 @@ function rcmail_user_prefs($current=null) ); } + // show checkbox to show email instead of name + if (!isset($no_override['message_show_email'])) { + $field_id = 'rcmfd_message_show_email'; + $input_msgshowemail = new html_checkbox(array('name' => '_message_show_email', 'id' => $field_id, 'value' => 1)); + + $blocks['main']['options']['message_show_email'] = array( + 'title' => html::label($field_id, Q(rcube_label('showemail'))), + 'content' => $input_msgshowemail->show($config['message_show_email']?1:0), + ); + } + // show checkbox for HTML/plaintext messages if (!isset($no_override['prefer_html'])) { $field_id = 'rcmfd_htmlmsg'; diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc index 140f173c6..3bb82aa38 100644 --- a/program/steps/settings/save_prefs.inc +++ b/program/steps/settings/save_prefs.inc @@ -60,6 +60,7 @@ switch ($CURR_SECTION) case 'mailview': $a_user_prefs = array( 'message_extwin' => intval($_POST['_message_extwin']), + 'message_show_email' => isset($_POST['_message_show_email']) ? TRUE : FALSE, 'prefer_html' => isset($_POST['_prefer_html']) ? TRUE : FALSE, 'inline_images' => isset($_POST['_inline_images']) ? TRUE : FALSE, 'show_images' => isset($_POST['_show_images']) ? intval($_POST['_show_images']) : 0, @@ -157,7 +158,7 @@ switch ($CURR_SECTION) $a_user_prefs['timezone'] = (string) $a_user_prefs['timezone']; if (isset($a_user_prefs['refresh_interval']) && !empty($CONFIG['min_refresh_interval'])) { - if ($a_user_prefs['refresh_interval'] > $CONFIG['min_refresh_interval']) { + if ($a_user_prefs['refresh_interval'] < $CONFIG['min_refresh_interval']) { $a_user_prefs['refresh_interval'] = $CONFIG['min_refresh_interval']; } } |