Skip to content

Instantly share code, notes, and snippets.

@perifer
Created November 1, 2011 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perifer/1330608 to your computer and use it in GitHub Desktop.
Save perifer/1330608 to your computer and use it in GitHub Desktop.
<?php
/**
* Implementation of hook_preprocess().
*/
function manniskohjalp_preprocess(&$vars, $hook) {
// Static variable used for passing data from preprocess functions,
// e.g from preprocess-view to preprocess-page.
$manniskohjalp_shared = &drupal_static(__FUNCTION__, array());
$vars['manniskohjalp_shared'] = $manniskohjalp_shared;
// Dynamic preprocess file split-up
$hook = str_replace('_', '-', $hook);
$path = drupal_get_path('theme', 'manniskohjalp') . '/preprocess/';
$file = $path . 'preprocess-' . $hook . '.inc';
if (file_exists($file)) {
include($file);
}
$manniskohjalp_shared = $vars['manniskohjalp_shared'];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment