summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--alpha/includes/alpha.inc30
-rw-r--r--alpha/template.php24
-rw-r--r--alpha/theme-settings.php2
-rw-r--r--omega/template.php16
4 files changed, 41 insertions, 31 deletions
diff --git a/alpha/includes/alpha.inc b/alpha/includes/alpha.inc
index fa60120..7aa433f 100644
--- a/alpha/includes/alpha.inc
+++ b/alpha/includes/alpha.inc
@@ -106,18 +106,19 @@ function alpha_invoke($type, $hook, &$vars) {
// If one of the themes in the theme trail implements this hook
// include the corresponding .inc file and call the associated function.
- foreach (array_keys(alpha_theme_trail($theme->theme)) as $key) {
- $file = drupal_get_path('theme', $key) . '/' . $type . '/' . $type . '-' . str_replace('_', '-', $hook) . '.inc';
+ foreach (alpha_theme_trail($theme->theme) as $key => $name) {
$function = $key . '_alpha_' . $type . '_' . $hook;
- if (is_file($file)) {
- if (!function_exists($function)) {
+ if (!function_exists($function)) {
+ $file = drupal_get_path('theme', $key) . '/' . $type . '/' . $type . '-' . str_replace('_', '-', $hook) . '.inc';
+
+ if (is_file($file)) {
include $file;
}
-
- if (function_exists($function)) {
- $function($vars);
- }
+ }
+
+ if (function_exists($function)) {
+ $function($vars);
}
}
}
@@ -229,10 +230,17 @@ function alpha_theme_trail($theme) {
function alpha_get_theme() {
$container = &drupal_static(__FUNCTION__);
- $theme = $GLOBALS['theme_key'];
+ $key = $theme = $GLOBALS['theme_key'];
+ //$delta = NULL;
+ //
+ //if (module_exists('delta') && $delta = delta_get_delta($theme)) {
+ // $delta = $delta->machine_name;
+ // $key .= ':' . $delta;
+ //}
+
$delta = isset($GLOBALS['delta']) ? $GLOBALS['delta']->machine_name : NULL;
- $key = $theme . (isset($delta) ? ':' . $delta : '');
-
+ $key .= isset($delta) ? ':' . $delta : '';
+
if (!isset($container[$key])) {
foreach (array_keys(alpha_theme_trail($theme)) as $item) {
if (class_exists($item . '_theme_container')) {
diff --git a/alpha/template.php b/alpha/template.php
index a175fee..a329c9a 100644
--- a/alpha/template.php
+++ b/alpha/template.php
@@ -155,12 +155,14 @@ function alpha_page_alter(&$vars) {
$vars[$region]['#region'] = $region;
$vars[$region]['#theme_wrappers'] = array('region');
}
-
- $vars[$region] = array('alpha_debug_' . $region => array(
- '#type' => 'markup',
- '#markup' => '<div class="alpha-debug-block"><h2>' . $item['name'] . '</h2><p>' . t('This is a debugging block') . '</p></div>',
- '#weight' => -999,
- )) + $vars[$region];
+
+ if (isset($vars[$region]['#theme_wrappers']) && array_search('region', $vars[$region]['#theme_wrappers']) !== FALSE) {
+ $vars[$region] = array('alpha_debug_' . $region => array(
+ '#type' => 'markup',
+ '#markup' => '<div class="alpha-debug-block"><h2>' . $item['name'] . '</h2><p>' . t('This is a debugging block') . '</p></div>',
+ '#weight' => -999,
+ )) + $vars[$region];
+ }
}
}
}
@@ -280,7 +282,7 @@ function template_preprocess_zone(&$vars) {
/**
* Implements hook_preprocess_block().
*/
-function alpha_preprocess_block(&$vars) {
+function alpha_alpha_preprocess_block(&$vars) {
$vars['content_attributes_array']['class'][] = 'content';
$vars['content_attributes_array']['class'][] = 'clearfix';
$vars['attributes_array']['id'] = $vars['block_html_id'];
@@ -291,7 +293,7 @@ function alpha_preprocess_block(&$vars) {
/**
* Implements hook_preprocess_html().
*/
-function alpha_preprocess_html(&$vars) {
+function alpha_alpha_preprocess_html(&$vars) {
$theme = alpha_get_theme();
foreach (array('two-sidebars', 'one-sidebar sidebar-first', 'one-sidebar sidebar-second', 'no-sidebars') as $exclude) {
@@ -339,7 +341,7 @@ function alpha_preprocess_html(&$vars) {
/**
* Implements hook_preprocess_page().
*/
-function alpha_preprocess_page(&$vars) {
+function alpha_alpha_preprocess_page(&$vars) {
$theme = alpha_get_theme();
$theme->page = &$vars;
@@ -357,7 +359,7 @@ function alpha_preprocess_page(&$vars) {
/**
* Implements hook_preprocess_region().
*/
-function alpha_preprocess_region(&$vars) {
+function alpha_alpha_preprocess_region(&$vars) {
$vars['attributes_array']['id'] = drupal_html_id('region-' . $vars['region']);
$vars['content_attributes_array']['class'][] = 'region-inner';
$vars['content_attributes_array']['class'][] = $vars['attributes_array']['id'] . '-inner';
@@ -366,7 +368,7 @@ function alpha_preprocess_region(&$vars) {
/**
* Implements hook_process_page().
*/
-function alpha_process_page(&$vars) {
+function alpha_alpha_process_page(&$vars) {
$theme = alpha_get_theme();
$vars['title'] = $theme->settings['toggle']['page_title'] ? $vars['title'] : NULL;
diff --git a/alpha/theme-settings.php b/alpha/theme-settings.php
index 05c8eac..78658db 100644
--- a/alpha/theme-settings.php
+++ b/alpha/theme-settings.php
@@ -99,7 +99,7 @@ function alpha_theme_settings_form_validate($form, &$form_state) {
* @todo
*/
function alpha_theme_settings_form_submit($form, &$form_state) {
- alpha_cache_clear($form_state['theme'], (isset($form_state['delta']) ? $form_state['delta']->machine_name : NULL));
+ alpha_cache_clear($form_state['theme'], (isset($form_state['delta']) ? $form_state['delta'] : NULL));
}
/**
diff --git a/omega/template.php b/omega/template.php
index d4e0748..c2e60ee 100644
--- a/omega/template.php
+++ b/omega/template.php
@@ -25,7 +25,7 @@ function omega_alpha_zones_alter(&$zones, $theme) {
/**
* Implements hook_preprocess_html().
*/
-function omega_preprocess_html(&$vars) {
+function omega_alpha_preprocess_html(&$vars) {
$theme = alpha_get_theme();
$vars['rdf'] = new stdClass;
@@ -66,7 +66,7 @@ function omega_preprocess_html(&$vars) {
/**
* Implements hook_preprocess_comment().
*/
-function omega_preprocess_comment(&$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';
@@ -81,7 +81,7 @@ function omega_preprocess_comment(&$vars) {
/**
* Implements hook_preprocess_zone().
*/
-function omega_preprocess_zone(&$vars) {
+function omega_alpha_preprocess_zone(&$vars) {
if (alpha_library_active('omega_equalheights')) {
if (!empty($vars['elements']['#data']['equal_height_container'])) {
$vars['content_attributes_array']['class'][] = 'equal-height-container';
@@ -92,7 +92,7 @@ function omega_preprocess_zone(&$vars) {
/**
* Implements hook_preprocess_region().
*/
-function omega_preprocess_region(&$vars) {
+function omega_alpha_preprocess_region(&$vars) {
if (alpha_library_active('omega_equalheights')) {
if (!empty($vars['elements']['#data']['equal_height_container'])) {
$vars['content_attributes_array']['class'][] = 'equal-height-container';
@@ -107,7 +107,7 @@ function omega_preprocess_region(&$vars) {
/**
* Implements hook_preprocess_node().
*/
-function omega_preprocess_node(&$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']);
@@ -150,7 +150,7 @@ function omega_preprocess_node(&$vars) {
/**
* Implements hook_process_region().
*/
-function omega_process_region(&$vars) {
+function omega_alpha_process_region(&$vars) {
if (in_array($vars['elements']['#region'], array('content', 'menu', 'branding'))) {
$theme = alpha_get_theme();
@@ -186,7 +186,7 @@ function omega_process_region(&$vars) {
/**
* Implements hook_process_zone().
*/
-function omega_process_zone(&$vars) {
+function omega_alpha_process_zone(&$vars) {
$theme = alpha_get_theme();
if ($vars['elements']['#zone'] == 'content') {
@@ -198,7 +198,7 @@ function omega_process_zone(&$vars) {
/**
* Implements hook_preprocess_block().
*/
-function omega_preprocess_block(&$vars) {
+function omega_alpha_preprocess_block(&$vars) {
$theme = alpha_get_theme();
// Adding a class to the title attributes