// 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);
}
}
}
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')) {
$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];
+ }
}
}
}
/**
* 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'];
/**
* 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) {
/**
* Implements hook_preprocess_page().
*/
-function alpha_preprocess_page(&$vars) {
+function alpha_alpha_preprocess_page(&$vars) {
$theme = alpha_get_theme();
$theme->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';
/**
* 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;
* @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));
}
/**
/**
* Implements hook_preprocess_html().
*/
-function omega_preprocess_html(&$vars) {
+function omega_alpha_preprocess_html(&$vars) {
$theme = alpha_get_theme();
$vars['rdf'] = new stdClass;
/**
* 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';
/**
* 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';
/**
* 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';
/**
* 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']);
/**
* 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();
/**
* Implements hook_process_zone().
*/
-function omega_process_zone(&$vars) {
+function omega_alpha_process_zone(&$vars) {
$theme = alpha_get_theme();
if ($vars['elements']['#zone'] == 'content') {
/**
* 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