Pass on boolean instead of class name to main template

feature/node-rewrite
Sven Slootweg 12 years ago
parent 225633ac1d
commit c55aef5f05

@ -255,8 +255,7 @@ $sTemplateParameters = array_merge($sTemplateParameters, array(
'logged-in' => $sLoggedIn, 'logged-in' => $sLoggedIn,
'title' => $sPageTitle, 'title' => $sPageTitle,
'main' => $sMainContents, 'main' => $sMainContents,
/* TODO: Return a boolean instead and use this in the template. */ 'menu-visible' => (isset($router->uVariables['menu']) && $router->sAuthenticated === true),
'main-class' => (isset($router->uVariables['menu']) && $router->sAuthenticated === true) ? "shift" : "",
'generation' => "<!-- page generated in " . (round(microtime(true) - $timing_start, 6)) . " seconds. -->" 'generation' => "<!-- page generated in " . (round(microtime(true) - $timing_start, 6)) . " seconds. -->"
)); ));

@ -26,7 +26,7 @@
</div> </div>
{%/if} {%/if}
</div> </div>
<div class="main {%?main-class}"> <div class="main {%if menu-visible == true}shift{%/if}">
{%?main} {%?main}
</div> </div>
<div class="footer"> <div class="footer">

Loading…
Cancel
Save