Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions e107_plugins/pm/pm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'" : '');
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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' :
Expand All @@ -916,7 +925,7 @@ function pm_user_lookup()
break;

case 'inbox' :
$caption = LAN_PM;
$caption = $pm->pm_caption('inbox');;

if(THEME_LEGACY === true)
{
Expand All @@ -927,7 +936,7 @@ function pm_user_lookup()
break;

case 'outbox' :
$caption = LAN_PM;
$caption = $pm->pm_caption('outbox');;

if(THEME_LEGACY === true)
{
Expand Down
5 changes: 4 additions & 1 deletion e107_plugins/pm/templates/pm_template.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@
$PM_WRAPPER['PM_REPLY']= "<tr><td class='forumheader' style='text-align:center'>{---}</td></tr>";

//$PM_SEND_PM = "<div id='pm-send-pm'>
$PM_TEMPLATE['send'] = "<div id='pm-send-pm'>
$PM_TEMPLATE['send']['caption'] = "{LAN=LAN_PM}";
$PM_TEMPLATE['send']['main'] = "<div id='pm-send-pm'>
<table class='table fborder'>
<thead>
<tr>
Expand Down Expand Up @@ -117,6 +118,7 @@
";

//$PM_INBOX_HEADER = "
$PM_TEMPLATE['inbox']['caption'] = "{LAN=LAN_PM}";
$PM_TEMPLATE['inbox']['start'] = "
<table class='table table-striped fborder'>
<thead>
Expand Down Expand Up @@ -168,6 +170,7 @@
";

//$PM_OUTBOX_HEADER = "
$PM_TEMPLATE['outbox']['caption'] = "{LAN=LAN_PM}";
$PM_TEMPLATE['outbox']['start'] = "
<table class='table table-striped fborder'>
<thead>
Expand Down
Loading