diff --git a/core/lib/Drupal/Core/Theme/Registry.php b/core/lib/Drupal/Core/Theme/Registry.php index dd2d0bc..ba7f433 100644 --- a/core/lib/Drupal/Core/Theme/Registry.php +++ b/core/lib/Drupal/Core/Theme/Registry.php @@ -32,7 +32,7 @@ class Registry implements DestructableInterface { * * @var array */ - protected $base_themes; + protected $baseThemes; /** * The name of the theme engine of $theme. @@ -109,7 +109,7 @@ class Registry implements DestructableInterface { /** - * Constructs a new theme registry instance. + * Constructs a \Drupal\Core\\Theme\Registry object. * * @param \Drupal\Core\Cache\CacheBackendInterface $cache * The cache backend interface to use for the complete theme registry data. @@ -125,7 +125,10 @@ public function __construct(CacheBackendInterface $cache, ModuleHandlerInterface } /** - * DIE. + * Initializes a theme with a certain name. + * + * This function does to much magic, so it should be replaced by another + * services which holds the current active theme information. * * @param string $theme_name * (optional) The name of the theme for which to construct the registry. @@ -174,7 +177,7 @@ protected function init($theme_name = NULL) { drupal_theme_initialize(); } $this->theme = $GLOBALS['theme_info']; - $this->base_themes = $GLOBALS['base_theme_info']; + $this->baseThemes = $GLOBALS['base_theme_info']; $this->engine = $GLOBALS['theme_engine']; } // Instead of the global theme, a specific theme was requested. @@ -184,23 +187,23 @@ protected function init($theme_name = NULL) { $this->theme = $themes[$theme_name]; // Find all base themes. - $this->base_themes = array(); + $this->baseThemes = array(); $ancestor = $theme_name; while ($ancestor && isset($themes[$ancestor]->base_theme)) { $ancestor = $themes[$ancestor]->base_theme; - $this->base_themes[] = $themes[$ancestor]; + $this->baseThemes[] = $themes[$ancestor]; if (!empty($themes[$ancestor]->owner)) { include_once DRUPAL_ROOT . '/' . $themes[$ancestor]->owner; } } - $this->base_themes = array_reverse($this->base_themes); + $this->baseThemes = array_reverse($this->baseThemes); // @see _drupal_theme_initialize() if (isset($this->theme->engine)) { $this->engine = $this->theme->engine; include_once DRUPAL_ROOT . '/' . $this->theme->owner; if (function_exists($this->theme->engine . '_init')) { - foreach ($this->base_themes as $base) { + foreach ($this->baseThemes as $base) { call_user_func($this->theme->engine . '_init', $base); } call_user_func($this->theme->engine . '_init', $this->theme); @@ -306,7 +309,7 @@ protected function build() { } // Process each base theme. - foreach ($this->base_themes as $base) { + foreach ($this->baseThemes as $base) { // If the base theme uses a theme engine, process its hooks. $base_path = dirname($base->uri); if ($this->engine) {