2
2
/**
3
3
* @file
4
4
* Preprocess and Process Functions.
5
- *
6
- * 1. Rename each function and instance of "adaptivetheme_subtheme" to match
7
- * your subthemes name, e.g. if your theme name is "footheme" then the
8
- * function name will be "footheme_preprocess_hook". Tip - you can
9
- * search/replace on "adaptivetheme_subtheme".
10
- * 2. Uncomment the required function to use.
11
- * 3. Read carefully, especially within adaptivetheme_subtheme_preprocess_html()
12
- * , there are extra goodies you might want to leverage such as a very simple
13
- * way of adding stylesheets for Internet Explorer and a browser detection
14
- * script to add body classes.
15
- *
16
- * @see http://drupal.org/node/254940#variables-processor
17
5
*/
18
6
19
- global $ theme_key , $ path_to_ddbasic_core ;
20
- $ theme_key = $ GLOBALS ['theme_key ' ];
21
- $ path_to_ddbasic_core = drupal_get_path ('theme ' , 'ddbasic ' );
22
-
23
7
// Includes frequently used theme functions that gets theme info, css files etc.
24
- include_once $ path_to_ddbasic_core . '/inc/functions.inc ' ;
25
-
8
+ include_once $ GLOBALS ['theme_path ' ] . '/inc/functions.inc ' ;
26
9
27
10
/**
28
11
* Implements hook_preprocess_html().
29
12
*/
30
13
function ddbasic_preprocess_html (&$ vars ) {
31
- global $ theme_key , $ language ;
32
- $ theme_name = $ theme_key ;
14
+ $ language = $ GLOBALS ['language ' ];
33
15
34
16
// Setup iOS logo if it's set.
35
17
$ vars ['ios_logo ' ] = theme_get_setting ('iosicon_upload ' );
@@ -40,10 +22,6 @@ function ddbasic_preprocess_html(&$vars) {
40
22
// Clean up the lang attributes.
41
23
$ vars ['html_attributes ' ] = 'lang=" ' . $ language ->language . '" dir=" ' . $ language ->dir . '" ' ;
42
24
43
- // Build an array of poly-filling scripts.
44
- $ vars ['polyfills_array ' ] = '' ;
45
- $ vars ['polyfills_array ' ] = ddbasic_load_polyfills ($ theme_name , $ vars );
46
-
47
25
// Load ddbasic plugins.
48
26
ddbasic_load_plugins ();
49
27
@@ -70,13 +48,16 @@ function ddbasic_preprocess_html(&$vars) {
70
48
));
71
49
}
72
50
73
-
74
51
/**
75
52
* Implements hook_process_html().
76
53
*
77
54
* Process variables for html.tpl.php
78
55
*/
79
56
function ddbasic_process_html (&$ vars ) {
57
+ $ theme_name = $ GLOBALS ['theme_key ' ];
58
+ // Build an array of poly-filling scripts.
59
+ $ vars ['polyfills_array ' ] = '' ;
60
+ $ vars ['polyfills_array ' ] = ddbasic_load_polyfills ($ theme_name , $ vars );
80
61
// This code is copied from Adaptive Theme, at_core/inc/process.inc.
81
62
// It wraps the required polyfills scripts into a conditional comment.
82
63
if (!empty ($ vars ['polyfills_array ' ])) {
@@ -667,7 +648,7 @@ function ddbasic_remove_default_link_classes($classes) {
667
648
* Ex. add a javascript depending on the settings in the theme.
668
649
*/
669
650
function ddbasic_load_plugins () {
670
- global $ path_to_ddbasic_core ;
651
+ $ path_to_ddbasic_core = $ GLOBALS [ ' theme_path ' ] ;
671
652
672
653
// If sticky menus is enabled in the theme load it.
673
654
if (theme_get_setting ('main_menu_sticky ' )) {
@@ -749,7 +730,7 @@ function ddbasic_theme_conditional_scripts($ie_scripts) {
749
730
* @param string $theme_name : Name of the theme.
750
731
*/
751
732
function ddbasic_load_polyfills ($ theme_name ) {
752
- global $ path_to_ddbasic_core ;
733
+ $ path_to_ddbasic_core = $ GLOBALS [ ' theme_path ' ] ;
753
734
754
735
// Get the info file data.
755
736
$ info = ddbasic_get_info ($ theme_name );
@@ -806,7 +787,7 @@ function ddbasic_load_polyfills($theme_name) {
806
787
* Array of ?.
807
788
*/
808
789
function ddbasic_polly_wants_a_cracker ($ polly ) {
809
- global $ path_to_ddbasic_core ;
790
+ $ path_to_ddbasic_core = $ GLOBALS [ ' theme_path ' ] ;
810
791
811
792
$ baked_crackers = drupal_static (__FUNCTION__ , array ());
812
793
if (empty ($ baked_crackers )) {
0 commit comments