-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy paththeme-settings.php
79 lines (64 loc) · 3.67 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
<?php
// $Id$
// Include the definition of zen_theme_get_default_settings().
include_once './' . drupal_get_path('theme', 'SimplyCivi') . '/template.theme-registry.inc';
/**
* Implementation of THEMEHOOK_settings() function.
*
* @param $saved_settings
* An array of saved settings for this theme.
* @param $subtheme_defaults
* Allow a subtheme to override the default values.
* @return
* A form array.
*/
function SimplyCivi_settings($saved_settings, $subtheme_defaults = array()) {
/*
* The default values for the theme variables. Make sure $defaults exactly
* matches the $defaults in the template.php file.
*/
// Add CSS to adjust the layout on the settings page
drupal_add_css(drupal_get_path('theme', 'SimplyCivi') . '/css/theme-settings.css', 'theme');
// Add Javascript to adjust the layout on the settings page
// drupal_add_js(drupal_get_path('theme', 'SimplyCivi') . '/css/theme-settings.js', 'theme');
// Get the default values from the .info file.
$defaults = SimplyCivi_theme_get_default_settings('SimplyCivi');
// Allow a subtheme to override the default values.
$defaults = array_merge($defaults, $subtheme_defaults);
// Merge the saved variables and their default values.
$settings = array_merge($defaults, $saved_settings);
$form['SimplyCivi_dev'] = array(
'#type' => 'fieldset',
'#title' => t('Development Settings'),
'#weight' => 5,
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
// Setting for flush all caches
$form['SimplyCivi_dev']['SimplyCivi_rebuild_registry'] = array(
'#type' => 'checkbox',
'#title' => t('Rebuild the theme registry on every page.'),
'#default_value' => $settings['SimplyCivi_rebuild_registry'],
'#description' => t('During theme development, it can be very useful to continuously <a href="!link">rebuild the theme registry</a>. WARNING: this is a huge performance penalty and must be turned off on production websites.', array('!link' => 'http://drupal.org/node/173880#theme-registry')),
);
$form['SimplyCivi_animated_submit'] = array(
'#type' => 'checkbox',
'#title' => t('Prevent Duplicate Submits'),
'#default_value' => $settings['SimplyCivi_animated_submit'],
'#description' => t('This can be helpful to prevent users from hitting the submit button twice, however the autocomplete can interfere with this and cause it not to work. <a href="!link">More Information</a>', array('!link' => 'http://drupal.org/node/579070')),
);
$form['SimplyCivi_import_htmlmailings'] = array(
'#type' => 'checkbox',
'#title' => t('CiviCRM Import HTML page function'),
'#default_value' => $settings['SimplyCivi_import_htmlmailings'],
'#description' => t('Adds the ability to import a full HTML page directly into the CiviCRM HTML mailing form. This is an experimental feature and does not do anything intelligent - it will load scripts and all kinds of bad stuff if you enter a bad URL, so only load URLs of pages that are <em>specifically made for HTML emails</a> (e.g. no: javascript, relative-paths for images, advanced CSS, etc..)'),
);
$form['SimplyCivi_block_edit_links'] = array(
'#type' => 'checkbox',
'#title' => t('Show block edit and configure links for those with appropriate permissions'),
'#default_value' => $settings['SimplyCivi_block_edit_links'],
'#description' => t('This setting will display links to configure blocks, edit blocks, or modify the menus for block menus for users with the appropriate permissions. When enabled the links may obscure small blocks like the New User block.'),
);
// Return the additional form widgets
return $form;
}