mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 20:58:30 +01:00
PM plugin - code clean-up
This commit is contained in:
parent
1e930ed273
commit
c7cb49c89b
@ -1,13 +1,13 @@
|
||||
<?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">
|
||||
<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>
|
||||
<category>users</category>
|
||||
<adminLinks>
|
||||
<link url='admin_config.php' description='LAN_CONFIGURE' icon='images/pvt_message_32.png' iconSmall='images/pvt_message_16.png' primary='true' />
|
||||
</adminLinks>
|
||||
<pluginPrefs>
|
||||
<pref name="title">PMLAN_PM</pref>
|
||||
<pref name="title">LAN_PM</pref>
|
||||
<pref name="animate">1</pref>
|
||||
<pref name="dropdown">0</pref>
|
||||
<pref name="read_timeout">0</pref>
|
||||
|
@ -8,23 +8,16 @@
|
||||
*
|
||||
* 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');
|
||||
if(check_class($pm_prefs['pm_class']))
|
||||
|
||||
if(!check_class($pm_prefs['pm_class']))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
if (!e107::isInstalled('pm')) { return ''; }
|
||||
|
||||
@ -121,42 +114,37 @@ if(!isset($template))
|
||||
";
|
||||
*/
|
||||
|
||||
// $pm_menu_template = "
|
||||
// $pm_menu_template = "
|
||||
$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}
|
||||
<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}
|
||||
";
|
||||
}
|
||||
|
||||
//if(check_class($pm_prefs['pm_class']))
|
||||
//{
|
||||
$tp = e107::getParser();
|
||||
$sc = e107::getScBatch('pm',TRUE, 'pm');
|
||||
|
||||
$pm_inbox = $pmManager->pm_getInfo('inbox');
|
||||
$sc->wrapper('pm_menu');
|
||||
|
||||
$tp = e107::getParser();
|
||||
$sc = e107::getScBatch('pm',TRUE, 'pm');
|
||||
|
||||
$pm_inbox = $pmManager->pm_getInfo('inbox');
|
||||
$sc->wrapper('pm_menu');
|
||||
|
||||
// $txt = "\n".$tp->parseTemplate($pm_menu_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']);
|
||||
}
|
||||
$txt = "\n".$tp->parseTemplate($template, TRUE, $sc);
|
||||
|
||||
|
||||
//$ns->tablerender(LAN_PM, $txt, 'pm');
|
||||
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']);
|
||||
}
|
||||
|
||||
$caption = varset($pm_prefs['title'], LAN_PM);
|
||||
$ns->tablerender($caption, $txt, 'pm');
|
||||
}
|
||||
//$ns->tablerender(LAN_PM, $txt, 'pm');
|
||||
$caption = varset($pm_prefs['title'], LAN_PM);
|
||||
$ns->tablerender($caption, $txt, 'pm');
|
Loading…
x
Reference in New Issue
Block a user