1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 13:47:31 +02:00

PM plugin - code clean-up

This commit is contained in:
Tijn Kuyper
2019-08-27 13:43:54 +02:00
parent 1e930ed273
commit c7cb49c89b
2 changed files with 33 additions and 45 deletions

View File

@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<e107Plugin name="Private Messenger" lan="LAN_PLUGIN_PM_NAME" version="3.0" date="2012-08-01" compatibility="2.0" installRequired="true"> <e107Plugin name="Private Messenger" lan="LAN_PLUGIN_PM_NAME" version="3.0" date="2012-08-01" compatibility="2.0" installRequired="true">
<author name="e107 Inc." email="devs@e107.org" /> <author name="e107 Inc." url="http://e107.org" />
<description lan="LAN_PLUGIN_PM_DESCRIPTION">This plugin is a fully featured Private Messaging system.</description> <description lan="LAN_PLUGIN_PM_DESCRIPTION">This plugin is a fully featured Private Messaging system.</description>
<category>users</category> <category>users</category>
<adminLinks> <adminLinks>
<link url='admin_config.php' description='LAN_CONFIGURE' icon='images/pvt_message_32.png' iconSmall='images/pvt_message_16.png' primary='true' /> <link url='admin_config.php' description='LAN_CONFIGURE' icon='images/pvt_message_32.png' iconSmall='images/pvt_message_16.png' primary='true' />
</adminLinks> </adminLinks>
<pluginPrefs> <pluginPrefs>
<pref name="title">PMLAN_PM</pref> <pref name="title">LAN_PM</pref>
<pref name="animate">1</pref> <pref name="animate">1</pref>
<pref name="dropdown">0</pref> <pref name="dropdown">0</pref>
<pref name="read_timeout">0</pref> <pref name="read_timeout">0</pref>

View File

@@ -8,23 +8,16 @@
* *
* PM plugin - menu display * PM plugin - menu display
* *
* $Source: /cvs_backup/e107_0.8/e107_plugins/pm/private_msg_menu.php,v $
* $Revision$
* $Date$
* $Author$
*/ */
/**
* e107 Private messenger plugin
*
* @package e107_plugins
* @subpackage pm
* @version $Id$;
*/
$pm_prefs = e107::getPlugPref('pm'); $pm_prefs = e107::getPlugPref('pm');
if(check_class($pm_prefs['pm_class']))
if(!check_class($pm_prefs['pm_class']))
{ {
return null;
}
if (!defined('e107_INIT')) { exit; } if (!defined('e107_INIT')) { exit; }
if (!e107::isInstalled('pm')) { return ''; } if (!e107::isInstalled('pm')) { return ''; }
@@ -121,42 +114,37 @@ if(!isset($template))
"; ";
*/ */
// $pm_menu_template = " // $pm_menu_template = "
$template = " $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}
<br /> <br />
{PM_INBOX_TOTAL} ".LAN_PM_36.", {PM_INBOX_UNREAD} ".LAN_PM_37." {PM_INBOX_FILLED} {PM_INBOX_TOTAL} ".LAN_PM_36.", {PM_INBOX_UNREAD} ".LAN_PM_37." {PM_INBOX_FILLED}
<br /> <br />
<a href='".e_PLUGIN_ABS."pm/pm.php?outbox'>".PM_OUTBOX_ICON."</a> <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 /> <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_OUTBOX_TOTAL} ".LAN_PM_36.", {PM_OUTBOX_UNREAD} ".LAN_PM_37." {PM_OUTBOX_FILLED}
{PM_SEND_PM_LINK} {PM_SEND_PM_LINK}
{PM_BLOCKED_SENDERS_MANAGE} {PM_BLOCKED_SENDERS_MANAGE}
"; ";
} }
//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');
$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($template, TRUE, $sc); $txt = "\n".$tp->parseTemplate($template, TRUE, $sc);
if($pm_inbox['inbox']['new'] > 0 && $pm_prefs['popup'] && strpos(e_SELF, 'pm.php') === FALSE && $_COOKIE['pm-alert'] != 'ON')
{
$txt .= pm_show_popup($pm_inbox, $pm_prefs['popup_delay']);
}
if($pm_inbox['inbox']['new'] > 0 && $pm_prefs['popup'] && strpos(e_SELF, 'pm.php') === FALSE && $_COOKIE['pm-alert'] != 'ON')
//$ns->tablerender(LAN_PM, $txt, 'pm'); {
$txt .= pm_show_popup($pm_inbox, $pm_prefs['popup_delay']);
}
$caption = varset($pm_prefs['title'], LAN_PM); //$ns->tablerender(LAN_PM, $txt, 'pm');
$ns->tablerender($caption, $txt, 'pm'); $caption = varset($pm_prefs['title'], LAN_PM);
} $ns->tablerender($caption, $txt, 'pm');