diff --git a/omega/template.php b/omega/template.php
index e51fee4..c4c76dd 100644
--- a/omega/template.php
+++ b/omega/template.php
@@ -27,24 +27,24 @@ function omega_alpha_zones_alter(&$zones, $theme) {
*/
function omega_alpha_preprocess_html(&$vars) {
$theme = alpha_get_theme();
- $vars['rdf'] = new stdClass;
-
+ $vars['rdf'] = new stdClass;
+
if (module_exists('rdf')) {
$vars['doctype'] = '' . "\n";
$vars['rdf']->version = ' version="HTML+RDFa 1.1"';
$vars['rdf']->namespaces = $vars['rdf_namespaces'];
$vars['rdf']->profile = ' profile="' . $vars['grddl_profile'] . '"';
- }
+ }
else {
$vars['doctype'] = '' . "\n";
$vars['rdf']->version = '';
$vars['rdf']->namespaces = '';
$vars['rdf']->profile = '';
}
-
+
if (alpha_library_active('omega_mediaqueries')) {
$layouts = array();
-
+
if (isset($theme->grids[$theme->settings['grid']])) {
foreach ($theme->grids[$theme->settings['grid']]['layouts'] as $layout) {
if ($layout['enabled']) {
@@ -52,12 +52,12 @@ function omega_alpha_preprocess_html(&$vars) {
}
}
- drupal_add_js(array('omega' => array(
+ drupal_add_js(array('omega' => array(
'layouts' => array(
'primary' => $theme->grids[$theme->settings['grid']]['primary'],
- 'order' => array_keys($layouts),
+ 'order' => array_keys($layouts),
'queries' => $layouts,
- ),
+ ),
)), 'setting');
}
}
@@ -69,10 +69,10 @@ function omega_alpha_preprocess_html(&$vars) {
function omega_alpha_preprocess_comment(&$vars) {
// Prepare the arrays to handle the classes and ids for the node container.
$vars['attributes_array']['class'][] = 'clearfix';
-
+
$vars['datetime'] = format_date($vars['comment']->created, 'custom', 'c');
$vars['unpublished'] = '';
-
+
if ($vars['status'] == 'comment-unpublished') {
$vars['unpublished'] = '
' . t('Unpublished') . '
';
}
@@ -87,6 +87,12 @@ function omega_alpha_preprocess_zone(&$vars) {
$vars['content_attributes_array']['class'][] = 'equal-height-container';
}
}
+
+ if (empty($vars['content']) && !empty($vars['elements']['#data']['force'])) {
+ $vars['attributes_array']['class'][] = 'zone--empty';
+ $vars['attributes_array']['class'][] = drupal_html_class("zone-{$vars['zone']}--empty");
+ $vars['theme_hook_suggestions '][] = "zone__{$vars['zone']}__empty";
+ }
}
/**
@@ -97,11 +103,17 @@ function omega_alpha_preprocess_region(&$vars) {
if (!empty($vars['elements']['#data']['equal_height_container'])) {
$vars['content_attributes_array']['class'][] = 'equal-height-container';
}
-
+
if (!empty($vars['elements']['#data']['equal_height_element'])) {
$vars['attributes_array']['class'][] = 'equal-height-element';
}
}
+
+ if (empty($vars['content']) && !empty($vars['elements']['#data']['force'])) {
+ $vars['attributes_array']['class'][] = 'region--empty';
+ $vars['attributes_array']['class'][] = drupal_html_class("region-{$vars['region']}--empty");
+ $vars['theme_hook_suggestions '][] = "region__{$vars['region']}__empty";
+ }
}
/**
@@ -110,39 +122,39 @@ function omega_alpha_preprocess_region(&$vars) {
function omega_alpha_preprocess_node(&$vars) {
// Prepare the arrays to handle the classes and ids for the node container.
$vars['attributes_array']['id'] = drupal_html_id('node-' . $vars['type'] . '-' . $vars['nid']);
-
+
// Add a class to allow styling based on publish status.
if ($vars['status']) {
$vars['attributes_array']['class'][] = 'node-published';
}
-
+
// Add a class to allow styling based on promotion.
if (!$vars['promote']) {
$vars['attributes_array']['class'][] = 'node-not-promoted';
}
-
+
// Add a class to allow styling based on sticky status.
if (!$vars['sticky']) {
$vars['attributes_array']['class'][] = 'node-not-sticky';
}
-
+
// Add a class to allow styling of nodes being viewed by the author of the node in question.
if ($vars['uid'] == $vars['user']->uid) {
$vars['attributes_array']['class'][] = 'self-posted';
}
-
+
// Add a class to allow styling based on the node author.
$vars['attributes_array']['class'][] = drupal_html_class('author-' . $vars['node']->name);
-
+
// Add a class to allow styling for zebra striping.
$vars['attributes_array']['class'][] = drupal_html_class($vars['zebra']);
-
+
// Add a class to make the node container self clearing.
- $vars['attributes_array']['class'][] = 'clearfix';
-
+ $vars['attributes_array']['class'][] = 'clearfix';
+
$vars['content_attributes_array']['class'][] = 'content';
$vars['content_attributes_array']['class'][] = 'clearfix';
-
+
// Adding a class to the title attributes
$vars['title_attributes_array']['class'][] = 'node-title';
}
@@ -153,33 +165,33 @@ function omega_alpha_preprocess_node(&$vars) {
function omega_alpha_process_region(&$vars) {
if (in_array($vars['elements']['#region'], array('content', 'menu', 'branding'))) {
$theme = alpha_get_theme();
-
+
switch ($vars['elements']['#region']) {
case 'content':
$vars['title_prefix'] = $theme->page['title_prefix'];
$vars['title'] = $theme->page['title'];
$vars['title_suffix'] = $theme->page['title_suffix'];
$vars['tabs'] = $theme->page['tabs'];
- $vars['action_links'] = $theme->page['action_links'];
+ $vars['action_links'] = $theme->page['action_links'];
$vars['title_hidden'] = $theme->page['title_hidden'];
$vars['feed_icons'] = $theme->page['feed_icons'];
break;
-
+
case 'menu':
$vars['main_menu'] = $theme->page['main_menu'];
$vars['secondary_menu'] = $theme->page['secondary_menu'];
break;
-
+
case 'branding':
$vars['site_name'] = $theme->page['site_name'];
$vars['linked_site_name'] = l($vars['site_name'], '', array('attributes' => array('rel' => 'home', 'title' => t('Home')), 'html' => TRUE));
- $vars['site_slogan'] = $theme->page['site_slogan'];
+ $vars['site_slogan'] = $theme->page['site_slogan'];
$vars['site_name_hidden'] = $theme->page['site_name_hidden'];
$vars['site_slogan_hidden'] = $theme->page['site_slogan_hidden'];
$vars['logo'] = $theme->page['logo'];
$vars['logo_img'] = $vars['logo'] ? '' : '';
$vars['linked_logo_img'] = $vars['logo'] ? l($vars['logo_img'], '', array('attributes' => array('rel' => 'home', 'title' => t($vars['site_name'])), 'html' => TRUE)) : '';
- break;
+ break;
}
}
}
@@ -189,7 +201,7 @@ function omega_alpha_process_region(&$vars) {
*/
function omega_alpha_process_zone(&$vars) {
$theme = alpha_get_theme();
-
+
if ($vars['elements']['#zone'] == 'content') {
$vars['messages'] = $theme->page['messages'];
$vars['breadcrumb'] = $theme->page['breadcrumb'];
@@ -201,18 +213,18 @@ function omega_alpha_process_zone(&$vars) {
*/
function omega_alpha_preprocess_block(&$vars) {
$theme = alpha_get_theme();
-
+
// Adding a class to the title attributes
$vars['title_attributes_array']['class'][] = 'block-title';
// Add odd/even zebra classes into the array of classes
$vars['attributes_array']['class'][] = $vars['block_zebra'];
-
+
if(empty($vars['block']->subject) && (string) $vars['block']->subject != '0') {
// Add a class to provide CSS for blocks without titles.
$vars['attributes_array']['class'][] = 'block-without-title';
}
-
+
if ($vars['block']->module != 'alpha-debug' && isset($vars['block']->region)) {
if (alpha_library_active('omega_equalheights') && isset($theme->regions[$vars['block']->region])) {
if ($theme->regions[$vars['block']->region]['equal_height_container']) {