1 |
85ad3d82
|
Assos Assos
|
<?php
|
2 |
|
|
|
3 |
|
|
/**
|
4 |
|
|
* @file
|
5 |
|
|
*
|
6 |
|
|
* @author greenSkin
|
7 |
|
|
*/
|
8 |
|
|
|
9 |
|
|
/*******************************************************************************
|
10 |
|
|
* Callback Functions, Forms, and Tables
|
11 |
|
|
******************************************************************************/
|
12 |
|
|
|
13 |
|
|
/**
|
14 |
|
|
* Settings form for module filter.
|
15 |
|
|
*/
|
16 |
|
|
function module_filter_settings() {
|
17 |
8a7e43dd
|
Florent Torregrosa
|
$form['module_filter_set_focus'] = array(
|
18 |
|
|
'#type' => 'checkbox',
|
19 |
|
|
'#title' => t('Set focus to filter field on page load'),
|
20 |
7d7b5830
|
Assos Assos
|
'#description' => t('Currently has no effect when using Overlay module.'),
|
21 |
8a7e43dd
|
Florent Torregrosa
|
'#default_value' => variable_get('module_filter_set_focus', 1),
|
22 |
|
|
);
|
23 |
|
|
|
24 |
85ad3d82
|
Assos Assos
|
$form['module_filter_tabs'] = array(
|
25 |
|
|
'#type' => 'checkbox',
|
26 |
8a7e43dd
|
Florent Torregrosa
|
'#title' => t('Enhance the modules page with tabs'),
|
27 |
|
|
'#description' => t('Alternate tabbed theme that restructures packages into tabs.'),
|
28 |
85ad3d82
|
Assos Assos
|
'#default_value' => variable_get('module_filter_tabs', 1)
|
29 |
|
|
);
|
30 |
|
|
$form['tabs'] = array(
|
31 |
|
|
'#type' => 'fieldset',
|
32 |
|
|
'#title' => t('Tabs'),
|
33 |
|
|
'#description' => t('Settings used with the tabs view of the modules page.'),
|
34 |
|
|
'#collapsible' => TRUE,
|
35 |
|
|
'#collapsed' => FALSE
|
36 |
|
|
);
|
37 |
|
|
$form['tabs']['module_filter_count_enabled'] = array(
|
38 |
|
|
'#type' => 'checkbox',
|
39 |
|
|
'#title' => t('Number of enabled modules'),
|
40 |
|
|
'#description' => t('Display the number of enabled modules in the active tab along with the total number of modules.'),
|
41 |
|
|
'#default_value' => variable_get('module_filter_count_enabled', 1)
|
42 |
|
|
);
|
43 |
|
|
$form['tabs']['module_filter_visual_aid'] = array(
|
44 |
|
|
'#type' => 'checkbox',
|
45 |
8a7e43dd
|
Florent Torregrosa
|
'#title' => t('Visual aids'),
|
46 |
|
|
'#description' => t('When enabling/disabling modules, the module name will display in the tab summary.<br />When filtering, a count of results for each tab will be presented.'),
|
47 |
85ad3d82
|
Assos Assos
|
'#default_value' => variable_get('module_filter_visual_aid', 1)
|
48 |
|
|
);
|
49 |
8a7e43dd
|
Florent Torregrosa
|
$form['tabs']['module_filter_hide_empty_tabs'] = array(
|
50 |
|
|
'#type' => 'checkbox',
|
51 |
|
|
'#title' => t('Hide tabs with no results'),
|
52 |
|
|
'#description' => t('When a filter returns no results for a tab, the tab is hidden. This is dependent on visual aids being enabled.'),
|
53 |
|
|
'#default_value' => variable_get('module_filter_hide_empty_tabs', 0)
|
54 |
|
|
);
|
55 |
85ad3d82
|
Assos Assos
|
$form['tabs']['module_filter_dynamic_save_position'] = array(
|
56 |
|
|
'#type' => 'checkbox',
|
57 |
8a7e43dd
|
Florent Torregrosa
|
'#title' => t('Dynamically position Save button'),
|
58 |
|
|
'#description' => t("For sites with lots of tabs, enable to help keep the 'Save configuration' button more accessible."),
|
59 |
|
|
'#default_value' => variable_get('module_filter_dynamic_save_position', 1)
|
60 |
|
|
);
|
61 |
|
|
$form['tabs']['module_filter_use_url_fragment'] = array(
|
62 |
|
|
'#type' => 'checkbox',
|
63 |
|
|
'#title' => t('Use URL fragment'),
|
64 |
|
|
'#description' => t('Use URL fragment when navigating between tabs. This lets you use the browsers back/forward buttons to navigate through the tabs you selected.') . '<br />' . t('When the Overlay module is enabled this functionality will not be used since overlay relies on the URL fragment.'),
|
65 |
|
|
'#default_value' => variable_get('module_filter_use_url_fragment', 1)
|
66 |
|
|
);
|
67 |
|
|
$form['tabs']['module_filter_use_switch'] = array(
|
68 |
|
|
'#type' => 'checkbox',
|
69 |
|
|
'#title' => t('Use switch instead of checkbox'),
|
70 |
|
|
'#description' => t('This is purely cosmetic (at least for now). Displays a ON/OFF switch rather than a checkbox to enable/disable modules.<br /><strong>Modules will not actually be enabled/disabled until the form is saved.</strong>'),
|
71 |
|
|
'#default_value' => variable_get('module_filter_use_switch', 1),
|
72 |
|
|
);
|
73 |
|
|
$form['tabs']['module_filter_track_recent_modules'] = array(
|
74 |
|
|
'#type' => 'checkbox',
|
75 |
|
|
'#title' => t('Track recently enabled/disabled modules'),
|
76 |
|
|
'#description' => t('Adds a "Recent" tab that displays modules that have been enabled or disabled with the last week.'),
|
77 |
|
|
'#default_value' => variable_get('module_filter_track_recent_modules', 1),
|
78 |
|
|
);
|
79 |
|
|
$form['tabs']['module_filter_remember_active_tab'] = array(
|
80 |
|
|
'#type' => 'checkbox',
|
81 |
|
|
'#title' => t('Remember active tab.'),
|
82 |
|
|
'#description' => t('When enabled, the active tab will be remembered.'),
|
83 |
|
|
'#default_value' => variable_get('module_filter_remember_active_tab', 1),
|
84 |
85ad3d82
|
Assos Assos
|
);
|
85 |
8a7e43dd
|
Florent Torregrosa
|
|
86 |
|
|
$form['update'] = array(
|
87 |
|
|
'#type' => 'fieldset',
|
88 |
|
|
'#title' => t('Update status'),
|
89 |
|
|
'#collapsible' => TRUE,
|
90 |
|
|
'#collapsed' => (module_exists('update')) ? FALSE : TRUE,
|
91 |
|
|
);
|
92 |
|
|
$form['update']['module_filter_remember_update_state'] = array(
|
93 |
|
|
'#type' => 'checkbox',
|
94 |
|
|
'#title' => t('Remember the last selected filter.'),
|
95 |
|
|
'#description' => t('When enabled, the last state (All, Update available, Security update, Unknown) will be remembered.'),
|
96 |
|
|
'#default_value' => variable_get('module_filter_remember_update_state', 0),
|
97 |
|
|
);
|
98 |
|
|
|
99 |
|
|
if (module_exists('page_actions')) {
|
100 |
|
|
$form['tabs']['module_filter_dynamic_save_position']['#description'] .= '<br />' . t('The module %name is enabled and thus this setting will have no affect.', array('%name' => t('Page actions')));
|
101 |
|
|
}
|
102 |
|
|
|
103 |
85ad3d82
|
Assos Assos
|
return system_settings_form($form);
|
104 |
|
|
} |