[ticket/11166] Use provided custom templates on AJAX confirm box

PHPBB3-11166
This commit is contained in:
Joas Schilling 2012-12-18 13:31:38 +01:00
parent 3af5531d0d
commit 0d7f61dc7a
5 changed files with 26 additions and 12 deletions

View file

@ -320,7 +320,7 @@ phpbb.ajaxify = function(options) {
else else
{ {
// If confirmation is required, display a diologue to the user. // If confirmation is required, display a diologue to the user.
phpbb.confirm(res.MESSAGE_TEXT, function(del) { phpbb.confirm(res.MESSAGE_BODY, function(del) {
if (del) if (del)
{ {
phpbb.loading_alert(); phpbb.loading_alert();

View file

@ -3084,8 +3084,9 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo
'YES_VALUE' => $user->lang['YES'], 'YES_VALUE' => $user->lang['YES'],
'S_CONFIRM_ACTION' => $u_action, 'S_CONFIRM_ACTION' => $u_action,
'S_HIDDEN_FIELDS' => $hidden . $s_hidden_fields) 'S_HIDDEN_FIELDS' => $hidden . $s_hidden_fields,
); 'S_AJAX_REQUEST' => $request->is_ajax(),
));
$sql = 'UPDATE ' . USERS_TABLE . " SET user_last_confirm_key = '" . $db->sql_escape($confirm_key) . "' $sql = 'UPDATE ' . USERS_TABLE . " SET user_last_confirm_key = '" . $db->sql_escape($confirm_key) . "'
WHERE user_id = " . $user->data['user_id']; WHERE user_id = " . $user->data['user_id'];
@ -3097,6 +3098,7 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo
$u_action .= '&confirm_uid=' . $user->data['user_id'] . '&sess=' . $user->session_id . '&sid=' . $user->session_id; $u_action .= '&confirm_uid=' . $user->data['user_id'] . '&sess=' . $user->session_id . '&sid=' . $user->session_id;
$json_response = new phpbb_json_response; $json_response = new phpbb_json_response;
$json_response->send(array( $json_response->send(array(
'MESSAGE_BODY' => $template->assign_display('body'),
'MESSAGE_TITLE' => (!isset($user->lang[$title])) ? $user->lang['CONFIRM'] : $user->lang[$title], 'MESSAGE_TITLE' => (!isset($user->lang[$title])) ? $user->lang['CONFIRM'] : $user->lang[$title],
'MESSAGE_TEXT' => (!isset($user->lang[$title . '_CONFIRM'])) ? $title : $user->lang[$title . '_CONFIRM'], 'MESSAGE_TEXT' => (!isset($user->lang[$title . '_CONFIRM'])) ? $title : $user->lang[$title . '_CONFIRM'],

View file

@ -1,3 +1,14 @@
<!-- IF S_AJAX_REQUEST -->
<p>{MESSAGE_TEXT}</p>
<fieldset class="submit-buttons">
<input type="button" name="confirm" value="{L_YES}" class="button1" />&nbsp;
<input type="button" name="cancel" value="{L_NO}" class="button2" />
</fieldset>
<!-- ELSE -->
<!-- INCLUDE overall_header.html --> <!-- INCLUDE overall_header.html -->
<form id="confirm" action="{S_CONFIRM_ACTION}" method="post"> <form id="confirm" action="{S_CONFIRM_ACTION}" method="post">
@ -18,3 +29,5 @@
</form> </form>
<!-- INCLUDE overall_footer.html --> <!-- INCLUDE overall_footer.html -->
<!-- ENDIF -->

View file

@ -36,9 +36,7 @@
</div> </div>
<div id="phpbb_confirm" class="phpbb_alert"> <div id="phpbb_confirm" class="phpbb_alert">
<a href="#" class="alert_close"></a> <a href="#" class="alert_close"></a>
<p class="alert_text"></p> <div class="alert_text"></div>
<input type="button" class="button1" value="{L_YES}" />&nbsp;
<input type="button" class="button2" value="{L_NO}" />
</div> </div>
</div> </div>

View file

@ -548,9 +548,9 @@ li.pagination ul {
border: 1px solid transparent; border: 1px solid transparent;
position: fixed; position: fixed;
display: none; display: none;
top: 40%; top: 30%;
left: 35%; left: 25%;
width: 30%; width: 50%;
z-index: 50; z-index: 50;
padding: 25px; padding: 25px;
padding: 0 25px 20px 25px; padding: 0 25px 20px 25px;
@ -574,6 +574,7 @@ li.pagination ul {
.phpbb_alert p { .phpbb_alert p {
margin: 8px 0; margin: 8px 0;
padding-bottom: 8px; padding-bottom: 8px;
font-size: 1.2em;
} }
#darkenwrapper { #darkenwrapper {