From 0945e0a99cbe65402c06d37180c0fed0bfffc010 Mon Sep 17 00:00:00 2001 From: rica-carv Date: Sat, 20 Dec 2025 11:41:46 +0000 Subject: [PATCH 1/2] Update PM templates to include captions --- e107_plugins/pm/templates/pm_template.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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'] = "
From b87c4ef5bb36a0c85523122ab1fbf051bcbc0172 Mon Sep 17 00:00:00 2001 From: rica-carv Date: Sat, 20 Dec 2025 11:50:36 +0000 Subject: [PATCH 2/2] Update pm.php --- e107_plugins/pm/pm.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/e107_plugins/pm/pm.php b/e107_plugins/pm/pm.php index 61e7e013a8..2e4f9eff8d 100755 --- a/e107_plugins/pm/pm.php +++ b/e107_plugins/pm/pm.php @@ -130,6 +130,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 @@ -190,7 +199,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'" : ''); @@ -417,7 +426,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) { @@ -889,7 +898,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' : @@ -913,7 +922,7 @@ function pm_user_lookup() break; case 'inbox' : - $caption = LAN_PM; + $caption = $pm->pm_caption('inbox');; if(THEME_LEGACY === true) { @@ -924,7 +933,7 @@ function pm_user_lookup() break; case 'outbox' : - $caption = LAN_PM; + $caption = $pm->pm_caption('outbox');; if(THEME_LEGACY === true) {