You are here

function author_pane_get_preprocess in Author Pane 5

Get a list of preprocess functions for a given hook.

Parameters

$hook: A theme hook that need preprocessing.

Return value

An array or preprocessor function.

1 call to author_pane_get_preprocess()
author_pane_call_preprocess in ./d6_compat.inc
Call preprocess functions for a theme hook.

File

./d6_compat.inc, line 37

Code

function author_pane_get_preprocess($hook) {
  static $registry;
  if (!isset($registry)) {
    global $theme;

    // Check the theme registry cache; if it exists, use it.
    $cache = cache_get("author_pane_registry:{$theme}", 'cache');
    if (isset($cache->data) && $cache->data) {
      $registry = unserialize($cache->data);
    }
    else {

      // We'll build it below.
      $registry = array();
    }
  }

  // If we don't have registry or don't have an entry, build one and cache it.
  // This will build the registry as needed so unused functions won't be polluting it.
  if (empty($registry) || !isset($registry[$hook])) {
    global $theme;
    $registry[$hook] = _author_pane_build_preprocess($hook);
    cache_set("author_pane_registry:{$theme}", 'cache', serialize($registry));
  }
  return $registry[$hook];
}