Newer
Older
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
/**
* Implementation of THEMEHOOK_settings() function.
*
* @param $saved_settings
* array An array of saved settings for this theme.
* @return
* array A form array.
*/
function phptemplate_settings($saved_settings) {
/**
* The default values for the theme variables. Make sure $defaults exactly
* matches the $defaults in the template.php file.
*/
$defaults = array(
'breadcrumb_display' => 0,
'user_notverified_display' => 1,
'front_page_title_display' => 'title_slogan',
'page_title_display_custom' => '',
'other_page_title_display' => 'ptitle_slogan',
'other_page_title_display_custom' => '',
'configurable_separator' => ' | ',
'meta_keywords' => '',
'meta_description' => '',
);
// Merge the saved variables and their default values
$settings = array_merge($defaults, $saved_settings);
// Create theme settings form widgets using Forms API
// Breadcrumb
$form['tnt_container']['general_settings']['breadcrumb'] = array(
'#type' => 'fieldset',
'#title' => t('Breadcrumb'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['tnt_container']['general_settings']['breadcrumb']['breadcrumb_display'] = array(
'#type' => 'checkbox',
'#title' => t('Display breadcrumb'),
'#default_value' => $settings['breadcrumb_display'],
);
// Username
$form['tnt_container']['general_settings']['username'] = array(
'#type' => 'fieldset',
'#title' => t('Username'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['tnt_container']['general_settings']['username']['user_notverified_display'] = array(
'#type' => 'checkbox',
'#title' => t('Display "not verified" for unregistered usernames'),
'#default_value' => $settings['user_notverified_display'],
);
// SEO settings
$form['tnt_container']['seo'] = array(
'#type' => 'fieldset',
'#title' => t('Search engine optimization (SEO) settings'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
// Page titles
$form['tnt_container']['seo']['page_format_titles'] = array(
'#type' => 'fieldset',
'#title' => t('Page titles'),
'#description' => t('This is the title that displays in the title bar of your web browser. Your site title, slogan, and mission can all be set on your Site Information page'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
// front page title
$form['tnt_container']['seo']['page_format_titles']['front_page_format_titles'] = array(
'#type' => 'fieldset',
'#title' => t('Front page title'),
'#description' => t('Your front page in particular should have important keywords for your site in the page title'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['tnt_container']['seo']['page_format_titles']['front_page_format_titles']['front_page_title_display'] = array(
'#type' => 'select',
'#title' => t('Set text of front page title'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
'#default_value' => $settings['front_page_title_display'],
'#options' => array(
'title_slogan' => t('Site title | Site slogan'),
'slogan_title' => t('Site slogan | Site title'),
'title_mission' => t('Site title | Site mission'),
'custom' => t('Custom (below)'),
),
);
$form['tnt_container']['seo']['page_format_titles']['front_page_format_titles']['page_title_display_custom'] = array(
'#type' => 'textfield',
'#title' => t('Custom'),
'#size' => 60,
'#default_value' => $settings['page_title_display_custom'],
'#description' => t('Enter a custom page title for your front page'),
);
// other pages title
$form['tnt_container']['seo']['page_format_titles']['other_page_format_titles'] = array(
'#type' => 'fieldset',
'#title' => t('Other page titles'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['tnt_container']['seo']['page_format_titles']['other_page_format_titles']['other_page_title_display'] = array(
'#type' => 'select',
'#title' => t('Set text of other page titles'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
'#default_value' => $settings['other_page_title_display'],
'#options' => array(
'ptitle_slogan' => t('Page title | Site slogan'),
'ptitle_stitle' => t('Page title | Site title'),
'ptitle_smission' => t('Page title | Site mission'),
'ptitle_custom' => t('Page title | Custom (below)'),
'custom' => t('Custom (below)'),
),
);
$form['tnt_container']['seo']['page_format_titles']['other_page_format_titles']['other_page_title_display_custom'] = array(
'#type' => 'textfield',
'#title' => t('Custom'),
'#size' => 60,
'#default_value' => $settings['other_page_title_display_custom'],
'#description' => t('Enter a custom page title for all other pages'),
);
// SEO configurable separator
$form['tnt_container']['seo']['page_format_titles']['configurable_separator'] = array(
'#type' => 'textfield',
'#title' => t('Title separator'),
'#description' => t('Customize the separator character used in the page title'),
'#size' => 60,
'#default_value' => $settings['configurable_separator'],
);
// Metadata
$form['tnt_container']['seo']['meta'] = array(
'#type' => 'fieldset',
'#title' => t('Meta tags'),
'#description' => t('Meta tags aren\'t used much by search engines anymore, but the meta description is important -- this is what will be shown as the description of your link in search engine results. NOTE: For more advanced meta tag functionality, check out the Meta Tags (aka. Node Words) module. These theme settings do not work in conjunction with this module and will not appear if you have it enabled.'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
if (module_exists('nodewords') == FALSE) {
$form['tnt_container']['seo']['meta']['meta_keywords'] = array(
'#type' => 'textfield',
'#title' => t('Meta keywords'),
'#description' => t('Enter a comma-separated list of keywords'),
'#size' => 60,
'#default_value' => $settings['meta_keywords'],
);
$form['tnt_container']['seo']['meta']['meta_description'] = array(
'#type' => 'textarea',
'#title' => t('Meta description'),
'#cols' => 60,
'#rows' => 6,
'#default_value' => $settings['meta_description'],
);
} else {
$form['tnt_container']['seo']['meta']['#description'] = 'NOTICE: You currently have the "nodewords" module installed and enabled, so the meta tag theme settings have been disabled to prevent conflicts. If you later wish to re-enable the meta tag theme settings, you must first disable the "nodewords" module.';
$form['tnt_container']['seo']['meta']['meta_keywords']['#disabled'] = 'disabled';
$form['tnt_container']['seo']['meta']['meta_description']['#disabled'] = 'disabled';
}
// Return theme settings form
return $form;
}