root / drupal7 / modules / simpletest / tests / themes / test_theme / theme-settings.php @ cd5c298a
1 |
<?php
|
---|---|
2 |
|
3 |
/**
|
4 |
* @file
|
5 |
* Theme setting callbacks for the test_theme theme.
|
6 |
*/
|
7 |
|
8 |
/**
|
9 |
* Implements hook_form_FORM_ID_alter().
|
10 |
*/
|
11 |
function test_theme_form_system_theme_settings_alter(&$form, &$form_state) { |
12 |
$form['test_theme_checkbox'] = array( |
13 |
'#type' => 'checkbox', |
14 |
'#title' => 'Test theme checkbox', |
15 |
'#default_value' => theme_get_setting('test_theme_checkbox'), |
16 |
); |
17 |
|
18 |
// Force the form to be cached so we can test that this file is properly
|
19 |
// loaded and the custom submit handler is properly called even on a cached
|
20 |
// form build.
|
21 |
$form_state['cache'] = TRUE; |
22 |
$form['#submit'][] = 'test_theme_form_system_theme_settings_submit'; |
23 |
} |
24 |
|
25 |
/**
|
26 |
* Form submission handler for the test theme settings form.
|
27 |
*
|
28 |
* @see test_theme_form_system_theme_settings_alter()
|
29 |
*/
|
30 |
function test_theme_form_system_theme_settings_submit($form, &$form_state) { |
31 |
drupal_set_message('The test theme setting was saved.');
|
32 |
} |