Skip to content

Commit d906a10

Browse files
committedMay 6, 2012
Fixes #14089: "Operation Successful" notifications are not centered.
1 parent a917bd6 commit d906a10

40 files changed

+107
-330
lines changed
 

‎account_prefs_update.php

+1-6
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,6 @@
134134

135135
html_page_top( null, $f_redirect_url );
136136

137-
echo '<br /><div>';
137+
html_operation_successful( $f_redirect_url );
138138

139-
echo lang_get( 'operation_successful' );
140-
141-
echo '<br />';
142-
print_bracket_link( $f_redirect_url, lang_get( 'proceed' ) );
143-
echo '<br /></div>';
144139
html_page_bottom();

‎account_sponsor_update.php

+3-8
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,9 @@
8282

8383
form_security_purge( 'account_sponsor_update' );
8484

85-
$t_redirect = 'account_sponsor_page.php';
86-
html_page_top( null, $t_redirect );
85+
$t_redirect_url = 'account_sponsor_page.php';
86+
html_page_top( null, $t_redirect_url );
8787

88-
echo '<br /><div>';
88+
html_operation_successful( $t_redirect_url, lang_get( 'payment_updated' ) );
8989

90-
echo lang_get( 'payment_updated' ) . '<br />';
91-
92-
echo lang_get( 'operation_successful' ) . '<br />';
93-
print_bracket_link( $t_redirect, lang_get( 'proceed' ) );
94-
echo '</div>';
9590
html_page_bottom();

‎account_update.php

+10-9
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
// admins / managers to change details of other users.
7474
$t_user_id = auth_get_current_user_id();
7575

76-
$t_redirect = 'account_page.php';
76+
$t_redirect_url = 'account_page.php';
7777

7878
/** @todo Listing what fields were updated is not standard behaviour of MantisBT - it also complicates the code. */
7979
$t_email_updated = false;
@@ -121,23 +121,24 @@
121121

122122
form_security_purge('account_update');
123123

124-
html_page_top( null, $t_redirect );
124+
html_page_top( null, $t_redirect_url );
125125

126-
echo '<br /><div>';
126+
$t_message = '';
127127

128128
if ( $t_email_updated ) {
129-
echo lang_get( 'email_updated' ) . '<br />';
129+
$t_message .= lang_get( 'email_updated' );
130130
}
131131

132132
if ( $t_password_updated ) {
133-
echo lang_get( 'password_updated' ) . '<br />';
133+
$t_message = is_blank( $t_message ) ? '' : $t_message . '<br />';
134+
$t_message .= lang_get( 'password_updated' );
134135
}
135136

136137
if ( $t_realname_updated ) {
137-
echo lang_get( 'realname_updated' ) . '<br />';
138+
$t_message = is_blank( $t_message ) ? '' : $t_message . '<br />';
139+
$t_message .= lang_get( 'realname_updated' );
138140
}
139141

140-
echo lang_get( 'operation_successful' ) . '<br />';
141-
print_bracket_link( $t_redirect, lang_get( 'proceed' ) );
142-
echo '</div>';
142+
html_operation_successful( $t_redirect_url, $t_message );
143+
143144
html_page_bottom();

‎bug_file_add.php

+2-9
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,7 @@
9696
$t_redirect_url = string_get_bug_view_url( $f_bug_id );
9797

9898
html_page_top( null, $t_redirect_url );
99-
?>
100-
<br />
101-
<div>
102-
<?php
103-
echo lang_get( 'operation_successful' ) . '<br />';
104-
print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
105-
?>
106-
</div>
10799

108-
<?php
100+
html_operation_successful( $t_redirect_url );
101+
109102
html_page_bottom();

‎bug_reminder.php

+4-9
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,8 @@
108108
form_security_purge( 'bug_reminder' );
109109

110110
html_page_top( null, string_get_bug_view_url( $f_bug_id ) );
111-
?>
112-
<br />
113-
<div>
114-
<?php
115-
echo lang_get( 'operation_successful' ).'<br />';
116-
print_bracket_link( string_get_bug_view_url( $f_bug_id ), lang_get( 'proceed' ) );
117-
?>
118-
</div>
119-
<?php
111+
112+
$t_redirect = string_get_bug_view_url( $f_bug_id );
113+
html_operation_successful( $t_redirect );
114+
120115
html_page_bottom();

