]> git.wh0rd.org Git - tt-rss.git/commitdiff
dhtml user details
authorAndrew Dolgov <fox@bah.spb.su>
Fri, 18 Nov 2005 12:38:21 +0000 (13:38 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Fri, 18 Nov 2005 12:38:21 +0000 (13:38 +0100)
backend.php
prefs.js
tt-rss.css

index a2f6a0da7360626eb3dfaad197ec8145b679e663..91853d4b84852165f329c5db1265747988ad34a1 100644 (file)
                                ttrss_users
                        ORDER by login");
 
+               print "<div id=\"prefUserDetails\">PLACEHOLDER</div>";
+
                print "<p><table width=\"100%\" class=\"prefUserList\" id=\"prefUserList\">";
 
                print "<tr class=\"title\">
                        } else if (!$edit_uid || $subop != "edit") {
 
                                print "<td><input onclick='toggleSelectRow(this);' 
-                               type=\"checkbox\" id=\"UMCHK-".$line["id"]."\"></td>";
+                               type=\"checkbox\" id=\"UMCHK-$uid\"></td>";
 
                                print "<td><a href=\"javascript:editUser($uid);\">" . 
                                        $line["login"] . "</td>";               
                        return;
                }
                          
-               print "<html><head>
+/*             print "<html><head>
                        <title>Tiny Tiny RSS : User Details</title>
                        <link rel=\"stylesheet\" href=\"tt-rss.css\" type=\"text/css\">
                        <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
-                       </head><body>";
+                       </head><body>"; */
 
                $uid = sprintf("%d", $_GET["id"]);
 
-               /* FIXME this badly needs real implementation */
-
                print "<div class='userDetails'>";
 
                $result = db_query($link, "SELECT login,last_login,access_level
 
                print "</ul>";
 
-               print "<p align='center'>
-                       <a      href=\"javascript:window.close()\">(Close this window)</a></p>";
-
                print "</div>";
 
-               print "</body></html>";
+               print "<div align='center'>
+                       <input type='submit' class='button'                     
+                       onclick=\"closeUserDetails()\" value=\"Close this window\"></div>";
+
+//             print "</body></html>"; 
 
        }
 
index 4333aac1849819b654c339e37cebdaee98a5771c..6aae959e6fcd0e330de3a12dbc994b0c84f06479 100644 (file)
--- a/prefs.js
+++ b/prefs.js
@@ -101,23 +101,33 @@ function userlist_callback() {
        if (xmlhttp.readyState == 4) {
                container.innerHTML=xmlhttp.responseText;
 
-/*             if (active_filter) {
-                       var row = document.getElementById("ULRR-" + active_label);
+               if (active_user) {
+                       var row = document.getElementById("UMRR-" + active_user);
                        if (row) {
                                if (!row.className.match("Selected")) {
                                        row.className = row.className + "Selected";
                                }               
                        }
-                       var checkbox = document.getElementById("LICHK-" + active_label);
+                       var checkbox = document.getElementById("UMCHK-" + active_user);
                        
                        if (checkbox) {
                                checkbox.checked = true;
                        }
-               } */
+               } 
+
                p_notify("");
        }
 }
 
+function userdetails_callback() {
+       var container = document.getElementById('prefUserDetails');
+       if (xmlhttp.readyState == 4) {
+               container.innerHTML=xmlhttp.responseText;
+               container.style.display = "block";
+       }
+}
+
+
 function prefslist_callback() {
        var container = document.getElementById('prefContent');
        if (xmlhttp.readyState == 4) {
@@ -850,6 +860,11 @@ function resetSelectedUserPass() {
 
 function selectedUserDetails() {
 
+       if (!xmlhttp_ready(xmlhttp)) {
+               printLockingError();
+               return
+       }
+
        var rows = getSelectedUsers();
 
        if (rows.length == 0) {
@@ -864,9 +879,9 @@ function selectedUserDetails() {
 
        var id = rows[0];
 
-       var w = window.open("backend.php?op=user-details&id=" + id,
-               "User Details", 
-               "menubar=no,location=no,resizable=yes,scrollbars=yes,status=no");
+       xmlhttp.open("GET", "backend.php?op=user-details&id=" + id, true);
+       xmlhttp.onreadystatechange=userdetails_callback;
+       xmlhttp.send(null);
 
 }
 
@@ -1051,4 +1066,7 @@ function dispOptionHelp(event, sender) {
 
 } */
 
-
+function closeUserDetails() {
+       var d = document.getElementById('prefUserDetails');
+       d.style.display = "none";
+}
index ca591c50ecfb8c304fb2724e62e1fd4f0a2153ef..bdf5b03cf44676d9fd2f40fdb59a77fceeaa3a71 100644 (file)
@@ -411,7 +411,7 @@ a.helpLink:hover {
        color : #5050aa;
 }
 
-div.helpResponse, div.userDetails {
+div.helpResponse {
        margin : 10px;
        background-image : url("images/vgrad_light_rev2.png");
        background-position : top left;
@@ -420,6 +420,15 @@ div.helpResponse, div.userDetails {
        border : 1px solid #f0f0f0;
 }
 
+div.userDetails {
+       background-image : url("images/vgrad_light_rev2.png");
+       background-position : top left;
+       background-repeat : repeat-x;
+       padding : 5px;
+       margin-bottom : 10px;
+       border : 1px solid #f0f0f0;
+}
+
 div.helpResponse h1, div.userDetails h1 {
        border-width : 0px 0px 1px 0px;
        border-style : solid;
@@ -566,3 +575,14 @@ table.innerLoginForm {
 table.innerLoginForm td {
        padding : 3px 3px 5px 3px;
 }
+
+#prefUserDetails {
+       position : absolute;
+       margin-left : 30%;
+       background-color : white;
+       width : 30%;
+       z-index : 3;
+       border : 1px solid #c0c0c0;
+       display : none;
+       padding-bottom : 10px;
+}