forked from drupal-bootstrap/drupal-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.php
executable file
·71 lines (66 loc) · 2.42 KB
/
template.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
/**
* @file
* template.php
*
* This file should only contain light helper functions and stubs pointing to
* other files containing more complex functions.
*
* The stubs should point to files within the `theme` folder named after the
* function itself minus the theme prefix. If the stub contains a group of
* functions, then please organize them so they are related in some way and name
* the file appropriately to at least hint at what it contains.
*
* All [pre]process functions, theme functions and template implementations also
* live in the 'theme' folder. This is a highly automated and complex system
* designed to only load the necessary files when a given theme hook is invoked.
* @see _bootstrap_theme()
* @see ./includes/registry.inc
*
* Due to a bug in Drush, these includes must live inside the 'theme' folder
* instead of something like 'includes'. If a module or theme has an 'includes'
* folder, Drush will think it is trying to bootstrap core when it is invoked
* from inside the particular extension's directory.
* @see https://drupal.org/node/2102287
*/
/**
* Include common functions used through out theme.
*/
include_once dirname(__FILE__) . '/includes/common.inc';
/**
* Include any deprecated functions.
*/
bootstrap_include('bootstrap', 'includes/deprecated.inc');
/**
* Implements hook_theme().
*
* Register theme hook implementations.
*
* The implementations declared by this hook have two purposes: either they
* specify how a particular render array is to be rendered as HTML (this is
* usually the case if the theme function is assigned to the render array's
* #theme property), or they return the HTML that should be returned by an
* invocation of theme().
*
* @see _bootstrap_theme()
*/
function bootstrap_theme(&$existing, $type, $theme, $path) {
bootstrap_include($theme, 'includes/registry.inc');
return _bootstrap_theme($existing, $type, $theme, $path);
}
/**
* Clear any previously set element_info() static cache.
*
* If element_info() was invoked before the theme was fully initialized, this
* can cause the theme's alter hook to not be invoked.
*
* @see https://www.drupal.org/node/2351731
*/
drupal_static_reset('element_info');
/**
* Declare various hook_*_alter() hooks.
*
* hook_*_alter() implementations must live (via include) inside this file so
* they are properly detected when drupal_alter() is invoked.
*/
bootstrap_include('bootstrap', 'includes/alter.inc');