Changeset 1645 for trunk/include/functions_mail.inc.php
- Timestamp:
- Dec 9, 2006, 1:43:23 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_mail.inc.php
r1644 r1645 102 102 103 103 /** 104 * Returns an new mail template 105 * 106 * @param none 107 */ 108 function get_mail_template() 109 { 110 global $conf; 111 112 // for mail, default template are used 113 list($tmpl, $thm) = explode('/', $conf['default_template']); 114 $mail_template = new Template(PHPWG_ROOT_PATH.'template/'.$tmpl, $thm); 115 116 return $mail_template; 117 } 118 119 /** 104 120 * sends an email, using PhpWebGallery specific informations 105 121 */ … … 147 163 } 148 164 149 list($tmpl, $thm) = explode('/', $conf['default_template']);150 151 165 $content = ''; 152 166 153 if ($email_format == 'text/html') 154 { 155 $template_mail = new Template(PHPWG_ROOT_PATH.'template/'.$tmpl, $thm); 156 157 $template_mail->set_filenames(array('mail_header'=>'mail/header.tpl')); 158 159 $template_mail->assign_vars( 160 array( 161 'BODY_ID' => 162 isset($page['body_id']) ? 163 $page['body_id'] : '', 164 165 'CONTENT_ENCODING' => $lang_info['charset'], 166 'LANG'=>$lang_info['code'], 167 'DIR'=>$lang_info['direction'] 168 169 )); 170 171 $content.= $template_mail->parse('mail_header', true); 172 } 167 if (!isset($conf_mail[$email_format][$lang_info['charset']]['header'])) 168 { 169 if ($email_format == 'text/html') 170 { 171 $mail_template = get_mail_template(); 172 173 $mail_template->set_filenames(array('mail_header'=>'mail/header.tpl')); 174 175 $mail_template->assign_vars( 176 array( 177 'BODY_ID' => 178 isset($page['body_id']) ? 179 $page['body_id'] : '', 180 181 'CONTENT_ENCODING' => $lang_info['charset'], 182 'LANG'=>$lang_info['code'], 183 'DIR'=>$lang_info['direction'] 184 185 )); 186 187 $conf_mail[$email_format][$lang_info['charset']]['header'] = 188 $mail_template->parse('mail_header', true); 189 } 190 else 191 { 192 $conf_mail[$email_format][$lang_info['charset']]['header'] = ''; 193 } 194 } 195 196 $content.= $conf_mail[$email_format][$lang_info['charset']]['header']; 173 197 174 198 if (($format_infos == 'text/plain') and ($email_format == 'text/html')) … … 181 205 } 182 206 183 if ($email_format == 'text/plain') 184 { 185 $content.= $conf_mail['text_footer']; 186 } 187 else 188 { 189 $template_mail->set_filenames(array('mail_footer'=>'footer.tpl')); 190 191 $template_mail->assign_vars( 192 array( 193 'VERSION' => $conf['show_version'] ? PHPWG_VERSION : '', 194 195 'L_TITLE_MAIL' => urlencode(l10n('title_send_mail')), 196 'MAIL' => get_webmaster_mail_address() 197 )); 198 199 $content.= $template_mail->parse('mail_footer', true); 200 } 207 if (!isset($conf_mail[$email_format][$lang_info['charset']]['footer'])) 208 { 209 if ($email_format == 'text/html') 210 { 211 $mail_template->set_filenames(array('mail_footer'=>'mail/footer.tpl')); 212 213 $mail_template->assign_vars( 214 array( 215 'GALLERY_URL' => 216 isset($page['gallery_url']) ? 217 $page['gallery_url'] : $conf['gallery_url'], 218 'GALLERY_TITLE' => 219 isset($page['gallery_title']) ? 220 $page['gallery_title'] : $conf['gallery_title'], 221 'VERSION' => $conf['show_version'] ? PHPWG_VERSION : '', 222 223 'L_TITLE_MAIL' => urlencode(l10n('title_send_mail')), 224 'MAIL' => get_webmaster_mail_address() 225 )); 226 227 $conf_mail[$email_format][$lang_info['charset']]['footer'] = 228 $mail_template->parse('mail_footer', true); 229 } 230 else 231 { 232 $conf_mail[$email_format][$lang_info['charset']]['footer'] = $conf_mail['text_footer']; 233 } 234 } 235 236 $content.= $conf_mail[$email_format][$lang_info['charset']]['footer']; 201 237 202 238 if ($conf_mail['mail_options'])
Note: See TracChangeset
for help on using the changeset viewer.