Skip to content

Commit

Permalink
Fixes #14089: "Operation Successful" notifications are not centered.
Browse files Browse the repository at this point in the history
  • Loading branch information
vboctor committed May 6, 2012
1 parent a917bd6 commit d906a10
Show file tree
Hide file tree
Showing 40 changed files with 107 additions and 330 deletions.
7 changes: 1 addition & 6 deletions account_prefs_update.php
Expand Up @@ -134,11 +134,6 @@

html_page_top( null, $f_redirect_url );

echo '<br /><div>';
html_operation_successful( $f_redirect_url );

echo lang_get( 'operation_successful' );

echo '<br />';
print_bracket_link( $f_redirect_url, lang_get( 'proceed' ) );
echo '<br /></div>';
html_page_bottom();
11 changes: 3 additions & 8 deletions account_sponsor_update.php
Expand Up @@ -82,14 +82,9 @@

form_security_purge( 'account_sponsor_update' );

$t_redirect = 'account_sponsor_page.php';
html_page_top( null, $t_redirect );
$t_redirect_url = 'account_sponsor_page.php';
html_page_top( null, $t_redirect_url );

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

echo lang_get( 'payment_updated' ) . '<br />';

echo lang_get( 'operation_successful' ) . '<br />';
print_bracket_link( $t_redirect, lang_get( 'proceed' ) );
echo '</div>';
html_page_bottom();
19 changes: 10 additions & 9 deletions account_update.php
Expand Up @@ -73,7 +73,7 @@
// admins / managers to change details of other users.
$t_user_id = auth_get_current_user_id();

$t_redirect = 'account_page.php';
$t_redirect_url = 'account_page.php';

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

form_security_purge('account_update');

html_page_top( null, $t_redirect );
html_page_top( null, $t_redirect_url );

echo '<br /><div>';
$t_message = '';

if ( $t_email_updated ) {
echo lang_get( 'email_updated' ) . '<br />';
$t_message .= lang_get( 'email_updated' );
}

if ( $t_password_updated ) {
echo lang_get( 'password_updated' ) . '<br />';
$t_message = is_blank( $t_message ) ? '' : $t_message . '<br />';
$t_message .= lang_get( 'password_updated' );
}

if ( $t_realname_updated ) {
echo lang_get( 'realname_updated' ) . '<br />';
$t_message = is_blank( $t_message ) ? '' : $t_message . '<br />';
$t_message .= lang_get( 'realname_updated' );
}

echo lang_get( 'operation_successful' ) . '<br />';
print_bracket_link( $t_redirect, lang_get( 'proceed' ) );
echo '</div>';
html_operation_successful( $t_redirect_url, $t_message );

html_page_bottom();
11 changes: 2 additions & 9 deletions bug_file_add.php
Expand Up @@ -96,14 +96,7 @@
$t_redirect_url = string_get_bug_view_url( $f_bug_id );

html_page_top( null, $t_redirect_url );
?>
<br />
<div>
<?php
echo lang_get( 'operation_successful' ) . '<br />';
print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
?>
</div>

<?php
html_operation_successful( $t_redirect_url );

html_page_bottom();
13 changes: 4 additions & 9 deletions bug_reminder.php
Expand Up @@ -108,13 +108,8 @@
form_security_purge( 'bug_reminder' );

html_page_top( null, string_get_bug_view_url( $f_bug_id ) );
?>
<br />
<div>
<?php
echo lang_get( 'operation_successful' ).'<br />';
print_bracket_link( string_get_bug_view_url( $f_bug_id ), lang_get( 'proceed' ) );
?>
</div>
<?php

$t_redirect = string_get_bug_view_url( $f_bug_id );
html_operation_successful( $t_redirect );

html_page_bottom();
6 changes: 2 additions & 4 deletions bug_report.php
Expand Up @@ -283,10 +283,8 @@
}

html_page_top2();
?>
<br />
<div>
<?php

echo '<div class="success-msg">';
echo lang_get( 'operation_successful' ) . '<br />';
print_bracket_link( string_get_bug_view_url( $t_bug_id ), sprintf( lang_get( 'view_submitted_bug_link' ), $t_bug_id ) );
print_bracket_link( 'view_all_bug_page.php', lang_get( 'view_bugs_link' ) );
Expand Down
16 changes: 16 additions & 0 deletions core/html_api.php
Expand Up @@ -587,6 +587,22 @@ function html_bottom_banner() {
}
}

/**
* A function that outputs that an operation was successful and provides a redirect link.
* @param $p_redirect_url The url to redirect to.
*/
function html_operation_successful( $p_redirect_url, $p_message = '' ) {
echo '<div class="success-msg">';

if ( !is_blank( $p_message ) ) {
echo $p_message . '<br />';
}

echo lang_get( 'operation_successful' ).'<br />';
print_bracket_link( $p_redirect_url, lang_get( 'proceed' ) );
echo '</div>';
}

