1
|
<?php
|
2
|
/**
|
3
|
* @file
|
4
|
* Admin page callbacks for the Language Icons module.
|
5
|
*/
|
6
|
|
7
|
/**
|
8
|
* Form builder; configure Language Icons.
|
9
|
*
|
10
|
* @todo Improve (re-phrase?) $form['show']['#description'].
|
11
|
*
|
12
|
* @ingroup forms
|
13
|
* @see system_settings_form()
|
14
|
*/
|
15
|
function languageicons_admin_settings() {
|
16
|
$form['show'] = array(
|
17
|
'#type' => 'fieldset',
|
18
|
'#title' => t('Add language icons'),
|
19
|
'#description' => t('Link types to add language icons.'),
|
20
|
'#collapsible' => TRUE,
|
21
|
'#collapsed' => TRUE,
|
22
|
);
|
23
|
$form['show']['languageicons_show_node'] = array(
|
24
|
'#type' => 'checkbox',
|
25
|
'#title' => t('Node links'),
|
26
|
'#default_value' => variable_get('languageicons_show_node', 1),
|
27
|
'#disabled' => TRUE,
|
28
|
);
|
29
|
$form['show']['languageicons_show_block'] = array(
|
30
|
'#type' => 'checkbox',
|
31
|
'#title' => t('Language switcher block'),
|
32
|
'#default_value' => variable_get('languageicons_show_block', 1),
|
33
|
'#disabled' => TRUE,
|
34
|
);
|
35
|
$form['show']['disabled'] = array(
|
36
|
'#prefix' => '<div class="messages error">',
|
37
|
'#markup' => t('These options are currently disabled due to <a href="!issue_url">a bug</a> that cannot currently be resolved. They may be reintroduced at a later stage.', array(
|
38
|
'!issue_url' => 'http://drupal.org/node/1005144',
|
39
|
)),
|
40
|
'#suffix' => '</div>',
|
41
|
);
|
42
|
$form['languageicons_placement'] = array(
|
43
|
'#type' => 'radios',
|
44
|
'#title' => t('Icon placement'),
|
45
|
'#options' => array(
|
46
|
'before' => t('Before link'),
|
47
|
'after' => t('After link'),
|
48
|
'replace' => t('Replace link'),
|
49
|
),
|
50
|
'#default_value' => variable_get('languageicons_placement', 'before'),
|
51
|
'#description' => t('Where to display the icon, relative to the link title.'),
|
52
|
);
|
53
|
$form['languageicons_path'] = array(
|
54
|
'#type' => 'textfield',
|
55
|
'#title' => t('Icons file path'),
|
56
|
'#default_value' => variable_get('languageicons_path', drupal_get_path('module', 'languageicons') . '/flags/*.png'),
|
57
|
'#size' => 70,
|
58
|
'#maxlength' => 180,
|
59
|
'#description' => t('Path for language icons, relative to Drupal installation. "*" is a placeholder for language code.'),
|
60
|
);
|
61
|
$form['languageicons_size'] = array(
|
62
|
'#type' => 'textfield',
|
63
|
'#title' => t('Image size'),
|
64
|
'#default_value' => variable_get('languageicons_size', '16x12'),
|
65
|
'#size' => 7,
|
66
|
'#maxlength' => 7,
|
67
|
'#description' => t('Image size for language icons, in the form "width x height".'),
|
68
|
);
|
69
|
|
70
|
return system_settings_form($form);
|
71
|
}
|