- Timestamp:
- Nov 18, 2013, 6:36:35 PM (11 years ago)
- Location:
- trunk/include
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions.inc.php
r25507 r25550 104 104 } 105 105 106 /** no option for mkgetdir() */ 106 107 define('MKGETDIR_NONE', 0); 108 /** sets mkgetdir() recursive */ 107 109 define('MKGETDIR_RECURSIVE', 1); 110 /** sets mkgetdir() exit script on error */ 108 111 define('MKGETDIR_DIE_ON_ERROR', 2); 112 /** sets mkgetdir() add a index.htm file */ 109 113 define('MKGETDIR_PROTECT_INDEX', 4); 114 /** sets mkgetdir() add a .htaccess file*/ 110 115 define('MKGETDIR_PROTECT_HTACCESS', 8); 111 define('MKGETDIR_DEFAULT', 7); 116 /** default options for mkgetdir() = MKGETDIR_RECURSIVE | MKGETDIR_DIE_ON_ERROR | MKGETDIR_PROTECT_INDEX */ 117 define('MKGETDIR_DEFAULT', MKGETDIR_RECURSIVE | MKGETDIR_DIE_ON_ERROR | MKGETDIR_PROTECT_INDEX); 118 112 119 /** 113 120 * creates directory if not exists and ensures that directory is writable -
trunk/include/functions_mail.inc.php
r25384 r25550 23 23 24 24 /** 25 * @package functions\mail 26 */ 27 28 29 /** 25 30 * Returns the name of the mail sender 31 * 26 32 * @return string 27 33 */ … … 35 41 /** 36 42 * Returns the email of the mail sender 43 * 37 44 * @since 2.6 38 45 * @return string … … 46 53 47 54 /** 48 * Returns an array of mail configuration parameters :55 * Returns an array of mail configuration parameters. 49 56 * - send_bcc_mail_webmaster 50 57 * - mail_allow_html … … 80 87 81 88 /** 82 * Returns an email address with an associated real name 83 * @param string name 84 * @param string email 89 * Returns an email address with an associated real name. 90 * Can return either: 91 * - email@domain.com 92 * - name <email@domain.com> 93 * 94 * @param string $name 95 * @param string $email 96 * @return string 85 97 */ 86 98 function format_email($name, $email) … … 105 117 106 118 /** 107 * Returns the mail and the name from a formatted address119 * Returns the email and the name from a formatted address. 108 120 * @since 2.6 109 * @param string|array $input 110 * @return array 121 * 122 * @param string|string[] $input - if is an array must contain email[, name] 123 * @return array email, name 111 124 */ 112 125 function unformat_email($input) … … 138 151 139 152 /** 140 * Return a clean array of hashmaps (email, name) from various inputs 141 * - comma separated list 142 * - array of emails 143 * - single hashmap (email[, name]) 153 * Return a clean array of hashmaps (email, name) removing duplicates. 154 * It accepts various inputs: 155 * - comma separated list 156 * - array of emails 157 * - single hashmap (email[, name]) 158 * - array of incomplete hashmaps 144 159 * @since 2.6 145 160 * … … 164 179 { 165 180 $item = array( 166 'email' => $item,181 'email' => trim($item), 167 182 'name' => '', 168 183 ); … … 185 200 $data = array_map('unformat_email', $data); 186 201 } 187 188 return $data; 189 } 190 191 /** 192 * Returns an email address list with minimal email string 202 203 $existing = array(); 204 foreach ($data as $i => $entry) 205 { 206 if (isset($existing[ $entry['email'] ]) 207 { 208 unset($data[$i]); 209 } 210 else 211 { 212 $existing[ $entry['email'] ] = true; 213 } 214 } 215 216 return array_values($data); 217 } 218 219 /** 220 * Returns an email address list with minimal email string. 221 * @deprecated 2.6 222 * 193 223 * @param string $email_list - comma separated 194 224 * @return string … … 212 242 213 243 /** 214 * Return an new mail template 244 * Return an new mail template. 245 * 215 246 * @param string $email_format - text/html or text/plain 216 247 * @return Template … … 223 254 224 255 /** 225 * Return string email format (text/html or text/plain) 226 * @param bool is_html 256 * Return string email format (text/html or text/plain). 257 * 258 * @param bool $is_html 227 259 * @return string 228 260 */ … … 233 265 234 266 /** 235 * Switch language to specified language 267 * Switch language to specified language. 236 268 * All entries are push on language stack 269 * 237 270 * @param string $language 238 271 */ … … 296 329 297 330 /** 298 * Switch back language pushed with switch_lang_to function 331 * Switch back language pushed with switch_lang_to() function. 332 * @see switch_lang_to() 299 333 */ 300 334 function switch_lang_back() … … 318 352 319 353 /** 320 * Send a notification email to all administrators 354 * Send a notification email to all administrators. 321 355 * current user (if admin) is not notified 356 * 322 357 * @param string|array $subject 323 358 * @param string|array $content … … 376 411 377 412 /** 378 * Send a email to all administrators 413 * Send a email to all administrators. 379 414 * current user (if admin) is excluded 380 415 * @see pwg_mail() … … 425 460 426 461 /** 427 * Send an email to a group 462 * Send an email to a group. 428 463 * @see pwg_mail() 429 464 * 430 465 * @param int $group_id 431 466 * @param array $args - as in pwg_mail() 432 * @option string language_selected - filters users of the group by language467 * o language_selected: filters users of the group by language [default value empty] 433 468 * @param array $tpl - as in pwg_mail() 434 469 * @return boolean … … 509 544 510 545 /** 511 * sends an email, using Piwigo specific informations512 * 513 * @param string| string[]$to546 * Sends an email, using Piwigo specific informations. 547 * 548 * @param string|array $to 514 549 * @param array $args 515 550 * o from: sender [default value webmaster email] … … 594 629 if ($conf_mail['send_bcc_mail_webmaster']) 595 630 { 596 $Bcc[] = get_webmaster_mail_address(); 631 $Bcc[] = array( 632 'email' => get_webmaster_mail_address(), 633 'name' => '', 634 ); 597 635 } 598 636 if (!empty($Bcc)) … … 822 860 { 823 861 $ret = $mail->send(); 824 if (!$ret and (!ini_get('display_errors') ||is_admin()))862 if (!$ret and (!ini_get('display_errors') or is_admin())) 825 863 { 826 864 trigger_error('Mailer Error: ' . $mail->ErrorInfo, E_USER_WARNING); … … 859 897 860 898 /** 861 * Moves CSS rules contained in the <style> tag to inline CSS 862 * (for compatibility with Gmail and such clients)899 * Moves CSS rules contained in the <style> tag to inline CSS. 900 * Used for compatibility with Gmail and such clients 863 901 * @since 2.6 902 * 864 903 * @param string $content 865 904 * @return string … … 875 914 876 915 /** 877 * Saves a copy of the mail if _data/tmp 878 * @param boolean $result 879 * @param string $to 916 * Saves a copy of the mail if _data/tmp. 917 * 918 * @param boolean $success 919 * @param PHPMailer $mail 880 920 * @param array $args 881 * @param PHPMailer $mail882 * @return boolean $result883 921 */ 884 922 function pwg_send_mail_test($success, $mail, $args) -
trunk/include/functions_metadata.inc.php
r24968 r25550 23 23 24 24 /** 25 * returns informations from IPTC metadata, mapping is done at the beginning 26 * of the function 25 * @package functions\metadata 26 */ 27 28 29 /** 30 * returns informations from IPTC metadata, mapping is done in this function. 27 31 * 28 32 * @param string $filename 33 * @param array $map 29 34 * @return array 30 35 */ … … 81 86 82 87 /** 83 * return a cleaned IPTC value 88 * return a cleaned IPTC value. 84 89 * 85 * @param string value90 * @param string $value 86 91 * @return string 87 92 */ … … 128 133 129 134 /** 130 * returns informations from EXIF metadata, mapping is done at the beginning 131 * of the function 135 * returns informations from EXIF metadata, mapping is done in this function. 132 136 * 133 137 * @param string $filename 138 * @param array $map 134 139 * @return array 135 140 */ … … 181 186 return $result; 182 187 } 188 183 189 ?> -
trunk/include/functions_picture.inc.php
r19703 r25550 22 22 // +-----------------------------------------------------------------------+ 23 23 24 /** 25 * @package functions\picture 26 */ 24 27 25 /* 26 * get slideshow default params into array 28 29 /** 30 * Returns slideshow default params. 31 * - period 32 * - repeat 33 * - play 27 34 * 28 * @param void 29 * 30 * @return slideshow default values into array 35 * @return array 31 36 */ 32 37 function get_default_slideshow_params() … … 41 46 } 42 47 43 /* 44 * check and correct slideshow params from array48 /** 49 * Checks and corrects slideshow params 45 50 * 46 * @param array of params 47 * 48 * @return slideshow corrected values into array 51 * @param array $params 52 * @return array 49 53 */ 50 function correct_slideshow_params($params =array())54 function correct_slideshow_params($params=array()) 51 55 { 52 56 global $conf; … … 64 68 } 65 69 66 /* 67 * Decode slideshow string params into array70 /** 71 * Decodes slideshow string params into array 68 72 * 69 * @param string params like "" 70 * 71 * @return slideshow values into array 73 * @param string $encode_params 74 * @return array 72 75 */ 73 function decode_slideshow_params($encode_params =null)76 function decode_slideshow_params($encode_params=null) 74 77 { 75 78 global $conf; … … 106 109 } 107 110 108 /* 109 * Encode slideshow array params into array111 /** 112 * Encodes slideshow array params into a string 110 113 * 111 * @param array params 112 * 113 * @return slideshow values into string 114 * @param array $decode_params 115 * @return string 114 116 */ 115 function encode_slideshow_params($decode_params =array())117 function encode_slideshow_params($decode_params=array()) 116 118 { 117 119 global $conf; … … 128 130 return $result; 129 131 } 132 130 133 ?>
Note: See TracChangeset
for help on using the changeset viewer.