Skip to content

Commit

Permalink
Added branding configuration options to Mantis per bug #7130 and #8799
Browse files Browse the repository at this point in the history
git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@4930 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
amyreese committed Jan 28, 2008
1 parent 59db4f9 commit 6b4572f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
5 changes: 5 additions & 0 deletions config_defaults_inc.php
Expand Up @@ -471,6 +471,11 @@
$g_window_title = 'Mantis'; # browser window title
$g_page_title = ''; # title at top of html page (empty by default, since there is a logo now)

# --- site branding ---------------
$g_favicon_image = 'images/favicon.ico';
$g_logo_image = 'images/mantis_logo.gif';
$g_logo_url = 'http://www.mantisbt.org';

# --- advanced views --------------
# BOTH, SIMPLE_ONLY, ADVANCED_ONLY
$g_show_report = BOTH;
Expand Down
26 changes: 23 additions & 3 deletions core/html_api.php
Expand Up @@ -112,7 +112,10 @@ function html_page_top1( $p_page_title = null ) {
html_content_type();
include( config_get( 'meta_include_file' ) );
html_rss_link();
echo '<link rel="shortcut icon" href="', helper_mantis_url( 'images/favicon.ico' ), '" type="image/x-icon" />';
$t_favicon_image = config_get( 'favicon_image' );
if ( !is_blank( $t_favicon_image ) ) {
echo '<link rel="shortcut icon" href="', helper_mantis_url( $t_favicon_image ), '" type="image/x-icon" />';
}
html_title( $p_page_title );
html_head_javascript();
}
Expand Down Expand Up @@ -316,18 +319,35 @@ function html_header() {
# (10) Print a user-defined banner at the top of the page if there is one.
function html_top_banner() {
$t_page = config_get( 'top_include_page' );
$t_logo_image = config_get( 'logo_image' );
$t_logo_url = config_get( 'logo_url' );

if ( is_blank( $t_logo_image ) ) {
$t_show_logo = false;
} else {
$t_show_logo = true;
if ( is_blank( $t_logo_url ) ) {
$t_show_url = false;
} else {
$t_show_url = true;
}
}

if ( !is_blank( $t_page ) && file_exists( $t_page ) && !is_dir( $t_page ) ) {
include( $t_page );
} else {
} else if ( $t_show_logo ) {
if ( is_page_name( 'login_page' ) ) {
$t_align = 'center';
} else {
$t_align = 'left';
}

echo '<div align="', $t_align, '">';
echo '<a href="http://www.mantisbt.org" title="Free Web Based Bug Tracker"><img border="0" alt="Mantis Bugtracker" src="' . helper_mantis_url( 'images/mantis_logo.gif' ) . '" /></a>';
if ( $t_show_url )
echo '<a href="', config_get( 'logo_url' ), '">';
echo '<img border="0" alt="Mantis Bugtracker" src="' . helper_mantis_url( config_get( 'logo_image' ) ) . '" />';
if ( $t_show_url )
echo '</a>';
echo '</div>';
}

Expand Down

0 comments on commit 6b4572f

Please sign in to comment.