- Patch #778880 by Steven Merrill: add static caching to color.module.

merge-requests/26/head
Dries Buytaert 2010-04-22 23:25:32 +00:00
parent 8cb52e47c1
commit 43c86c4e6f
1 changed files with 7 additions and 0 deletions

View File

@ -115,10 +115,17 @@ function _color_page_alter(&$vars) {
* Retrieve the color.module info for a particular theme.
*/
function color_get_info($theme) {
static $theme_info = array();
if (isset($theme_info[$theme])) {
return $theme_info[$theme];
}
$path = drupal_get_path('theme', $theme);
$file = DRUPAL_ROOT . '/' . $path . '/color/color.inc';
if ($path && file_exists($file)) {
include $file;
$theme_info[$theme] = $info;
return $info;
}
}