aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_mail.inc.php
diff options
context:
space:
mode:
authorrub <rub@piwigo.org>2007-02-08 22:04:36 +0000
committerrub <rub@piwigo.org>2007-02-08 22:04:36 +0000
commit5b038de71715c8ec006abffe9d23c4172b71d0ba (patch)
tree8ca826e68a35ea386b3831cf30a0fb1eb9632efe /include/functions_mail.inc.php
parent1f53608976250806d9a37f93e386f53a84aedbbc (diff)
Issue 0000639: Force selected page on index.php
Continue the Radu idea, restrict more use of random list Issue 0000598: NBM: Add new informations Add css on mail Use user template for mail (on next commit, best control) Comment mass_inserts because don't with MySQL 4.1.9 git-svn-id: http://piwigo.org/svn/trunk@1792 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_mail.inc.php')
-rw-r--r--include/functions_mail.inc.php39
1 files changed, 20 insertions, 19 deletions
diff --git a/include/functions_mail.inc.php b/include/functions_mail.inc.php
index 07be28b50..b44697078 100644
--- a/include/functions_mail.inc.php
+++ b/include/functions_mail.inc.php
@@ -103,12 +103,10 @@ function format_email($name, $email)
*/
function get_mail_template($email_format)
{
- global $conf;
+ global $user;
- // for mail, default template are used
- list($tmpl, $thm) = explode('/', $conf['default_template']);
- $mail_template = new Template(PHPWG_ROOT_PATH.'template/'.$tmpl, $thm);
- $mail_template->set_rootdir(PHPWG_ROOT_PATH.'template/'.$tmpl.'/mail/'.$email_format);
+ $mail_template = new Template(PHPWG_ROOT_PATH.'template/'.$user['template'], $user['theme']);
+ $mail_template->set_rootdir(PHPWG_ROOT_PATH.'template/'.$user['template'].'/mail/'.$email_format);
return $mail_template;
}
@@ -128,7 +126,7 @@ function get_str_email_format($is_html)
*/
function pwg_mail($to, $from = '', $subject = 'PhpWebGallery', $infos = '', $format_infos = 'text/plain', $email_format = null)
{
- global $conf, $conf_mail, $lang_info, $page;
+ global $conf, $conf_mail, $lang_info, $page, $user;
$cvt7b_subject = str_translate_to_ascii7bits($subject);
@@ -177,7 +175,7 @@ function pwg_mail($to, $from = '', $subject = 'PhpWebGallery', $infos = '', $for
$content = '';
- if (!isset($conf_mail[$email_format][$lang_info['charset']]))
+ if (!isset($conf_mail[$email_format][$lang_info['charset']][$user['template']][$user['theme']]))
{
if (!isset($mail_template))
{
@@ -190,10 +188,6 @@ function pwg_mail($to, $from = '', $subject = 'PhpWebGallery', $infos = '', $for
$mail_template->assign_vars(
array(
//Header
- 'BODY_ID' =>
- isset($page['body_id']) ?
- $page['body_id'] : '',
-
'CONTENT_ENCODING' => $lang_info['charset'],
'LANG' => $lang_info['code'],
'DIR' => $lang_info['direction'],
@@ -213,15 +207,21 @@ function pwg_mail($to, $from = '', $subject = 'PhpWebGallery', $infos = '', $for
));
// what are displayed on the header of each mail ?
- $conf_mail[$email_format][$lang_info['charset']]['header'] =
- $mail_template->parse('mail_header', true);
+ $conf_mail[$email_format]
+ [$lang_info['charset']]
+ [$user['template']][$user['theme']]['header'] =
+ $mail_template->parse('mail_header', true);
// what are displayed on the footer of each mail ?
- $conf_mail[$email_format][$lang_info['charset']]['footer'] =
- $mail_template->parse('mail_footer', true);
+ $conf_mail[$email_format]
+ [$lang_info['charset']]
+ [$user['template']][$user['theme']]['footer'] =
+ $mail_template->parse('mail_footer', true);
}
- $content.= $conf_mail[$email_format][$lang_info['charset']]['header'];
+ $content.= $conf_mail[$email_format]
+ [$lang_info['charset']]
+ [$user['template']][$user['theme']]['header'];
if (($format_infos == 'text/plain') and ($email_format == 'text/html'))
{
@@ -232,7 +232,9 @@ function pwg_mail($to, $from = '', $subject = 'PhpWebGallery', $infos = '', $for
$content.= $infos;
}
- $content.= $conf_mail[$email_format][$lang_info['charset']]['footer'];
+ $content.= $conf_mail[$email_format]
+ [$lang_info['charset']]
+ [$user['template']][$user['theme']]['footer'];
// Undo Compute root_path in order have complete path
if ($email_format == 'text/html')
@@ -257,8 +259,7 @@ function pwg_mail($to, $from = '', $subject = 'PhpWebGallery', $infos = '', $for
fwrite($file, $content);
fclose($file);
return true;
- }
- */
+ }*/
if ($conf_mail['mail_options'])
{