Projet

Général

Profil

Paste
Télécharger (4,85 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / module_filter / module_filter.admin.inc @ 7d7b5830

1
<?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
  $form['module_filter_set_focus'] = array(
18
    '#type' => 'checkbox',
19
    '#title' => t('Set focus to filter field on page load'),
20
    '#description' => t('Currently has no effect when using Overlay module.'),
21
    '#default_value' => variable_get('module_filter_set_focus', 1),
22
  );
23

    
24
  $form['module_filter_tabs'] = array(
25
    '#type' => 'checkbox',
26
    '#title' => t('Enhance the modules page with tabs'),
27
    '#description' => t('Alternate tabbed theme that restructures packages into tabs.'),
28
    '#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
    '#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
    '#default_value' => variable_get('module_filter_visual_aid', 1)
48
  );
49
  $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
  $form['tabs']['module_filter_dynamic_save_position'] = array(
56
    '#type' => 'checkbox',
57
    '#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
  );
85

    
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
  return system_settings_form($form);
104
}