Skip to content

Commit

Permalink
Added lost_pwd_page to the list of pages where the logo is centered
Browse files Browse the repository at this point in the history
1. Add lost password page to the list of pages where the logo is centered.
2. Move this logic to a method that can be called from elsewhere.  For example, it is useful to call this logic from custom headers.
  • Loading branch information
vboctor committed Feb 26, 2012
1 parent c55f351 commit 407b013
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 1 addition & 5 deletions core/html_api.php
Expand Up @@ -463,11 +463,7 @@ function html_top_banner() {
if( !is_blank( $t_page ) && file_exists( $t_page ) && !is_dir( $t_page ) ) {
include( $t_page );
} else if( $t_show_logo ) {
if ( is_page_name( 'login_page' ) || is_page_name( 'signup_page' ) || is_page_name( 'signup' ) ) {
$t_align = 'center';
} else {
$t_align = 'left';
}
$t_align = should_center_logo() ? 'center' : 'left';

echo '<div align="', $t_align, '">';
if( $t_show_url ) {
Expand Down
9 changes: 9 additions & 0 deletions core/utility_api.php
Expand Up @@ -198,6 +198,15 @@ function is_page_name( $p_string ) {
return isset( $_SERVER['SCRIPT_NAME'] ) && ( 0 < strpos( $_SERVER['SCRIPT_NAME'], $p_string ) );
}

/**
* A function that determines whether the logo should be centered or left aligned based on the page.
* @return bool true: centered, false: otherwise.
* @access public
*/
function should_center_logo() {
return ( is_page_name( 'login_page' ) || is_page_name( 'signup_page' ) || is_page_name( 'signup' ) || is_page_name( 'lost_pwd_page' ) );
}

function is_windows_server() {
if( defined( 'PHP_WINDOWS_VERSION_MAJOR' ) ) {
return (PHP_WINDOWS_VERSION_MAJOR > 0);
Expand Down

0 comments on commit 407b013

Please sign in to comment.