1
0
mirror of https://github.com/e107inc/e107.git synced 2025-06-10 13:11:48 +02:00

Fixes #977 - PM send to multiple users. Cleaned up some of the GUI for Bootstrap.

This commit is contained in:
Cameron
2015-04-23 09:53:54 -07:00
parent 3bbda20886
commit 9708756548
5 changed files with 30 additions and 13 deletions

View File

@ -520,11 +520,14 @@ function nextprev_shortcode($parm = '')
} }
// Use NEW nextprev method // Use NEW nextprev method
$np_parm['template'] = "[PREV]&nbsp;&nbsp;[DROPDOWN]&nbsp;&nbsp;[NEXT]"; $np_parm['template'] = "<span class='form-group form-inline'>[PREV]&nbsp;&nbsp;[DROPDOWN]&nbsp;&nbsp;[NEXT]<span>";
$np_parms['prev'] = '&nbsp;&nbsp;&lt;&lt;&nbsp;&nbsp;'; $np_parms['prev'] = '&nbsp;&nbsp;&lt;&lt;&nbsp;&nbsp;';
$np_parms['next'] = '&nbsp;&nbsp;&gt;&gt;&nbsp;&nbsp;'; $np_parms['next'] = '&nbsp;&nbsp;&gt;&gt;&nbsp;&nbsp;';
$np_parms['np_class'] = 'tbox npbutton btn btn-default'; $np_parms['np_class'] = 'tbox npbutton btn btn-default';
$np_parms['dropdown_class'] = 'tbox npdropdown form-control'; $np_parms['dropdown_class'] = 'tbox npdropdown form-control';
$caption = ''; // legacy has no caption.
if($cached_parms = getcachedvars('nextprev')) if($cached_parms = getcachedvars('nextprev'))
{ {
@ -593,10 +596,12 @@ function nextprev_shortcode($parm = '')
} }
$dropdown .= '</select>'; $dropdown .= '</select>';
$ret = $np_parm['template']; // Set default $ret = $np_parm['template']; // Set default
if (isset($np_parms['template']) && $np_parms['template']) if (isset($np_parms['template']) && $np_parms['template'])
{ {
$ret = $np_parms['template']; // Use override $ret = $np_parms['template']; // Use override
} }
$ret = str_replace('[DROPDOWN]', $dropdown, $ret); $ret = str_replace('[DROPDOWN]', $dropdown, $ret);
$ret = str_replace('[PREV]', $prev, $ret); $ret = str_replace('[PREV]', $prev, $ret);
$ret = str_replace('[NEXT]', $next, $ret); $ret = str_replace('[NEXT]', $next, $ret);

View File

@ -453,7 +453,7 @@ class user_class
} }
// Only return the select box if we've ended up with some options // Only return the select box if we've ended up with some options
if ($text) $text = "\n<select class='tbox' name='{$fieldname}' id='{$fieldname}' {$extra_js}>\n".$text."</select>\n"; if ($text) $text = "\n<select class='tbox form-control' name='{$fieldname}' id='{$fieldname}' {$extra_js}>\n".$text."</select>\n";
return $text; return $text;
} }

View File