‎bug_report.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,8 @@
283283
}
284284

285285
html_page_top2();
286-
?>
287-
<br />
288-
<div>
289-
<?php
286+
287+
echo '<div class="success-msg">';
290288
echo lang_get( 'operation_successful' ) . '<br />';
291289
print_bracket_link( string_get_bug_view_url( $t_bug_id ), sprintf( lang_get( 'view_submitted_bug_link' ), $t_bug_id ) );
292290
print_bracket_link( 'view_all_bug_page.php', lang_get( 'view_bugs_link' ) );

‎core/html_api.php

+16
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,22 @@ function html_bottom_banner() {
587587
}
588588
}
589589

590+
/**
591+
* A function that outputs that an operation was successful and provides a redirect link.
592+
* @param $p_redirect_url The url to redirect to.
593+
*/
594+
function html_operation_successful( $p_redirect_url, $p_message = '' ) {
595+
echo '<div class="success-msg">';
596+
597+
if ( !is_blank( $p_message ) ) {
598+
echo $p_message . '<br />';
599+
}
600+
601+
echo lang_get( 'operation_successful' ).'<br />';
602+
print_bracket_link( $p_redirect_url, lang_get( 'proceed' ) );
603+
echo '</div>';
604+
}
605+
590606
/**
591607
* (13) Print the page footer information
592608
* @param string $p_file

‎css/default.css

+4-2
Original file line numberDiff line numberDiff line change
@@ -555,20 +555,22 @@ div.form-container .input,
555555
width: 65%;
556556
}
557557
div.success-msg,
558+
div.failure-msg,
558559
div.important-msg {
559560
display: block;
560561
width: 60%;
561562
margin: 2em auto;
562563
}
563-
div.success-msg {
564+
div.success-msg,
565+
div.failure-msg {
564566
text-align: center;
565567
}
566568
div.important-msg {
567569
color: red;
568570
border: 1px solid red;
569571
background-color: #fceded;
570572
}
571-
div.important-msg ul, .success-msg {
573+
div.important-msg ul, .success-msg, .failure-msg {
572574
margin: 0em;
573575
padding: 2em 2em 2em 4em;
574576
}

‎manage_config_columns_reset.php

+2-7
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,9 @@
5151

5252
form_security_purge( 'manage_config_columns_reset' );
5353

54-
echo '<br />';
55-
echo '<div>';
56-
5754
$t_redirect_url = 'account_manage_columns_page.php';
5855
html_page_top( lang_get( 'manage_email_config' ), $t_redirect_url );
59-
echo '<br />';
60-
echo lang_get( 'operation_successful' ) . '<br />';
61-
print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
62-
echo '</div>';
56+
57+
html_operation_successful( $t_redirect_url );
6358

6459
html_page_bottom();

‎manage_config_columns_set.php

+2-9
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,7 @@
126126

127127
$t_redirect_url = $f_form_page === 'account' ? 'account_manage_columns_page.php' : 'manage_config_columns_page.php';
128128
html_page_top( null, $t_redirect_url );
129-
?>
130-
<div>
131-
<br />
132-
<?php
133-
echo lang_get( 'operation_successful' ) . '<br />';
134-
print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
135-
?>
136-
</div>
137129

138-
<?php
130+
html_operation_successful( $t_redirect_url );
131+
139132
html_page_bottom();

‎manage_config_email_set.php

+1-9
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,7 @@
175175
}
176176

177177
form_security_purge('manage_config_email_set');
178-
?>
179178

180-
<br />
181-
<div>
182-
<?php
183-
echo lang_get( 'operation_successful' ) . '<br />';
184-
print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
185-
?>
186-
</div>
179+
html_operation_successful( $t_redirect_url );
187180

188-
<?php
189181
html_page_bottom();

‎manage_config_revert.php

+2-9
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,7 @@
8787
$t_redirect_url = $f_return;
8888

8989
html_page_top( null, $t_redirect_url );
90-
?>
91-
<br />
92-
<div>
93-
<?php
94-
echo lang_get( 'operation_successful' ).'<br />';
95-
print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
96-
?>
97-
</div>
9890

99-
<?php
91+
html_operation_successful( $t_redirect_url );
92+
10093
html_page_bottom();

‎manage_config_work_threshold_set.php

+1-9
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,7 @@ function set_capability_enum( $p_threshold, $p_all_projects_only=false ) {
177177
set_capability_row( 'bug_reminder_threshold' );
178178

179179
form_security_purge( 'manage_config_work_threshold_set' );
180-
?>
181180

182-
<br />
183-
<div>
184-
<?php
185-
echo lang_get( 'operation_successful' ) . '<br />';
186-
print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
187-
?>
188-
</div>
181+
html_operation_successful( $t_redirect_url );
189182

190-
<?php
191183
html_page_bottom();

‎manage_config_workflow_set.php

+1-9
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,7 @@
145145
}
146146

147147
form_security_purge( 'manage_config_workflow_set' );
148-
?>
149148

150-
<br />
151-
<div>
152-
<?php
153-
echo lang_get( 'operation_successful' ) . '<br />';
154-
print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
155-
?>
156-
</div>
149+
html_operation_successful( $t_redirect_url );
157150

158-
<?php
159151
html_page_bottom();

‎manage_custom_field_create.php

+1-9
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,6 @@
6767

6868
html_page_top( null, $t_redirect_url );
6969

70-
echo '<br />';
71-
echo '<div>';
72-
73-
echo lang_get( 'operation_successful' ) . '<br />';
74-
75-
print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
76-
77-
echo '</div>';
70+
html_operation_successful( $t_redirect_url );
7871

7972
html_page_bottom();
80-

‎manage_custom_field_delete.php

+1-9
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,7 @@
7575
form_security_purge('manage_custom_field_delete');
7676

7777
html_page_top( null, $f_return );
78-
?>
7978

80-
<br />
81-
<div>
82-
<?php
83-
echo lang_get( 'operation_successful' ) . '<br />';
84-
print_bracket_link( $f_return, lang_get( 'proceed' ) );
85-
?>
86-
</div>
79+
html_operation_successful( $f_return );
8780

88-
<?php
8981
html_page_bottom();

‎manage_custom_field_update.php

+1-8
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,6 @@
7878

7979
html_page_top( null, $f_return );
8080

81-
echo '<br />';
82-
echo '<div>';
83-
84-
echo lang_get( 'operation_successful' ) . '<br />';
85-
86-
print_bracket_link( $f_return, lang_get( 'proceed' ) );
87-
88-
echo '</div>';
81+
html_operation_successful( $f_return );
8982

9083
html_page_bottom();

‎manage_proj_cat_delete.php

+2-9
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,7 @@
8686
}
8787

8888
html_page_top( null, $t_redirect_url );
89-
?>
90-
<br />
91-
<div>
92-
<?php
93-
echo lang_get( 'operation_successful' ).'<br />';
94-
print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
95-
?>
96-
</div>
9789

98-
<?php
90+
html_operation_successful( $t_redirect_url );
91+
9992
html_page_bottom();

‎manage_proj_cat_update.php

+2-9
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,7 @@
8585
}
8686

8787
html_page_top( null, $t_redirect_url );
88-
?>
89-
<br />
90-
<div>
91-
<?php
92-
echo lang_get( 'operation_successful' ) . '<br />';
93-
print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
94-
?>
95-
</div>
9688

97-
<?php
89+
html_operation_successful( $t_redirect_url );
90+
9891
html_page_bottom();

‎manage_proj_create.php

+1-10
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,7 @@
9292
$t_redirect_url = 'manage_proj_page.php';
9393

9494
html_page_top( null, $t_redirect_url );
95-
?>
9695

97-
<br />
98-
<div>
99-
<?php
100-
echo lang_get( 'operation_successful' ) . '<br />';
101-
102-
print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
103-
?>
104-
</div>
96+
html_operation_successful( $t_redirect_url );
10597

106-
<?php
10798
html_page_bottom();

‎manage_proj_custom_field_add_existing.php

+1-10
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,7 @@
6666
$t_redirect_url = 'manage_proj_edit_page.php?project_id=' . $f_project_id;
6767

6868
html_page_top( null, $t_redirect_url );
69-
?>
7069

71-
<br />
72-
<div>
73-
<?php
74-
echo lang_get( 'operation_successful' ).'<br />';
75-
76-
print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
77-
?>
78-
</div>
70+
html_operation_successful( $t_redirect_url );
7971

80-
<?php
8172
html_page_bottom();

0 commit comments

Comments
 (0)
Please sign in to comment.