Projet

Général

Profil

Paste
Télécharger (14,5 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / themes / adaptivetheme / at_core / inc / forms / settings.modifyoutput.inc @ a08833bd

1
<?php
2

    
3
/**
4
 * @file
5
 * Generate form elments for the Modify Output settings.
6
 */
7
function at_core_modify_output_form(&$form) {
8
  $form['at']['modify-output'] = array(
9
    '#type' => 'fieldset',
10
    '#title' => t('Markup Overrides'),
11
    '#weight' => 40,
12
  );
13

    
14
  // Design
15
  $form['at']['modify-output']['design'] = array(
16
    '#type' => 'fieldset',
17
    '#title' => t('Design'),
18
    '#description' => t('<h3>Design</h3>'),
19
  );
20
  // Adjust gutter width
21
  $form['at']['modify-output']['design']['global_gutter_width'] = array(
22
    '#type' => 'textfield',
23
    '#title' => t('Set gutter width:'),
24
    '#size' => 2,
25
    '#maxlength' => 2,
26
    '#field_suffix' => 'px',
27
    '#description' => t('Gutters are set using margin-left and margin-right. This will override the default 10px margins set in <code>global.page.css</code>.'),
28
    '#default_value' => check_plain(at_get_setting('global_gutter_width')),
29
  );
30
  // Use the page full width wrappers template
31
  $form['at']['modify-output']['design']['page_full_width_wrappers'] = array(
32
    '#type' => 'checkbox',
33
    '#title' => t('Use page--full-width-wrappers.tpl.php by default'),
34
    '#description' => t('This setting will load a page template will full width DIV wrappers - perfect for designs with 100% width sections, header or footer. Note that if you choose to use other page template suggestions you should use copies of page--full-width-wrappers.tpl.php, you will find this in adaptivetheme/at-core/templates.'),
35
    '#default_value' => at_get_setting('page_full_width_wrappers'),
36
  );
37
  // Add page-[content-type] suggestions, all suggestions carry a performance
38
  // overhead, so allow the user to choose this rather than doing to by default
39
  $form['at']['modify-output']['design']['page_content_type_suggestions'] = array(
40
    '#type' => 'checkbox',
41
    '#title' => t('Enable page--[content-type].tpl.php suggestions'),
42
    '#description' => t('If the node type is "blog" the template suggestion will be "page--blog.tpl.php". The content type suggestions are weak and can be overridden by single page--node.tpl.php template or standard page--node-[nid] templates.'),
43
    '#default_value' => at_get_setting('page_content_type_suggestions'),
44
  );
45
  // Add spans to theme_links
46
  $form['at']['modify-output']['design']['menu_item_span_elements'] = array(
47
    '#type' => 'checkbox',
48
    '#title' => t('Wrap menu item text in SPAN tags - useful for certain theme or design related techniques'),
49
    '#description' => t('Note: this does not work for <a href="!link" target="_blank">Superfish menus</a>, which includes its own feature for doing this.', array('!link' => 'http://drupal.org/project/superfish')),
50
    '#default_value' => at_get_setting('menu_item_span_elements'),
51
  );
52

    
53
  // Breadcrumb settings
54
  $form['at']['modify-output']['breadcrumb'] = array(
55
    '#type' => 'fieldset',
56
    '#title' => t('Breadcrumbs'),
57
    '#description' => t('<h3>Breadcrumb Settings</h3>'),
58
  );
59
  $form['at']['modify-output']['breadcrumb']['wrapper'] = array(
60
    '#type' => 'fieldset',
61
    '#title' => t('Breadcrumbs'),
62
  );
63
  // Display?
64
  $form['at']['modify-output']['breadcrumb']['wrapper']['breadcrumb_display'] = array(
65
    '#type' => 'checkbox',
66
    '#title' => t('Show breadcrumbs'),
67
    '#default_value' => at_get_setting('breadcrumb_display'),
68
  );
69
  // Home link?
70
  $form['at']['modify-output']['breadcrumb']['wrapper']['breadcrumb_home'] = array(
71
    '#type' => 'checkbox',
72
    '#title' => t('Show the homepage link'),
73
    '#default_value' => at_get_setting('breadcrumb_home'),
74
    '#states' => array(
75
      'visible' => array('input[name="breadcrumb_display"]' => array('checked' => TRUE)),
76
    ),
77
  );
78
  // Label?
79
  $form['at']['modify-output']['breadcrumb']['wrapper']['breadcrumb_label'] = array(
80
    '#type' => 'checkbox',
81
    '#title' => t('Show the "You are here" label'),
82
    '#default_value' => at_get_setting('breadcrumb_label'),
83
    '#states' => array(
84
      'visible' => array('input[name="breadcrumb_display"]' => array('checked' => TRUE)),
85
    ),
86
  );
87
  // Page title?
88
  $form['at']['modify-output']['breadcrumb']['wrapper']['breadcrumb_title'] = array(
89
    '#type' => 'checkbox',
90
    '#title' => t('Append the page title to the breadcrumb trail'),
91
    '#default_value' => at_get_setting('breadcrumb_title'),
92
    '#states' => array(
93
      'visible' => array('input[name="breadcrumb_display"]' => array('checked' => TRUE)),
94
    ),
95
  );
96
  // Seperator
97
  $form['at']['modify-output']['breadcrumb']['wrapper']['breadcrumb_separator'] = array(
98
    '#type'  => 'textfield',
99
    '#title' => t('Separator'),
100
    '#description' => t('Text, basic markup and html entities only. Dont forget to include spaces.'),
101
    '#default_value' => filter_xss_admin(at_get_setting('breadcrumb_separator')),
102
    '#size' => 25,
103
    '#maxlength' => 60,
104
    '#states' => array(
105
      'visible' => array('input[name="breadcrumb_display"]' => array('checked' => TRUE)),
106
    ),
107
  );
108

    
109
  // Login block options. There is also a slide-down block option, but I have never added it.
110
  if (at_get_setting('horizontal_login_block_enable') === 'on') {
111
    $form['at']['modify-output']['login-block'] = array(
112
      '#type' => 'fieldset',
113
      '#title' => t('Login Block'),
114
      '#description' => t('<h3>Login Block Options</h3>'),
115
    );
116
    // Login block links
117
    $form['at']['modify-output']['login-block']['login_block_remove_links'] = array(
118
      '#type' => 'checkbox',
119
      '#title' => t('Remove links'),
120
      '#default_value' => at_get_setting('login_block_remove_links'),
121
      '#description' => t('Remove the <em>Create new account</em> and <em>Request new password</em> links from the login block.'),
122
    );
123
    // Login block OpenID
124
    $form['at']['modify-output']['login-block']['login_block_remove_openid'] = array(
125
      '#type' => 'checkbox',
126
      '#title' => t('Remove OpenID elements'),
127
      '#default_value' => at_get_setting('login_block_remove_openid'),
128
      '#description' => t('Remove the OpenID links and form elements from the login block.'),
129
    );
130
    // Horizontal login block
131
    $form['at']['modify-output']['login-block']['horizontal_login_block'] = array(
132
      '#type' => 'checkbox',
133
      '#title' => t('Horizontal login block'),
134
      '#default_value' => at_get_setting('horizontal_login_block'),
135
      '#description' => t('Enable a horizontal style login block (all elements on one line). This does not work so well with OpenID and you should probably check the setting to remove OpendID elements.'),
136
    );
137
  }
138

    
139
  // User block
140
  $form['at']['modify-output']['user_block'] = array(
141
    '#type' => 'fieldset',
142
    '#title' => t('User block'),
143
    '#description' => t('<h3>User block</h3>'),
144
  );
145
  // Use extra fieldsets in advanced serach form
146
  $form['at']['modify-output']['user_block']['user_block_user_name'] = array(
147
    '#type' => 'checkbox',
148
    '#title' => t('Use the "user name" as the User menu block title.'),
149
    '#default_value' => at_get_setting('user_block_user_name'),
150
    '#description' => t('This will override the block title setting (in block configuration) and use the users "user name" as the block title for the "User menu" block.'),
151
  );
152

    
153
  // Hide or Remove
154
  $form['at']['modify-output']['hide-remove'] = array(
155
    '#type' => 'fieldset',
156
    '#title' => t('Hide or Remove'),
157
    '#description' => t('<h3>Hide or Remove</h3>'),
158
  );
159
  // Hide front page title
160
  $form['at']['modify-output']['hide-remove']['frontpage_remove_title'] = array(
161
    '#type' => 'checkbox',
162
    '#title' => t('Remove the frontpage title'),
163
    '#default_value' => at_get_setting('frontpage_remove_title'),
164
    '#description' => t('Checking this setting will remove the page title from the front page, for example if you set a node to be the front page content you may want to hide the title.'),
165
  );
166
  // Unset block system main front
167
  $form['at']['modify-output']['hide-remove']['unset_block_system_main_front'] = array(
168
    '#type' => 'checkbox',
169
    '#title' => t('Do not display the Main content block on the front page'),
170
    '#default_value' => at_get_setting('unset_block_system_main_front'),
171
    '#description' => t('Checking this setting will remove the Main content block from the front page only - useful for removing the welcome message and allowing use of another block.'),
172
  );
173
  // Hide RSS icons
174
  $form['at']['modify-output']['hide-remove']['feed_icons_hide'] = array(
175
    '#type' => 'checkbox',
176
    '#title' => t('Remove RSS feed icons'),
177
    '#default_value' => at_get_setting('feed_icons_hide'),
178
    '#description' => t('Checking this setting will remove RSS feed icons. This will not affect the Syndicate block icon.'),
179
  );
180
  // Hide comment title
181
  $form['at']['modify-output']['hide-remove']['comments_hide_title'] = array(
182
    '#type' => 'checkbox',
183
    '#title' => t('Hide comment titles'),
184
    '#default_value' => at_get_setting('comments_hide_title'),
185
    '#description' => t('Checking this setting will hide comment titles using element-invisible. Hiding rather than removing titles maintains accessibility and semantic structure while not showing titles to sighted users.'),
186
  );
187
  // Remove menu link titles
188
  $form['at']['modify-output']['hide-remove']['unset_menu_titles'] = array(
189
    '#type' => 'checkbox',
190
    '#title' => t('Remove menu link titles'),
191
    '#default_value' => at_get_setting('unset_menu_titles'),
192
    '#description' => t('Checking this setting will remove all menu link titles (tool tips). This only works for menu blocks.'),
193
  );
194
  // Remove local tasks
195
  $form['at']['modify-output']['hide-remove']['unset_local_tasks'] = array(
196
    '#type' => 'checkbox',
197
    '#title' => t('Remove primary and secondary local tasks'),
198
    '#default_value' => at_get_setting('unset_local_tasks'),
199
    '#description' => t('Checking this setting will globally remove all local task tabs. You will need to rely on contextual links or an adminstration type menu that can render local tasks, such as Admin menu.'),
200
  );
201

    
202
  // Accessibility
203
  $form['at']['modify-output']['a11y'] = array(
204
    '#type' => 'fieldset',
205
    '#title' => t('Accessibility'),
206
    '#description' => t('<h3>Accessibility</h3>'),
207
  );
208
  // Use extra fieldsets in advanced serach form
209
  $form['at']['modify-output']['a11y']['adv_search_extra_fieldsets'] = array(
210
    '#type' => 'checkbox',
211
    '#title' => t('Use extra fieldset wrappers in the advanced search form'),
212
    '#default_value' => at_get_setting('adv_search_extra_fieldsets'),
213
    '#description' => t('The problem with Drupals standard Advanced search form is that each criterion group is wrapped in a DIV, whereas it should use fieldsets. Turning this on may cause issues with modules that modify the search form such as Search Config.'),
214
  );
215
  // Skip link target
216
  $form['at']['modify-output']['a11y']['skip_link_target'] = array(
217
    '#type' => 'textfield',
218
    '#title' => t('Skip to navigation target ID'),
219
    '#description' => t('If your main content is not in the Main Content region you can change the skip link target ID to match.'),
220
    '#default_value' => check_plain(at_get_setting('skip_link_target')),
221
  );
222

    
223
  // SEO/Authorship
224
  $form['at']['modify-output']['seo'] = array(
225
    '#type' => 'fieldset',
226
    '#title' => t('SEO'),
227
    '#description' => t('<h3>SEO</h3>'),
228
  );
229
  // Use extra fieldsets in advanced serach form
230
  $form['at']['modify-output']['seo']['rel_author'] = array(
231
    '#type' => 'checkbox',
232
    '#title' => t('Add rel=author to user names.'),
233
    '#default_value' => at_get_setting('rel_author'),
234
    '#description' => t('Add rel author to user names to support Googles <a href="!authorhship" target="_blank">Authorship</a> feature.', array('!authorhship' => 'http://support.google.com/webmasters/bin/answer.py?hl=en&answer=1408986')),
235
  );
236
  // Change Logo title
237
  $form['at']['modify-output']['seo']['logo_title'] = array(
238
    '#type' => 'checkbox',
239
    '#title' => t('Use the Site Name for the logo title (tool tip).'),
240
    '#default_value' => at_get_setting('logo_title'),
241
    '#description' => t('By default the text "Home page" is used for the tool tip. This option overrides this with the site name.'),
242
  );
243

    
244
  // Extra CSS Classes
245
  $form['at']['modify-output']['extra-classes'] = array(
246
    '#type' => 'fieldset',
247
    '#title' => t('Extra Classes'),
248
    '#description' => t('<h3>Extra CSS Classes</h3>'),
249
  );
250
  // Page
251
  $form['at']['modify-output']['extra-classes']['extra_page_classes'] = array(
252
    '#type' => 'checkbox',
253
    '#title' => t('Page classes'),
254
    '#description' => t('page-path, add/edit/delete (for workflow states), content type classes, section classes, site name class (useful for multisites) and a language class (i18n)'),
255
    '#default_value' => at_get_setting('extra_page_classes'),
256
  );
257
  // Node
258
  $form['at']['modify-output']['extra-classes']['extra_article_classes'] = array(
259
    '#type' => 'checkbox',
260
    '#title' => t('Node classes'),
261
    '#description' => t('promoted, sticky, preview, language, odd/even classes, user picture handling, and build mode classes'),
262
    '#default_value' => at_get_setting('extra_article_classes'),
263
  );
264
  // Comment
265
  $form['at']['modify-output']['extra-classes']['extra_comment_classes'] = array(
266
    '#type' => 'checkbox',
267
    '#title' => t('Comment classes'),
268
    '#description' => t('anonymous, author, viewer, new, odd/even classes and classes for hidden titles, user picture and signature handling'),
269
    '#default_value' => at_get_setting('extra_comment_classes'),
270
  );
271
  // Block
272
  $form['at']['modify-output']['extra-classes']['extra_block_classes'] = array(
273
    '#type' => 'checkbox',
274
    '#title' => t('Blocks classes'),
275
    '#description' => t('odd/even (zebra classes), block region, delta and block count classes'),
276
    '#default_value' => at_get_setting('extra_block_classes'),
277
  );
278
  // Menu
279
  $form['at']['modify-output']['extra-classes']['extra_menu_classes'] = array(
280
    '#type' => 'checkbox',
281
    '#title' => t('Menus classes'),
282
    '#description' =>  t('menu link ID (mlid) and menu level (depth)'),
283
    '#default_value' => at_get_setting('extra_menu_classes'),
284
  );
285
  // Item lists
286
  $form['at']['modify-output']['extra-classes']['extra_item_list_classes'] = array(
287
    '#type' => 'checkbox',
288
    '#title' => t('Item-lists classes'),
289
    '#description' => t('first, last and odd/even (zebra classes)'),
290
    '#default_value' => at_get_setting('extra_item_list_classes'),
291
  );
292

    
293
  // Attribution
294
  $form['at']['modify-output']['attribution'] = array(
295
    '#type' => 'fieldset',
296
    '#title' => t('Attribution'),
297
    '#description' => t('<h3>Attribution</h3>'),
298
  );
299
  $form['at']['modify-output']['attribution']['attribution_toggle'] = array(
300
    '#type' => 'checkbox',
301
    '#title' => t('Show attribution message'),
302
    '#description' => t('Displays a message and link for Adaptivethemes.com'),
303
    '#default_value' => at_get_setting('attribution_toggle'),
304
  );
305
}