/**
* (13) Print the page footer information
* @param string $p_file
Expand Down
6 changes: 4 additions & 2 deletions css/default.css
Expand Up @@ -555,20 +555,22 @@ div.form-container .input,
width: 65%;
}
div.success-msg,
div.failure-msg,
div.important-msg {
display: block;
width: 60%;
margin: 2em auto;
}
div.success-msg {
div.success-msg,
div.failure-msg {
text-align: center;
}
div.important-msg {
color: red;
border: 1px solid red;
background-color: #fceded;
}
div.important-msg ul, .success-msg {
div.important-msg ul, .success-msg, .failure-msg {
margin: 0em;
padding: 2em 2em 2em 4em;
}
Expand Down
9 changes: 2 additions & 7 deletions manage_config_columns_reset.php
Expand Up @@ -51,14 +51,9 @@

form_security_purge( 'manage_config_columns_reset' );

echo '<br />';
echo '<div>';

$t_redirect_url = 'account_manage_columns_page.php';
html_page_top( lang_get( 'manage_email_config' ), $t_redirect_url );
echo '<br />';
echo lang_get( 'operation_successful' ) . '<br />';
print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
echo '</div>';

html_operation_successful( $t_redirect_url );

html_page_bottom();
11 changes: 2 additions & 9 deletions manage_config_columns_set.php
Expand Up @@ -126,14 +126,7 @@

$t_redirect_url = $f_form_page === 'account' ? 'account_manage_columns_page.php' : 'manage_config_columns_page.php';
html_page_top( null, $t_redirect_url );
?>
<div>
<br />
<?php
echo lang_get( 'operation_successful' ) . '<br />';
print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
?>
</div>

<?php
html_operation_successful( $t_redirect_url );

html_page_bottom();
10 changes: 1 addition & 9 deletions manage_config_email_set.php
Expand Up @@ -175,15 +175,7 @@
}

form_security_purge('manage_config_email_set');
?>

<br />
<div>
<?php
echo lang_get( 'operation_successful' ) . '<br />';
print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
?>
</div>
html_operation_successful( $t_redirect_url );

<?php
html_page_bottom();
11 changes: 2 additions & 9 deletions manage_config_revert.php
Expand Up @@ -87,14 +87,7 @@
$t_redirect_url = $f_return;

html_page_top( null, $t_redirect_url );
?>
<br />
<div>
<?php
echo lang_get( 'operation_successful' ).'<br />';
print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
?>
</div>

<?php
html_operation_successful( $t_redirect_url );

html_page_bottom();
10 changes: 1 addition & 9 deletions manage_config_work_threshold_set.php
Expand Up @@ -177,15 +177,7 @@ function set_capability_enum( $p_threshold, $p_all_projects_only=false ) {
set_capability_row( 'bug_reminder_threshold' );

form_security_purge( 'manage_config_work_threshold_set' );
?>

<br />
<div>
<?php
echo lang_get( 'operation_successful' ) . '<br />';
print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
?>
</div>
html_operation_successful( $t_redirect_url );

<?php
html_page_bottom();
10 changes: 1 addition & 9 deletions manage_config_workflow_set.php
Expand Up @@ -145,15 +145,7 @@
}

form_security_purge( 'manage_config_workflow_set' );
?>

<br />
<div>
<?php
echo lang_get( 'operation_successful' ) . '<br />';
print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
?>
</div>
html_operation_successful( $t_redirect_url );

<?php
html_page_bottom();
10 changes: 1 addition & 9 deletions manage_custom_field_create.php
Expand Up @@ -67,14 +67,6 @@

html_page_top( null, $t_redirect_url );

echo '<br />';
echo '<div>';

echo lang_get( 'operation_successful' ) . '<br />';

print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );

echo '</div>';
html_operation_successful( $t_redirect_url );

html_page_bottom();

10 changes: 1 addition & 9 deletions manage_custom_field_delete.php
Expand Up @@ -75,15 +75,7 @@
form_security_purge('manage_custom_field_delete');

html_page_top( null, $f_return );
?>

<br />
<div>
<?php
echo lang_get( 'operation_successful' ) . '<br />';
print_bracket_link( $f_return, lang_get( 'proceed' ) );
?>
</div>
html_operation_successful( $f_return );

<?php
html_page_bottom();
9 changes: 1 addition & 8 deletions manage_custom_field_update.php
Expand Up @@ -78,13 +78,6 @@

html_page_top( null, $f_return );

echo '<br />';
echo '<div>';

echo lang_get( 'operation_successful' ) . '<br />';

print_bracket_link( $f_return, lang_get( 'proceed' ) );

echo '</div>';
html_operation_successful( $f_return );

html_page_bottom();
11 changes: 2 additions & 9 deletions manage_proj_cat_delete.php
Expand Up @@ -86,14 +86,7 @@
}

html_page_top( null, $t_redirect_url );
?>
<br />
<div>
<?php
echo lang_get( 'operation_successful' ).'<br />';
print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
?>
</div>

<?php
html_operation_successful( $t_redirect_url );

html_page_bottom();
11 changes: 2 additions & 9 deletions manage_proj_cat_update.php
Expand Up @@ -85,14 +85,7 @@
}

html_page_top( null, $t_redirect_url );
?>
<br />
<div>
<?php
echo lang_get( 'operation_successful' ) . '<br />';
print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
?>
</div>

<?php
html_operation_successful( $t_redirect_url );

html_page_bottom();
11 changes: 1 addition & 10 deletions manage_proj_create.php
Expand Up @@ -92,16 +92,7 @@
$t_redirect_url = 'manage_proj_page.php';

html_page_top( null, $t_redirect_url );
?>

<br />
<div>
<?php
echo lang_get( 'operation_successful' ) . '<br />';

print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
?>
</div>
html_operation_successful( $t_redirect_url );

<?php
html_page_bottom();
11 changes: 1 addition & 10 deletions manage_proj_custom_field_add_existing.php
Expand Up @@ -66,16 +66,7 @@
$t_redirect_url = 'manage_proj_edit_page.php?project_id=' . $f_project_id;

html_page_top( null, $t_redirect_url );
?>

<br />
<div>
<?php
echo lang_get( 'operation_successful' ).'<br />';

print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) );
?>
</div>
html_operation_successful( $t_redirect_url );

<?php
html_page_bottom();

0 comments on commit d906a10

Please sign in to comment.