From 0d7f61dc7ab8b875b288b2d41ef27aa360973e57 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 18 Dec 2012 13:31:38 +0100 Subject: [PATCH 1/5] [ticket/11166] Use provided custom templates on AJAX confirm box PHPBB3-11166 --- phpBB/assets/javascript/core.js | 2 +- phpBB/includes/functions.php | 8 +++++--- .../styles/prosilver/template/confirm_body.html | 17 +++++++++++++++-- .../prosilver/template/overall_footer.html | 4 +--- phpBB/styles/prosilver/theme/common.css | 7 ++++--- 5 files changed, 26 insertions(+), 12 deletions(-) diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index f7d6688f68..aab9153003 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -320,7 +320,7 @@ phpbb.ajaxify = function(options) { else { // 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) { phpbb.loading_alert(); diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 8ef5284134..fe42373862 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3084,8 +3084,9 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo 'YES_VALUE' => $user->lang['YES'], '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) . "' WHERE user_id = " . $user->data['user_id']; @@ -3097,8 +3098,9 @@ 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; $json_response = new phpbb_json_response; $json_response->send(array( + 'MESSAGE_BODY' => $template->assign_display('body'), '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'], 'YES_VALUE' => $user->lang['YES'], 'S_CONFIRM_ACTION' => str_replace('&', '&', $u_action), //inefficient, rewrite whole function diff --git a/phpBB/styles/prosilver/template/confirm_body.html b/phpBB/styles/prosilver/template/confirm_body.html index cddbdee391..4a3de01091 100644 --- a/phpBB/styles/prosilver/template/confirm_body.html +++ b/phpBB/styles/prosilver/template/confirm_body.html @@ -1,3 +1,14 @@ + + +

{MESSAGE_TEXT}

+ +
+   + +
+ + +
@@ -6,10 +17,10 @@

{MESSAGE_TITLE}

{MESSAGE_TEXT}

- +
{S_HIDDEN_FIELDS} -   +  
@@ -18,3 +29,5 @@
+ + diff --git a/phpBB/styles/prosilver/template/overall_footer.html b/phpBB/styles/prosilver/template/overall_footer.html index 7e43ff2d0a..97083b144b 100644 --- a/phpBB/styles/prosilver/template/overall_footer.html +++ b/phpBB/styles/prosilver/template/overall_footer.html @@ -36,9 +36,7 @@
-

-   - +
diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css index 50b22f44df..416c660a2c 100644 --- a/phpBB/styles/prosilver/theme/common.css +++ b/phpBB/styles/prosilver/theme/common.css @@ -548,9 +548,9 @@ li.pagination ul { border: 1px solid transparent; position: fixed; display: none; - top: 40%; - left: 35%; - width: 30%; + top: 30%; + left: 25%; + width: 50%; z-index: 50; padding: 25px; padding: 0 25px 20px 25px; @@ -574,6 +574,7 @@ li.pagination ul { .phpbb_alert p { margin: 8px 0; padding-bottom: 8px; + font-size: 1.2em; } #darkenwrapper { From 5028fb981d422111f02fac31fdd48aa8f3da5617 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 15 Jan 2013 13:10:25 +0100 Subject: [PATCH 2/5] [ticket/11166] Fix typo in comment PHPBB3-11166 --- phpBB/assets/javascript/core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index aab9153003..0862c553d9 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -319,7 +319,7 @@ phpbb.ajaxify = function(options) { } else { - // If confirmation is required, display a diologue to the user. + // If confirmation is required, display a dialog to the user. phpbb.confirm(res.MESSAGE_BODY, function(del) { if (del) { From 0baa36f6ba1354f0e8ce78fe645392d3968e0e4e Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 15 Jan 2013 13:11:01 +0100 Subject: [PATCH 3/5] [ticket/11166] Add caption to AJAX confirm box default template PHPBB3-11166 --- phpBB/styles/prosilver/template/confirm_body.html | 1 + 1 file changed, 1 insertion(+) diff --git a/phpBB/styles/prosilver/template/confirm_body.html b/phpBB/styles/prosilver/template/confirm_body.html index 4a3de01091..eb0cad2597 100644 --- a/phpBB/styles/prosilver/template/confirm_body.html +++ b/phpBB/styles/prosilver/template/confirm_body.html @@ -1,5 +1,6 @@ +

{MESSAGE_TITLE}

{MESSAGE_TEXT}

From 3c5eb8bcadb9af8e87525ea6dbf8b5ffc3e7bb26 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 3 Mar 2013 17:23:06 +0100 Subject: [PATCH 4/5] [ticket/11166] Fix several custom confirm templates in prosilver PHPBB3-11166 --- .../prosilver/template/mcp_approve.html | 28 ++++++++++++++++ phpBB/styles/prosilver/template/mcp_move.html | 32 +++++++++++++++++++ phpBB/styles/prosilver/theme/common.css | 17 ++++++++-- 3 files changed, 75 insertions(+), 2 deletions(-) diff --git a/phpBB/styles/prosilver/template/mcp_approve.html b/phpBB/styles/prosilver/template/mcp_approve.html index faa88aefc7..6c8215c7c6 100644 --- a/phpBB/styles/prosilver/template/mcp_approve.html +++ b/phpBB/styles/prosilver/template/mcp_approve.html @@ -1,3 +1,30 @@ + + +

{MESSAGE_TITLE}

+

{MESSAGE_TEXT}

+ + + + + + + + + + + +
+   + +
+ + +
@@ -51,3 +78,4 @@
+ diff --git a/phpBB/styles/prosilver/template/mcp_move.html b/phpBB/styles/prosilver/template/mcp_move.html index d7a4f3d798..c2ee25f0d9 100644 --- a/phpBB/styles/prosilver/template/mcp_move.html +++ b/phpBB/styles/prosilver/template/mcp_move.html @@ -1,3 +1,34 @@ + + +

{MESSAGE_TITLE}

+

{MESSAGE_TEXT}

+ +

{ADDITIONAL_MSG}

+ + + + + + + + + + + +
+   + +
+ + +
@@ -35,3 +66,4 @@
+ diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css index 416c660a2c..0af8e28423 100644 --- a/phpBB/styles/prosilver/theme/common.css +++ b/phpBB/styles/prosilver/theme/common.css @@ -548,7 +548,7 @@ li.pagination ul { border: 1px solid transparent; position: fixed; display: none; - top: 30%; + top: 150px; left: 25%; width: 50%; z-index: 50; @@ -574,7 +574,20 @@ li.pagination ul { .phpbb_alert p { margin: 8px 0; padding-bottom: 8px; - font-size: 1.2em; +} + +.phpbb_alert label { + display: block; + margin: 8px 0; + padding-bottom: 8px; +} + +.phpbb_alert div.alert_text > p, +.phpbb_alert div.alert_text > label, +.phpbb_alert div.alert_text > select, +.phpbb_alert div.alert_text > textarea, +.phpbb_alert div.alert_text > input { + font-size: 1.1em; } #darkenwrapper { From 001572f76425a1fdb6621d26dae875438152cc97 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 3 Mar 2013 17:34:01 +0100 Subject: [PATCH 5/5] [ticket/11166] Add ajaxify support to normal ACP confirm_box() Currently no custom template from the ACP uses AJAX support. PHPBB3-11166 --- phpBB/adm/style/admin.css | 21 ++++++++++++++++++--- phpBB/adm/style/confirm_body.html | 14 +++++++++++++- phpBB/adm/style/overall_footer.html | 4 +--- 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css index 8551c952c7..f7a7f9f9bf 100644 --- a/phpBB/adm/style/admin.css +++ b/phpBB/adm/style/admin.css @@ -1098,12 +1098,13 @@ input.disabled { border: 1px solid #999999; position: fixed; display: none; - top: 100px; - left: 35%; - width: 30%; + top: 150px; + left: 25%; + width: 50%; z-index: 50; padding: 25px; padding: 0 25px 20px 25px; + text-align: left; } .phpbb_alert .alert_close { @@ -1127,6 +1128,20 @@ input.disabled { padding-bottom: 8px; } +.phpbb_alert label { + display: block; + margin: 8px 0; + padding-bottom: 8px; +} + +.phpbb_alert div.alert_text > p, +.phpbb_alert div.alert_text > label, +.phpbb_alert div.alert_text > select, +.phpbb_alert div.alert_text > textarea, +.phpbb_alert div.alert_text > input { + font-size: 0.9em; +} + #darkenwrapper { display: none; } diff --git a/phpBB/adm/style/confirm_body.html b/phpBB/adm/style/confirm_body.html index 2fbb1a60d7..d0360d1b3a 100644 --- a/phpBB/adm/style/confirm_body.html +++ b/phpBB/adm/style/confirm_body.html @@ -1,3 +1,15 @@ + + +

{MESSAGE_TITLE}

+

{MESSAGE_TEXT}

+ +
+   + +
+ + +
@@ -14,7 +26,7 @@
- + diff --git a/phpBB/adm/style/overall_footer.html b/phpBB/adm/style/overall_footer.html index 2bc9ee52d7..bac0cd6625 100644 --- a/phpBB/adm/style/overall_footer.html +++ b/phpBB/adm/style/overall_footer.html @@ -29,9 +29,7 @@
-

-   - +