mirror of
https://github.com/e107inc/e107.git
synced 2025-07-13 11:06:20 +02:00
Merge pull request #2551 from rica-carv/rica-carv-pm_update
PM Plugin templates to V2.x locations
This commit is contained in:
@ -176,15 +176,22 @@ class pm_extended extends private_message
|
|||||||
{
|
{
|
||||||
return str_replace('{PERCENT}', $pm_outbox['outbox']['filled'], LAN_PM_13);
|
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');
|
// include_once(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php');
|
||||||
|
if(THEME_LEGACY){
|
||||||
|
include_once(THEME.'pm_template.php');
|
||||||
|
$PM_SEND_PM = $this->updateTemplate($PM_SEND_PM);
|
||||||
|
}
|
||||||
|
if (!$PM_SEND_PM){$PM_SEND_PM = e107::getTemplate('pm', 'pm', 'send');}
|
||||||
|
|
||||||
$enc = (check_class($this->pmPrefs['attach_class']) ? "enctype='multipart/form-data'" : '');
|
$enc = (check_class($this->pmPrefs['attach_class']) ? "enctype='multipart/form-data'" : '');
|
||||||
// setScVar('pm_handler_shortcodes','pmInfo', $pm_info);
|
// setScVar('pm_handler_shortcodes','pmInfo', $pm_info);
|
||||||
|
|
||||||
$sc = e107::getScBatch('pm',true, 'pm');
|
$sc = e107::getScBatch('pm',true, 'pm');
|
||||||
$sc->setVars($pm_info);
|
$sc->setVars($pm_info);
|
||||||
|
$sc->wrapper('pm');
|
||||||
|
|
||||||
$PM_SEND_PM = $this->updateTemplate($PM_SEND_PM);
|
// $PM_SEND_PM = $this->updateTemplate($PM_SEND_PM);
|
||||||
|
|
||||||
$text = "<form {$enc} method='post' action='".e_SELF."' id='dataform'>
|
$text = "<form {$enc} method='post' action='".e_SELF."' id='dataform'>
|
||||||
<div><input type='hidden' name='numsent' value='{$pm_outbox['outbox']['total']}' />".
|
<div><input type='hidden' name='numsent' value='{$pm_outbox['outbox']['total']}' />".
|
||||||
@ -205,8 +212,18 @@ class pm_extended extends private_message
|
|||||||
{
|
{
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
|
|
||||||
$tpl_file = THEME.'pm_template.php';
|
// $tpl_file = THEME.'pm_template.php';
|
||||||
include(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php');
|
// include(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php');
|
||||||
|
if(THEME_LEGACY){
|
||||||
|
include_once(THEME.'pm_template.php');
|
||||||
|
|
||||||
|
// Is updateTemplate really necessary for v2.x templates?
|
||||||
|
$PM_INBOX['start'] = $this->updateTemplate($PM_INBOX_HEADER);
|
||||||
|
$PM_INBOX['item'] = $this->updateTemplate($PM_INBOX_TABLE);
|
||||||
|
$PM_INBOX['empty'] = $this->updateTemplate($PM_INBOX_EMPTY);
|
||||||
|
$PM_INBOX['end'] = $this->updateTemplate($PM_INBOX_FOOTER);
|
||||||
|
}
|
||||||
|
if (!$PM_INBOX){$PM_INBOX = e107::getTemplate('pm', 'pm', 'inbox');}
|
||||||
|
|
||||||
$pm_blocks = $this->block_get();
|
$pm_blocks = $this->block_get();
|
||||||
$pmlist = $this->pm_get_inbox(USERID, $start, $this->pmPrefs['perpage']);
|
$pmlist = $this->pm_get_inbox(USERID, $start, $this->pmPrefs['perpage']);
|
||||||
@ -215,15 +232,17 @@ class pm_extended extends private_message
|
|||||||
|
|
||||||
$sc = e107::getScBatch('pm',true, 'pm');
|
$sc = e107::getScBatch('pm',true, 'pm');
|
||||||
$sc->pmNextPrev = array('start' => $start, 'total' => $pmlist['total_messages']);
|
$sc->pmNextPrev = array('start' => $start, 'total' => $pmlist['total_messages']);
|
||||||
|
$sc->wrapper('pm');
|
||||||
|
|
||||||
|
// Is updateTemplate really necessary for v2.x templates?
|
||||||
$PM_INBOX_HEADER = $this->updateTemplate($PM_INBOX_HEADER);
|
/*
|
||||||
$PM_INBOX_TABLE = $this->updateTemplate($PM_INBOX_TABLE);
|
$PM_INBOX_HEADER = $this->updateTemplate($PM_INBOX['start']);
|
||||||
$PM_INBOX_EMPTY = $this->updateTemplate($PM_INBOX_EMPTY);
|
$PM_INBOX_TABLE = $this->updateTemplate($PM_INBOX['item']);
|
||||||
$PM_INBOX_FOOTER = $this->updateTemplate($PM_INBOX_FOOTER);
|
$PM_INBOX_EMPTY = $this->updateTemplate($PM_INBOX['empty']);
|
||||||
|
$PM_INBOX_FOOTER = $this->updateTemplate($PM_INBOX['end']);
|
||||||
|
*/
|
||||||
$txt = "<form method='post' action='".e_REQUEST_SELF."?".e_QUERY."'>";
|
$txt = "<form method='post' action='".e_REQUEST_SELF."?".e_QUERY."'>";
|
||||||
$txt .= $tp->parseTemplate($PM_INBOX_HEADER, true, $sc);
|
$txt .= $tp->parseTemplate($PM_INBOX['start'], true, $sc);
|
||||||
|
|
||||||
if($pmlist['total_messages'])
|
if($pmlist['total_messages'])
|
||||||
{
|
{
|
||||||
@ -231,15 +250,15 @@ class pm_extended extends private_message
|
|||||||
{
|
{
|
||||||
if(trim($rec['pm_subject']) == '') { $rec['pm_subject'] = '['.LAN_PM_61.']'; }
|
if(trim($rec['pm_subject']) == '') { $rec['pm_subject'] = '['.LAN_PM_61.']'; }
|
||||||
$sc->setVars($rec);
|
$sc->setVars($rec);
|
||||||
$txt .= $tp->parseTemplate($PM_INBOX_TABLE, true, $sc);
|
$txt .= $tp->parseTemplate($PM_INBOX['item'], true, $sc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$txt .= $tp->parseTemplate($PM_INBOX_EMPTY, true, $sc);
|
$txt .= $tp->parseTemplate($PM_INBOX['empty'], true, $sc);
|
||||||
}
|
}
|
||||||
|
|
||||||
$txt .= $tp->parseTemplate($PM_INBOX_FOOTER, true, $sc);
|
$txt .= $tp->parseTemplate($PM_INBOX['end'], true, $sc);
|
||||||
$txt .= "</form>";
|
$txt .= "</form>";
|
||||||
|
|
||||||
|
|
||||||
@ -257,22 +276,35 @@ class pm_extended extends private_message
|
|||||||
{
|
{
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
|
|
||||||
$tpl_file = THEME.'pm_template.php';
|
// $tpl_file = THEME.'pm_template.php';
|
||||||
include(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php');
|
// include(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php');
|
||||||
|
if(THEME_LEGACY){
|
||||||
|
include_once(THEME.'pm_template.php');
|
||||||
|
|
||||||
|
// Is updateTemplate really necessary for v2.x templates?
|
||||||
|
$PM_OUTBOX['start'] = $this->updateTemplate($PM_OUTBOX_HEADER);
|
||||||
|
$PM_OUTBOX['item'] = $this->updateTemplate($PM_OUTBOX_TABLE);
|
||||||
|
$PM_OUTBOX['empty'] = $this->updateTemplate($PM_OUTBOX_EMPTY);
|
||||||
|
$PM_OUTBOX['end'] = $this->updateTemplate($PM_OUTBOX_FOOTER);
|
||||||
|
}
|
||||||
|
if (!$PM_OUTBOX){$PM_OUTBOX = e107::getTemplate('pm', 'pm', 'outbox');}
|
||||||
|
|
||||||
$pmlist = $this->pm_get_outbox(USERID, $start, $this->pmPrefs['perpage']);
|
$pmlist = $this->pm_get_outbox(USERID, $start, $this->pmPrefs['perpage']);
|
||||||
// setScVar('pm_handler_shortcodes', 'pmNextPrev', array('start' => $start, 'total' => $pmlist['total_messages']));
|
// setScVar('pm_handler_shortcodes', 'pmNextPrev', array('start' => $start, 'total' => $pmlist['total_messages']));
|
||||||
|
|
||||||
$sc = e107::getScBatch('pm', true, 'pm');
|
$sc = e107::getScBatch('pm', true, 'pm');
|
||||||
$sc->pmNextPrev = array('start' => $start, 'total' => $pmlist['total_messages']);
|
$sc->pmNextPrev = array('start' => $start, 'total' => $pmlist['total_messages']);
|
||||||
|
$sc->wrapper('pm');
|
||||||
|
|
||||||
$PM_OUTBOX_HEADER = $this->updateTemplate($PM_OUTBOX_HEADER);
|
// Is updateTemplate really necessary for v2.x templates?
|
||||||
$PM_OUTBOX_TABLE = $this->updateTemplate($PM_OUTBOX_TABLE);
|
/*
|
||||||
$PM_OUTBOX_EMPTY = $this->updateTemplate($PM_OUTBOX_EMPTY);
|
$PM_OUTBOX_HEADER = $this->updateTemplate($PM_OUTBOX['start']);
|
||||||
$PM_OUTBOX_FOOTER = $this->updateTemplate($PM_OUTBOX_FOOTER);
|
$PM_OUTBOX_TABLE = $this->updateTemplate($PM_OUTBOX['item']);
|
||||||
|
$PM_OUTBOX_EMPTY = $this->updateTemplate($PM_OUTBOX['empty']);
|
||||||
|
$PM_OUTBOX_FOOTER = $this->updateTemplate($PM_OUTBOX['end']);
|
||||||
|
*/
|
||||||
$txt = "<form method='post' action='".e_SELF."?".e_QUERY."'>";
|
$txt = "<form method='post' action='".e_SELF."?".e_QUERY."'>";
|
||||||
$txt .= $tp->parseTemplate($PM_OUTBOX_HEADER, true, $sc);
|
$txt .= $tp->parseTemplate($PM_OUTBOX['start'], true, $sc);
|
||||||
if($pmlist['total_messages'])
|
if($pmlist['total_messages'])
|
||||||
{
|
{
|
||||||
foreach($pmlist['messages'] as $rec)
|
foreach($pmlist['messages'] as $rec)
|
||||||
@ -280,14 +312,14 @@ class pm_extended extends private_message
|
|||||||
if(trim($rec['pm_subject']) == '') { $rec['pm_subject'] = '['.LAN_PM_61.']'; }
|
if(trim($rec['pm_subject']) == '') { $rec['pm_subject'] = '['.LAN_PM_61.']'; }
|
||||||
// setScVar('pm_handler_shortcodes','pmInfo', $rec);
|
// setScVar('pm_handler_shortcodes','pmInfo', $rec);
|
||||||
$sc->setVars($rec);
|
$sc->setVars($rec);
|
||||||
$txt .= $tp->parseTemplate($PM_OUTBOX_TABLE, true, $sc);
|
$txt .= $tp->parseTemplate($PM_OUTBOX['item'], true, $sc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$txt .= $tp->parseTemplate($PM_OUTBOX_EMPTY, true, $sc);
|
$txt .= $tp->parseTemplate($PM_OUTBOX['empty'], true, $sc);
|
||||||
}
|
}
|
||||||
$txt .= $tp->parseTemplate($PM_OUTBOX_FOOTER, true, $sc);
|
$txt .= $tp->parseTemplate($PM_OUTBOX['end'], true, $sc);
|
||||||
$txt .= '</form>';
|
$txt .= '</form>';
|
||||||
return $txt;
|
return $txt;
|
||||||
}
|
}
|
||||||
@ -304,12 +336,19 @@ class pm_extended extends private_message
|
|||||||
{
|
{
|
||||||
$ns = e107::getRender();
|
$ns = e107::getRender();
|
||||||
|
|
||||||
$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');
|
// include_once(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php');
|
||||||
|
if(THEME_LEGACY){
|
||||||
|
include_once(THEME.'pm_template.php');
|
||||||
|
$PM_SHOW = $this->updateTemplate($PM_SHOW);
|
||||||
|
}
|
||||||
|
if (!$PM_SHOW){$PM_SHOW = e107::getTemplate('pm', 'pm', 'show');}
|
||||||
|
|
||||||
$pm_info = $this->pm_get($pmid);
|
$pm_info = $this->pm_get($pmid);
|
||||||
|
|
||||||
$sc = e107::getScBatch('pm',true, 'pm');
|
$sc = e107::getScBatch('pm',true, 'pm');
|
||||||
$sc->setVars($pm_info);
|
$sc->setVars($pm_info);
|
||||||
|
$sc->wrapper('pm');
|
||||||
|
|
||||||
if($pm_info['pm_to'] != USERID && $pm_info['pm_from'] != USERID)
|
if($pm_info['pm_to'] != USERID && $pm_info['pm_from'] != USERID)
|
||||||
{
|
{
|
||||||
@ -327,7 +366,7 @@ class pm_extended extends private_message
|
|||||||
|
|
||||||
$sc->pmMode = $comeFrom;
|
$sc->pmMode = $comeFrom;
|
||||||
|
|
||||||
$PM_SHOW = $this->updateTemplate($PM_SHOW);
|
// $PM_SHOW = $this->updateTemplate($PM_SHOW);
|
||||||
|
|
||||||
$txt = e107::getParser()->parseTemplate($PM_SHOW, true, $sc);
|
$txt = e107::getParser()->parseTemplate($PM_SHOW, true, $sc);
|
||||||
|
|
||||||
@ -373,35 +412,49 @@ class pm_extended extends private_message
|
|||||||
public function showBlocked($start = 0)
|
public function showBlocked($start = 0)
|
||||||
{
|
{
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
$tpl_file = THEME.'pm_template.php';
|
// $tpl_file = THEME.'pm_template.php';
|
||||||
include(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php');
|
// include(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php');
|
||||||
|
if(THEME_LEGACY){
|
||||||
|
include_once(THEME.'pm_template.php');
|
||||||
|
|
||||||
|
// Is updateTemplate really necessary for v2.x templates?
|
||||||
|
$PM_BLOCKED['start'] = $this->updateTemplate($PM_BLOCKED_HEADER);
|
||||||
|
$PM_BLOCKED['item'] = $this->updateTemplate($PM_BLOCKED_TABLE);
|
||||||
|
$PM_BLOCKED['empty'] = $this->updateTemplate($PM_BLOCKED_EMPTY);
|
||||||
|
$PM_BLOCKED['end'] = $this->updateTemplate($PM_BLOCKED_FOOTER);
|
||||||
|
}
|
||||||
|
if (!$PM_BLOCKED){$PM_BLOCKED = e107::getTemplate('pm', 'pm', 'blocked');}
|
||||||
|
|
||||||
$pmBlocks = $this->block_get_user(); // TODO - handle pagination, maybe (is it likely to be necessary?)
|
$pmBlocks = $this->block_get_user(); // TODO - handle pagination, maybe (is it likely to be necessary?)
|
||||||
|
|
||||||
$sc = e107::getScBatch('pm',TRUE, 'pm');
|
$sc = e107::getScBatch('pm',TRUE, 'pm');
|
||||||
$sc->pmBlocks = $pmBlocks;
|
$sc->pmBlocks = $pmBlocks;
|
||||||
|
$sc->wrapper('pm');
|
||||||
|
|
||||||
$PM_BLOCKED_HEADER = $this->updateTemplate($PM_BLOCKED_HEADER);
|
// Is updateTemplate really necessary for v2.x templates?
|
||||||
$PM_BLOCKED_TABLE = $this->updateTemplate($PM_BLOCKED_TABLE);
|
/*
|
||||||
$PM_BLOCKED_EMPTY = $this->updateTemplate($PM_BLOCKED_EMPTY);
|
$PM_BLOCKED_HEADER = $this->updateTemplate($PM_BLOCKED['start']);
|
||||||
$PM_BLOCKED_FOOTER = $this->updateTemplate($PM_BLOCKED_FOOTER);
|
$PM_BLOCKED_TABLE = $this->updateTemplate($PM_BLOCKED['item']);
|
||||||
|
$PM_BLOCKED_EMPTY = $this->updateTemplate($PM_BLOCKED['empty']);
|
||||||
|
$PM_BLOCKED_FOOTER = $this->updateTemplate($PM_BLOCKED['end']);
|
||||||
|
*/
|
||||||
|
|
||||||
$txt = "<form method='post' action='".e_SELF."?".e_QUERY."'>";
|
$txt = "<form method='post' action='".e_SELF."?".e_QUERY."'>";
|
||||||
$txt .= $tp->parseTemplate($PM_BLOCKED_HEADER, true, $sc);
|
$txt .= $tp->parseTemplate($PM_BLOCKED['start'], true, $sc);
|
||||||
if($pmTotalBlocked = count($pmBlocks))
|
if($pmTotalBlocked = count($pmBlocks))
|
||||||
{
|
{
|
||||||
foreach($pmBlocks as $pmBlocked)
|
foreach($pmBlocks as $pmBlocked)
|
||||||
{
|
{
|
||||||
$sc->pmBlocked = $pmBlocked;
|
$sc->pmBlocked = $pmBlocked;
|
||||||
// setScVar('pm_handler_shortcodes','pmBlocked', $pmBlocked);
|
// setScVar('pm_handler_shortcodes','pmBlocked', $pmBlocked);
|
||||||
$txt .= $tp->parseTemplate($PM_BLOCKED_TABLE, true, $sc);
|
$txt .= $tp->parseTemplate($PM_BLOCKED['item'], true, $sc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$txt .= $tp->parseTemplate($PM_BLOCKED_EMPTY, true, $sc);
|
$txt .= $tp->parseTemplate($PM_BLOCKED['empty'], true, $sc);
|
||||||
}
|
}
|
||||||
$txt .= $tp->parseTemplate($PM_BLOCKED_FOOTER, true, $sc);
|
$txt .= $tp->parseTemplate($PM_BLOCKED['end'], true, $sc);
|
||||||
$txt .= '</form>';
|
$txt .= '</form>';
|
||||||
return $txt;
|
return $txt;
|
||||||
}
|
}
|
||||||
|
@ -377,7 +377,7 @@ class private_message
|
|||||||
function pm_send_notify($uid, $pmInfo, $pmid, $attach_count = 0)
|
function pm_send_notify($uid, $pmInfo, $pmid, $attach_count = 0)
|
||||||
{
|
{
|
||||||
// require_once(e_HANDLER.'mail.php');
|
// require_once(e_HANDLER.'mail.php');
|
||||||
|
/*
|
||||||
$tpl_file = THEME.'pm_template.php';
|
$tpl_file = THEME.'pm_template.php';
|
||||||
|
|
||||||
$PM_NOTIFY = null; // loaded in template below.
|
$PM_NOTIFY = null; // loaded in template below.
|
||||||
@ -385,11 +385,14 @@ class private_message
|
|||||||
include(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php');
|
include(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php');
|
||||||
|
|
||||||
$template = $PM_NOTIFY;
|
$template = $PM_NOTIFY;
|
||||||
|
*/
|
||||||
|
if(THEME_LEGACY){include_once(THEME.'pm_template.php');}
|
||||||
|
if (!$PM_NOTIFY){$PM_NOTIFY = e107::getTemplate('pm', 'pm', 'notify');}
|
||||||
|
|
||||||
if(empty($template)) // BC Fallback.
|
if(empty($PM_NOTIFY)) // BC Fallback.
|
||||||
{
|
{
|
||||||
|
|
||||||
$template =
|
$PM_NOTIFY =
|
||||||
"<div>
|
"<div>
|
||||||
<h4>".LAN_PM_101."{SITENAME}</h4>
|
<h4>".LAN_PM_101."{SITENAME}</h4>
|
||||||
<table class='table table-striped'>
|
<table class='table table-striped'>
|
||||||
@ -416,7 +419,7 @@ class private_message
|
|||||||
$data['PM_URL'] = $url;// e107::url('pm','index', null, array('mode'=>'full')).'?show.'.$pmid;
|
$data['PM_URL'] = $url;// e107::url('pm','index', null, array('mode'=>'full')).'?show.'.$pmid;
|
||||||
$data['PM_BUTTON'] = "<a class='btn btn-primary' href='".$url."'>".LAN_PM_113."</a>";// e107::url('pm','index', null, array('mode'=>'full')).'?show.'.$pmid;
|
$data['PM_BUTTON'] = "<a class='btn btn-primary' href='".$url."'>".LAN_PM_113."</a>";// e107::url('pm','index', null, array('mode'=>'full')).'?show.'.$pmid;
|
||||||
|
|
||||||
$text = e107::getParser()->simpleParse($template, $data);
|
$text = e107::getParser()->simpleParse($PM_NOTIFY, $data);
|
||||||
|
|
||||||
$eml = array();
|
$eml = array();
|
||||||
$eml['email_subject'] = LAN_PM_100.USERNAME;
|
$eml['email_subject'] = LAN_PM_100.USERNAME;
|
||||||
@ -921,4 +924,4 @@ class private_message
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
43
e107_plugins/pm/private_msg_menu.php → e107_plugins/pm/pm_menu.php
Executable file → Normal file
43
e107_plugins/pm/private_msg_menu.php → e107_plugins/pm/pm_menu.php
Executable file → Normal file
@ -22,7 +22,9 @@
|
|||||||
* @subpackage pm
|
* @subpackage pm
|
||||||
* @version $Id$;
|
* @version $Id$;
|
||||||
*/
|
*/
|
||||||
|
$pm_prefs = e107::getPlugPref('pm');
|
||||||
|
if(check_class($pm_prefs['pm_class']))
|
||||||
|
{
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
if (!e107::isInstalled('pm')) { return ''; }
|
if (!e107::isInstalled('pm')) { return ''; }
|
||||||
|
|
||||||
@ -75,7 +77,7 @@ if(!function_exists('pm_show_popup'))
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$pm_prefs = e107::getPlugPref('pm');
|
//$pm_prefs = e107::getPlugPref('pm');
|
||||||
//global $sysprefs, $pm_prefs;
|
//global $sysprefs, $pm_prefs;
|
||||||
|
|
||||||
|
|
||||||
@ -97,29 +99,10 @@ $pmManager = new pmbox_manager($pm_prefs);
|
|||||||
|
|
||||||
//setScVar('pm_handler_shortcodes','pmManager', $pmManager);
|
//setScVar('pm_handler_shortcodes','pmManager', $pmManager);
|
||||||
|
|
||||||
define('PM_INBOX_ICON', "<img src='".e_PLUGIN_ABS."pm/images/mail_get.png' class='icon S16' alt='".LAN_PLUGIN_PM_INBOX."' title='".LAN_PLUGIN_PM_INBOX."' />");
|
$template = e107::getTemplate('pm', 'pm_menu');
|
||||||
define('PM_OUTBOX_ICON', "<img src='".e_PLUGIN_ABS."pm/images/mail_send.png' class='icon S16' alt='".LAN_PLUGIN_PM_OUTBOX."' title='".LAN_PLUGIN_PM_OUTBOX."' />");
|
|
||||||
define('PM_SEND_LINK', LAN_PLUGIN_PM_NEW);
|
|
||||||
define('NEWPM_ANIMATION', "<img src='".e_PLUGIN_ABS."pm/images/newpm.gif' alt='' />");
|
|
||||||
|
|
||||||
|
//if(!isset($pm_menu_template))
|
||||||
$sc_style['PM_SEND_PM_LINK']['pre'] = "<br /><br />";
|
if(!isset($PM_MENU_TEMPLATE))
|
||||||
$sc_style['PM_SEND_PM_LINK']['post'] = "";
|
|
||||||
|
|
||||||
$sc_style['PM_INBOX_FILLED']['pre'] = "[";
|
|
||||||
$sc_style['PM_INBOX_FILLED']['post'] = "%]";
|
|
||||||
|
|
||||||
$sc_style['PM_OUTBOX_FILLED']['pre'] = "[";
|
|
||||||
$sc_style['PM_OUTBOX_FILLED']['post'] = "%]";
|
|
||||||
|
|
||||||
$sc_style['PM_NEWPM_ANIMATE']['pre'] = "<a href='".e_PLUGIN_ABS."pm/pm.php?inbox'>";
|
|
||||||
$sc_style['PM_NEWPM_ANIMATE']['post'] = "</a>";
|
|
||||||
|
|
||||||
$sc_style['PM_BLOCKED_SENDERS_MANAGE']['pre'] = "<br />[ <a href='".e_PLUGIN_ABS."pm/pm.php?blocked'>";
|
|
||||||
$sc_style['PM_BLOCKED_SENDERS_MANAGE']['post'] = '</a> ]';
|
|
||||||
|
|
||||||
|
|
||||||
if(!isset($pm_menu_template))
|
|
||||||
{
|
{
|
||||||
//FIXME URL Breaks
|
//FIXME URL Breaks
|
||||||
/*
|
/*
|
||||||
@ -138,7 +121,8 @@ if(!isset($pm_menu_template))
|
|||||||
";
|
";
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$pm_menu_template = "
|
// $pm_menu_template = "
|
||||||
|
$PM_MENU_TEMPLATE = "
|
||||||
<a href='".e_PLUGIN_ABS."pm/pm.php?inbox'>".PM_INBOX_ICON."</a>
|
<a href='".e_PLUGIN_ABS."pm/pm.php?inbox'>".PM_INBOX_ICON."</a>
|
||||||
<a href='".e_PLUGIN_ABS."pm/pm.php?inbox'>".LAN_PLUGIN_PM_INBOX."</a>
|
<a href='".e_PLUGIN_ABS."pm/pm.php?inbox'>".LAN_PLUGIN_PM_INBOX."</a>
|
||||||
{PM_NEWPM_ANIMATE}
|
{PM_NEWPM_ANIMATE}
|
||||||
@ -153,15 +137,16 @@ if(!isset($pm_menu_template))
|
|||||||
";
|
";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if(check_class($pm_prefs['pm_class']))
|
||||||
if(check_class($pm_prefs['pm_class']))
|
//{
|
||||||
{
|
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
$sc = e107::getScBatch('pm',TRUE, 'pm');
|
$sc = e107::getScBatch('pm',TRUE, 'pm');
|
||||||
|
|
||||||
$pm_inbox = $pmManager->pm_getInfo('inbox');
|
$pm_inbox = $pmManager->pm_getInfo('inbox');
|
||||||
|
$sc->wrapper('pm_menu');
|
||||||
|
|
||||||
$txt = "\n".$tp->parseTemplate($pm_menu_template, TRUE, $sc);
|
// $txt = "\n".$tp->parseTemplate($pm_menu_template, TRUE, $sc);
|
||||||
|
$txt = "\n".$tp->parseTemplate($PM_MENU_TEMPLATE, TRUE, $sc);
|
||||||
|
|
||||||
if($pm_inbox['inbox']['new'] > 0 && $pm_prefs['popup'] && strpos(e_SELF, 'pm.php') === FALSE && $_COOKIE['pm-alert'] != 'ON')
|
if($pm_inbox['inbox']['new'] > 0 && $pm_prefs['popup'] && strpos(e_SELF, 'pm.php') === FALSE && $_COOKIE['pm-alert'] != 'ON')
|
||||||
{
|
{
|
68
e107_plugins/pm/templates/pm_menu_template.php
Normal file
68
e107_plugins/pm/templates/pm_menu_template.php
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* e107 website system
|
||||||
|
*
|
||||||
|
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||||
|
* Released under the terms and conditions of the
|
||||||
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
|
*
|
||||||
|
* PM plugin - template file
|
||||||
|
*
|
||||||
|
* $Source: /cvs_backup/e107_0.8/e107_plugins/pm/pm_template.php,v $
|
||||||
|
* $Revision$
|
||||||
|
* $Date$
|
||||||
|
* $Author$
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* e107 Private messenger plugin
|
||||||
|
*
|
||||||
|
* @package e107_plugins
|
||||||
|
* @subpackage pm
|
||||||
|
* @version $Id$;
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
|
define('PM_INBOX_ICON', "<img src='".e_PLUGIN_ABS."pm/images/mail_get.png' class='icon S16' alt='".LAN_PLUGIN_PM_INBOX."' title='".LAN_PLUGIN_PM_INBOX."' />");
|
||||||
|
define('PM_OUTBOX_ICON', "<img src='".e_PLUGIN_ABS."pm/images/mail_send.png' class='icon S16' alt='".LAN_PLUGIN_PM_OUTBOX."' title='".LAN_PLUGIN_PM_OUTBOX."' />");
|
||||||
|
define('PM_SEND_LINK', LAN_PLUGIN_PM_NEW);
|
||||||
|
define('NEWPM_ANIMATION', "<img src='".e_PLUGIN_ABS."pm/images/newpm.gif' alt='' />");
|
||||||
|
/*
|
||||||
|
$sc_style['PM_SEND_PM_LINK']['pre'] = "<br /><br />";
|
||||||
|
$sc_style['PM_SEND_PM_LINK']['post'] = "";
|
||||||
|
|
||||||
|
$sc_style['PM_INBOX_FILLED']['pre'] = "[";
|
||||||
|
$sc_style['PM_INBOX_FILLED']['post'] = "%]";
|
||||||
|
|
||||||
|
$sc_style['PM_OUTBOX_FILLED']['pre'] = "[";
|
||||||
|
$sc_style['PM_OUTBOX_FILLED']['post'] = "%]";
|
||||||
|
|
||||||
|
$sc_style['PM_NEWPM_ANIMATE']['pre'] = "<a href='".e_PLUGIN_ABS."pm/pm.php?inbox'>";
|
||||||
|
$sc_style['PM_NEWPM_ANIMATE']['post'] = "</a>";
|
||||||
|
|
||||||
|
$sc_style['PM_BLOCKED_SENDERS_MANAGE']['pre'] = "<br />[ <a href='".e_PLUGIN_ABS."pm/pm.php?blocked'>";
|
||||||
|
$sc_style['PM_BLOCKED_SENDERS_MANAGE']['post'] = '</a> ]';
|
||||||
|
*/
|
||||||
|
$PM_MENU_WRAPPER['PM_SEND_PM_LINK']= "<br /><br />{---}";
|
||||||
|
$PM_MENU_WRAPPER['PM_INBOX_FILLED']=$PM_MENU_WRAPPER['PM_OUTBOX_FILLED']= "[{---}%]";
|
||||||
|
$PM_MENU_WRAPPER['PM_NEWPM_ANIMATE']= "<a href='".e_PLUGIN_ABS."pm/pm.php?inbox'>{---}</a>";
|
||||||
|
$PM_MENU_WRAPPER['PM_BLOCKED_SENDERS_MANAGE']= "<br />[ <a href='".e_PLUGIN_ABS."pm/pm.php?blocked'>{---}</a> ]";
|
||||||
|
|
||||||
|
// $pm_menu_template = "
|
||||||
|
$PM_MENU_TEMPLATE = "
|
||||||
|
<a href='".e_PLUGIN_ABS."pm/pm.php?inbox'>".PM_INBOX_ICON."</a>
|
||||||
|
<a href='".e_PLUGIN_ABS."pm/pm.php?inbox'>".LAN_PLUGIN_PM_INBOX."</a>
|
||||||
|
{PM_NEWPM_ANIMATE}
|
||||||
|
<br />
|
||||||
|
{PM_INBOX_TOTAL} ".LAN_PM_36.", {PM_INBOX_UNREAD} ".LAN_PM_37." {PM_INBOX_FILLED}
|
||||||
|
<br />
|
||||||
|
<a href='".e_PLUGIN_ABS."pm/pm.php?outbox'>".PM_OUTBOX_ICON."</a>
|
||||||
|
<a href='".e_PLUGIN_ABS."pm/pm.php?outbox'>".LAN_PLUGIN_PM_OUTBOX."</a><br />
|
||||||
|
{PM_OUTBOX_TOTAL} ".LAN_PM_36.", {PM_OUTBOX_UNREAD} ".LAN_PM_37." {PM_OUTBOX_FILLED}
|
||||||
|
{PM_SEND_PM_LINK}
|
||||||
|
{PM_BLOCKED_SENDERS_MANAGE}
|
||||||
|
";
|
||||||
|
|
||||||
|
|
57
e107_plugins/pm/pm_template.php → e107_plugins/pm/templates/pm_template.php
Executable file → Normal file
57
e107_plugins/pm/pm_template.php → e107_plugins/pm/templates/pm_template.php
Executable file → Normal file
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
global $sc_style; // Needed for the PM_REPLY shortcode!
|
//global $sc_style; // Needed for the PM_REPLY shortcode!
|
||||||
|
|
||||||
if(deftrue('BOOTSTRAP') && deftrue('FONTAWESOME'))
|
if(deftrue('BOOTSTRAP') && deftrue('FONTAWESOME'))
|
||||||
{
|
{
|
||||||
@ -37,7 +37,7 @@ else
|
|||||||
if (!defined('PM_READ_ICON')) define('PM_READ_ICON', "<img src='".e_PLUGIN_ABS."pm/images/read.png' class='icon S16' alt='".LAN_PM_111."' />");
|
if (!defined('PM_READ_ICON')) define('PM_READ_ICON', "<img src='".e_PLUGIN_ABS."pm/images/read.png' class='icon S16' alt='".LAN_PM_111."' />");
|
||||||
if (!defined('PM_UNREAD_ICON')) define('PM_UNREAD_ICON', "<img src='".e_PLUGIN_ABS."pm/images/unread.png' class='icon S16' alt='".LAN_PM_27."' />");
|
if (!defined('PM_UNREAD_ICON')) define('PM_UNREAD_ICON', "<img src='".e_PLUGIN_ABS."pm/images/unread.png' class='icon S16' alt='".LAN_PM_27."' />");
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
$sc_style['PM_ATTACHMENT_ICON']['pre'] = " ";
|
$sc_style['PM_ATTACHMENT_ICON']['pre'] = " ";
|
||||||
$sc_style['PM_ATTACHMENTS']['pre'] = "<div class='alert alert-block alert-info'>";
|
$sc_style['PM_ATTACHMENTS']['pre'] = "<div class='alert alert-block alert-info'>";
|
||||||
$sc_style['PM_ATTACHMENTS']['post'] = "</div>";
|
$sc_style['PM_ATTACHMENTS']['post'] = "</div>";
|
||||||
@ -73,8 +73,21 @@ $sc_style['PM_REPLY']['pre'] = "<tr>
|
|||||||
$sc_style['PM_REPLY']['post'] = "</td>
|
$sc_style['PM_REPLY']['post'] = "</td>
|
||||||
</tr>
|
</tr>
|
||||||
";
|
";
|
||||||
|
*/
|
||||||
|
|
||||||
$PM_SEND_PM = "<div id='pm-send-pm'>
|
$PM_WRAPPER['PM_ATTACHMENT_ICON']= " {---}";
|
||||||
|
$PM_WRAPPER['PM_ATTACHMENTS']= "<div class='alert alert-block alert-info'>{---}</div>";
|
||||||
|
|
||||||
|
//$sc_style['PM_NEXTPREV']['pre'] = "<tr><td class='forumheader' colspan='6' style='text-align:left'> ".LAN_PM_59;
|
||||||
|
//$sc_style['PM_NEXTPREV']['post'] = "</td></tr>";
|
||||||
|
|
||||||
|
$PM_WRAPPER['PM_EMOTES']= "<tr><td class='forumheader3'>".LAN_PM_7.": </td><td class='forumheader3'>{---}</td></tr>";
|
||||||
|
$PM_WRAPPER['PM_ATTACHMENT']= "<tr><td class='forumheader3'>".LAN_PM_8.": </td><td class='forumheader3'>{---}</td></tr>";
|
||||||
|
$PM_WRAPPER['PM_RECEIPT']= "<tr><td class='forumheader3'>".LAN_PM_9.": </td><td class='forumheader3'>{---}</td></tr>";
|
||||||
|
$PM_WRAPPER['PM_REPLY']= "<tr><td class='forumheader' style='text-align:center' colspan='2'>{---}</td></tr>";
|
||||||
|
|
||||||
|
//$PM_SEND_PM = "<div id='pm-send-pm'>
|
||||||
|
$PM_TEMPLATE['send'] = "<div id='pm-send-pm'>
|
||||||
<table class='table fborder'>
|
<table class='table fborder'>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -103,7 +116,8 @@ $PM_SEND_PM = "<div id='pm-send-pm'>
|
|||||||
</div>
|
</div>
|
||||||
";
|
";
|
||||||
|
|
||||||
$PM_INBOX_HEADER = "
|
//$PM_INBOX_HEADER = "
|
||||||
|
$PM_TEMPLATE['inbox']['start'] = "
|
||||||
<table class='table table-striped fborder'>
|
<table class='table table-striped fborder'>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -118,7 +132,8 @@ $PM_INBOX_HEADER = "
|
|||||||
<tbody>
|
<tbody>
|
||||||
";
|
";
|
||||||
|
|
||||||
$PM_INBOX_TABLE = "{SETIMAGE: w=30&h=30&crop=1}
|
//$PM_INBOX_TABLE = "{SETIMAGE: w=30&h=30&crop=1}
|
||||||
|
$PM_TEMPLATE['inbox']['item'] = "{SETIMAGE: w=30&h=30&crop=1}
|
||||||
<tr class='{PM_STATUS_CLASS}'>
|
<tr class='{PM_STATUS_CLASS}'>
|
||||||
<td class='forumheader3'>{PM_SELECT}</td>
|
<td class='forumheader3'>{PM_SELECT}</td>
|
||||||
<td class='forumheader3'>{PM_ATTACHMENT_ICON}</td>
|
<td class='forumheader3'>{PM_ATTACHMENT_ICON}</td>
|
||||||
@ -130,13 +145,15 @@ $PM_INBOX_TABLE = "{SETIMAGE: w=30&h=30&crop=1}
|
|||||||
</tr>
|
</tr>
|
||||||
";
|
";
|
||||||
|
|
||||||
$PM_INBOX_EMPTY = "
|
//$PM_INBOX_EMPTY = "
|
||||||
|
$PM_TEMPLATE['inbox']['empty'] = "
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan='6' class='forumheader'>".LAN_PM_34."</td>
|
<td colspan='6' class='forumheader'>".LAN_PM_34."</td>
|
||||||
</tr>
|
</tr>
|
||||||
";
|
";
|
||||||
|
|
||||||
$PM_INBOX_FOOTER = "
|
//$PM_INBOX_FOOTER = "
|
||||||
|
$PM_TEMPLATE['inbox']['end'] = "
|
||||||
<tr>
|
<tr>
|
||||||
<td class='forumheader' colspan='3'>
|
<td class='forumheader' colspan='3'>
|
||||||
<input type='hidden' name='pm_come_from' value='inbox' />
|
<input type='hidden' name='pm_come_from' value='inbox' />
|
||||||
@ -150,7 +167,8 @@ $PM_INBOX_FOOTER = "
|
|||||||
</table>
|
</table>
|
||||||
";
|
";
|
||||||
|
|
||||||
$PM_OUTBOX_HEADER = "
|
//$PM_OUTBOX_HEADER = "
|
||||||
|
$PM_TEMPLATE['outbox']['start'] = "
|
||||||
<table class='table table-striped fborder'>
|
<table class='table table-striped fborder'>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -165,7 +183,8 @@ $PM_OUTBOX_HEADER = "
|
|||||||
<tbody>
|
<tbody>
|
||||||
";
|
";
|
||||||
|
|
||||||
$PM_OUTBOX_TABLE = "
|
//$PM_OUTBOX_TABLE = "
|
||||||
|
$PM_TEMPLATE['outbox']['item'] = "
|
||||||
<tr>
|
<tr>
|
||||||
<td class='forumheader3'>{PM_SELECT}</td>
|
<td class='forumheader3'>{PM_SELECT}</td>
|
||||||
<td class='forumheader3'>{PM_ATTACHMENT_ICON}</td>
|
<td class='forumheader3'>{PM_ATTACHMENT_ICON}</td>
|
||||||
@ -176,7 +195,8 @@ $PM_OUTBOX_TABLE = "
|
|||||||
</tr>
|
</tr>
|
||||||
";
|
";
|
||||||
|
|
||||||
$PM_OUTBOX_EMPTY = "
|
//$PM_OUTBOX_EMPTY = "
|
||||||
|
$PM_TEMPLATE['outbox']['empty'] = "
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan='6' class='forumheader'>".LAN_PM_34."</td>
|
<td colspan='6' class='forumheader'>".LAN_PM_34."</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -194,7 +214,8 @@ $PM_OUTBOX_FOOTER = "
|
|||||||
</table>
|
</table>
|
||||||
";*/
|
";*/
|
||||||
|
|
||||||
$PM_OUTBOX_FOOTER = "
|
//$PM_OUTBOX_FOOTER = "
|
||||||
|
$PM_TEMPLATE['outbox']['end'] = "
|
||||||
<tr>
|
<tr>
|
||||||
<td class='forumheader' colspan='3'>
|
<td class='forumheader' colspan='3'>
|
||||||
<input type='hidden' name='pm_come_from' value='inbox' />
|
<input type='hidden' name='pm_come_from' value='inbox' />
|
||||||
@ -210,7 +231,7 @@ $PM_OUTBOX_FOOTER = "
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
$PM_BLOCKED_HEADER = "
|
$PM_TEMPLATE['blocked']['start'] = "
|
||||||
<table class='table table-striped fborder'>
|
<table class='table table-striped fborder'>
|
||||||
<tr>
|
<tr>
|
||||||
<td class='fcaption' style='width:5%'> </td>
|
<td class='fcaption' style='width:5%'> </td>
|
||||||
@ -220,7 +241,7 @@ $PM_BLOCKED_HEADER = "
|
|||||||
</tr>
|
</tr>
|
||||||
";
|
";
|
||||||
|
|
||||||
$PM_BLOCKED_TABLE = "
|
$PM_TEMPLATE['blocked']['item'] = "
|
||||||
<tr>
|
<tr>
|
||||||
<td class='forumheader3'>{PM_BLOCKED_SELECT}</td>
|
<td class='forumheader3'>{PM_BLOCKED_SELECT}</td>
|
||||||
<td class='forumheader3'>{PM_BLOCKED_USER=link}</td>
|
<td class='forumheader3'>{PM_BLOCKED_USER=link}</td>
|
||||||
@ -229,13 +250,13 @@ $PM_BLOCKED_TABLE = "
|
|||||||
</tr>
|
</tr>
|
||||||
";
|
";
|
||||||
|
|
||||||
$PM_BLOCKED_EMPTY = "
|
$PM_TEMPLATE['blocked']['empty'] = "
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan='4' class='forumheader'>".LAN_PM_67."</td>
|
<td colspan='4' class='forumheader'>".LAN_PM_67."</td>
|
||||||
</tr>
|
</tr>
|
||||||
";
|
";
|
||||||
|
|
||||||
$PM_BLOCKED_FOOTER = "
|
$PM_TEMPLATE['blocked']['end'] = "
|
||||||
<tr>
|
<tr>
|
||||||
<td class='forumheader' colspan='4' style='text-align:center'>
|
<td class='forumheader' colspan='4' style='text-align:center'>
|
||||||
{PM_DELETE_BLOCKED_SELECTED}
|
{PM_DELETE_BLOCKED_SELECTED}
|
||||||
@ -246,7 +267,8 @@ $PM_BLOCKED_FOOTER = "
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
$PM_SHOW =
|
//$PM_SHOW =
|
||||||
|
$PM_TEMPLATE['show'] =
|
||||||
"<div class='pm-show' style='text-align: center'>
|
"<div class='pm-show' style='text-align: center'>
|
||||||
<table class='table table-bordered table-striped fborder'>
|
<table class='table table-bordered table-striped fborder'>
|
||||||
<tr>
|
<tr>
|
||||||
@ -268,7 +290,8 @@ $PM_SHOW =
|
|||||||
";
|
";
|
||||||
|
|
||||||
|
|
||||||
$PM_NOTIFY =
|
//$PM_NOTIFY =
|
||||||
|
$PM_TEMPLATE['notify'] =
|
||||||
"<div>
|
"<div>
|
||||||
<h4>".LAN_PM_101."{SITENAME}</h4>
|
<h4>".LAN_PM_101."{SITENAME}</h4>
|
||||||
<table class='table table-striped'>
|
<table class='table table-striped'>
|
Reference in New Issue
Block a user