-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.module
110 lines (102 loc) · 3.73 KB
/
bootstrap.module
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
/**
* @file
* Integrate Drupal with Twitter Bootstrap.
*/
/**
* Implements hook_library().
*/
function bootstrap_library() {
$path = libraries_get_path('bootstrap');
$libraries['bootstrap'] = array(
'title' => 'Bootstrap, from Twitter',
'website' => 'http://twitter.github.com/bootstrap/',
'version' => '2.0.4',
'js' => array(
$path . '/js/bootstrap.min.js' => array(
'group' => JS_LIBRARY,
'weight' => 2,
),
),
'css' => array(
$path . '/css/bootstrap.min.css' => array(
'group' => CSS_SYSTEM,
'weight' => 2,
),
),
);
$libraries['bootstrap-responsive'] = array(
'title' => 'Bootstrap Responsive',
'website' => 'http://twitter.github.com/bootstrap/',
'version' => '2.0.4',
'css' => array(
$path . '/css/bootstrap-responsive.min.css' => array(
'group' => CSS_SYSTEM,
'weight' => 2,
),
),
);
return $libraries;
}
/**
* Implements hook_init().
*/
function bootstrap_init() {
drupal_add_library('bootstrap', 'bootstrap');
drupal_add_library('bootstrap', 'bootstrap-responsive');
}
/**
* Implements hook_css_alter().
*/
function bootstrap_css_alter(&$css) {
#unset($css[drupal_get_path('module', 'system') . '/admin.css']);
unset($css[drupal_get_path('module', 'system') . '/defaults.css']);
#unset($css[drupal_get_path('module', 'system') . '/system.admin.css']);
#unset($css[drupal_get_path('module', 'system') . '/system.base.css']);
#unset($css[drupal_get_path('module', 'system') . '/system.css']);
unset($css[drupal_get_path('module', 'system') . '/system.menus.css']);
unset($css[drupal_get_path('module', 'system') . '/system.messages.css']);
unset($css[drupal_get_path('module', 'system') . '/system.theme.css']);
}
/**
* Implements hook_js_alter().
*/
function bootstrap_js_alter(&$javascript) {
unset($javascript['misc/textarea.js']);
}
/**
* Implements hook_theme_registry_alter().
*/
function bootstrap_theme_registry_alter(&$theme_registry) {
// includes/theme.inc
if (isset($theme_registry['status_messages'])) {
$theme_registry['status_messages']['function'] = 'theme_bootstrap_status_messages';
$theme_registry['status_messages']['includes'] = array(drupal_get_path('module', 'bootstrap') . '/includes/theme.inc');
}
if (isset($theme_registry['breadcrumb'])) {
$theme_registry['breadcrumb']['function'] = 'theme_bootstrap_breadcrumb';
$theme_registry['breadcrumb']['includes'] = array(drupal_get_path('module', 'bootstrap') . '/includes/theme.inc');
}
// includes/pager.inc
if (isset($theme_registry['pager'])) {
$theme_registry['pager']['function'] = 'theme_bootstrap_pager';
$theme_registry['pager']['includes'] = array(drupal_get_path('module', 'bootstrap') . '/includes/pager.inc');
}
// includes/form.inc
if (isset($theme_registry['button'])) {
$theme_registry['button']['function'] = 'theme_bootstrap_button';
$theme_registry['button']['includes'] = array(drupal_get_path('module', 'bootstrap') . '/includes/form.inc');
}
if (isset($theme_registry['textfield'])) {
$theme_registry['textfield']['function'] = 'theme_bootstrap_textfield';
$theme_registry['textfield']['includes'] = array(drupal_get_path('module', 'bootstrap') . '/includes/form.inc');
}
if (isset($theme_registry['textarea'])) {
$theme_registry['textarea']['function'] = 'theme_bootstrap_textarea';
$theme_registry['textarea']['includes'] = array(drupal_get_path('module', 'bootstrap') . '/includes/form.inc');
}
if (isset($theme_registry['form_element'])) {
$theme_registry['form_element']['function'] = 'theme_bootstrap_form_element';
$theme_registry['form_element']['includes'] = array(drupal_get_path('module', 'bootstrap') . '/includes/form.inc');
}
}