Changeset 19225 for trunk


Ignore:
Timestamp:
Nov 29, 2012, 3:57:32 PM (11 years ago)
Author:
mistic100
Message:

clean some function desc

Location:
trunk/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions.inc.php

    r18967 r19225  
    903903 *
    904904 * @param string key: translation key
    905  * @param array/string/../number args:
    906  *   arguments to use on sprintf($key, args)
     905 * @param mixed args: arguments to use on sprintf($key, args)
    907906 *   if args is a array, each values are used on sprintf
    908907 * @return string
     
    922921
    923922/*
    924  * returns a string with formated with l10n_args elements
    925  *
    926  * @param element/array $key_args: element or array of l10n_args elements
    927  * @param $sep: if $key_args is array,
    928  *   separator is used when translated l10n_args elements are concated
     923 * returns a string formated with l10n elements
     924 *
     925 * @param array $key_args: l10n_args element or array of l10n_args elements
     926 * @param string $sep: used when translated elements are concatened
    929927 * @return string
    930928 */
     
    946944      if ($key === 'key_args')
    947945      {
    948         array_unshift($element, l10n(array_shift($element)));
     946        array_unshift($element, l10n(array_shift($element))); // translate the key
    949947        $result .= call_user_func_array('sprintf', $element);
    950948      }
  • trunk/include/functions_mail.inc.php

    r12922 r19225  
    6464 * Returns an array of mail configuration parameters :
    6565 *
    66  * - mail_options: see $conf['mail_options']
    67  * - send_bcc_mail_webmaster: see $conf['send_bcc_mail_webmaster']
    68  * - email_webmaster: mail corresponding to $conf['webmaster_id']
    69  * - formated_email_webmaster: the name of webmaster is $conf['gallery_title']
    70  * - text_footer: Piwigo and version
     66 * - mail_options
     67 * - send_bcc_mail_webmaster
     68 * - default_email_format
     69 * - alternative_email_format
     70 * - use_smtp
     71 * - smtp_host
     72 * - smtp_user
     73 * - smtp_password
     74 * - boundary_key
     75 * - email_webmaster
     76 * - formated_email_webmaster
    7177 *
    7278 * @return array
     
    8490    'smtp_host' => $conf['smtp_host'],
    8591    'smtp_user' => $conf['smtp_user'],
    86     'smtp_password' => $conf['smtp_password']
     92    'smtp_password' => $conf['smtp_password'],
     93    'boundary_key' => generate_key(32),
    8794    );
    8895
     
    93100  $conf_mail['formated_email_webmaster'] =
    94101    format_email(get_mail_sender_name(), $conf_mail['email_webmaster']);
    95 
    96   $conf_mail['boundary_key'] = generate_key(32);
    97102
    98103  return $conf_mail;
     
    148153  }
    149154
    150   return implode(',', $result);
     155  return implode(',', array_unique($result));
    151156}
    152157
     
    155160 * Return an new mail template
    156161 *
    157  * @params:
    158  *   - email_format: mail format
    159  *   - args: function params of mail function:
    160  *       o template: template to use [default get_default_theme()]
    161  *       o theme: template to use [default get_default_theme()]
     162 * @param string email_format: mail format, text/html or text/plain
     163 * @param string theme: theme to use [default get_default_theme()]
    162164 */
    163165function & get_mail_template($email_format, $theme='')
     
    174176
    175177/**
    176  * Return string email format (html or not)
     178 * Return string email format (text/html or text/plain)
    177179 *
    178180 * @param string format
     
    275277 *   - keyargs_subject: mail subject on l10n_args format
    276278 *   - keyargs_content: mail content on l10n_args format
     279 *   - send_technical_details: send user IP and browser
    277280 *
    278281 * @return boolean (Ok or not)
     
    318321  if (count($admins) > 0)
    319322  {
    320     $keyargs_content_admin_info = array(
    321       get_l10n_args('Connected user: %s', stripslashes($user['username'])),
    322       get_l10n_args('IP: %s', $_SERVER['REMOTE_ADDR']),
    323       get_l10n_args('Browser: %s', $_SERVER['HTTP_USER_AGENT'])
    324       );
    325 
    326323    switch_lang_to(get_default_language());
    327324
     
    329326    if ($send_technical_details)
    330327    {
     328      $keyargs_content_admin_info = array(
     329        get_l10n_args('Connected user: %s', stripslashes($user['username'])),
     330        get_l10n_args('IP: %s', $_SERVER['REMOTE_ADDR']),
     331        get_l10n_args('Browser: %s', $_SERVER['HTTP_USER_AGENT'])
     332        );
     333     
    331334      $content.= "\n".l10n_args($keyargs_content_admin_info)."\n";
    332335    }
     
    355358 *   - email_format: mail format
    356359 *   - keyargs_subject: mail subject on l10n_args format
    357  *   - dirname: short name of directory including template
    358360 *   - tpl_shortname: short template name without extension
    359361 *   - assign_vars: array used to assign_vars to mail template
Note: See TracChangeset for help on using the changeset viewer.