mirror of
https://github.com/e107inc/e107.git
synced 2025-08-11 09:04:38 +02:00
Private Message plugin working again to some extent.
This commit is contained in:
@@ -26,12 +26,12 @@
|
||||
|
||||
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
//if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
include_lan(e_PLUGIN.'pm/languages/'.e_LANGUAGE.'.php');
|
||||
include_once(e_PLUGIN.'pm/pm_func.php');
|
||||
register_shortcode('pm_handler_shortcodes', true);
|
||||
initShortcodeClass('pm_handler_shortcodes');
|
||||
// register_shortcode('pm_handler_shortcodes', true);
|
||||
// initShortcodeClass('pm_handler_shortcodes');
|
||||
|
||||
|
||||
/*
|
||||
@@ -77,28 +77,30 @@ PM_BLOCKED_DELETE
|
||||
DELETE_BLOCKED_SELECTED
|
||||
*/
|
||||
|
||||
|
||||
class pm_handler_shortcodes
|
||||
class pm_shortcodes extends e_shortcode
|
||||
// class pm_handler_shortcodes
|
||||
{
|
||||
protected $e107;
|
||||
public $pmPrefs; // PM system options
|
||||
public $pmInfo; // Data relating to current PM being displayed
|
||||
public $pmInfo; // Data relating to current PM being displayed - replaced by $var.
|
||||
public $pmBlocks = array(); // Array of blocked users.
|
||||
public $pmBlocked = array(); // Block info when using 'display blocked' page
|
||||
public $nextPrev = array(); // Variables used by nextprev
|
||||
public $nextPrev = array(); //XXX In USE ?? // Variables used by nextprev
|
||||
public $pmManager = NULL; // Pointer to pmbox_manager class instance
|
||||
public $pmNextPrev = array();
|
||||
//public $var = array();
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->e107 = e107::getInstance();
|
||||
$pm_prefs = e107::getPlugPref('pm');
|
||||
$this->pmManager = new pmbox_manager($pm_prefs);
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_form_touser()
|
||||
{
|
||||
if(vartrue($this->pmInfo['from_name']))
|
||||
if(vartrue($this->var['from_name']))
|
||||
{
|
||||
return "<input type='hidden' name='pm_to' value='{$this->pmInfo['from_name']}' />{$this->pmInfo['from_name']}";
|
||||
return "<input type='hidden' name='pm_to' value='{$this->var['from_name']}' />{$this->var['from_name']}";
|
||||
}
|
||||
require_once(e_HANDLER.'user_select_class.php');
|
||||
$us = new user_select;
|
||||
@@ -109,14 +111,17 @@ class pm_handler_shortcodes
|
||||
}
|
||||
else
|
||||
{
|
||||
$frm = e107::getForm();
|
||||
return $frm->text('pm_to','',10,'typeahead=users');
|
||||
|
||||
$ret = $us->select_form($type, 'pm_to', '', $this->pmPrefs['pm_class']);
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function sc_pm_form_toclass()
|
||||
public function sc_pm_form_toclass()
|
||||
{
|
||||
if(vartrue($this->pmInfo['from_name']))
|
||||
if(vartrue($this->var['from_name']))
|
||||
{
|
||||
return '';
|
||||
}
|
||||
@@ -136,12 +141,12 @@ class pm_handler_shortcodes
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_form_subject()
|
||||
public function sc_pm_form_subject()
|
||||
{
|
||||
$value = '';
|
||||
if(vartrue($this->pmInfo['pm_subject']))
|
||||
if(vartrue($this->var['pm_subject']))
|
||||
{
|
||||
$value = $this->pmInfo['pm_subject'];
|
||||
$value = $this->var['pm_subject'];
|
||||
if(substr($value, 0, strlen(LAN_PM_58)) != LAN_PM_58)
|
||||
{
|
||||
$value = LAN_PM_58.$value;
|
||||
@@ -151,41 +156,41 @@ class pm_handler_shortcodes
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_form_message()
|
||||
public function sc_pm_form_message()
|
||||
{
|
||||
$value = '';
|
||||
if(vartrue($this->pmInfo['pm_text']))
|
||||
if(vartrue($this->var['pm_text']))
|
||||
{
|
||||
if(isset($_POST['quote']))
|
||||
{
|
||||
$t = time();
|
||||
$value = "[quote{$t}={$this->pmInfo['from_name']}]\n{$this->pmInfo['pm_text']}\n[/quote{$t}]\n\n";
|
||||
$value = "[quote{$t}={$this->var['from_name']}]\n{$this->var['pm_text']}\n[/quote{$t}]\n\n";
|
||||
}
|
||||
}
|
||||
return "<textarea class='tbox' name='pm_message' cols='60' rows='10' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>{$value}</textarea>";
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_emotes()
|
||||
public function sc_pm_emotes()
|
||||
{
|
||||
require_once(e_HANDLER.'emote.php');
|
||||
return r_emote();
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_post_button()
|
||||
public function sc_pm_post_button()
|
||||
{
|
||||
return "<input class='button btn' type='submit' name='postpm' value='".LAN_PM_1."' />";
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_preview_button()
|
||||
public function sc_pm_preview_button()
|
||||
{
|
||||
return "<input class='button btn' type='submit' name='postpm' value='".LAN_PM_3."' />";
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_attachment()
|
||||
public function sc_pm_attachment()
|
||||
{
|
||||
if (check_class($this->pmPrefs['attach_class']))
|
||||
{
|
||||
@@ -203,25 +208,25 @@ class pm_handler_shortcodes
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_attachment_icon()
|
||||
public function sc_pm_attachment_icon()
|
||||
{
|
||||
if($this->pmInfo['pm_attachments'] != "")
|
||||
if($this->var['pm_attachments'] != "")
|
||||
{
|
||||
return ATTACHMENT_ICON;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_attachments()
|
||||
public function sc_pm_attachments()
|
||||
{
|
||||
if($this->pmInfo['pm_attachments'] != '')
|
||||
if($this->var['pm_attachments'] != '')
|
||||
{
|
||||
$attachments = explode(chr(0), $this->pmInfo['pm_attachments']);
|
||||
$attachments = explode(chr(0), $this->var['pm_attachments']);
|
||||
$i = 0;
|
||||
foreach($attachments as $a)
|
||||
{
|
||||
list($timestamp, $fromid, $rand, $filename) = explode("_", $a, 4);
|
||||
$url = $this->url('action/get', array('id' => $this->pmInfo['pm_id'], 'index' => $i));
|
||||
$url = $this->url('action/get', array('id' => $this->var['pm_id'], 'index' => $i));
|
||||
$ret .= "<a href='".$url."'>{$filename}</a><br />";
|
||||
$i++;
|
||||
}
|
||||
@@ -231,7 +236,7 @@ class pm_handler_shortcodes
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_receipt()
|
||||
public function sc_pm_receipt()
|
||||
{
|
||||
if (check_class($this->pmPrefs['receipt_class']))
|
||||
{
|
||||
@@ -241,114 +246,117 @@ class pm_handler_shortcodes
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_inbox_total()
|
||||
public function sc_pm_inbox_total()
|
||||
{
|
||||
$pm_inbox = $this->pmManager->pm_getInfo('inbox');
|
||||
return intval($pm_inbox['inbox']['total']);
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_inbox_unread()
|
||||
public function sc_pm_inbox_unread()
|
||||
{
|
||||
$pm_inbox = $this->pmManager->pm_getInfo('inbox');
|
||||
return intval($pm_inbox['inbox']['unread']);
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_inbox_filled()
|
||||
public function sc_pm_inbox_filled()
|
||||
{
|
||||
$pm_inbox = $this->pmManager->pm_getInfo('inbox');
|
||||
return (intval($pm_inbox['inbox']['filled']) > 0 ? $pm_inbox['inbox']['filled'] : '');
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_outbox_total()
|
||||
public function sc_pm_outbox_total()
|
||||
{
|
||||
$pm_outbox = $this->pmManager->pm_getInfo('outbox');
|
||||
return intval($pm_outbox['outbox']['total']);
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_outbox_unread()
|
||||
public function sc_pm_outbox_unread()
|
||||
{
|
||||
$pm_outbox = $this->pmManager->pm_getInfo('outbox');
|
||||
return intval($pm_outbox['outbox']['unread']);
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_outbox_filled()
|
||||
public function sc_pm_outbox_filled()
|
||||
{
|
||||
$pm_outbox = $this->pmManager->pm_getInfo('outbox');
|
||||
return (intval($pm_outbox['outbox']['filled']) > 0 ? $pm_outbox['outbox']['filled'] : '');
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_date($parm = '')
|
||||
public function sc_pm_date($parm = '')
|
||||
{
|
||||
require_once(e_HANDLER.'date_handler.php');
|
||||
if('lapse' != $parm)
|
||||
{
|
||||
return convert::convert_date($this->pmInfo['pm_sent'], $parm);
|
||||
return convert::convert_date($this->var['pm_sent'], $parm);
|
||||
}
|
||||
else
|
||||
{
|
||||
return convert::computeLapse($this->pmInfo['pm_sent']);
|
||||
return convert::computeLapse($this->var['pm_sent']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_read($parm = '')
|
||||
public function sc_pm_read($parm = '')
|
||||
{
|
||||
if($this->pmInfo['pm_read'] == 0)
|
||||
if($this->var['pm_read'] == 0)
|
||||
{
|
||||
return LAN_PM_27;
|
||||
}
|
||||
if($this->pmInfo['pm_read'] == 1)
|
||||
if($this->var['pm_read'] == 1)
|
||||
{
|
||||
return LAN_PM_28;
|
||||
}
|
||||
require_once(e_HANDLER.'date_handler.php');
|
||||
if('lapse' != $parm)
|
||||
{
|
||||
return convert::convert_date($this->pmInfo['pm_read'], $parm);
|
||||
return convert::convert_date($this->var['pm_read'], $parm);
|
||||
}
|
||||
else
|
||||
{
|
||||
return convert::computeLapse($this->pmInfo['pm_read']);
|
||||
return convert::computeLapse($this->var['pm_read']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_from_to()
|
||||
public function sc_pm_from_to()
|
||||
{
|
||||
if($this->pmInfo['pm_from'] == USERID)
|
||||
$tp = e107::getParser();
|
||||
|
||||
if($this->var['pm_from'] == USERID)
|
||||
{
|
||||
$ret = LAN_PM_2.': <br />';
|
||||
$this->pmInfo['user_name'] = $this->pmInfo['sent_name'];
|
||||
$ret .= $this->e107->tp->parseTemplate("{PM_TO=link}");
|
||||
$this->var['user_name'] = $this->var['sent_name'];
|
||||
$ret .= $tp->parseTemplate("{PM_TO=link}");
|
||||
}
|
||||
else
|
||||
{
|
||||
$ret = LAN_PM_31.': <br />';
|
||||
$this->pmInfo['user_name'] = $this->pmInfo['from_name'];
|
||||
$ret .= $this->e107->tp->parseTemplate("{PM_FROM=link}");
|
||||
$this->var['user_name'] = $this->var['from_name'];
|
||||
$ret .= $tp->parseTemplate("{PM_FROM=link}");
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_subject($parm = '')
|
||||
public function sc_pm_subject($parm = '')
|
||||
{
|
||||
$ret = $this->e107->tp->toHTML($this->pmInfo['pm_subject'], true, 'USER_TITLE');
|
||||
$tp = e107::getParser();
|
||||
$ret = $tp->toHTML($this->var['pm_subject'], true, 'USER_TITLE');
|
||||
$prm = explode(',',$parm);
|
||||
if('link' == $prm[0])
|
||||
{
|
||||
$extra = '';
|
||||
// TODO - go with only one route version - view/message ???
|
||||
if (isset($prm[1])) $extra = '.'.$prm[1];
|
||||
if($extra == 'inbox') $url = $this->url('message', 'id='.$this->pmInfo['pm_id']);
|
||||
elseif($extra == 'outbox') $url = $this->url('sent', 'id='.$this->pmInfo['pm_id']);
|
||||
else $url = $this->url('show', 'id='.$this->pmInfo['pm_id']);
|
||||
if($extra == 'inbox') $url = $this->url('message', 'id='.$this->var['pm_id']);
|
||||
elseif($extra == 'outbox') $url = $this->url('sent', 'id='.$this->var['pm_id']);
|
||||
else $url = $this->url('show', 'id='.$this->var['pm_id']);
|
||||
|
||||
$ret = "<a href='".$ret."'>".$ret."</a>";
|
||||
}
|
||||
@@ -356,28 +364,30 @@ class pm_handler_shortcodes
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_from($parm = '')
|
||||
public function sc_pm_from($parm = '')
|
||||
{
|
||||
$url = e107::getUrl();
|
||||
|
||||
if('link' == $parm)
|
||||
{
|
||||
return "<a href='".$this->e107->url->create('user/profile/view', array('id' => $this->pmInfo['pm_from'], 'name' => $this->pmInfo['user_name']))."'>{$this->pmInfo['user_name']}</a>";
|
||||
return "<a href='".$url->create('user/profile/view', array('id' => $this->var['pm_from'], 'name' => $this->var['user_name']))."'>{$this->var['user_name']}</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->pmInfo['user_name'];
|
||||
return $this->var['user_name'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_select()
|
||||
public function sc_pm_select()
|
||||
{
|
||||
return "<input type='checkbox' name='selected_pm[{$this->pmInfo['pm_id']}]' value='1' />";
|
||||
return "<input type='checkbox' name='selected_pm[{$this->var['pm_id']}]' value='1' />";
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_read_icon()
|
||||
public function sc_pm_read_icon()
|
||||
{
|
||||
if($this->pmInfo['pm_read'] > 0 )
|
||||
if($this->var['pm_read'] > 0 )
|
||||
{
|
||||
return PM_READ_ICON;
|
||||
}
|
||||
@@ -388,26 +398,26 @@ class pm_handler_shortcodes
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_avatar()
|
||||
public function sc_pm_avatar()
|
||||
{
|
||||
return $this->e107->tp->parseTemplate("{USER_AVATAR={$this->pmInfo['user_image']}}");
|
||||
return e107::getParser()->parseTemplate("{USER_AVATAR={$this->var['user_image']}}");
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_block_user()
|
||||
public function sc_pm_block_user()
|
||||
{
|
||||
if(in_array($this->pmInfo['pm_from'], $this->pmBlocks))
|
||||
if(in_array($this->var['pm_from'], $this->pmBlocks))
|
||||
{
|
||||
return "<a href='".$this->url('action/unblock', 'id='.$this->pmInfo['pm_from'])."'><img src='".e_PLUGIN_ABS."pm/images/mail_unblock.png' title='".LAN_PM_51."' alt='".LAN_PM_51."' class='icon S16' /></a>";
|
||||
return "<a href='".$this->url('action/unblock', 'id='.$this->var['pm_from'])."'><img src='".e_PLUGIN_ABS."pm/images/mail_unblock.png' title='".LAN_PM_51."' alt='".LAN_PM_51."' class='icon S16' /></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "<a href='".$this->url('action/block', 'id='.$this->pmInfo['pm_from'])."'><img src='".e_PLUGIN_ABS."pm/images/mail_block.png' title='".LAN_PM_50."' alt='".LAN_PM_50."' class='icon S16' /></a>";
|
||||
return "<a href='".$this->url('action/block', 'id='.$this->var['pm_from'])."'><img src='".e_PLUGIN_ABS."pm/images/mail_block.png' title='".LAN_PM_50."' alt='".LAN_PM_50."' class='icon S16' /></a>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_delete($parm = '')
|
||||
public function sc_pm_delete($parm = '')
|
||||
{
|
||||
if($parm != '')
|
||||
{
|
||||
@@ -415,53 +425,54 @@ class pm_handler_shortcodes
|
||||
}
|
||||
else
|
||||
{
|
||||
$extra = '.'.($this->pmInfo['pm_from'] == USERID ? 'outbox' : 'inbox');
|
||||
$extra = '.'.($this->var['pm_from'] == USERID ? 'outbox' : 'inbox');
|
||||
}
|
||||
if($extra !== 'inbox' && $extra !== 'outbox') return '';
|
||||
$action = $extra == 'outbox' ? 'delete-out' : 'delete-in';
|
||||
return "<a href='".$this->url('action/'.$action, 'id='.$this->pmInfo['pm_id'])."'><img src='".e_PLUGIN_ABS."pm/images/mail_delete.png' title='".LAN_PM_52."' alt='".LAN_PM_52."' class='icon S16' /></a>";
|
||||
return "<a href='".$this->url('action/'.$action, 'id='.$this->var['pm_id'])."'><img src='".e_PLUGIN_ABS."pm/images/mail_delete.png' title='".LAN_PM_52."' alt='".LAN_PM_52."' class='icon S16' /></a>";
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_delete_selected()
|
||||
public function sc_pm_delete_selected()
|
||||
{
|
||||
return "<input type='submit' name='pm_delete_selected' class='button' value='".LAN_PM_53."' />";
|
||||
return "<input type='submit' name='pm_delete_selected' class='button btn btn-danger' value='".LAN_PM_53."' />";
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_to($parm = '')
|
||||
public function sc_pm_to($parm = '')
|
||||
{
|
||||
if(is_numeric($this->pmInfo['pm_to']))
|
||||
if(is_numeric($this->var['pm_to']))
|
||||
{
|
||||
if('link' == $parm)
|
||||
{
|
||||
return "<a href='".$this->e107->url->create('user/profile/view', array('id' => $this->pmInfo['pm_to'], 'name' => $this->pmInfo['user_name']))."'>{$this->pmInfo['user_name']}</a>";
|
||||
$url = e107::getUrl();
|
||||
return "<a href='".$url->create('user/profile/view', array('id' => $this->var['pm_to'], 'name' => $this->var['user_name']))."'>{$this->var['user_name']}</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->pmInfo['user_name'];
|
||||
return $this->var['user_name'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return LAN_PM_63.' '.$this->pmInfo['pm_to'];
|
||||
return LAN_PM_63.' '.$this->var['pm_to'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_message()
|
||||
public function sc_pm_message()
|
||||
{
|
||||
return $this->e107->tp->toHTML($this->pmInfo['pm_text'], true);
|
||||
return e107::getParser()->toHTML($this->var['pm_text'], true);
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_reply()
|
||||
public function sc_pm_reply()
|
||||
{
|
||||
if($this->pmInfo['pm_to'] == USERID)
|
||||
if($this->var['pm_to'] == USERID)
|
||||
{
|
||||
// pm_id is mapped insisde the config to id key
|
||||
$ret = "
|
||||
<form method='post' action='".$this->url('reply', $this->pmInfo)."'>
|
||||
<form method='post' action='".$this->url('reply', $this->var)."'>
|
||||
<input type='checkbox' name='quote' /> ".LAN_PM_54."  <input class='button' type='submit' name='reply' value='".LAN_PM_55."' />
|
||||
</form>
|
||||
";
|
||||
@@ -470,7 +481,7 @@ class pm_handler_shortcodes
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_send_pm_link()
|
||||
public function sc_pm_send_pm_link()
|
||||
{
|
||||
$pm_outbox = $this->pmManager->pm_getInfo('outbox');
|
||||
if($pm_outbox['outbox']['filled'] < 100)
|
||||
@@ -482,7 +493,7 @@ class pm_handler_shortcodes
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_newpm_animate()
|
||||
public function sc_pm_newpm_animate()
|
||||
{
|
||||
if($this->pmPrefs['animate'])
|
||||
{
|
||||
@@ -496,27 +507,28 @@ class pm_handler_shortcodes
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_nextprev($parm = '')
|
||||
public function sc_pm_nextprev($parm = '')
|
||||
{
|
||||
return $this->e107->tp->parseTemplate("{NEXTPREV={$this->pmNextPrev['total']},{$this->pmPrefs['perpage']},{$this->pmNextPrev['start']},".e_SELF."?{$parm}.[FROM]}");
|
||||
return e107::getParser()->parseTemplate("{NEXTPREV={$this->pmNextPrev['total']},{$this->pmPrefs['perpage']},{$this->pmNextPrev['start']},".e_SELF."?{$parm}.[FROM]}");
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_blocked_senders_manage()
|
||||
public function sc_pm_blocked_senders_manage()
|
||||
{
|
||||
$count = $this->e107->sql->db_Count('private_msg_block', '(*)', 'WHERE `pm_block_to` = '.USERID);
|
||||
$sql = e107::getDb();
|
||||
$count = $sql->db_Count('private_msg_block', '(*)', 'WHERE `pm_block_to` = '.USERID);
|
||||
if (!$count) return '';
|
||||
return LAN_PM_66;
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_blocked_select()
|
||||
public function sc_pm_blocked_select()
|
||||
{
|
||||
return "<input type='checkbox' name='selected_pm[{$this->pmBlocked['pm_block_from']}]' value='1' />";
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_blocked_user($parm = '')
|
||||
public function sc_pm_blocked_user($parm = '')
|
||||
{
|
||||
if (!$this->pmBlocked['user_name'])
|
||||
{
|
||||
@@ -524,7 +536,9 @@ class pm_handler_shortcodes
|
||||
}
|
||||
if('link' == $parm)
|
||||
{
|
||||
return "<a href='".$this->e107->url->create('user/profile/view', array('id' => $this->pmBlocked['pm_block_from'], 'name' => $this->pmBlocked['user_name']))."'>{$this->pmBlocked['user_name']}</a>";
|
||||
|
||||
$url = e107::getUrl();
|
||||
return "<a href='".$url->create('user/profile/view', array('id' => $this->pmBlocked['pm_block_from'], 'name' => $this->pmBlocked['user_name']))."'>{$this->pmBlocked['user_name']}</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -533,20 +547,20 @@ class pm_handler_shortcodes
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_blocked_date($parm='')
|
||||
public function sc_pm_blocked_date($parm='')
|
||||
{
|
||||
require_once(e_HANDLER.'date_handler.php');
|
||||
return convert::convert_date($this->pmBlocked['pm_block_datestamp'], $parm);
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_blocked_delete()
|
||||
public function sc_pm_blocked_delete()
|
||||
{
|
||||
return "<a href='".$this->url('action/delete-blocked', array('id' => $this->pmBlocked['pm_block_from']))."'><img src='".e_PLUGIN_ABS."pm/images/mail_delete.png' title='".LAN_PM_52."' alt='".LAN_PM_52."' class='icon S16' /></a>";
|
||||
}
|
||||
|
||||
|
||||
public function sc_pm_delete_blocked_selected()
|
||||
public function sc_pm_delete_blocked_selected()
|
||||
{
|
||||
return "<input type='submit' name='pm_delete_blocked_selected' class='button' value='".LAN_PM_53."' />";
|
||||
}
|
||||
@@ -556,8 +570,11 @@ class pm_handler_shortcodes
|
||||
*/
|
||||
public function url($action, $params = array(), $options = array())
|
||||
{
|
||||
if($action == "new"){ $action = 'send'; }
|
||||
return e_PLUGIN."pm/pm.php?".$action; //FIXME
|
||||
if(strpos($action, '/') === false) $action = 'view/'.$action;
|
||||
$this->e107->url->create('pm/'.$action, $params, $options);
|
||||
|
||||
e107::getUrl()->create('pm/'.$action, $params, $options);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user