@ -164,14 +164,14 @@ class private_message
'pm_size' => $pmsize 'pm_size' => $pmsize
); );
} }
if(isset($vars['to_userclass']) || isset($vars['to_array'])) if(isset($vars['to_userclass']) || isset($vars['to_array']))
{ {
if(isset($vars['to_userclass'])) if(isset($vars['to_userclass']))
{ {
require_once(e_HANDLER.'userclass_class.php');
$toclass = e107::getUserClass()->uc_get_classname($vars['pm_userclass']); $toclass = e107::getUserClass()->uc_get_classname($vars['pm_userclass']);
$tolist = $this->get_users_inclass($vars['pm_userclass']); $tolist = $this->get_users_inclass($vars['pm_userclass']);
$ret .= LAN_PM_38.": {$vars['to_userclass']}<br />"; $ret .= LAN_PM_38.": {$toclass}<br />";
$class = TRUE; $class = TRUE;
} }
else else
@ -213,6 +213,9 @@ class private_message
{ {
$info['pm_id'] = $pmid; $info['pm_id'] = $pmid;
e107::getEvent()->trigger('user_pm_sent', $info); e107::getEvent()->trigger('user_pm_sent', $info);
unset($info['pm_id']); // prevent it from being used on the next record.
if($class == FALSE) if($class == FALSE)
{ {
$toclass .= $u['user_name'].', '; $toclass .= $u['user_name'].', ';
@ -226,6 +229,7 @@ class private_message
else else
{ {
$ret .= LAN_PM_39.": {$u['user_name']} <br />"; $ret .= LAN_PM_39.": {$u['user_name']} <br />";
e107::getMessage()->addDebug($sql->getLastErrorText());
} }
} }
if ($addOutbox) if ($addOutbox)

View File

@ -133,14 +133,17 @@ class pm_shortcodes extends e_shortcode
if(check_class($this->pmPrefs['opt_userclass']) && check_class($this->pmPrefs['multi_class'])) if(check_class($this->pmPrefs['opt_userclass']) && check_class($this->pmPrefs['multi_class']))
{ {
$ret = "<input type='checkbox' name='to_userclass' value='1' />".LAN_PM_4." "; //$ret = "<input type='checkbox' name='to_userclass' value='1' />".LAN_PM_4." ";
require_once(e_HANDLER.'userclass_class.php');
$ret = "<div class='input-group'><span class='input-group-addon'>".e107::getForm()->checkbox('to_userclass',1,false, LAN_PM_4)."</span>";
$args = (ADMIN ? 'admin, classes' : 'classes, matchclass'); $args = (ADMIN ? 'admin, classes' : 'classes, matchclass');
if(check_class($this->pmPrefs['sendall_class'])) if(check_class($this->pmPrefs['sendall_class']))
{ {
$args = 'member, '.$args; $args = 'member, '.$args;
} }
$ret .= e107::getUserClass()->uc_dropdown('pm_userclass', '', $args);
$ret .= e107::getUserClass()->uc_dropdown('pm_userclass', '', $args)."</div>";
if (strpos($ret,'option') === FALSE) $ret = ''; if (strpos($ret,'option') === FALSE) $ret = '';
} }
return $ret; return $ret;
@ -424,11 +427,15 @@ class pm_shortcodes extends e_shortcode
{ {
if(in_array($this->var['pm_from'], $this->pmBlocks)) if(in_array($this->var['pm_from'], $this->pmBlocks))
{ {
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>"; $icon = (deftrue('FONTAWESOME')) ? e107::getParser()->toGlyph('fa-user-times') : "<img src='".e_PLUGIN_ABS."pm/images/mail_unblock.png' alt='".LAN_PM_51."' class='icon S16' />";
return "<a class='btn btn-sm btn-default' href='".$this->url('action/unblock', 'id='.$this->var['pm_from'])."' title='".LAN_PM_51."'>".$icon."</a>";
} }
else else
{ {
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>"; $icon = (deftrue('FONTAWESOME')) ? e107::getParser()->toGlyph('fa-user-times') : "<img src='".e_PLUGIN_ABS."pm/images/mail_block.png' alt='".LAN_PM_50."' class='icon S16' />";
return "<a class='btn btn-sm btn-default' href='".$this->url('action/block', 'id='.$this->var['pm_from'])."' title='".LAN_PM_50."'>".$icon."</a>";
} }
} }
@ -503,7 +510,7 @@ class pm_shortcodes extends e_shortcode
if($pm_outbox['outbox']['filled'] < 100) if($pm_outbox['outbox']['filled'] < 100)
{ {
$link = $this->url('new'); $link = $this->url('new');
return "<a class='btn btn-mini' href='{$link}'>".PM_SEND_LINK."</a>"; return "<a class='btn btn-mini btn-xs btn-default' href='{$link}'>".PM_SEND_LINK."</a>";
} }
return ''; return '';
} }

View File

@ -67,14 +67,15 @@ $sc_style['PM_REPLY']['post'] = "</td>
</tr> </tr>
"; ";
$PM_SEND_PM = "<div style='text-align: center'> $PM_SEND_PM = "<div id='pm-send-pm'>
<table style='width:95%' class='table fborder'> <table class='table fborder'>
<tr> <tr>
<td colspan='2' class='fcaption'>".LAN_PM_1.": </td> <td colspan='2' class='fcaption'>".LAN_PM_1.": </td>
</tr> </tr>
<tr> <tr>
<td class='forumheader3' style='width: 30%'>".LAN_PM_2.": </td> <td class='forumheader3' style='width: 30%'>".LAN_PM_2.": </td>
<td class='forumheader3' style='width: 70%; text-align:left'>{PM_FORM_TOUSER}<br />{PM_FORM_TOCLASS}</td> <td class='forumheader3' style='width: 70%; text-align:left'>{PM_FORM_TOUSER}<br />
<div class='form-inline'>{PM_FORM_TOCLASS}</div></td>
</tr> </tr>
<tr> <tr>
<td class='forumheader3'>".LAN_PM_5.": </td> <td class='forumheader3'>".LAN_PM_5.": </td>