- Patch #778880 by Steven Merrill: add static caching to color.module.
parent
8cb52e47c1
commit
43c86c4e6f
|
@ -115,10 +115,17 @@ function _color_page_alter(&$vars) {
|
||||||
* Retrieve the color.module info for a particular theme.
|
* Retrieve the color.module info for a particular theme.
|
||||||
*/
|
*/
|
||||||
function color_get_info($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);
|
$path = drupal_get_path('theme', $theme);
|
||||||
$file = DRUPAL_ROOT . '/' . $path . '/color/color.inc';
|
$file = DRUPAL_ROOT . '/' . $path . '/color/color.inc';
|
||||||
if ($path && file_exists($file)) {
|
if ($path && file_exists($file)) {
|
||||||
include $file;
|
include $file;
|
||||||
|
$theme_info[$theme] = $info;
|
||||||
return $info;
|
return $info;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue