1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 20:57:26 +02:00

Private Messenger: remove debug info. Fix for "Send a Reply" button.

This commit is contained in:
Cameron
2016-04-01 18:09:27 -07:00
parent 10f0d80291
commit 89f6794c53
3 changed files with 57 additions and 74 deletions

View File

@@ -226,7 +226,8 @@ class pm_extended extends private_message
$txt .= $tp->parseTemplate($PM_INBOX_FOOTER, true, $sc); $txt .= $tp->parseTemplate($PM_INBOX_FOOTER, true, $sc);
$txt .= "</form>"; $txt .= "</form>";
return $txt; return $txt;
} }

View File

@@ -172,8 +172,8 @@ class private_message
'pm_size' => $pmsize 'pm_size' => $pmsize
); );
print_a($info); // print_a($info);
print_a($vars); // print_a($vars);
} }
if(isset($vars['to_userclass']) || isset($vars['to_array'])) if(isset($vars['to_userclass']) || isset($vars['to_array']))

View File

@@ -124,6 +124,8 @@ if(!class_exists('plugin_pm_pm_shortcodes'))
require_once(e_HANDLER.'user_select_class.php'); require_once(e_HANDLER.'user_select_class.php');
$us = new user_select; $us = new user_select;
$type = ($this->pmPrefs['dropdown'] == TRUE ? 'list' : 'popup'); $type = ($this->pmPrefs['dropdown'] == TRUE ? 'list' : 'popup');
if(check_class($this->pmPrefs['multi_class'])) if(check_class($this->pmPrefs['multi_class']))
{ {
$ret = $us->select_form($type, 'textarea.pm_to', '', $this->pmPrefs['pm_class']); $ret = $us->select_form($type, 'textarea.pm_to', '', $this->pmPrefs['pm_class']);
@@ -132,6 +134,7 @@ if(!class_exists('plugin_pm_pm_shortcodes'))
{ {
$frm = e107::getForm(); $frm = e107::getForm();
//TODO Use $frm->userpicker(); //TODO Use $frm->userpicker();
return $frm->userlist('pm_to',null,array('default'=>'blank'));
return $frm->text('pm_to','',20,'typeahead=users'); return $frm->text('pm_to','',20,'typeahead=users');
// $ret = $us->select_form($type, 'pm_to', '', $this->pmPrefs['pm_class']); // $ret = $us->select_form($type, 'pm_to', '', $this->pmPrefs['pm_class']);
@@ -559,7 +562,7 @@ if(!class_exists('plugin_pm_pm_shortcodes'))
{ {
// pm_id is mapped insisde the config to id key // pm_id is mapped insisde the config to id key
$ret = " $ret = "
<form method='post' action='".$this->url('reply', $this->var)."'> <form method='post' action='".$this->url('action/reply', $this->var)."'>
<input type='checkbox' name='quote' /> ".LAN_PM_54." &nbsp;&nbsp;&nbsp<input class='btn btn-primary button' type='submit' name='reply' value='".LAN_PM_55."' /> <input type='checkbox' name='quote' /> ".LAN_PM_54." &nbsp;&nbsp;&nbsp<input class='btn btn-primary button' type='submit' name='reply' value='".LAN_PM_55."' />
</form> </form>
"; ";
@@ -573,7 +576,7 @@ if(!class_exists('plugin_pm_pm_shortcodes'))
$pm_outbox = $this->pmManager->pm_getInfo('outbox'); $pm_outbox = $this->pmManager->pm_getInfo('outbox');
if($pm_outbox['outbox']['filled'] < 100) if($pm_outbox['outbox']['filled'] < 100)
{ {
$link = $this->url('new'); $link = $this->url('action/new');
return "<a class='btn btn-mini btn-xs btn-default' href='{$link}'>".PM_SEND_LINK."</a>"; return "<a class='btn btn-mini btn-xs btn-default' href='{$link}'>".PM_SEND_LINK."</a>";
} }
return ''; return '';
@@ -603,7 +606,7 @@ if(!class_exists('plugin_pm_pm_shortcodes'))
public function sc_pm_blocked_senders_manage() public function sc_pm_blocked_senders_manage()
{ {
$sql = e107::getDb(); $sql = e107::getDb();
$count = $sql->db_Count('private_msg_block', '(*)', 'WHERE `pm_block_to` = '.USERID); $count = $sql->count('private_msg_block', '(*)', 'WHERE `pm_block_to` = '.USERID);
if (!$count) return ''; if (!$count) return '';
return LAN_PM_66; return LAN_PM_66;
} }
@@ -636,8 +639,7 @@ if(!class_exists('plugin_pm_pm_shortcodes'))
public function sc_pm_blocked_date($parm='') public function sc_pm_blocked_date($parm='')
{ {
require_once(e_HANDLER.'date_handler.php'); return e107::getDate()->convert_date($this->pmBlocked['pm_block_datestamp'], $parm);
return convert::convert_date($this->pmBlocked['pm_block_datestamp'], $parm);
} }
@@ -654,7 +656,7 @@ if(!class_exists('plugin_pm_pm_shortcodes'))
private function url($route, $params = array(), $options) private function url($route, $params = array())
{ {
if(is_string($params)) if(is_string($params))
@@ -669,77 +671,57 @@ if(!class_exists('plugin_pm_pm_shortcodes'))
$route = explode('/', $route, 2); $route = explode('/', $route, 2);
} }
$base = e107::url('pm','index').'?';
switch($route[1])
$base = e107::url('pm','index').'?'; {
case 'index':
switch($route[1]) case 'inbox':
{ return $base.'inbox';
case 'index': break;
case 'inbox': case 'outbox':
return $base.'inbox'; return $base.'outbox';
break; break;
case 'outbox':
return $base.'outbox';
break;
// we could just remove them all and let only 'message' live // we could just remove them all and let only 'message' live
case 'show': case 'show':
return $base.'show.'.$params['id']; return $base.'show.'.$params['id'];
break; break;
case 'message':
case 'message': return $base.'show.'.$params['id'].'.inbox';
return $base.'show.'.$params['id'].'.inbox'; break;
break; case 'sent':
return $base.'show.'.$params['id'].'.outbox';
case 'sent': break;
return $base.'show.'.$params['id'].'.outbox'; case 'reply':
break; return $base.'reply.'.$params['id'];
break;
case 'reply': case 'new':
return $base.'reply.'.$params['id']; return $base.'send';
break; break;
case 'delete-in':
case 'new': return $base.'del.'.$params['id'].'.inbox';
return $base.'send'; break;
break; case 'delete-out':
} return $base.'del.'.$params['id'].'.outbox';
break;
case 'delete-blocked':
return $base.'delblocked.'.$params['id'];
switch($route[1]) break;
{ case 'block':
case 'delete-in': return $base.'block.'.$params['id'];
return $base.'del.'.$params['id'].'.inbox'; break;
break; case 'unblock':
return $base.'unblock.'.$params['id'];
case 'delete-out': break;
return $base.'del.'.$params['id'].'.outbox'; case 'get':
break; return $base.'get.'.$params['id'].'.'.$params['index'];
break;
case 'delete-blocked':
return $base.'delblocked.'.$params['id'];
break;
case 'block':
return $base.'block.'.$params['id'];
break;
case 'unblock':
return $base.'unblock.'.$params['id'];
break;
case 'get':
return $base.'get.'.$params['id'].'.'.$params['index'];
break;
}
} }
} }
}
} }
?> ?>