diff --git a/e107_plugins/pm/pm.php b/e107_plugins/pm/pm.php index 9260b56fb6..ce70fb03e6 100755 --- a/e107_plugins/pm/pm.php +++ b/e107_plugins/pm/pm.php @@ -133,6 +133,15 @@ public function __construct($prefs, $manager) parent::__construct($prefs); } + function pm_caption($type = 'inbox') +{ + $PM_TEMPLATE = e107::getTemplate('pm', 'pm', $type); + $tp = e107::getParser(); + $sc = e107::getScBatch('pm', 'epm', 'pm'); + $sc->wrapper('pm'); + $caption_source = vartrue($PM_TEMPLATE['caption'], LAN_PM); + return $tp->parseTemplate($caption_source, true, $sc); +} /** * Show the 'Send to' form @@ -193,7 +202,7 @@ function show_send($to_uid) if(empty($PM_SEND_PM)) { - $PM_SEND_PM = e107::getTemplate('pm', 'pm', 'send'); + $PM_SEND_PM = e107::getTemplate('pm', 'pm', 'send')['main']; } $enc = (check_class($this->pmPrefs['attach_class']) ? "enctype='multipart/form-data'" : ''); @@ -420,7 +429,7 @@ function show_pm($pmid, $comeFrom = '') $bread = array('text' => LAN_PLUGIN_PM_INBOX, 'url' => e107::url('pm', 'index') . '?mode=inbox'); } - $ns->tablerender(LAN_PM, $this->breadcrumb($bread, '#' . $pmid) . $txt); + $ns->tablerender($this->pm_caption($comeFrom), $this->breadcrumb($bread, '#' . $pmid) . $txt); if(!$comeFrom) { @@ -892,7 +901,7 @@ function pm_user_lookup() switch($action) { case 'send' : - $ns->tablerender(LAN_PM, $pm->breadcrumb(LAN_PLUGIN_PM_NEW) . $mes->render() . $pm->show_send($pm_proc_id)); + $ns->tablerender($pm->pm_caption('send'), $pm->breadcrumb(LAN_PLUGIN_PM_NEW) . $mes->render() . $pm->show_send($pm_proc_id)); break; case 'reply' : @@ -916,7 +925,7 @@ function pm_user_lookup() break; case 'inbox' : - $caption = LAN_PM; + $caption = $pm->pm_caption('inbox');; if(THEME_LEGACY === true) { @@ -927,7 +936,7 @@ function pm_user_lookup() break; case 'outbox' : - $caption = LAN_PM; + $caption = $pm->pm_caption('outbox');; if(THEME_LEGACY === true) { diff --git a/e107_plugins/pm/templates/pm_template.php b/e107_plugins/pm/templates/pm_template.php index 1439c3b67f..dd9dbc886d 100644 --- a/e107_plugins/pm/templates/pm_template.php +++ b/e107_plugins/pm/templates/pm_template.php @@ -87,7 +87,8 @@ $PM_WRAPPER['PM_REPLY']= "{---}"; //$PM_SEND_PM = "
-$PM_TEMPLATE['send'] = "
+$PM_TEMPLATE['send']['caption'] = "{LAN=LAN_PM}"; +$PM_TEMPLATE['send']['main'] = "
@@ -117,6 +118,7 @@ "; //$PM_INBOX_HEADER = " +$PM_TEMPLATE['inbox']['caption'] = "{LAN=LAN_PM}"; $PM_TEMPLATE['inbox']['start'] = "
@@ -168,6 +170,7 @@ "; //$PM_OUTBOX_HEADER = " +$PM_TEMPLATE['outbox']['caption'] = "{LAN=LAN_PM}"; $PM_TEMPLATE['outbox']['start'] = "