You are here

function skinr_panels_theme_registry_alter in Skinr 8.2

Same name and namespace in other branches
  1. 7.2 skinr_panels/skinr_panels.module \skinr_panels_theme_registry_alter()

Implements hook_theme_registry_alter().

Re-order preprocess functions to prioritize skinr_ui_preprocess, which adds contextual links, over template_preprocess_HOOK functions. This fixes a problem with the way panels handles contextual links.

File

skinr_panels/skinr_panels.module, line 29
Provides Skinr integration with Panels.

Code

function skinr_panels_theme_registry_alter(&$theme_registry) {
  $preprocess_functions = array();
  foreach ($theme_registry['panels_pane']['preprocess functions'] as $function) {
    if ($function == 'skinr_ui_preprocess' || $function == 'skinr_panels_preprocess') {
      continue;
    }
    $preprocess_functions[] = $function;
    if ($function == 'template_preprocess') {

      // Insert our preprocess function right after template_preprocess to give it priority over template_preprocess_HOOK functions.
      $preprocess_functions[] = 'skinr_panels_preprocess';
      $preprocess_functions[] = 'skinr_ui_preprocess';
    }
  }
  $theme_registry['panels_pane']['preprocess functions'] = $preprocess_functions;

  // Add a preprocess function to theme_links(). This is a total hack.
  $theme_registry['links']['preprocess functions'][] = 'skinr_panels_preprocess_links';
}