-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththeme-settings.php
591 lines (569 loc) · 26.5 KB
/
theme-settings.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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
<?php
/**
* @file
* theme-settings.php
*
* Provides theme settings for Bootstrap based themes when admin theme is not.
*
* @see ./includes/settings.inc
*/
/**
* Include common Bootstrap functions.
*/
include_once dirname(__FILE__) . '/includes/common.inc';
bootstrap_include('bootstrap', 'includes/cdn.inc');
/**
* Implements hook_form_FORM_ID_alter().
*/
function bootstrap_form_system_theme_settings_alter(&$form, $form_state, $form_id = NULL) {
// Do not add Bootstrap specific settings to non-bootstrap based themes,
// including a work-around for a core bug affecting admin themes.
// @see https://drupal.org/node/943212
$theme = !empty($form_state['build_info']['args'][0]) ? $form_state['build_info']['args'][0] : FALSE;
if (isset($form_id) || $theme === FALSE || !in_array('bootstrap', _bootstrap_get_base_themes($theme, TRUE))) {
return;
}
// Display a warning if jquery_update isn't enabled.
if ((!module_exists('jquery_update') || !version_compare(variable_get('jquery_update_jquery_version', '1.10'), '1.9', '>=')) && !bootstrap_setting('toggle_jquery_error', $theme)) {
drupal_set_message(t('jQuery Update is not enabled, Bootstrap requires a minimum jQuery version of 1.9 or higher. Please enable the <a href="!jquery_update_project_url">jQuery Update</a> module @jquery_update_version or higher. If you are seeing this, then you must <a href="!jquery_update_configure">manually configuration</a> this setting or optionally <a href="!bootstrap_suppress_jquery_error">suppress this message</a> instead.', array(
'@jquery_update_version' => '7.x-2.5',
'!jquery_update_project_url' => 'https://www.drupal.org/project/jquery_update',
'!jquery_update_configure' => url('admin/config/development/jquery_update'),
'!bootstrap_suppress_jquery_error' => url('admin/appearance/settings/' . $theme, array(
'fragment' => 'edit-bootstrap-toggle-jquery-error',
)),
)), 'error', FALSE);
}
// Create vertical tabs for all Bootstrap related settings.
$form['bootstrap'] = array(
'#type' => 'vertical_tabs',
'#attached' => array(
'js' => array(drupal_get_path('theme', 'bootstrap') . '/js/bootstrap.admin.js'),
),
'#prefix' => '<h2><small>' . t('Bootstrap Settings') . '</small></h2>',
'#weight' => -10,
);
// General.
$form['general'] = array(
'#type' => 'fieldset',
'#title' => t('General'),
'#group' => 'bootstrap',
);
//Container
$form['general']['container'] = array(
'#type' => 'fieldset',
'#title' => t('Container'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['general']['container']['bootstrap_fluid_container'] = array(
'#type' => 'checkbox',
'#title' => t('Fluid container'),
'#default_value' => bootstrap_setting('fluid_container', $theme),
'#description' => t('Use <code>.container-fluid</code> class. See <a href="http://getbootstrap.com/css/#grid-example-fluid">Fluid container</a>'),
);
// Buttons.
$form['general']['buttons'] = array(
'#type' => 'fieldset',
'#title' => t('Buttons'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['general']['buttons']['bootstrap_button_size'] = array(
'#type' => 'select',
'#title' => t('Default button size'),
'#default_value' => bootstrap_setting('button_size', $theme),
'#empty_option' => t('Normal'),
'#options' => array(
'btn-xs' => t('Extra Small'),
'btn-sm' => t('Small'),
'btn-lg' => t('Large'),
),
);
$form['general']['buttons']['bootstrap_button_colorize'] = array(
'#type' => 'checkbox',
'#title' => t('Colorize Buttons'),
'#default_value' => bootstrap_setting('button_colorize', $theme),
'#description' => t('Adds classes to buttons based on their text value. See: <a href="!bootstrap_url" target="_blank">Buttons</a> and <a href="!api_url" target="_blank">hook_bootstrap_colorize_text_alter()</a>', array(
'!bootstrap_url' => 'http://getbootstrap.com/css/#buttons',
'!api_url' => 'http://drupalcode.org/project/bootstrap.git/blob/refs/heads/7.x-3.x:/bootstrap.api.php#l13',
)),
);
$form['general']['buttons']['bootstrap_button_iconize'] = array(
'#type' => 'checkbox',
'#title' => t('Iconize Buttons'),
'#default_value' => bootstrap_setting('button_iconize', $theme),
'#description' => t('Adds icons to buttons based on the text value. See: <a href="!api_url" target="_blank">hook_bootstrap_iconize_text_alter()</a>', array(
'!api_url' => 'http://drupalcode.org/project/bootstrap.git/blob/refs/heads/7.x-3.x:/bootstrap.api.php#l37',
)),
);
// Forms.
$form['general']['forms'] = array(
'#type' => 'fieldset',
'#title' => t('Forms'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['general']['forms']['bootstrap_forms_required_has_error'] = array(
'#type' => 'checkbox',
'#title' => t('Make required elements display as an error'),
'#default_value' => bootstrap_setting('forms_required_has_error', $theme),
'#description' => t('If an element in a form is required, enabling this will always display the element with a <code>.has-error</code> class. This turns the element red and helps in usability for determining which form elements are required to submit the form. This feature compliments the "JavaScript > Forms > Automatically remove error classes when values have been entered" feature.'),
);
$form['general']['forms']['bootstrap_forms_smart_descriptions'] = array(
'#type' => 'checkbox',
'#title' => t('Smart form descriptions (via Tooltips)'),
'#description' => t('Convert descriptions into tooltips (must be enabled) automatically based on certain criteria. This helps reduce the, sometimes unnecessary, amount of noise on a page full of form elements.'),
'#default_value' => bootstrap_setting('forms_smart_descriptions', $theme),
);
$form['general']['forms']['bootstrap_forms_smart_descriptions_limit'] = array(
'#type' => 'textfield',
'#title' => t('"Smart form descriptions" maximum character limit'),
'#description' => t('Prevents descriptions from becoming tooltips by checking the character length of the description (HTML is not counted towards this limit). To disable this filtering criteria, leave an empty value.'),
'#default_value' => bootstrap_setting('forms_smart_descriptions_limit', $theme),
'#states' => array(
'visible' => array(
':input[name="bootstrap_forms_smart_descriptions"]' => array('checked' => TRUE),
),
),
);
$form['general']['forms']['bootstrap_forms_smart_descriptions_allowed_tags'] = array(
'#type' => 'textfield',
'#title' => t('"Smart form descriptions" allowed (HTML) tags'),
'#description' => t('Prevents descriptions from becoming tooltips by checking for HTML not in the list above (i.e. links). Separate by commas. To disable this filtering criteria, leave an empty value.'),
'#default_value' => bootstrap_setting('forms_smart_descriptions_allowed_tags', $theme),
'#states' => array(
'visible' => array(
':input[name="bootstrap_forms_smart_descriptions"]' => array('checked' => TRUE),
),
),
);
// Images.
$form['general']['images'] = array(
'#type' => 'fieldset',
'#title' => t('Images'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['general']['images']['bootstrap_image_shape'] = array(
'#type' => 'select',
'#title' => t('Default image shape'),
'#description' => t('Add classes to an <code><img></code> element to easily style images in any project. Note: Internet Explorer 8 lacks support for rounded corners. See: <a href="!bootstrap_url" target="_blank">Image Shapes</a>', array(
'!bootstrap_url' => 'http://getbootstrap.com/css/#images-shapes',
)),
'#default_value' => bootstrap_setting('image_shape', $theme),
'#empty_option' => t('None'),
'#options' => array(
'img-rounded' => t('Rounded'),
'img-circle' => t('Circle'),
'img-thumbnail' => t('Thumbnail'),
),
);
$form['general']['images']['bootstrap_image_responsive'] = array(
'#type' => 'checkbox',
'#title' => t('Responsive Images'),
'#default_value' => bootstrap_setting('image_responsive', $theme),
'#description' => t('Images in Bootstrap 3 can be made responsive-friendly via the addition of the <code>.img-responsive</code> class. This applies <code>max-width: 100%;</code> and <code>height: auto;</code> to the image so that it scales nicely to the parent element.'),
);
// Tables.
$form['general']['tables'] = array(
'#type' => 'fieldset',
'#title' => t('Tables'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['general']['tables']['bootstrap_table_bordered'] = array(
'#type' => 'checkbox',
'#title' => t('Bordered table'),
'#default_value' => bootstrap_setting('table_bordered', $theme),
'#description' => t('Add borders on all sides of the table and cells.'),
);
$form['general']['tables']['bootstrap_table_condensed'] = array(
'#type' => 'checkbox',
'#title' => t('Condensed table'),
'#default_value' => bootstrap_setting('table_condensed', $theme),
'#description' => t('Make tables more compact by cutting cell padding in half.'),
);
$form['general']['tables']['bootstrap_table_hover'] = array(
'#type' => 'checkbox',
'#title' => t('Hover rows'),
'#default_value' => bootstrap_setting('table_hover', $theme),
'#description' => t('Enable a hover state on table rows.'),
);
$form['general']['tables']['bootstrap_table_striped'] = array(
'#type' => 'checkbox',
'#title' => t('Striped rows'),
'#default_value' => bootstrap_setting('table_striped', $theme),
'#description' => t('Add zebra-striping to any table row within the <code><tbody></code>. <strong>Note:</strong> Striped tables are styled via the <code>:nth-child</code> CSS selector, which is not available in Internet Explorer 8.'),
);
$form['general']['tables']['bootstrap_table_responsive'] = array(
'#type' => 'checkbox',
'#title' => t('Responsive tables'),
'#default_value' => bootstrap_setting('table_responsive', $theme),
'#description' => t('Makes tables responsive by wrapping them in <code>.table-responsive</code> to make them scroll horizontally up to small devices (under 768px). When viewing on anything larger than 768px wide, you will not see any difference in these tables.'),
);
// Components.
$form['components'] = array(
'#type' => 'fieldset',
'#title' => t('Components'),
'#group' => 'bootstrap',
);
// Breadcrumbs.
$form['components']['breadcrumbs'] = array(
'#type' => 'fieldset',
'#title' => t('Breadcrumbs'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['components']['breadcrumbs']['bootstrap_breadcrumb'] = array(
'#type' => 'select',
'#title' => t('Breadcrumb visibility'),
'#default_value' => bootstrap_setting('breadcrumb', $theme),
'#options' => array(
0 => t('Hidden'),
1 => t('Visible'),
2 => t('Only in admin areas'),
),
);
$form['components']['breadcrumbs']['bootstrap_breadcrumb_home'] = array(
'#type' => 'checkbox',
'#title' => t('Show "Home" breadcrumb link'),
'#default_value' => bootstrap_setting('breadcrumb_home', $theme),
'#description' => t('If your site has a module dedicated to handling breadcrumbs already, ensure this setting is enabled.'),
'#states' => array(
'invisible' => array(
':input[name="bootstrap_breadcrumb"]' => array('value' => 0),
),
),
);
$form['components']['breadcrumbs']['bootstrap_breadcrumb_title'] = array(
'#type' => 'checkbox',
'#title' => t('Show current page title at end'),
'#default_value' => bootstrap_setting('breadcrumb_title', $theme),
'#description' => t('If your site has a module dedicated to handling breadcrumbs already, ensure this setting is disabled.'),
'#states' => array(
'invisible' => array(
':input[name="bootstrap_breadcrumb"]' => array('value' => 0),
),
),
);
// Navbar.
$form['components']['navbar'] = array(
'#type' => 'fieldset',
'#title' => t('Navbar'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['components']['navbar']['bootstrap_navbar_position'] = array(
'#type' => 'select',
'#title' => t('Navbar Position'),
'#description' => t('Select your Navbar position.'),
'#default_value' => bootstrap_setting('navbar_position', $theme),
'#options' => array(
'static-top' => t('Static Top'),
'fixed-top' => t('Fixed Top'),
'fixed-bottom' => t('Fixed Bottom'),
),
'#empty_option' => t('Normal'),
);
$form['components']['navbar']['bootstrap_navbar_inverse'] = array(
'#type' => 'checkbox',
'#title' => t('Inverse navbar style'),
'#description' => t('Select if you want the inverse navbar style.'),
'#default_value' => bootstrap_setting('navbar_inverse', $theme),
);
// Region wells.
$wells = array(
'' => t('None'),
'well' => t('.well (normal)'),
'well well-sm' => t('.well-sm (small)'),
'well well-lg' => t('.well-lg (large)'),
);
$form['components']['region_wells'] = array(
'#type' => 'fieldset',
'#title' => t('Region wells'),
'#description' => t('Enable the <code>.well</code>, <code>.well-sm</code> or <code>.well-lg</code> classes for specified regions. See: documentation on !wells.', array(
'!wells' => l(t('Bootstrap Wells'), 'http://getbootstrap.com/components/#wells'),
)),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
// Get defined regions.
$regions = system_region_list($theme);
foreach ($regions as $name => $title) {
$form['components']['region_wells']['bootstrap_region_well-' . $name] = array(
'#title' => $title,
'#type' => 'select',
'#attributes' => array(
'class' => array('input-sm'),
),
'#options' => $wells,
'#default_value' => bootstrap_setting('region_well-' . $name, $theme),
);
}
// JavaScript settings.
$form['javascript'] = array(
'#type' => 'fieldset',
'#title' => t('JavaScript'),
'#group' => 'bootstrap',
);
// Anchors.
$form['javascript']['anchors'] = array(
'#type' => 'fieldset',
'#title' => t('Anchors'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['javascript']['anchors']['bootstrap_anchors_fix'] = array(
'#type' => 'checkbox',
'#title' => t('Fix anchor positions'),
'#default_value' => bootstrap_setting('anchors_fix', $theme),
'#description' => t('Ensures anchors are correctly positioned only when there is margin or padding detected on the BODY element. This is useful when fixed navbar or administration menus are used.'),
);
$form['javascript']['anchors']['bootstrap_anchors_smooth_scrolling'] = array(
'#type' => 'checkbox',
'#title' => t('Enable smooth scrolling'),
'#default_value' => bootstrap_setting('anchors_smooth_scrolling', $theme),
'#description' => t('Animates page by scrolling to an anchor link target smoothly when clicked.'),
'#states' => array(
'invisible' => array(
':input[name="bootstrap_anchors_fix"]' => array('checked' => FALSE),
),
),
);
// Forms.
$form['javascript']['forms'] = array(
'#type' => 'fieldset',
'#title' => t('Forms'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['javascript']['forms']['bootstrap_forms_has_error_value_toggle'] = array(
'#type' => 'checkbox',
'#title' => t('Automatically remove error classes when values have been entered'),
'#default_value' => bootstrap_setting('forms_has_error_value_toggle', $theme),
'#description' => t('If an element has a <code>.has-error</code> class attached to it, enabling this will automatically remove that class when a value is entered. This feature compliments the "General > Forms > Make required elements display as an error" feature.'),
);
// Popovers.
$form['javascript']['popovers'] = array(
'#type' => 'fieldset',
'#title' => t('Popovers'),
'#description' => t('Add small overlays of content, like those on the iPad, to any element for housing secondary information.'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['javascript']['popovers']['bootstrap_popover_enabled'] = array(
'#type' => 'checkbox',
'#title' => t('Enable popovers.'),
'#description' => t('Elements that have the !code attribute set will automatically initialize the popover upon page load. !warning', array(
'!code' => '<code>data-toggle="popover"</code>',
'!warning' => '<strong class="error text-error">WARNING: This feature can sometimes impact performance. Disable if pages appear to "hang" after initial load.</strong>',
)),
'#default_value' => bootstrap_setting('popover_enabled', $theme),
);
$form['javascript']['popovers']['options'] = array(
'#type' => 'fieldset',
'#title' => t('Options'),
'#description' => t('These are global options. Each popover can independently override desired settings by appending the option name to !data. Example: !data-animation.', array(
'!data' => '<code>data-</code>',
'!data-animation' => '<code>data-animation="false"</code>',
)),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#states' => array(
'visible' => array(
':input[name="bootstrap_popover_enabled"]' => array('checked' => TRUE),
),
),
);
$form['javascript']['popovers']['options']['bootstrap_popover_animation'] = array(
'#type' => 'checkbox',
'#title' => t('animate'),
'#description' => t('Apply a CSS fade transition to the popover.'),
'#default_value' => bootstrap_setting('popover_animation', $theme),
);
$form['javascript']['popovers']['options']['bootstrap_popover_html'] = array(
'#type' => 'checkbox',
'#title' => t('HTML'),
'#description' => t("Insert HTML into the popover. If false, jQuery's text method will be used to insert content into the DOM. Use text if you're worried about XSS attacks."),
'#default_value' => bootstrap_setting('popover_html', $theme),
);
$form['javascript']['popovers']['options']['bootstrap_popover_placement'] = array(
'#type' => 'select',
'#title' => t('placement'),
'#description' => t('Where to position the popover. When "auto" is specified, it will dynamically reorient the popover. For example, if placement is "auto left", the popover will display to the left when possible, otherwise it will display right.'),
'#default_value' => bootstrap_setting('popover_placement', $theme),
'#options' => drupal_map_assoc(array(
'top',
'bottom',
'left',
'right',
'auto',
'auto top',
'auto bottom',
'auto left',
'auto right',
)),
);
$form['javascript']['popovers']['options']['bootstrap_popover_selector'] = array(
'#type' => 'textfield',
'#title' => t('selector'),
'#description' => t('If a selector is provided, tooltip objects will be delegated to the specified targets. In practice, this is used to enable dynamic HTML content to have popovers added. See !this and !example.', array(
'!this' => l(t('this'), 'https://github.com/twbs/bootstrap/issues/4215'),
'!example' => l(t('an informative example'), 'http://jsfiddle.net/fScua/'),
)),
'#default_value' => bootstrap_setting('popover_selector', $theme),
);
$form['javascript']['popovers']['options']['bootstrap_popover_trigger'] = array(
'#type' => 'checkboxes',
'#title' => t('trigger'),
'#description' => t('How a popover is triggered.'),
'#default_value' => bootstrap_setting('popover_trigger', $theme),
'#options' => drupal_map_assoc(array(
'click',
'hover',
'focus',
'manual',
)),
);
$form['javascript']['popovers']['options']['bootstrap_popover_trigger_autoclose'] = array(
'#type' => 'checkbox',
'#title' => t('Auto-close on document click'),
'#description' => t('Will automatically close the current popover if a click occurs anywhere else other than the popover element.'),
'#default_value' => bootstrap_setting('popover_trigger_autoclose', $theme),
);
$form['javascript']['popovers']['options']['bootstrap_popover_title'] = array(
'#type' => 'textfield',
'#title' => t('title'),
'#description' => t("Default title value if \"title\" attribute isn't present."),
'#default_value' => bootstrap_setting('popover_title', $theme),
);
$form['javascript']['popovers']['options']['bootstrap_popover_content'] = array(
'#type' => 'textfield',
'#title' => t('content'),
'#description' => t('Default content value if "data-content" or "data-target" attributes are not present.'),
'#default_value' => bootstrap_setting('popover_content', $theme),
);
$form['javascript']['popovers']['options']['bootstrap_popover_delay'] = array(
'#type' => 'textfield',
'#title' => t('delay'),
'#description' => t('The amount of time to delay showing and hiding the popover (in milliseconds). Does not apply to manual trigger type.'),
'#default_value' => bootstrap_setting('popover_delay', $theme),
);
$form['javascript']['popovers']['options']['bootstrap_popover_container'] = array(
'#type' => 'textfield',
'#title' => t('container'),
'#description' => t('Appends the popover to a specific element. Example: "body". This option is particularly useful in that it allows you to position the popover in the flow of the document near the triggering element - which will prevent the popover from floating away from the triggering element during a window resize.'),
'#default_value' => bootstrap_setting('popover_container', $theme),
);
// Tooltips.
$form['javascript']['tooltips'] = array(
'#type' => 'fieldset',
'#title' => t('Tooltips'),
'#description' => t("Inspired by the excellent jQuery.tipsy plugin written by Jason Frame; Tooltips are an updated version, which don't rely on images, use CSS3 for animations, and data-attributes for local title storage. See !link for more documentation.", array(
'!link' => l(t('Bootstrap tooltips'), 'http://getbootstrap.com/javascript/#tooltips'),
)),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['javascript']['tooltips']['bootstrap_tooltip_enabled'] = array(
'#type' => 'checkbox',
'#title' => t('Enable tooltips'),
'#description' => t('Elements that have the !code attribute set will automatically initialize the tooltip upon page load. !warning', array(
'!code' => '<code>data-toggle="tooltip"</code>',
'!warning' => '<strong class="error text-error">WARNING: This feature can sometimes impact performance. Disable if pages appear to "hang" after initial load.</strong>',
)),
'#default_value' => bootstrap_setting('tooltip_enabled', $theme),
);
$form['javascript']['tooltips']['options'] = array(
'#type' => 'fieldset',
'#title' => t('Options'),
'#description' => t('These are global options. Each tooltip can independently override desired settings by appending the option name to !data. Example: !data-animation.', array(
'!data' => '<code>data-</code>',
'!data-animation' => '<code>data-animation="false"</code>',
)),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#states' => array(
'visible' => array(
':input[name="bootstrap_tooltip_enabled"]' => array('checked' => TRUE),
),
),
);
$form['javascript']['tooltips']['options']['bootstrap_tooltip_animation'] = array(
'#type' => 'checkbox',
'#title' => t('animate'),
'#description' => t('Apply a CSS fade transition to the tooltip.'),
'#default_value' => bootstrap_setting('tooltip_animation', $theme),
);
$form['javascript']['tooltips']['options']['bootstrap_tooltip_html'] = array(
'#type' => 'checkbox',
'#title' => t('HTML'),
'#description' => t("Insert HTML into the tooltip. If false, jQuery's text method will be used to insert content into the DOM. Use text if you're worried about XSS attacks."),
'#default_value' => bootstrap_setting('tooltip_html', $theme),
);
$form['javascript']['tooltips']['options']['bootstrap_tooltip_placement'] = array(
'#type' => 'select',
'#title' => t('placement'),
'#description' => t('Where to position the tooltip. When "auto" is specified, it will dynamically reorient the tooltip. For example, if placement is "auto left", the tooltip will display to the left when possible, otherwise it will display right.'),
'#default_value' => bootstrap_setting('tooltip_placement', $theme),
'#options' => drupal_map_assoc(array(
'top',
'bottom',
'left',
'right',
'auto',
'auto top',
'auto bottom',
'auto left',
'auto right',
)),
);
$form['javascript']['tooltips']['options']['bootstrap_tooltip_selector'] = array(
'#type' => 'textfield',
'#title' => t('selector'),
'#description' => t('If a selector is provided, tooltip objects will be delegated to the specified targets.'),
'#default_value' => bootstrap_setting('tooltip_selector', $theme),
);
$form['javascript']['tooltips']['options']['bootstrap_tooltip_trigger'] = array(
'#type' => 'checkboxes',
'#title' => t('trigger'),
'#description' => t('How a tooltip is triggered.'),
'#default_value' => bootstrap_setting('tooltip_trigger', $theme),
'#options' => drupal_map_assoc(array(
'click',
'hover',
'focus',
'manual',
)),
);
$form['javascript']['tooltips']['options']['bootstrap_tooltip_delay'] = array(
'#type' => 'textfield',
'#title' => t('delay'),
'#description' => t('The amount of time to delay showing and hiding the tooltip (in milliseconds). Does not apply to manual trigger type.'),
'#default_value' => bootstrap_setting('tooltip_delay', $theme),
);
$form['javascript']['tooltips']['options']['bootstrap_tooltip_container'] = array(
'#type' => 'textfield',
'#title' => t('container'),
'#description' => t('Appends the tooltip to a specific element. Example: "body"'),
'#default_value' => bootstrap_setting('tooltip_container', $theme),
);
// Advanced settings.
$form['advanced'] = array(
'#type' => 'fieldset',
'#title' => t('Advanced'),
'#group' => 'bootstrap',
);
// jQuery Update error suppression.
$form['advanced']['bootstrap_toggle_jquery_error'] = array(
'#type' => 'checkbox',
'#title' => t('Suppress jQuery version error message'),
'#default_value' => bootstrap_setting('toggle_jquery_error', $theme),
'#description' => t('Enable this if the version of jQuery has been upgraded to 1.9+ using a method other than the <a href="!jquery_update" target="_blank">jQuery Update</a> module.', array(
'!jquery_update' => 'https://drupal.org/project/jquery_update',
)),
);
// BootstrapCDN.
bootstrap_cdn_provider_settings_form($form, $form_state, $theme);
}