diff options
author | mistic100 <mistic@piwigo.org> | 2012-11-29 14:57:32 +0000 |
---|---|---|
committer | mistic100 <mistic@piwigo.org> | 2012-11-29 14:57:32 +0000 |
commit | cd1af14ce01e9663e30db9ddd404231a86b0b6bd (patch) | |
tree | a4d2e00f221eb9c0082d33d99b5cd41a69daedec | |
parent | c84eaf1985cfe74794dc6b432fd01a39a9a23409 (diff) |
clean some function desc
git-svn-id: http://piwigo.org/svn/trunk@19225 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | include/functions.inc.php | 12 | ||||
-rw-r--r-- | include/functions_mail.inc.php | 46 |
2 files changed, 29 insertions, 29 deletions
diff --git a/include/functions.inc.php b/include/functions.inc.php index 2a1abcd89..d66232e12 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -902,8 +902,7 @@ function l10n_dec($singular_fmt_key, $plural_fmt_key, $decimal) * returns a single element to use with l10n_args * * @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 */ @@ -921,11 +920,10 @@ function get_l10n_args($key, $args) } /* - * returns a string with formated with l10n_args elements + * returns a string formated with l10n 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 + * @param array $key_args: l10n_args element or array of l10n_args elements + * @param string $sep: used when translated elements are concatened * @return string */ function l10n_args($key_args, $sep = "\n") @@ -945,7 +943,7 @@ function l10n_args($key_args, $sep = "\n") 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); } else diff --git a/include/functions_mail.inc.php b/include/functions_mail.inc.php index 4b2f4147e..9ae2d7d5f 100644 --- a/include/functions_mail.inc.php +++ b/include/functions_mail.inc.php @@ -63,11 +63,17 @@ function get_mail_sender_name() /* * 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 */ @@ -83,7 +89,8 @@ function get_mail_configuration() 'use_smtp' => !empty($conf['smtp_host']), '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), ); // we have webmaster id among user list, what's his email address ? @@ -93,8 +100,6 @@ function get_mail_configuration() $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; } @@ -147,18 +152,15 @@ function get_strict_email_list($email_list) $result[] = trim($email); } - return implode(',', $result); + return implode(',', array_unique($result)); } /** * 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='') { @@ -173,7 +175,7 @@ function & get_mail_template($email_format, $theme='') } /** - * Return string email format (html or not) + * Return string email format (text/html or text/plain) * * @param string format */ @@ -274,6 +276,7 @@ function switch_lang_back() * @param: * - 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) */ @@ -317,17 +320,17 @@ SELECT 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()); $content = l10n_args($keyargs_content)."\n"; 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"; } @@ -354,7 +357,6 @@ SELECT * - group_id: mail are sent to group with this Id * - 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 * - language_selected: send mail only to user with this selected language |