/** * Determines the layout. * * The layout is determined the nitobe_content_placement setting and number of * sidebars that have content. * * @param array &$variables * The template variables. After invoking this function, these keys will be * added to $vars: * - nitobe_content_width: The CSS class providing the full width of the * content region without any push/pull classes. * - nitobe_placement: The theme setting for how the sidebars should be * rendered relative to the content region. Will be one of: 'left', * 'center', or 'right'. */ function nitobe_set_layout(&$variables) { // -- Add the layout variables. $placement = theme_get_setting("nitobe_content_placement"); $placement = empty($placement) ? "center" : $placement; $layout = $variables["layout"]; $variables["nitobe_placement"] = $placement; // -- Determine the classes for the content and sidebars. $has_first = $layout == "first" || $layout == "both"; $has_second = $layout == "second" || $layout == "both"; $content = nitobe_ns("grid-16", $has_first, 4, $has_second, 4); $variables["nitobe_content_width"] = $content; $variables["page"]["sidebar_first"]["#nitobe_classes"] = array("grid-4"); $variables["page"]["sidebar_second"]["#nitobe_classes"] = array("grid-4"); // -- The grid class for items in the main column. $variables["nitobe_content_width"] = nitobe_ns("grid-16", $has_first, 4, $has_second, 4); // -- Add the push/pull classes. $push_pull = _nitobe_get_push_pull(); foreach (array("sidebar_first", "sidebar_second") as $region) { if (isset($push_pull[$placement][$layout][$region])) { $variables["page"][$region]["#nitobe_classes"][] = $push_pull[$placement][$layout][$region]; } } }
print $scripts; ?> <!--[if lt IE 8]> <?php print phptemplate_get_ie_styles() . "\n"; ?> <![endif]--> </head> <body class="nitobe <?php print $body_classes; ?> "> <div id="page-wrapper" class="clear-block"> <div id="header-area" class="container-16"> <div id="title-group" class="<?php print nitobe_ns('grid-16', $header, 6, $search_box, 4); ?> "> <?php if (isset($nitobe_logo)) { print $nitobe_logo; } ?> <?php if (isset($nitobe_title)) { print $nitobe_title; } ?> <?php if (isset($nitobe_slogan)) { print $nitobe_slogan;