Commit 1bd9d016 authored by Nigel McNie's avatar Nigel McNie
Browse files

Theme changes to support the new multicolumn layout.

The magic of the CSS means that the main content column is always first.
No tables in sight!
parent c2b0847d
......@@ -475,9 +475,31 @@ EOF;
usort($SIDEBLOCKS, create_function('$a,$b', 'if ($a["weight"] == $b["weight"]) return 0; return ($a["weight"] < $b["weight"]) ? -1 : 1;'));
// Place all sideblocks on the right. If this structure is munged
// appropriately, you can put blocks on the left. In future versions of
// Mahara, we'll make it easy to do this.
$tmp = $SIDEBLOCKS;
$SIDEBLOCKS = array(
'left' => array(),
'right' => $tmp,
);
$smarty->assign('userauthinstance', $SESSION->get('authinstance'));
$smarty->assign('MNETUSER', $SESSION->get('mnetuser'));
$smarty->assign('SIDEBLOCKS', $SIDEBLOCKS);
if ($SIDEBLOCKS['left'] && $SIDEBLOCKS['right']) {
$layout = Theme::THREE_COLUMN;
}
else if ($SIDEBLOCKS['left']) {
$layout = Theme::LEFT_COLUMN;
}
else if ($SIDEBLOCKS['right']) {
$layout = Theme::RIGHT_COLUMN;
}
else {
$layout = Theme::ONE_COLUMN;
}
$smarty->assign('PAGELAYOUT', $layout);
if ($USER->get('parentuser')) {
$smarty->assign('USERMASQUERADING', true);
......
{if $SIDEBLOCKS.left && $SIDEBLOCKS.right}
{if $THEME->columnwidthunits == 'pixels'} </div>
{/if}
</div>
<div class="col2">
{include file="sidebar.tpl" blocks=$SIDEBLOCKS.left}
</div>
<div class="col3">
{include file="sidebar.tpl" blocks=$SIDEBLOCKS.right}
</div>
</div>
</div>
</div>
{elseif $SIDEBLOCKS.left}
{if $THEME->columnwidthunits == 'pixels'} </div>
{/if}
</div>
<div class="col2">
{include file="sidebar.tpl" blocks=$SIDEBLOCKS.left}
</div>
</div>
</div>
{elseif $SIDEBLOCKS.right}
{if $THEME->columnwidthunits == 'pixels'} </div>
{/if}
</div>
<div class="col2">
{include file="sidebar.tpl" blocks=$SIDEBLOCKS.right}
</div>
</div>
</div>
{else}
TODO: 1 column layout
{/if}
</div>
<div id="footerwrap">
<div id="poweredby"><a href="http://mahara.org/"><img src="{theme_path location='images/powered-by-mahara.png'}" border="0" alt=""></a></div>
......
......@@ -27,6 +27,9 @@
{foreach from=$STYLESHEETLIST item=cssurl}
<link rel="stylesheet" type="text/css" href="{$cssurl}">
{/foreach}
<style type="text/css">
{$THEME->get_column_css($PAGELAYOUT)}
</style>
<link rel="stylesheet" type="text/css" href="{theme_path location='style/print.css'}" media="print">
<script type="text/javascript" src="{$WWWROOT}js/css.js"></script>
<link rel="shortcut icon" href="{$WWWROOT}favicon.ico" type="image/vnd.microsoft.icon">
......@@ -78,4 +81,26 @@
{/if}
{/if}
</div>
<div id="mainwrapper">
<div id="main-wrapper">
{if $SIDEBLOCKS.left && $SIDEBLOCKS.right}
<div class="colmask threecol">
<div class="colmid">
<div class="colleft">
{if $THEME->columnwidthunits == 'pixels'} <div class="col1wrap">
{/if}
<div class="col1">
{elseif $SIDEBLOCKS.left}
<div class="colmask leftmenu">
<div class="col{if $THEME->columnwidthunits == 'pixels'}right{else}left{/if}">
{if $THEME->columnwidthunits == 'pixels'} <div class="col1wrap">
{/if}
<div class="col1">
{elseif $SIDEBLOCKS.right}
<div class="colmask rightmenu">
<div class="colleft">
{if $THEME->columnwidthunits == 'pixels'} <div class="col1wrap">
{/if}
<div class="col1">
{else}
TODO: 1 column layout
{/if}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment