// BEGIN HEADER
StringBuilder header = new StringBuilder();
// get the theme header -- usually used for javascript
string themeHeader = GetThemeContents( "THEME", "HEADER", null, true );
if ( themeHeader != null && themeHeader.Length > 0 )
{
header.Append(themeHeader);
}
header.AppendFormat( "<table width=100% cellspacing=0 class=content cellpadding=0><tr>" );
if ( User != null && User.IsAuthenticated )
{
header.AppendFormat( "<td style=\"padding:5px\" class=post align=left><b>{0}</b></td>", String.Format( GetText( "TOOLBAR", "LOGGED_IN_AS" ) + " ", Server.HtmlEncode( PageUserName ) ) );
header.AppendFormat( "<td style=\"padding:5px\" align=right valign=middle class=post>" );
if ( !IsGuest )
header.AppendFormat( String.Format( " <a target='_top' href=\"{0}\">{1}</a> | ", Forum.GetLink( Pages.cp_inbox ), GetText( "CP_INBOX", "TITLE" ) ) );
/* TODO: help is currently useless...
if ( IsAdmin )
header.AppendFormat( String.Format( " <a target='_top' href=\"{0}\">{1}</a> | ", Forum.GetLink( Pages.help_index ), GetText( "TOOLBAR", "HELP" ) ) );
*/
header.AppendFormat( String.Format( " <a href=\"{0}\">{1}</a> | ", Forum.GetLink( Pages.search ), GetText( "TOOLBAR", "SEARCH" ) ) );
if ( IsAdmin )
header.AppendFormat( String.Format( " <a target='_top' href=\"{0}\">{1}</a> | ", Forum.GetLink( Pages.admin_admin ), GetText( "TOOLBAR", "ADMIN" ) ) );
if ( IsModerator || IsForumModerator )
header.AppendFormat( String.Format( " <a href=\"{0}\">{1}</a> | ", Forum.GetLink( Pages.moderate_index ), GetText( "TOOLBAR", "MODERATE" ) ) );
header.AppendFormat( String.Format( " <a href=\"{0}\">{1}</a> | ", Forum.GetLink( Pages.active ), GetText( "TOOLBAR", "ACTIVETOPICS" ) ) );
if ( !IsGuest )
header.AppendFormat( String.Format( " <a href=\"{0}\">{1}</a> | ", Forum.GetLink( Pages.cp_profile ), GetText( "TOOLBAR", "MYPROFILE" ) ) );
//ADMIN ONLY//
if ( IsAdmin )
header.AppendFormat( String.Format( " <a href=\"{0}\">{1}</a> |", Forum.GetLink( Pages.members ), GetText( "TOOLBAR", "MEMBERS" ) ) );
if ( User.CanLogin )
header.AppendFormat( String.Format( " <a href=\"{0}\" onclick=\"return confirm('Are you sure you want to logout?');\">{1}</a>", Forum.GetLink( Pages.logout ), GetText( "TOOLBAR", "LOGOUT" ) ) );
}
else
{
header.AppendFormat( String.Format( "<td style=\"padding:5px\" class=post align=left><b>{0}</b></td>", GetText( "TOOLBAR", "WELCOME_GUEST" ) ) );
header.AppendFormat( "<td style=\"padding:5px\" align=right valign=middle class=post>" );
header.AppendFormat( String.Format( " <a href=\"{0}\">{1}</a> | ", Forum.GetLink( Pages.search ), GetText( "TOOLBAR", "SEARCH" ) ) );
header.AppendFormat( String.Format( " <a href=\"{0}\">{1}</a> ", Forum.GetLink( Pages.active ), GetText( "TOOLBAR", "ACTIVETOPICS" ) ) );
//header.AppendFormat( String.Format( " <a href=\"{0}\">{1}</a>", Forum.GetLink( Pages.members ), GetText( "TOOLBAR", "MEMBERS" ) ) );
if ( User != null && User.CanLogin )
{
if ( TransPage != "LOGIN" )
header.AppendFormat( String.Format( " | <a href=\"{0}\">{1}</a>", Forum.GetLink( Pages.login, "ReturnUrl={0}", Server.UrlEncode( Utils.GetSafeRawUrl() ) ), GetText( "TOOLBAR", "LOGIN" ) ) );
if ( !BoardSettings.DisableRegistrations )
header.AppendFormat( String.Format( " | <a href=\"{0}\">{1}</a>", Forum.GetLink( Pages.rules ), GetText( "TOOLBAR", "REGISTER" ) ) );
}
}
header.AppendFormat( "</td></tr></table>" );
header.AppendFormat( "<br />" );
if ( ForumControl.Header != null )
ForumControl.Header.Info = header.ToString();
else
m_headerInfo = header.ToString();
// END HEADER