X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FElements%2FHeader;h=3aeb3197224106a351823f53d2682d2ae7c05e4e;hb=9c67763013a6d16725f50637fe43bde5fe15bcd4;hp=5d89fe690afb854e98b22d4d66b04b5fcaefb2d3;hpb=b5352dfcdce712af4ff2d76b034ec53fc5034024;p=freeside.git diff --git a/rt/share/html/Elements/Header b/rt/share/html/Elements/Header index 5d89fe690..3aeb31972 100755 --- a/rt/share/html/Elements/Header +++ b/rt/share/html/Elements/Header @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -46,17 +46,16 @@ %# %# END BPS TAGGED BLOCK }}} <& /elements/header.html, { - 'title' => $Title, - 'head' => $head, - 'etc' => $etc, + 'title' => $Title, + 'head' => $head, + 'etc' => $etc, #make space for RT menu for now# 'nobr' => 1, - 'nocss' => 1, + 'nocss' => 1, + 'no_jquery' => $JavaScript, } &> <%INIT> #for "Site CSS from theme editor" below -#use Scalar::Util qw(blessed); - $r->headers_out->{'Pragma'} = 'no-cache'; $r->headers_out->{'Cache-control'} = 'no-cache'; @@ -74,35 +73,45 @@ my $style = $session{'CurrentUser'} my @css_files; if ( RT->Config->Get('DevelMode') ) { - @css_files = ( "$style/main.css", RT->Config->Get('CSSFiles' ) ); + @css_files = map { "/static/css/$_" } "$style/main.css", RT->Config->Get('CSSFiles'); } else { my $key = RT::Interface::Web::SquishedCSS( $style )->Key; - @css_files = "$style-squished-$key.css"; + @css_files = "/NoAuth/css/$style/squished-$key.css"; } -my $head = ''; +# We use BodyClass in its $ARGS form so that callbacks have a chance to +# massage it +push @{$ARGS{'BodyClass'}}, lc $style; -#XXX $head .= <& /Elements/Framekiller &>; +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 $squished = RT->Config->Get('DevelMode') ? '' : '-squished'; -$head .= qq(\n); +if ( $JavaScript ) { + $head .= $m->scomp('JavascriptConfig'); +} + for my $cssfile ( @css_files ) { - $head .= qq(\n); + $head .= qq(\n); } -$head .= qq(\n); for (keys %{$LinkRel || {}}) { $head .= qq('; } +$head .= qq(\n); if ( $RSSAutoDiscovery ) { $head .= qq(); @@ -110,26 +119,19 @@ if ( $RSSAutoDiscovery ) { if ($JavaScript) { $head .= $m->scomp('HeaderJavascript', focus => $Focus, onload => $onload, RichText => $RichText ); -} -my $stylesheet_plugin = "/NoAuth/css/$style/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 = qq[ class="\L$style" ]; +#XXX $head .= <& /Elements/Framekiller &>; + +my $etc = ' class="'. join( '',@{$ARGS{'BodyClass'}}). '" '; $etc .= qq[ id="comp-$id"] if $id; @@ -138,15 +140,14 @@ $etc .= qq[ id="comp-$id"] if $id; #$Focus => 'focus' $Focus => '' $Title => 'RT' -$Code => undef $Refresh => 0 -$Why => undef $ShowBar => 1 $URL => undef $RSSAutoDiscovery => undef $onload => undef $LinkRel => undef -$JavaScript => 1 $SkipDoctype => 0 $RichText => 1 +$BodyClass => undef +$JavaScript => 1