1
0
mirror of https://github.com/e107inc/e107.git synced 2025-06-04 09:54:56 +02:00

Fix user select and related in pm plugin

This commit is contained in:
SecretR 2014-12-22 20:35:05 +02:00
parent 8590b9b38b
commit 83d16f2c3d
2 changed files with 48 additions and 37 deletions

View File

@ -15,13 +15,6 @@
// DEPRECATED - SUBJECT TO REMOVAL // DEPRECATED - SUBJECT TO REMOVAL
// Possible replacements: $frm->userpicker(); // Possible replacements: $frm->userpicker();
if (!defined("e_THEME")) {
require_once('../class2.php');
include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_user_select.php");
$us = new user_select;
$us -> popup();
}
include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_user_select.php"); include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_user_select.php");
class user_select class user_select
@ -142,10 +135,9 @@ class user_select
{ {
$text .= "<input class='tbox' type='text' name='".$form_id."' id='".$form_id."' size='25' maxlength='30' value='".$tp -> post_toForm($user_value)."'>&nbsp;"; $text .= "<input class='tbox' type='text' name='".$form_id."' id='".$form_id."' size='25' maxlength='30' value='".$tp -> post_toForm($user_value)."'>&nbsp;";
} }
// @todo popup doesn't work ATM because e_HANDLER_ABS not valid $text .= "<img src='".e_IMAGE_ABS."generic/user_select.png'
$text .= "<img src='".e_IMAGE_ABS."generic/user_select.png'
style='width: 16px; height: 16px; vertical-align: top' alt='".US_LAN_4."...' style='width: 16px; height: 16px; vertical-align: top' alt='".US_LAN_4."...'
title='".US_LAN_4."...' onclick=\"window.open('".e_HANDLER_ABS."user_select_class.php?".$user_form."','user_search', 'toolbar=no,location=no,status=yes,scrollbars=yes,resizable=yes,width=300,height=200,left=100,top=100'); return false;\" />"; title='".US_LAN_4."...' onclick=\"window.open('".e_PLUGIN_ABS."pm/pm.php?".$user_form."','user_search', 'toolbar=no,location=no,status=yes,scrollbars=yes,resizable=yes,width=300,height=200,left=100,top=100'); return false;\" />";
} }
/* /*
@ -200,13 +192,16 @@ class user_select
// send the charset to the browser - overrides spurious server settings with the lan pack settings. // send the charset to the browser - overrides spurious server settings with the lan pack settings.
header("Content-type: text/html; charset=utf-8", TRUE); header("Content-type: text/html; charset=utf-8", TRUE);
echo (defined("STANDARDS_MODE") ? "" : "<?xml version='1.0' encoding='utf-8' "."?".">\n")."<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n"; //echo (defined("STANDARDS_MODE") ? "" : "<?xml version='1.0' encoding='utf-8' "."?".">\n")."<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n";
echo "<html xmlns='http://www.w3.org/1999/xhtml'".(defined("TEXTDIRECTION") ? " dir='".TEXTDIRECTION."'" : "").(defined("CORE_LC") ? " xml:lang=\"".CORE_LC."\"" : "")."> //echo "<html xmlns='http://www.w3.org/1999/xhtml'".(defined("TEXTDIRECTION") ? " dir='".TEXTDIRECTION."'" : "").(defined("CORE_LC") ? " xml:lang=\"".CORE_LC."\"" : "").">
echo "<!doctype html>
<html lang='".CORE_LC."'>
<head> <head>
<title>".SITENAME."</title>\n"; <title>".SITENAME."</title>\n";
echo "<link rel=stylesheet href='".THEME_ABS."style.css'> echo "<link rel=stylesheet href='".e_WEB_ABS."js/bootstrap/css/bootstrap.min.css'>
<link rel=stylesheet href='".THEME_ABS."style.css'>
<script language='JavaScript' type='text/javascript'> <script language='JavaScript' type='text/javascript'>
<!-- <!--
function SelectUser() { function SelectUser() {
@ -220,14 +215,19 @@ class user_select
<body> <body>
"; ";
$text = "<form action='".e_SELF."?".e_QUERY."' method='POST'> $text = "
<table style='width:100%' class='fborder'> <div class='col-sm-12'>
<tr> <h1 class='text-center'>".US_LAN_4."</h1>
<td class='forumheader3' style='text-align: center'><input type='text' name='srch' class='tbox' value='".$tp -> post_toForm(varset($_POST['srch'],''))."' size='40'> <form action='".e_SELF."?".e_QUERY."' method='POST' role='form'>
<input class='btn btn-default button' type='submit' name='dosrch' class='tbox' value='".US_LAN_6."' /></td> <div class='form-group text-center'>
</tr> <label for='srch'>Search</label>
</table> <input type='text' name='srch' id='srch' class='tbox form-control' value='".$tp -> post_toForm(varset($_POST['srch'],''))."' size='40'>
</form> </div>
<div class='form-group text-center'>
<button class='btn btn-default button' type='submit' name='dosrch' class='tbox' value='".US_LAN_6."'>".US_LAN_6."</button>
</div>
</form>
</div>
"; ";
if (isset($_POST['dosrch'])) if (isset($_POST['dosrch']))
@ -241,27 +241,30 @@ class user_select
{ {
$fcount = count($userlist); $fcount = count($userlist);
} }
$text .= "<br /><form name='results' action='".e_SELF."?".e_QUERY."' method='POST'> $text .= "<br />
<table style='width:100%' class='fborder'> <div class='col-sm-12'>
<tr><td class='fcaption'>{$fcount} ".US_LAN_5."</td></tr> <form name='results' action='".e_SELF."?".e_QUERY."' method='POST'>
<tr> <div class='form-group text-center'>
<td class='forumheader3'> <label for='usersel'>{$fcount} ".US_LAN_5."</label>
<select class='tbox' name='usersel' width='60' ondblclick='SelectUser()'> <select class='tbox' name='usersel' id='usersel' width='60' ondblclick='SelectUser()'>
"; ";
foreach($userlist as $u) { foreach($userlist as $u) {
$text .= "<option value='{$u}'>{$u}"; $text .= "<option value='{$u}'>{$u}";
} }
$text .= " $text .= "
</select> </select>
<input type='button' class='btn btn-default button' value='".US_LAN_1."' onClick='SelectUser()' /> </div>
</td> <div class='form-group text-center'>
<input type='button' class='btn btn-default button' value='".US_LAN_1."' onClick='SelectUser()' />
</tr> </div>
</table> </form>
</form> </div>
"; ";
} }
$ns -> tablerender(US_LAN_4, $text); //$ns -> tablerender(US_LAN_4, $text);
echo $text;
echo "\n</body>\n</html>"; echo "\n</body>\n</html>";
} }
@ -281,5 +284,3 @@ class user_select
} }
} }
?>

View File

@ -47,6 +47,16 @@ $qs = explode('.', e_QUERY);
$action = varset($qs[0],'inbox'); $action = varset($qs[0],'inbox');
if (!$action) $action = 'inbox'; if (!$action) $action = 'inbox';
if($action == 'textarea' || $action == 'input')
{
if($qs[1] == 'pm_to') {
require_once(e_HANDLER.'user_select_class.php');
$us = new user_select;
$us->popup();
exit;
}
}
$pm_proc_id = intval(varset($qs[1],0)); $pm_proc_id = intval(varset($qs[1],0));
//$pm_prefs = $sysprefs->getArray('pm_prefs'); //$pm_prefs = $sysprefs->getArray('pm_prefs');