Skip to content
Snippets Groups Projects
Commit 2868eddc authored by Tim Steiner's avatar Tim Steiner
Browse files

[gh-232] Merging from testing into staging

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x/staging@1078 20a16fea-79d4-4915-8869-1ea9d5ebf173
parent 169b406e
No related branches found
No related tags found
No related merge requests found
......@@ -195,6 +195,7 @@ function unl_wysiwyg_plugin($editor) {
'buttons' => array(
'unlZenBox' => 'UNL Zen Box',
'unlZenTable' => 'UNL Zen Table',
'unlGrid' => 'UNL Grid',
'unlLayout' => 'UNL Layout',
'unlTooltip' => 'UNL Tooltip',
),
......
......@@ -98,34 +98,13 @@ else {
}
if ($page['sidebar_first']) {
$t->maincontentarea .= '<div id="sidebar-first" class="sidebar col left">' . PHP_EOL
. render($page['sidebar_first']) . PHP_EOL
. '</div>';
$t->maincontentarea .= render($page['sidebar_first']) . PHP_EOL;
}
if ($page['sidebar_first'] && !$page['sidebar_second']) {
$t->maincontentarea .= '<div class="three_col right">' . PHP_EOL;
}
else if ($page['sidebar_first'] && $page['sidebar_second']) {
$t->maincontentarea .= '<div class="two_col">' . PHP_EOL;
}
else if (!$page['sidebar_first'] && $page['sidebar_second']) {
$t->maincontentarea .= '<div class="three_col left">' . PHP_EOL;
}
$t->maincontentarea .= strtr(render($page['content']), array('sticky-enabled' => 'zentable cool')) . PHP_EOL;
if ($page['sidebar_second']) {
$t->maincontentarea .= '</div>' . PHP_EOL
. '<div id="sidebar-second" class="sidebar col right">' . PHP_EOL
. render($page['sidebar_second']) . PHP_EOL
. '</div>' . PHP_EOL;
$t->maincontentarea .= render($page['sidebar_second']) . PHP_EOL;
}
if ($page['sidebar_first'] && !$page['sidebar_second']) {
$t->maincontentarea .= '</div>' . PHP_EOL;
}
// Related Links
if ($page['leftcollinks']) {
$t->leftcollinks = render($page['leftcollinks']);
......
<?php
// $Id: region.tpl.php,v 1.1 2009/10/05 02:43:01 webchick Exp $
/**
* @file
* Default theme implementation to display a region.
* unl_wdn theme implementation to display a region.
*
* Available variables:
* - $content: The content for this region, typically blocks.
......@@ -14,6 +13,7 @@
* - region-[name]: The name of the region with underscores replaced with
* dashes. For example, the page_top region would have a region-page-top class.
* - $region: The name of the region variable as defined in the theme's .info file.
* - $region_name: The name of the region variable with '_' replaced with '-'.
*
* Helper variables:
* - $classes_array: Array of html class attribute values. It is flattened
......@@ -26,5 +26,12 @@
* @see template_preprocess_region()
* @see template_process()
*/
?>
echo $content;
<?php if ($region != 'navlinks'): ?>
<div id="<?php print $region_name; ?>" class="<?php print $classes; ?>">
<?php endif;?>
<?php print $content; ?>
<?php if ($region != 'navlinks'): ?>
</div>
<?php endif;?>
\ No newline at end of file
......@@ -58,6 +58,41 @@ function unl_wdn_preprocess_html(&$vars, $hook) {
$vars['head_title'] = check_plain(implode(' | ', $head_title));
}
/**
* Implements template_preprocess_region().
* Adds grid classes for sidebar_first, sidebar_second, and content regions.
*/
function unl_wdn_preprocess_region(&$vars) {
static $grid;
if (!isset($grid)) {
$grid = _unl_wdn_grid_info();
}
$vars['region_name'] = str_replace('_', '-', $vars['region']);
$vars['classes_array'][] = $vars['region_name'];
if (in_array($vars['region'], array_keys($grid['regions']))) {
$vars['classes_array'][] = 'grid' . $grid['regions'][$vars['region']]['width'];
}
// Sidebar regions receive common 'sidebar' class
$sidebar_regions = array('sidebar_first', 'sidebar_second');
if (in_array($vars['region'], $sidebar_regions)) {
$vars['classes_array'][] = 'sidebar';
}
// Determine which region needs the 'first' class
if ($vars['region'] == 'content' && $grid['regions']['sidebar_first']['width'] == 0) {
$vars['classes_array'][] = 'first';
}
else if ($vars['region'] == 'sidebar_first') {
$vars['classes_array'][] = 'first';
}
}
/**
* Implements template_preprocess_node().
*/
function unl_wdn_preprocess_node(&$vars) {
// Drupal doesn't correctly set the $page flag for the preview on node/add/page which results in the <h2> being displayed in modules/node/node.tpl.php
if (isset($vars['elements']['#node']->op) && $vars['elements']['#node']->op == 'Preview') {
......@@ -261,3 +296,30 @@ function unl_wdn_get_site_name_abbreviated() {
return variable_get('site_name', 'Department');
}
}
/**
* Generate grid numbers for sidebar_first, sidebar_second, and content regions.
* Based on work in the Fusion theme (fusion_core_grid_info()).
*/
function _unl_wdn_grid_info() {
static $grid;
if (!isset($grid)) {
$grid = array();
$grid['width'] = 12;
$sidebar_first_width = (block_list('sidebar_first')) ? theme_get_setting('sidebar_first_width') : 0;
$sidebar_second_width = (block_list('sidebar_second')) ? theme_get_setting('sidebar_second_width') : 0;
$grid['regions'] = array();
$regions = array('sidebar_first', 'sidebar_second', 'content');
foreach ($regions as $region) {
if ($region == 'content') {
$region_width = $grid['width'] - $sidebar_first_width - $sidebar_second_width;
}
if ($region == 'sidebar_first' || $region == 'sidebar_second') {
$region_width = ($region == 'sidebar_first') ? $sidebar_first_width : $sidebar_second_width;
}
$grid['regions'][$region] = array('width' => $region_width);
}
}
return $grid;
}
......@@ -51,6 +51,18 @@ function unl_wdn_form_system_theme_settings_alter(&$form, &$form_state) {
$form['advanced_settings'] = array(
'#type' => 'fieldset',
'#title' => t('Advanced Settings'),
'sidebar_first_width' => array(
'#type' => 'textfield',
'#title' => t('Sidebar first Grid Size'),
'#default_value' => theme_get_setting('sidebar_first_width'),
'#description' => t('Enter only the numeral, for grid4 just enter 4.'),
),
'sidebar_second_width' => array(
'#type' => 'textfield',
'#title' => t('Sidebar second Grid Size'),
'#default_value' => theme_get_setting('sidebar_second_width'),
'#description' => t('Enter only the numeral, for grid4 just enter 4.'),
),
'zen_forms' => array(
'#type' => 'checkbox',
'#title' => t('Use Zen Forms'),
......
......@@ -33,3 +33,5 @@ settings[toggle_favicon] = 0
settings[zen_forms] = 0
settings[use_base] = 1
settings[wdn_beta] = 0
settings[sidebar_first_width] = 3
settings[sidebar_second_width] = 3
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment