svnno****@sourc*****
svnno****@sourc*****
2007年 11月 19日 (月) 00:41:57 JST
Revision: 256 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=slashdotjp&view=rev&rev=256 Author: caesar Date: 2007-11-19 00:41:57 +0900 (Mon, 19 Nov 2007) Log Message: ----------- edit template for user deletion page Modified Paths: -------------- slashjp/branches/deluser/plugins/DelUser/deluser.pl Added Paths: ----------- slashjp/branches/deluser/plugins/DelUser/templates/deleteUser;deluser;default Removed Paths: ------------- slashjp/branches/deluser/plugins/DelUser/templates/deleteUserForm;deluser;default -------------- next part -------------- Modified: slashjp/branches/deluser/plugins/DelUser/deluser.pl =================================================================== --- slashjp/branches/deluser/plugins/DelUser/deluser.pl 2007-11-15 14:58:07 UTC (rev 255) +++ slashjp/branches/deluser/plugins/DelUser/deluser.pl 2007-11-18 15:41:57 UTC (rev 256) @@ -28,7 +28,7 @@ my %ops = ( deleteform => [$user_ok, \&deleteUserForm], - delete => [$post_ok, \&deleteUser], + deleteok => [$post_ok && $user_ok , \&deleteUser], ); # set default op @@ -49,18 +49,22 @@ ################################################################## sub deleteUserForm { - my($slashdb, $reader, $constants, $user, $form) = @_; - slashDisplay('deleteUserForm'); + my($slashdb, $reader, $constants, $user, $form, $note) = @_; + slashDisplay('deleteUser'); footer(); } sub deleteUser { my($slashdb, $reader, $constants, $user, $form) = @_; + my $note; my $uid = $user->{uid}; # my $rows = $slashdb->deleteUser($uid); - slashDisplay('deleteUserFinished'); - footer(); +# slashDisplay('deleteUserFinished'); +# footer(); + +# redirect("$rootdir/my/logout"); + deleteUserForm(@_, $note); } createEnvironment(); Added: slashjp/branches/deluser/plugins/DelUser/templates/deleteUser;deluser;default =================================================================== --- slashjp/branches/deluser/plugins/DelUser/templates/deleteUser;deluser;default 2007-11-15 14:58:07 UTC (rev 255) +++ slashjp/branches/deluser/plugins/DelUser/templates/deleteUser;deluser;default 2007-11-18 15:41:57 UTC (rev 256) @@ -0,0 +1,60 @@ +__section__ +default +__description__ +Delete user form +__title__ +Delete user form +__page__ +deluser +__lang__ +en_US +__name__ +deleteUserForm +__template__ +<div id="slashboxes"> + [% PROCESS userboxes %] +</div> +[% thisnickname = user.nickname | strip_literal; + title = "アカウント$thisnickname ($user.uid)を削除" %] +<div id="users-blocks"> + <div class="generalbody"> + <script language="JavaScript"> +// <!-- + function toggle_recurse(elem, flag) { + for (var i = 0; i < elem.childNodes.length; i++) { + var e = elem.childNodes[i]; + if ( e.id == "delete_ok_box" ) { continue; } + if (e.tagName == "SELECT" || e.tagName == "INPUT") { + e.disabled = !flag; + } else if (e.tagName == "LABEL") { + e.style.color = flag ? "black" : "#666"; + e.disabled = !flag; + } + toggle_recurse(e, flag); + } + } + function toggle_form(flag) { + toggle_recurse(document.getElementById("createuserform"), flag); + } +// --> + </script> + <form action="[% constants.real_rootdir %]/deluser.pl" method="post"> + <fieldset> + <legend></legend> + [% PROCESS formkey_tag %] + <input type="hidden" name="uid" value="[% user.uid %]"> + <p>アカウントを削除する場合は,以下のチェックボックスにチェックを入れ送信ボタンを押してください。</p> + <div id="delete_ok_box"> + <input id="delete_ok" type="checkbox" name="delete_ok" value="delete_ok" onClick="toggle_form(this.checked)" onKeydown="toggle_form(this.checked)"> + <label for="delete_ok">本当に削除する</label> + </div> + <input type="hidden" name="op" value="delete"> + <input type="submit" value="送信" class="button"> + </fieldset> + </form> + </div> +</div> +__seclev__ +500 +__version__ +$Id: $ Deleted: slashjp/branches/deluser/plugins/DelUser/templates/deleteUserForm;deluser;default =================================================================== --- slashjp/branches/deluser/plugins/DelUser/templates/deleteUserForm;deluser;default 2007-11-15 14:58:07 UTC (rev 255) +++ slashjp/branches/deluser/plugins/DelUser/templates/deleteUserForm;deluser;default 2007-11-18 15:41:57 UTC (rev 256) @@ -1,18 +0,0 @@ -__section__ -default -__description__ -Delete user form -__title__ -Delete user form -__page__ -deluser -__lang__ -en_US -__name__ -deleteUserForm -__template__ -This is test -__seclev__ -500 -__version__ -$Id: $