X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FElements%2FHeader;h=717bf070c3665dc10105f7064206a78e1217febd;hp=5e08fe384ae8b643f144cd6213481b46379ddf89;hb=e572171073e0af425764f6a281fc7a6039398325;hpb=e9e0cf0989259b94d9758eceff448666a2e5a5cc diff --git a/rt/share/html/Elements/Header b/rt/share/html/Elements/Header index 5e08fe384..717bf070c 100755 --- a/rt/share/html/Elements/Header +++ b/rt/share/html/Elements/Header @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2014 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, - #make space for RT menu for now# 'nobr' => 1, - 'nocss' => 1, + 'title' => $Title, + 'head' => $head, + 'etc' => $etc, + 'nobr' => 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,17 +73,23 @@ 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) { my $URL = $m->notes->{RefreshURL}; $URL = $URL ? ";URL=$URL" : ""; @@ -95,60 +100,63 @@ 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('/Elements/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(); } if ($JavaScript) { - $head .= $m->scomp('HeaderJavascript', focus => $Focus, onload => $onload, RichText => $RichText ); -} + $head .= $m->scomp('/Elements/HeaderJavascript', focus => $Focus, onload => $onload, RichText => $RichText ); + +$head .= q[ + +]; -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 $sbs = RT->Config->Get("UseSideBySideLayout", $session{'CurrentUser'}) ? ' sidebyside' : ''; -my $etc = qq[ class="\L$style$sbs" ]; +#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 -$JavaScript => 1 $SkipDoctype => 0 $RichText => 1 +$BodyClass => undef +$JavaScript => 1