Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 407b013

Browse files
committedFeb 26, 2012
Added lost_pwd_page to the list of pages where the logo is centered
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.
1 parent c55f351 commit 407b013

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed
 

‎core/html_api.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -463,11 +463,7 @@ function html_top_banner() {
463463
if( !is_blank( $t_page ) && file_exists( $t_page ) && !is_dir( $t_page ) ) {
464464
include( $t_page );
465465
} else if( $t_show_logo ) {
466-
if ( is_page_name( 'login_page' ) || is_page_name( 'signup_page' ) || is_page_name( 'signup' ) ) {
467-
$t_align = 'center';
468-
} else {
469-
$t_align = 'left';
470-
}
466+
$t_align = should_center_logo() ? 'center' : 'left';
471467

472468
echo '<div align="', $t_align, '">';
473469
if( $t_show_url ) {

‎core/utility_api.php

+9
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,15 @@ function is_page_name( $p_string ) {
198198
return isset( $_SERVER['SCRIPT_NAME'] ) && ( 0 < strpos( $_SERVER['SCRIPT_NAME'], $p_string ) );
199199
}
200200

201+
/**
202+
* A function that determines whether the logo should be centered or left aligned based on the page.
203+
* @return bool true: centered, false: otherwise.
204+
* @access public
205+
*/
206+
function should_center_logo() {
207+
return ( is_page_name( 'login_page' ) || is_page_name( 'signup_page' ) || is_page_name( 'signup' ) || is_page_name( 'lost_pwd_page' ) );
208+
}
209+
201210
function is_windows_server() {
202211
if( defined( 'PHP_WINDOWS_VERSION_MAJOR' ) ) {
203212
return (PHP_WINDOWS_VERSION_MAJOR > 0);

0 commit comments

Comments
 (0)
Please sign in to comment.