From 5917a8e4a7549dd708521ca8b96134674c35e3b6 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 20 Mar 2006 15:12:41 +0100 Subject: [PATCH] easier user privilege editor, misc js cleanups --- backend.php | 26 +++++++++++++++++++++----- functions.js | 28 ++++++++++++++++------------ prefs.js | 6 ++++-- tt-rss.css | 2 ++ 4 files changed, 43 insertions(+), 19 deletions(-) diff --git a/backend.php b/backend.php index 9dae9138..ba73e1a0 100644 --- a/backend.php +++ b/backend.php @@ -3984,6 +3984,8 @@ $line["last_login"] = date(get_pref($link, 'SHORT_DATE_FORMAT'), strtotime($line["last_login"])); + $access_level_names = array(0 => "User", 10 => "Administrator"); + /* if ($uid == $_SESSION["uid"]) { print ""; print "" . - $line["access_level"] . ""; + $access_level_names[$line["access_level"]] . ""; } else if ($uid != $edit_uid) { @@ -4014,7 +4016,7 @@ print "".$line["login"].""; print "".$line["email"].""; - print "".$line["access_level"].""; + print "".$access_level_names[$line["access_level"]].""; } else { @@ -4027,9 +4029,23 @@ print ""; - print ""; - +// print ""; + + print ""; + print ""; + print ""; + } print "".$line["last_login"].""; diff --git a/functions.js b/functions.js index 92bcc3bf..1d45b1cb 100644 --- a/functions.js +++ b/functions.js @@ -870,18 +870,22 @@ function leading_zero(p) { } function center_element(e) { - var c_width = document.body.clientWidth; - var c_height = document.body.clientHeight; - var c_scroll = document.body.scrollTop; - - var e_width = e.clientWidth; - var e_height = e.clientHeight; - - var set_y = (c_height / 2) + c_scroll - (e_height / 2); - var set_x = (c_width / 2) - (e_width / 2); - - e.style.top = set_y + "px"; - e.style.left = set_x + "px"; + try { + var c_width = document.body.clientWidth; + var c_height = document.body.clientHeight; + + var c_scroll = document.body.scrollTop; + var e_width = e.clientWidth; + var e_height = e.clientHeight; + + var set_y = (c_height / 2) + c_scroll - (e_height / 2); + var set_x = (c_width / 2) - (e_width / 2); + + e.style.top = set_y + "px"; + e.style.left = set_x + "px"; + } catch (e) { + exception_error("center_element", e); + } } diff --git a/prefs.js b/prefs.js index 1f74ae83..8d15d5c2 100644 --- a/prefs.js +++ b/prefs.js @@ -153,7 +153,6 @@ function infobox_callback() { box.innerHTML=xmlhttp.responseText; if (shadow) { shadow.style.display = "block"; - center_element(shadow); } else { box.style.display = "block"; } @@ -899,7 +898,10 @@ function userEditSave() { } var login = document.getElementById("iedit_ulogin").value; - var level = document.getElementById("iedit_ulevel").value; + var level = document.getElementById("iedit_ulevel"); + + level = level[level.selectedIndex].id; + var email = document.getElementById("iedit_email").value; if (login.length == 0) { diff --git a/tt-rss.css b/tt-rss.css index 6c85c713..ed320a0c 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -555,6 +555,8 @@ div.helpResponse { background-image : url("images/shadow.png"); position : absolute; width : 30%; + left : 35%; + top : 30%; z-index : 3; display : none; } -- 2.39.5