mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
Merge branch '3.2.x'
This commit is contained in:
commit
f259a451bb
2 changed files with 8 additions and 6 deletions
|
@ -204,10 +204,12 @@ class messenger
|
||||||
/**
|
/**
|
||||||
* Set email template to use
|
* Set email template to use
|
||||||
*/
|
*/
|
||||||
function template($template_file, $template_lang = '', $template_path = '')
|
function template($template_file, $template_lang = '', $template_path = '', $template_dir_prefix = '')
|
||||||
{
|
{
|
||||||
global $config, $phpbb_root_path, $user;
|
global $config, $phpbb_root_path, $user;
|
||||||
|
|
||||||
|
$template_dir_prefix = (!$template_dir_prefix || $template_dir_prefix[0] === '/') ? $template_dir_prefix : '/' . $template_dir_prefix;
|
||||||
|
|
||||||
$this->setup_template();
|
$this->setup_template();
|
||||||
|
|
||||||
if (!trim($template_file))
|
if (!trim($template_file))
|
||||||
|
@ -226,7 +228,7 @@ class messenger
|
||||||
if ($template_path)
|
if ($template_path)
|
||||||
{
|
{
|
||||||
$template_paths = array(
|
$template_paths = array(
|
||||||
$template_path,
|
$template_path . $template_dir_prefix,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -235,7 +237,7 @@ class messenger
|
||||||
$template_path .= $template_lang . '/email';
|
$template_path .= $template_lang . '/email';
|
||||||
|
|
||||||
$template_paths = array(
|
$template_paths = array(
|
||||||
$template_path,
|
$template_path . $template_dir_prefix,
|
||||||
);
|
);
|
||||||
|
|
||||||
// we can only specify default language fallback when the path is not a custom one for which we
|
// we can only specify default language fallback when the path is not a custom one for which we
|
||||||
|
@ -245,14 +247,14 @@ class messenger
|
||||||
$fallback_template_path = (!empty($user->lang_path)) ? $user->lang_path : $phpbb_root_path . 'language/';
|
$fallback_template_path = (!empty($user->lang_path)) ? $user->lang_path : $phpbb_root_path . 'language/';
|
||||||
$fallback_template_path .= basename($config['default_lang']) . '/email';
|
$fallback_template_path .= basename($config['default_lang']) . '/email';
|
||||||
|
|
||||||
$template_paths[] = $fallback_template_path;
|
$template_paths[] = $fallback_template_path . $template_dir_prefix;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->set_template_paths(array(
|
$this->set_template_paths(array(
|
||||||
array(
|
array(
|
||||||
'name' => $template_lang . '_email',
|
'name' => $template_lang . '_email',
|
||||||
'ext_path' => 'language/' . $template_lang . '/email'
|
'ext_path' => 'language/' . $template_lang . '/email' . $template_dir_prefix,
|
||||||
),
|
),
|
||||||
), $template_paths);
|
), $template_paths);
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@ abstract class messenger_base extends \phpbb\notification\method\base
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$messenger->template($template_dir_prefix . $notification->get_email_template(), $user['user_lang']);
|
$messenger->template($notification->get_email_template(), $user['user_lang'], '', $template_dir_prefix);
|
||||||
|
|
||||||
$messenger->set_addresses($user);
|
$messenger->set_addresses($user);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue