diff --git a/e107_plugins/pm/pm.php b/e107_plugins/pm/pm.php index 33d8df939..871d81944 100755 --- a/e107_plugins/pm/pm.php +++ b/e107_plugins/pm/pm.php @@ -176,10 +176,10 @@ class pm_extended extends private_message { return str_replace('{PERCENT}', $pm_outbox['outbox']['filled'], LAN_PM_13); } -// $tpl_file = THEME.'pm_template.php'; + // $tpl_file = THEME.'pm_template.php'; // include_once(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php'); - - $PM_SEND_PM = e107::getTemplate('pm', 'pm', 'send'); + if(THEME_LEGACY){include_once(THEME.'pm_template.php');} + if (!$PM_SEND_PM){$PM_SEND_PM = e107::getTemplate('pm', 'pm', 'send');} $enc = (check_class($this->pmPrefs['attach_class']) ? "enctype='multipart/form-data'" : ''); // setScVar('pm_handler_shortcodes','pmInfo', $pm_info); @@ -211,8 +211,23 @@ class pm_extended extends private_message // $tpl_file = THEME.'pm_template.php'; // include(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php'); - - $PM_INBOX = e107::getTemplate('pm', 'pm', 'inbox'); + if(THEME_LEGACY){ + include_once(THEME.'pm_template.php'); + + $PM_INBOX_HEADER = $this->updateTemplate($PM_INBOX_HEADER); + $PM_INBOX_TABLE = $this->updateTemplate($PM_INBOX_TABLE); + $PM_INBOX_EMPTY = $this->updateTemplate($PM_INBOX_EMPTY); + $PM_INBOX_FOOTER = $this->updateTemplate($PM_INBOX_FOOTER); + } + if (!$PM_INBOX_TABLE){ + $PM_INBOX = e107::getTemplate('pm', 'pm', 'inbox'); + + // Is updateTemplate really necessary for v2.x templates? + $PM_INBOX_HEADER = $PM_INBOX['start']; + $PM_INBOX_TABLE = $PM_INBOX['item']; + $PM_INBOX_EMPTY = $PM_INBOX['empty']; + $PM_INBOX_FOOTER = $PM_INBOX['end']; + } $pm_blocks = $this->block_get(); $pmlist = $this->pm_get_inbox(USERID, $start, $this->pmPrefs['perpage']); @@ -224,11 +239,12 @@ class pm_extended extends private_message $sc->wrapper('pm'); // Is updateTemplate really necessary for v2.x templates? +/* $PM_INBOX_HEADER = $this->updateTemplate($PM_INBOX['start']); $PM_INBOX_TABLE = $this->updateTemplate($PM_INBOX['item']); $PM_INBOX_EMPTY = $this->updateTemplate($PM_INBOX['empty']); $PM_INBOX_FOOTER = $this->updateTemplate($PM_INBOX['end']); - +*/ $txt = "