sortable user editor

This commit is contained in:
Andrew Dolgov 2006-08-20 14:54:54 +01:00
parent e161a2cc34
commit 79ec0f2f4c
2 changed files with 13 additions and 6 deletions

View File

@ -3384,6 +3384,12 @@
} }
} }
$sort = db_escape_string($_GET["sort"]);
if (!$sort || $sort == "undefined") {
$sort = "login";
}
print "<div class=\"prefGenericAddBox\"> print "<div class=\"prefGenericAddBox\">
<input id=\"uadd_box\" <input id=\"uadd_box\"
onkeyup=\"toggleSubmitNotEmpty(this, 'user_add_btn')\" onkeyup=\"toggleSubmitNotEmpty(this, 'user_add_btn')\"
@ -3398,7 +3404,7 @@
SUBSTRING(last_login,1,16) as last_login SUBSTRING(last_login,1,16) as last_login
FROM FROM
ttrss_users ttrss_users
ORDER by login"); ORDER BY $sort");
// print "<div id=\"infoBoxShadow\"><div id=\"infoBox\">PLACEHOLDER</div></div>"; // print "<div id=\"infoBoxShadow\"><div id=\"infoBox\">PLACEHOLDER</div></div>";
@ -3413,9 +3419,9 @@
print "<tr class=\"title\"> print "<tr class=\"title\">
<td align='center' width=\"5%\">&nbsp;</td> <td align='center' width=\"5%\">&nbsp;</td>
<td width='40%'>Login</td> <td width='40%'><a href=\"javascript:updateUsersList('login')\">Login</a></td>
<td width='40%'>Access Level</td> <td width='40%'><a href=\"javascript:updateUsersList('access_level')\">Access Level</a></td>
<td width='30%'>Last login</td></tr>"; <td width='30%'><a href=\"javascript:updateUsersList('last_login')\">Last login</a></td></tr>";
$lnum = 0; $lnum = 0;

View File

@ -157,7 +157,7 @@ function updateFeedList(sort_key) {
} }
function updateUsersList() { function updateUsersList(sort_key) {
if (!xmlhttp_ready(xmlhttp)) { if (!xmlhttp_ready(xmlhttp)) {
printLockingError(); printLockingError();
@ -168,7 +168,8 @@ function updateUsersList() {
// p_notify("Loading, please wait..."); // p_notify("Loading, please wait...");
xmlhttp.open("GET", "backend.php?op=pref-users", true); xmlhttp.open("GET", "backend.php?op=pref-users&sort="
+ param_escape(sort_key), true);
xmlhttp.onreadystatechange=userlist_callback; xmlhttp.onreadystatechange=userlist_callback;
xmlhttp.send(null); xmlhttp.send(null);