root / drupal7 / sites / all / themes / bootstrap / template.php @ edccd837
1 | 87dbc3bf | Benjamin Luce | <?php
|
---|---|---|---|
2 | /**
|
||
3 | * @file
|
||
4 | caf16a48 | Assos Assos | * The primary PHP file for the Drupal Bootstrap base theme.
|
5 | 87dbc3bf | Benjamin Luce | *
|
6 | caf16a48 | Assos Assos | * This file should only contain light helper functions and point to stubs in
|
7 | 87dbc3bf | Benjamin Luce | * other files containing more complex functions.
|
8 | *
|
||
9 | caf16a48 | Assos Assos | * The stubs should point to files within the `./includes` folder named after
|
10 | * the function itself minus the theme prefix. If the stub contains a group of
|
||
11 | 87dbc3bf | Benjamin Luce | * functions, then please organize them so they are related in some way and name
|
12 | * the file appropriately to at least hint at what it contains.
|
||
13 | *
|
||
14 | caf16a48 | Assos Assos | * All [pre]process functions, theme functions and template files lives inside
|
15 | * the `./templates` folder. This is a highly automated and complex system
|
||
16 | 87dbc3bf | Benjamin Luce | * designed to only load the necessary files when a given theme hook is invoked.
|
17 | *
|
||
18 | caf16a48 | Assos Assos | * Visit this project's official documentation site, http://drupal-bootstrap.org
|
19 | * or the markdown files inside the `./docs` folder.
|
||
20 | *
|
||
21 | * @see _bootstrap_theme()
|
||
22 | 87dbc3bf | Benjamin Luce | */
|
23 | |||
24 | /**
|
||
25 | * Include common functions used through out theme.
|
||
26 | */
|
||
27 | caf16a48 | Assos Assos | include_once dirname(__FILE__) . '/includes/common.inc'; |
28 | |||
29 | /**
|
||
30 | * Include any deprecated functions.
|
||
31 | */
|
||
32 | bootstrap_include('bootstrap', 'includes/deprecated.inc'); |
||
33 | 87dbc3bf | Benjamin Luce | |
34 | /**
|
||
35 | * Implements hook_theme().
|
||
36 | *
|
||
37 | * Register theme hook implementations.
|
||
38 | *
|
||
39 | * The implementations declared by this hook have two purposes: either they
|
||
40 | * specify how a particular render array is to be rendered as HTML (this is
|
||
41 | * usually the case if the theme function is assigned to the render array's
|
||
42 | * #theme property), or they return the HTML that should be returned by an
|
||
43 | * invocation of theme().
|
||
44 | *
|
||
45 | * @see _bootstrap_theme()
|
||
46 | */
|
||
47 | function bootstrap_theme(&$existing, $type, $theme, $path) { |
||
48 | caf16a48 | Assos Assos | bootstrap_include($theme, 'includes/registry.inc'); |
49 | 87dbc3bf | Benjamin Luce | return _bootstrap_theme($existing, $type, $theme, $path); |
50 | } |
||
51 | |||
52 | caf16a48 | Assos Assos | /**
|
53 | * Clear any previously set element_info() static cache.
|
||
54 | *
|
||
55 | * If element_info() was invoked before the theme was fully initialized, this
|
||
56 | * can cause the theme's alter hook to not be invoked.
|
||
57 | *
|
||
58 | * @see https://www.drupal.org/node/2351731
|
||
59 | */
|
||
60 | drupal_static_reset('element_info');
|
||
61 | |||
62 | 87dbc3bf | Benjamin Luce | /**
|
63 | * Declare various hook_*_alter() hooks.
|
||
64 | *
|
||
65 | * hook_*_alter() implementations must live (via include) inside this file so
|
||
66 | * they are properly detected when drupal_alter() is invoked.
|
||
67 | */
|
||
68 | caf16a48 | Assos Assos | bootstrap_include('bootstrap', 'includes/alter.inc'); |