Changeset 25360
- Timestamp:
- Nov 6, 2013, 6:57:53 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions_notification_by_mail.inc.php
r25018 r25360 257 257 if ($is_action_send) 258 258 { 259 $nbm_user['theme'] = $user['theme']; 260 $env_nbm['mail_template'] = get_mail_template($env_nbm['email_format'], $nbm_user['theme']); 259 $env_nbm['mail_template'] = get_mail_template($env_nbm['email_format']); 261 260 $env_nbm['mail_template']->set_filename('notification_by_mail', 'notification_by_mail.tpl'); 262 261 } … … 424 423 set_user_on_env_nbm($nbm_user, true); 425 424 426 $subject = '['.$conf['gallery_title'].'] :'.($is_subscribe ? l10n('Subscribe to notification by mail'): l10n('Unsubscribe from notification by mail'));425 $subject = '['.$conf['gallery_title'].'] '.($is_subscribe ? l10n('Subscribe to notification by mail'): l10n('Unsubscribe from notification by mail')); 427 426 428 427 // Assign current var for nbm mail … … 440 439 ) 441 440 ); 442 443 if (pwg_mail 444 ( 445 format_email(stripslashes($nbm_user['username']), $nbm_user['mail_address']), 446 array 447 ( 448 'from' => $env_nbm['send_as_mail_formated'], 449 'subject' => $subject, 450 'email_format' => $env_nbm['email_format'], 451 'content' => $env_nbm['mail_template']->parse('notification_by_mail', true), 452 'content_format' => $env_nbm['email_format'], 453 'theme' => $nbm_user['theme'] 454 ) 455 )) 441 442 $ret = pwg_mail( 443 array( 444 'name' => stripslashes($nbm_user['username']), 445 'email' => $nbm_user['mail_address'], 446 ), 447 array( 448 'from' => $env_nbm['send_as_mail_formated'], 449 'subject' => $subject, 450 'email_format' => $env_nbm['email_format'], 451 'content' => $env_nbm['mail_template']->parse('notification_by_mail', true), 452 'content_format' => $env_nbm['email_format'], 453 ) 454 ); 455 456 if ($ret) 456 457 { 457 458 inc_mail_sent_success($nbm_user); -
trunk/admin/notification_by_mail.php
r25018 r25360 306 306 if ($exist_data) 307 307 { 308 $subject = '['.$conf['gallery_title'].'] :'.l10n('New photos added');308 $subject = '['.$conf['gallery_title'].'] '.l10n('New photos added'); 309 309 310 310 // Assign current var for nbm mail … … 378 378 ) 379 379 ); 380 381 if (pwg_mail 382 ( 383 format_email(stripslashes($nbm_user['username']), $nbm_user['mail_address']), 384 array 385 ( 386 'from' => $env_nbm['send_as_mail_formated'], 387 'subject' => $subject, 388 'email_format' => $env_nbm['email_format'], 389 'content' => $env_nbm['mail_template']->parse('notification_by_mail', true), 390 'content_format' => $env_nbm['email_format'], 391 'theme' => $nbm_user['theme'] 392 ) 393 )) 380 381 $ret = pwg_mail( 382 array( 383 'name' => stripslashes($nbm_user['username']), 384 'email' => $nbm_user['mail_address'], 385 ), 386 array( 387 'from' => $env_nbm['send_as_mail_formated'], 388 'subject' => $subject, 389 'email_format' => $env_nbm['email_format'], 390 'content' => $env_nbm['mail_template']->parse('notification_by_mail', true), 391 'content_format' => $env_nbm['email_format'], 392 ) 393 ); 394 395 if ($ret) 394 396 { 395 397 inc_mail_sent_success($nbm_user); -
trunk/include/functions.inc.php
r25288 r25360 1027 1027 * @return string 1028 1028 */ 1029 function get_l10n_args($key, $args )1029 function get_l10n_args($key, $args='') 1030 1030 { 1031 1031 if (is_array($args)) -
trunk/include/functions_comment.inc.php
r25357 r25360 233 233 $comment_url = get_absolute_root_url().'comments.php?comment_id='.$comm['id']; 234 234 235 $ content = array(236 l10n('Author: %s', stripslashes($comm['author']) ),237 l10n('Email: %s', stripslashes($comm['email']) ),238 l10n('Comment: %s', stripslashes($comm['content']) ),239 '',240 l10n('Manage this user comment: %s', $comment_url),235 $keyargs_content = array( 236 get_l10n_args('Author: %s', stripslashes($comm['author']) ), 237 get_l10n_args('Email: %s', stripslashes($comm['email']) ), 238 get_l10n_args('Comment: %s', stripslashes($comm['content']) ), 239 get_l10n_args(''), 240 get_l10n_args('Manage this user comment: %s', $comment_url), 241 241 ); 242 242 243 243 if ('moderate' == $comment_action) 244 244 { 245 $ content[] = l10n('(!) This comment requires validation');245 $keyargs_content[] = get_l10n_args('(!) This comment requires validation'); 246 246 } 247 247 248 248 pwg_mail_notification_admins( 249 l10n('Comment by %s', stripslashes($comm['author']) ),250 implode("\n", $content)249 get_l10n_args('Comment by %s', stripslashes($comm['author']) ), 250 $keyargs_content 251 251 ); 252 252 } … … 374 374 $comment_url = get_absolute_root_url().'comments.php?comment_id='.$comment['comment_id']; 375 375 376 $ content = array(377 l10n('Author: %s', stripslashes($GLOBALS['user']['username']) ),378 l10n('Comment: %s', stripslashes($comment['content']) ),379 '',380 l10n('Manage this user comment: %s', $comment_url),381 l10n('(!) This comment requires validation'),376 $keyargs_content = array( 377 get_l10n_args('Author: %s', stripslashes($GLOBALS['user']['username']) ), 378 get_l10n_args('Comment: %s', stripslashes($comment['content']) ), 379 get_l10n_args(''), 380 get_l10n_args('Manage this user comment: %s', $comment_url), 381 get_l10n_args('(!) This comment requires validation'), 382 382 ); 383 383 384 384 pwg_mail_notification_admins( 385 l10n('Comment by %s', stripslashes($GLOBALS['user']['username']) ),386 implode("\n", $content)385 get_l10n_args('Comment by %s', stripslashes($GLOBALS['user']['username']) ), 386 $keyargs_content 387 387 ); 388 388 } … … 411 411 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); 412 412 413 $ content = array(414 l10n('Author: %s', $comment['author']),413 $keyargs_content = array( 414 get_l10n_args('Author: %s', $comment['author']), 415 415 ); 416 416 417 417 if ($action=='delete') 418 418 { 419 $ content[] = l10n('This author removed the comment with id %d', $comment['comment_id']);420 } 421 else 422 { 423 $ content[] = l10n('This author modified following comment:');424 $ content[] = l10n('Comment: %s', $comment['content']);419 $keyargs_content[] = get_l10n_args('This author removed the comment with id %d', $comment['comment_id']); 420 } 421 else 422 { 423 $keyargs_content[] = get_l10n_args('This author modified following comment:'); 424 $keyargs_content[] = get_l10n_args('Comment: %s', $comment['content']); 425 425 } 426 426 427 427 pwg_mail_notification_admins( 428 l10n('Comment by %s', $comment['author']),429 implode("\n", $content) 430 428 get_l10n_args('Comment by %s', $comment['author']), 429 $keyargs_content 430 ); 431 431 } 432 432 -
trunk/include/functions_mail.inc.php
r25358 r25360 169 169 170 170 /** 171 * Return string email format (text/html or text/plain) 172 * @param bool is_html 173 * @return string 174 */ 175 function get_str_email_format($is_html) 176 { 177 return ($is_html ? 'text/html' : 'text/plain'); 178 } 179 180 /** 171 181 * Switch language to specified language 172 182 * All entries are push on language stack … … 256 266 * Send a notification email to all administrators 257 267 * current user (if admin) is not notified 258 * @param string $subject259 * @param string $content268 * @param string|array $subject 269 * @param string|array $content 260 270 * @param boolean $send_technical_details - send user IP and browser 261 271 * @return boolean … … 267 277 return false; 268 278 } 269 270 // for backward compatibility < 2.6271 if (is_array($subject))272 {273 $subject = l10n_args($subject);274 }275 if (is_array($content))276 {277 $content = l10n_args($content);278 }279 279 280 280 global $conf, $user; 281 281 282 if (is_array($subject) or is_array($content)) 283 { 284 switch_lang_to(get_default_language()); 285 286 if (is_array($subject)) 287 { 288 $subject = l10n_args($subject); 289 } 290 if (is_array($content)) 291 { 292 $content = l10n_args($content); 293 } 294 295 switch_lang_back(); 296 } 297 282 298 $tpl_vars = array(); 283 299 if ($send_technical_details) 284 300 { 285 $tpl_vars['TECHNICAL'] = 286 l10n('Connected user: %s', stripslashes($user['username'])) ."\n". 287 l10n('IP: %s', $_SERVER['REMOTE_ADDR']) . "\n" . 288 l10n('Browser: %s', $_SERVER['HTTP_USER_AGENT']); 301 $tpl_vars['TECHNICAL'] = array( 302 'username' => stripslashes($user['username']), 303 'ip' => $_SERVER['REMOTE_ADDR'], 304 'user_agent' => $_SERVER['HTTP_USER_AGENT'], 305 ); 289 306 } 290 307 -
trunk/include/functions_user.inc.php
r25357 r25360 230 230 $admin_url = get_absolute_root_url().'admin.php?page=user_list&username='.$login; 231 231 232 $ content = array(233 l10n('User: %s', stripslashes($login) ),234 l10n('Email: %s', $_POST['mail_address']),235 '',236 l10n('Admin: %s', $admin_url),232 $keyargs_content = array( 233 get_l10n_args('User: %s', stripslashes($login) ), 234 get_l10n_args('Email: %s', $_POST['mail_address']), 235 get_l10n_args(''), 236 get_l10n_args('Admin: %s', $admin_url), 237 237 ); 238 238 239 239 pwg_mail_notification_admins( 240 l10n('Registration of %s', stripslashes($login) ),241 implode("\n", $content)240 get_l10n_args('Registration of %s', stripslashes($login) ), 241 $keyargs_content 242 242 ); 243 243 } -
trunk/themes/default/template/mail/text/html/notification_admin.tpl
r25358 r25360 3 3 {if isset($TECHNICAL)} 4 4 <p style="padding-top:10px;font-size:11px;"> 5 {$TECHNICAL|nl2br} 5 {'Connected user: %s'|translate:$TECHNICAL.username}<br> 6 {'IP: %s'|translate:$TECHNICAL.ip}<br> 7 {'Browser: %s'|translate:$TECHNICAL.user_agent} 6 8 </p> 7 9 {/if} -
trunk/themes/default/template/mail/text/html/notification_by_mail.tpl
r8723 r25360 39 39 <p>{'See you soon,'|@translate}</p> 40 40 <p style="text-align:center">{$SEND_AS_NAME}</p> 41 <hr> 41 42 <p> 42 <br><hr>43 43 {'To unsubscribe'|@translate}{', click on'|@translate} <a href="{$UNSUBSCRIBE_LINK}">{$UNSUBSCRIBE_LINK}</a><br> 44 44 {'To subscribe'|@translate}{', click on'|@translate} <a href="{$SUBSCRIBE_LINK}">{$SUBSCRIBE_LINK}</a><br> 45 45 {'If you encounter problems or have any question, please send a message to'|@translate} <a href="mailto:{$CONTACT_EMAIL}?subject={'[NBM] Problems or questions'|@translate}">{$CONTACT_EMAIL}</a><br> 46 <hr><br>47 46 </p> 47 <hr> 48 48 {if not empty($recent_posts)} 49 49 </div> -
trunk/themes/default/template/mail/text/plain/notification_admin.tpl
r25357 r25360 3 3 {if isset($TECHNICAL)} 4 4 ----------------------------- 5 {$TECHNICAL} 5 {'Connected user: %s'|translate:$TECHNICAL.username} 6 {'IP: %s'|translate:$TECHNICAL.ip} 7 {'Browser: %s'|translate:$TECHNICAL.user_agent} 6 8 {/if} -
trunk/tools/triggers_list.php
r25202 r25360 569 569 ), 570 570 array( 571 'name' => 'mail_group_assign_vars',572 'type' => 'trigger_event',573 'vars' => array('array', 'assign_vars'),574 'files' => array('include\functions_mail.inc.php (pwg_mail_group)'),575 ),576 array(577 571 'name' => 'nbm_event_handler_added', 578 572 'type' => 'trigger_action', … … 707 701 ), 708 702 array( 709 'name' => ' send_mail',710 'type' => 'trigger_event', 711 'vars' => array('bool', 'result', ' string', 'mail_to', 'string', 'mail_subject', 'string', 'mail_content', 'array', 'mail_headers'),703 'name' => 'before_send_mail', 704 'type' => 'trigger_event', 705 'vars' => array('bool', 'result', 'mixed', 'to', 'array', 'arguments', 'PHPMailer', 'mail'), 712 706 'files' => array('include\functions_mail.inc.php (pwg_mail)'), 713 707 ), 714 708 array( 715 'name' => 'send_mail_content', 716 'type' => 'trigger_event', 717 'vars' => array('string', 'content'), 718 'files' => array('include\functions_mail.inc.php (pwg_mail)'), 719 ), 720 array( 721 'name' => 'send_mail_headers', 722 'type' => 'trigger_event', 723 'vars' => array('array', 'headers'), 724 'files' => array('include\functions_mail.inc.php (pwg_mail)'), 725 ), 726 array( 727 'name' => 'send_mail_subject', 728 'type' => 'trigger_event', 729 'vars' => array('string', 'cvt_subject'), 730 'files' => array('include\functions_mail.inc.php (pwg_mail)'), 731 ), 732 array( 733 'name' => 'send_mail_to', 734 'type' => 'trigger_event', 735 'vars' => array('string', 'to'), 709 'name' => 'before_parse_mail_template', 710 'type' => 'trigger_action', 711 'vars' => array('string', 'cache_key', 'string', 'content_type'), 736 712 'files' => array('include\functions_mail.inc.php (pwg_mail)'), 737 713 ),
Note: See TracChangeset
for help on using the changeset viewer.