Chris@0
|
1 <?php
|
Chris@0
|
2
|
Chris@0
|
3 namespace Drupal\Core\Theme;
|
Chris@0
|
4
|
Chris@0
|
5 use Drupal\Core\Extension\Extension;
|
Chris@0
|
6
|
Chris@0
|
7 /**
|
Chris@0
|
8 * Defines an interface which contain theme initialization logic.
|
Chris@0
|
9 */
|
Chris@0
|
10 interface ThemeInitializationInterface {
|
Chris@0
|
11
|
Chris@0
|
12 /**
|
Chris@0
|
13 * Initializes a given theme.
|
Chris@0
|
14 *
|
Chris@0
|
15 * This loads the active theme, for example include its engine file.
|
Chris@0
|
16 *
|
Chris@0
|
17 * @param string $theme_name
|
Chris@0
|
18 * The machine name of the theme.
|
Chris@0
|
19 *
|
Chris@0
|
20 * @return \Drupal\Core\Theme\ActiveTheme
|
Chris@0
|
21 * An active theme object instance for the given theme.
|
Chris@0
|
22 */
|
Chris@0
|
23 public function initTheme($theme_name);
|
Chris@0
|
24
|
Chris@0
|
25 /**
|
Chris@0
|
26 * Builds an active theme object.
|
Chris@0
|
27 *
|
Chris@0
|
28 * @param string $theme_name
|
Chris@0
|
29 * The machine name of the theme.
|
Chris@0
|
30 *
|
Chris@0
|
31 * @return \Drupal\Core\Theme\ActiveTheme
|
Chris@0
|
32 * An active theme object instance for the given theme.
|
Chris@0
|
33 *
|
Chris@0
|
34 * @throws \Drupal\Core\Theme\MissingThemeDependencyException
|
Chris@0
|
35 * Thrown when base theme for installed theme is not installed.
|
Chris@0
|
36 */
|
Chris@0
|
37 public function getActiveThemeByName($theme_name);
|
Chris@0
|
38
|
Chris@0
|
39 /**
|
Chris@0
|
40 * Loads a theme, so it is ready to be used.
|
Chris@0
|
41 *
|
Chris@0
|
42 * Loading a theme includes loading and initializing the engine,
|
Chris@0
|
43 * each base theme and its engines.
|
Chris@0
|
44 *
|
Chris@0
|
45 * @param \Drupal\Core\Theme\ActiveTheme $active_theme
|
Chris@0
|
46 * The theme to load.
|
Chris@0
|
47 */
|
Chris@0
|
48 public function loadActiveTheme(ActiveTheme $active_theme);
|
Chris@0
|
49
|
Chris@0
|
50 /**
|
Chris@0
|
51 * Builds up the active theme object from extensions.
|
Chris@0
|
52 *
|
Chris@0
|
53 * @param \Drupal\Core\Extension\Extension $theme
|
Chris@0
|
54 * The theme extension object.
|
Chris@0
|
55 * @param \Drupal\Core\Extension\Extension[] $base_themes
|
Chris@0
|
56 * An array of extension objects of base theme and its bases. It is ordered
|
Chris@0
|
57 * by 'next parent first', meaning the top level of the chain will be first.
|
Chris@0
|
58 *
|
Chris@0
|
59 * @return \Drupal\Core\Theme\ActiveTheme
|
Chris@0
|
60 * The active theme instance for the passed in $theme.
|
Chris@0
|
61 */
|
Chris@0
|
62 public function getActiveTheme(Extension $theme, array $base_themes = []);
|
Chris@0
|
63
|
Chris@0
|
64 }
|