Changeset 2139
- Timestamp:
- Oct 16, 2007, 10:45:00 PM (17 years ago)
- Location:
- branches/branch-1_7
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/branch-1_7/admin/cat_modify.php
r1916 r2139 530 530 531 531 // info by email to an access granted group of category informations 532 if (isset($_POST['submitEmail']) )532 if (isset($_POST['submitEmail']) and !empty($_POST['group'])) 533 533 { 534 534 set_make_full_url(); … … 641 641 { 642 642 $template->assign_block_vars( 643 'group_ option',643 'group_mail.group_option', 644 644 array( 645 645 'VALUE' => $row['id'], -
branches/branch-1_7/admin/notification_by_mail.php
r2088 r2139 211 211 212 212 /* 213 * Apply global functions to mail content 214 * return customize mail content rendered 215 */ 216 function render_global_customize_mail_content($customize_mail_content) 217 { 218 global $conf; 219 220 if ($conf['nbm_send_html_mail'] and !(strpos($customize_mail_content, '<') === 0)) 221 { 222 // On HTML mail, detects if the content are HTML format. 223 // If it's plain text format, convert content to readable HTML 224 return nl2br(htmlspecialchars($customize_mail_content)); 225 } 226 else 227 { 228 return $customize_mail_content; 229 } 230 } 231 232 /* 213 233 * Send mail for notification to all users 214 234 * Return list of "selected" users for 'list_to_send' … … 244 264 } 245 265 246 if ($conf['nbm_send_html_mail'] and !(strpos($customize_mail_content, '<') === 0)) 247 { 248 // On HTML mail, detects if the content are HTML format. 249 // If it's plain text format, convert content to readable HTML 250 $customize_mail_content = nl2br(htmlentities($customize_mail_content)); 251 } 266 $customize_mail_content = 267 trigger_event('nbm_render_global_customize_mail_content', $customize_mail_content); 268 252 269 253 270 // Prepare message after change language … … 344 361 } 345 362 346 if (!empty($customize_mail_content)) 363 $nbm_user_customize_mail_content = 364 trigger_event('nbm_render_user_customize_mail_content', 365 $customize_mail_content, $nbm_user); 366 if (!empty($nbm_user_customize_mail_content)) 347 367 { 348 368 $env_nbm['mail_template']->assign_block_vars 349 369 ( 350 'custom', array('CUSTOMIZE_MAIL_CONTENT' => $customize_mail_content) 370 'custom', 371 array('CUSTOMIZE_MAIL_CONTENT' => 372 $nbm_user_customize_mail_content) 351 373 ); 352 374 } … … 481 503 // +-----------------------------------------------------------------------+ 482 504 check_status(get_tab_status($page['mode'])); 505 506 507 // +-----------------------------------------------------------------------+ 508 // | Add event handler | 509 // +-----------------------------------------------------------------------+ 510 add_event_handler('nbm_render_global_customize_mail_content', 'render_global_customize_mail_content'); 511 trigger_action('nbm_event_handler_added'); 512 483 513 484 514 // +-----------------------------------------------------------------------+ -
branches/branch-1_7/include/functions_mail.inc.php
r2133 r2139 242 242 $lang = $switch_lang[$language]['lang']; 243 243 } 244 245 $user['language'] = $language; 244 246 } 245 247 } … … 272 274 $lang = $switch_lang[$language]['lang']; 273 275 } 276 $user['language'] = $language; 274 277 } 275 278 } … … 293 296 function pwg_mail_notification_admins($keyargs_subject, $keyargs_content) 294 297 { 298 // Check arguments 299 if 300 ( 301 empty($keyargs_subject) or 302 empty($keyargs_content) 303 ) 304 { 305 return false; 306 } 307 295 308 global $conf, $user; 296 309 $return = true; … … 377 390 $assign_vars = array(), $language_selected = '') 378 391 { 392 // Check arguments 393 if 394 ( 395 empty($group_id) or 396 empty($email_format) or 397 empty($keyargs_subject) or 398 empty($tpl_shortname) 399 ) 400 { 401 return false; 402 } 403 379 404 global $conf; 380 405 $return = true; … … 449 474 $mail_template->set_filename($tpl_shortname, 450 475 (empty($dirname) ? '' : $dirname.'/').$tpl_shortname.'.tpl'); 451 $mail_template->assign_vars($assign_vars); 476 477 $mail_template->assign_vars( 478 trigger_event('mail_group_assign_vars', $assign_vars)); 452 479 453 480 $return = pwg_mail … … 479 506 * 480 507 * @param: 481 * - to: Receiver, or receiversof the mail.508 * - to: receiver(s) of the mail. 482 509 * - args: function params of mail function: 483 510 * o from: sender [default value webmaster email] … … 696 723 } 697 724 698 /*Testing block 699 { 700 global $user; 725 return 726 trigger_event('send_mail', 727 false, /* Result */ 728 trigger_event('send_mail_to', $to), 729 trigger_event('send_mail_subject', $cvt_subject), 730 trigger_event('send_mail_content', $content), 731 trigger_event('send_mail_headers', $headers), 732 $args 733 ); 734 } 735 736 /* 737 * pwg sendmail 738 * 739 * @param: 740 * - result of other sendmail 741 * - to: Receiver or receiver(s) of the mail. 742 * - subject [default value 'PhpWebGallery'] 743 * - content: content of mail 744 * - headers: headers of mail 745 * 746 * @return boolean (Ok or not) 747 */ 748 function pwg_send_mail($result, $to, $subject, $content, $headers) 749 { 750 if (!$result) 751 { 752 global $conf_mail; 753 754 if ($conf_mail['use_smtp']) 755 { 756 include_once( PHPWG_ROOT_PATH.'include/class_smtp_mail.inc.php' ); 757 $smtp_mail = new smtp_mail( 758 $conf_mail['smtp_host'], $conf_mail['smtp_user'], $conf_mail['smtp_password'], 759 $conf_mail['email_webmaster']); 760 return $smtp_mail->mail($to, $subject, $content, $headers); 761 } 762 else 763 { 764 if ($conf_mail['mail_options']) 765 { 766 $options = '-f '.$conf_mail['email_webmaster']; 767 return mail($to, $subject, $content, $headers, $options); 768 } 769 else 770 { 771 return mail($to, $subject, $content, $headers); 772 } 773 } 774 } 775 } 776 777 /*Testing block 778 function pwg_send_mail_test($result, $to, $subject, $content, $headers, $args) 779 { 780 global $user, $lang_info; 701 781 @mkdir(PHPWG_ROOT_PATH.'testmail'); 702 $filename = PHPWG_ROOT_PATH.'testmail/mail.'.$user['username'] ;782 $filename = PHPWG_ROOT_PATH.'testmail/mail.'.$user['username'].'.'.$lang_info['code'].'.'.$args['template'].'.'.$args['theme']; 703 783 if ($args['content_format'] == 'text/plain') 704 784 { … … 710 790 } 711 791 $file = fopen($filename, 'w+'); 792 fwrite($file, $to); 793 fwrite($file, $subject); 794 fwrite($file, $headers); 712 795 fwrite($file, $content); 713 796 fclose($file); 714 797 return true; 715 }*/ 716 717 if ($conf_mail['use_smtp']) 718 { 719 include_once( PHPWG_ROOT_PATH.'include/class_smtp_mail.inc.php' ); 720 $smtp_mail = new smtp_mail( 721 $conf_mail['smtp_host'], $conf_mail['smtp_user'], $conf_mail['smtp_password'], 722 $conf_mail['email_webmaster']); 723 return $smtp_mail->mail($to, $cvt_subject, $content, $headers); 724 } 725 else 726 { 727 if ($conf_mail['mail_options']) 728 { 729 $options = '-f '.$conf_mail['email_webmaster']; 730 return mail($to, $cvt_subject, $content, $headers, $options); 731 } 732 else 733 { 734 return mail($to, $cvt_subject, $content, $headers); 735 } 736 } 737 } 798 } 799 add_event_handler('send_mail', 'pwg_send_mail_test', 0, 6);*/ 800 801 802 add_event_handler('send_mail', 'pwg_send_mail', EVENT_HANDLER_PRIORITY_NEUTRAL, 5); 803 trigger_action('functions_mail_included'); 738 804 739 805 ?> -
branches/branch-1_7/template/yoga/admin/cat_modify.tpl
r1916 r2139 213 213 </fieldset> 214 214 215 <!-- BEGIN group_mail --> 215 216 <fieldset id="emailCatInfo"> 216 217 <legend>{lang:Send an information email to group members}</legend> … … 222 223 <select name="group"> 223 224 <!-- BEGIN group_option --> 224 <option value="{group_ option.VALUE}">{group_option.OPTION}</option>225 <option value="{group_mail.group_option.VALUE}">{group_mail.group_option.OPTION}</option> 225 226 <!-- END group_option --> 226 227 </select> … … 242 243 243 244 </fieldset> 245 <!-- END group_mail --> 244 246 245 247 </form>
Note: See TracChangeset
for help on using the changeset viewer.