Created
November 1, 2011 14:20
-
-
Save perifer/1330608 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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