This commit is contained in:
Shish 2012-03-11 15:49:25 +00:00
parent 6c459c8323
commit 071b783f56
3 changed files with 22 additions and 20 deletions

View File

@ -53,7 +53,7 @@ class AdminPageTheme extends Themelet {
$h_terms = html_escape($terms);
$html = make_form(make_link("admin/delete_by_query"), "POST") . "
<input type='button' class='shm-unlocker' data-unlock-id='dbqsubmit' value='Unlock'>
<input type='button' class='shm-unlocker' data-unlock-sel='#dbqsubmit' value='Unlock'>
<input type='hidden' name='query' value='$h_terms'>
<input type='submit' id='dbqsubmit' disabled='true' value='Delete All These Images'>
</form>

View File

@ -174,33 +174,35 @@ class UserPageTheme extends Themelet {
";
if($user->class->name == "admin") {
global $_user_classes;
$i_user_id = int_escape($duser->id);
$h_is_admin = $duser->is_admin() ? " checked" : "";
$html .= "
<p>".make_form(make_link("user_admin/change_class"))."
<input type='hidden' name='id' value='$i_user_id'>
Class: <select name='class'>
";
global $_user_classes;
$class_html = "";
foreach($_user_classes as $name => $values) {
$h_name = html_escape($name);
$h_title = html_escape(ucwords($name));
$h_selected = ($name == $duser->class->name ? " selected" : "");
$html .= "<option value='$h_name'$h_selected>$h_title</option>\n";
$class_html .= "<option value='$h_name'$h_selected>$h_title</option>\n";
}
$html .= "
</select>
<input type='submit' value='Set'>
<p>".make_form(make_link("user_admin/change_class"))."
<input type='hidden' name='id' value='$i_user_id'>
<table style='width: 300px;'>
<tr><th colspan='2'>Change Class</th></tr>
<tr><td><select name='class'>$class_html</select></td></tr>
<tr><td><input type='submit' value='Set'></td></tr>
</table>
</form>
".make_form(make_link("user_admin/delete_user"))."
<p>".make_form(make_link("user_admin/delete_user"))."
<input type='hidden' name='id' value='$i_user_id'>
<input type='submit' value='Delete User' onclick='confirm(\"Delete the user?\");' />
</form>
".make_form(make_link("user_admin/delete_user_with_images"))."
<input type='hidden' name='id' value='$i_user_id'>
<input type='submit' value='Delete User with images' onclick='confirm(\"Delete the user with his uploaded images?\");' />
<table style='width: 300px;'>
<tr><th colspan='2'>Delete User</th></tr>
<tr><td><input type='checkbox' name='images'> Delete images</td></tr>
<tr><td><input type='checkbox' name='comments'> Delete comments</td></tr>
<tr><td><input type='button' class='shm-unlocker' data-unlock-sel='.deluser' value='Unlock'></td></tr>
<tr><td><input type='submit' class='deluser' value='Delete User' disabled='true'/></td></tr>
</table>
</form>
";
}

View File

@ -77,8 +77,8 @@ $(document).ready(function() {
});
$(".shm-unlocker").each(function(idx, elm) {
var tid = $(elm).data("unlock-id");
var tob = $("#"+tid);
var tid = $(elm).data("unlock-sel");
var tob = $(tid);
$(elm).click(function(e) {
$(elm).attr("disabled", true);
tob.attr("disabled", false);