X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FElements%2FHeader;h=3a5be7aee1b92419f9af4b2d5891624ef55f8f2c;hb=ed896d3f361d812337ec44dd4cf8f561d4192a80;hp=64d548dc3de3a84950ec6a2d473c773d52ba9ec2;hpb=fb4ab1073f0d15d660c6cdc4e07afebf68ef3924;p=freeside.git diff --git a/rt/share/html/Elements/Header b/rt/share/html/Elements/Header index 64d548dc3..3a5be7aee 100755 --- a/rt/share/html/Elements/Header +++ b/rt/share/html/Elements/Header @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -46,14 +46,16 @@ %# %# END BPS TAGGED BLOCK }}} <& /elements/header.html, { - 'title' => $Title, - 'head' => $head, - 'etc' => $etc, - 'nobr' => 1, - 'nocss' => 1, + 'title' => $Title, + 'head' => $head, + 'etc' => $etc, + #make space for RT menu for now# 'nobr' => 1, + 'nocss' => 1, + 'no_jquery' => $JavaScript, } &> <%INIT> +#for "Site CSS from theme editor" below $r->headers_out->{'Pragma'} = 'no-cache'; $r->headers_out->{'Cache-control'} = 'no-cache'; @@ -65,60 +67,86 @@ $id =~ s|index$||g if $id ne 'index'; $id =~ s|-$||g; +my $style = $session{'CurrentUser'} + ? $session{'CurrentUser'}->Stylesheet + : RT->Config->Get('WebDefaultStylesheet'); + +my @css_files; +if ( RT->Config->Get('DevelMode') ) { + @css_files = map { "/static/css/$_" } "$style/main.css", RT->Config->Get('CSSFiles'); +} +else { + my $key = + RT::Interface::Web::SquishedCSS( $style )->Key; + @css_files = "/NoAuth/css/$style/squished-$key.css"; +} + +# We use BodyClass in its $ARGS form so that callbacks have a chance to +# massage it +push @{$ARGS{'BodyClass'}}, lc $style; + +if (RT->Config->Get("UseSideBySideLayout", $session{'CurrentUser'})) { + push @{$ARGS{'BodyClass'}}, 'sidebyside'; +} + my $head = ''; if ($Refresh && $Refresh =~ /^(\d+)/ && $1 > 0) { - $head .= qq( ); + my $URL = $m->notes->{RefreshURL}; $URL = $URL ? ";URL=$URL" : ""; + $head .= qq( ); } my $WebPath = RT->Config->Get('WebPath'); my $WebImagesURL = RT->Config->Get('WebImagesURL'); -my $WebDefaultStylesheet = - RT->Config->Get('WebDefaultStylesheet', $session{'CurrentUser'}); my $squished = RT->Config->Get('DevelMode') ? '' : '-squished'; -$head .= < - - -END +if ( $JavaScript ) { + $head .= $m->scomp('/Elements/JavascriptConfig'); +} + +for my $cssfile ( @css_files ) { + $head .= qq(\n); +} for (keys %{$LinkRel || {}}) { $head .= qq('; } +$head .= qq(\n); if ( $RSSAutoDiscovery ) { $head .= qq(); } if ($JavaScript) { - $head .= $m->scomp('HeaderJavascript', focus => $Focus, onload => $onload); -} + $head .= $m->scomp('/Elements/HeaderJavascript', focus => $Focus, onload => $onload, RichText => $RichText ); -my $stylesheet_plugin = "/NoAuth/css/$WebDefaultStylesheet/InHeader"; -if ($m->comp_exists($stylesheet_plugin) ) { - $head .= $m->scomp($stylesheet_plugin); + my $stylesheet_plugin = "/NoAuth/css/$style/InHeader"; + if ($m->comp_exists($stylesheet_plugin) ) { + $head .= $m->scomp($stylesheet_plugin); + } } # $m->callback( %ARGS, CallbackName => 'Head' ); $head .= $m->scomp( '/Elements/Callback', _CallbackName => 'Head', %ARGS ); -my $etc = ''; +#XXX $head .= <& /Elements/Framekiller &>; + +my $etc = ' class="'. join( '',@{$ARGS{'BodyClass'}}). '" '; $etc .= qq[ id="comp-$id"] if $id; - <%ARGS> #$Focus => 'focus' $Focus => '' $Title => 'RT' -$Code => undef $Refresh => 0 -$Why => undef $ShowBar => 1 $URL => undef $RSSAutoDiscovery => undef $onload => undef $LinkRel => undef +$SkipDoctype => 0 +$RichText => 1 +$BodyClass => undef $JavaScript => 1