Index: trunk/include/functions.inc.php
===================================================================
--- trunk/include/functions.inc.php	(revision 19199)
+++ trunk/include/functions.inc.php	(revision 19225)
@@ -903,6 +903,5 @@
  *
  * @param string key: translation key
- * @param array/string/../number args:
- *   arguments to use on sprintf($key, args)
+ * @param mixed args: arguments to use on sprintf($key, args)
  *   if args is a array, each values are used on sprintf
  * @return string
@@ -922,9 +921,8 @@
 
 /*
- * returns a string with formated with l10n_args elements
- *
- * @param element/array $key_args: element or array of l10n_args elements
- * @param $sep: if $key_args is array,
- *   separator is used when translated l10n_args elements are concated
+ * returns a string formated with l10n elements
+ *
+ * @param array $key_args: l10n_args element or array of l10n_args elements
+ * @param string $sep: used when translated elements are concatened
  * @return string
  */
@@ -946,5 +944,5 @@
       if ($key === 'key_args')
       {
-        array_unshift($element, l10n(array_shift($element)));
+        array_unshift($element, l10n(array_shift($element))); // translate the key
         $result .= call_user_func_array('sprintf', $element);
       }
Index: trunk/include/functions_mail.inc.php
===================================================================
--- trunk/include/functions_mail.inc.php	(revision 19199)
+++ trunk/include/functions_mail.inc.php	(revision 19225)
@@ -64,9 +64,15 @@
  * Returns an array of mail configuration parameters :
  *
- * - mail_options: see $conf['mail_options']
- * - send_bcc_mail_webmaster: see $conf['send_bcc_mail_webmaster']
- * - email_webmaster: mail corresponding to $conf['webmaster_id']
- * - formated_email_webmaster: the name of webmaster is $conf['gallery_title']
- * - text_footer: Piwigo and version
+ * - mail_options
+ * - send_bcc_mail_webmaster
+ * - default_email_format
+ * - alternative_email_format
+ * - use_smtp
+ * - smtp_host
+ * - smtp_user
+ * - smtp_password
+ * - boundary_key
+ * - email_webmaster
+ * - formated_email_webmaster
  *
  * @return array
@@ -84,5 +90,6 @@
     'smtp_host' => $conf['smtp_host'],
     'smtp_user' => $conf['smtp_user'],
-    'smtp_password' => $conf['smtp_password']
+    'smtp_password' => $conf['smtp_password'],
+    'boundary_key' => generate_key(32),
     );
 
@@ -93,6 +100,4 @@
   $conf_mail['formated_email_webmaster'] =
     format_email(get_mail_sender_name(), $conf_mail['email_webmaster']);
-
-  $conf_mail['boundary_key'] = generate_key(32);
 
   return $conf_mail;
@@ -148,5 +153,5 @@
   }
 
-  return implode(',', $result);
+  return implode(',', array_unique($result));
 }
 
@@ -155,9 +160,6 @@
  * Return an new mail template
  *
- * @params:
- *   - email_format: mail format
- *   - args: function params of mail function:
- *       o template: template to use [default get_default_theme()]
- *       o theme: template to use [default get_default_theme()]
+ * @param string email_format: mail format, text/html or text/plain
+ * @param string theme: theme to use [default get_default_theme()]
  */
 function & get_mail_template($email_format, $theme='')
@@ -174,5 +176,5 @@
 
 /**
- * Return string email format (html or not)
+ * Return string email format (text/html or text/plain)
  *
  * @param string format
@@ -275,4 +277,5 @@
  *   - keyargs_subject: mail subject on l10n_args format
  *   - keyargs_content: mail content on l10n_args format
+ *   - send_technical_details: send user IP and browser
  *
  * @return boolean (Ok or not)
@@ -318,10 +321,4 @@
   if (count($admins) > 0)
   {
-    $keyargs_content_admin_info = array(
-      get_l10n_args('Connected user: %s', stripslashes($user['username'])),
-      get_l10n_args('IP: %s', $_SERVER['REMOTE_ADDR']),
-      get_l10n_args('Browser: %s', $_SERVER['HTTP_USER_AGENT'])
-      );
-
     switch_lang_to(get_default_language());
 
@@ -329,4 +326,10 @@
     if ($send_technical_details)
     {
+      $keyargs_content_admin_info = array(
+        get_l10n_args('Connected user: %s', stripslashes($user['username'])),
+        get_l10n_args('IP: %s', $_SERVER['REMOTE_ADDR']),
+        get_l10n_args('Browser: %s', $_SERVER['HTTP_USER_AGENT'])
+        );
+      
       $content.= "\n".l10n_args($keyargs_content_admin_info)."\n";
     }
@@ -355,5 +358,4 @@
  *   - email_format: mail format
  *   - keyargs_subject: mail subject on l10n_args format
- *   - dirname: short name of directory including template
  *   - tpl_shortname: short template name without extension
  *   - assign_vars: array used to assign_vars to mail template
