module_filter.admin.inc 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?php
  2. /**
  3. * @file
  4. *
  5. * @author greenSkin
  6. */
  7. /*******************************************************************************
  8. * Callback Functions, Forms, and Tables
  9. ******************************************************************************/
  10. /**
  11. * Settings form for module filter.
  12. */
  13. function module_filter_settings() {
  14. $form['module_filter_set_focus'] = array(
  15. '#type' => 'checkbox',
  16. '#title' => t('Set focus to filter field on page load'),
  17. '#description' => t('Currently has no effect when using Overlay module.'),
  18. '#default_value' => variable_get('module_filter_set_focus', 1),
  19. );
  20. $form['module_filter_tabs'] = array(
  21. '#type' => 'checkbox',
  22. '#title' => t('Enhance the modules page with tabs'),
  23. '#description' => t('Alternate tabbed theme that restructures packages into tabs.'),
  24. '#default_value' => variable_get('module_filter_tabs', 1),
  25. );
  26. $form['tabs'] = array(
  27. '#type' => 'fieldset',
  28. '#title' => t('Tabs'),
  29. '#description' => t('Settings used with the tabs view of the modules page.'),
  30. '#collapsible' => TRUE,
  31. '#collapsed' => FALSE,
  32. );
  33. $form['tabs']['module_filter_count_enabled'] = array(
  34. '#type' => 'checkbox',
  35. '#title' => t('Number of enabled modules'),
  36. '#description' => t('Display the number of enabled modules in the active tab along with the total number of modules.'),
  37. '#default_value' => variable_get('module_filter_count_enabled', 1),
  38. );
  39. $form['tabs']['module_filter_visual_aid'] = array(
  40. '#type' => 'checkbox',
  41. '#title' => t('Visual aids'),
  42. '#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.'),
  43. '#default_value' => variable_get('module_filter_visual_aid', 1),
  44. );
  45. $form['tabs']['module_filter_hide_empty_tabs'] = array(
  46. '#type' => 'checkbox',
  47. '#title' => t('Hide tabs with no results'),
  48. '#description' => t('When a filter returns no results for a tab, the tab is hidden. This is dependent on visual aids being enabled.'),
  49. '#default_value' => variable_get('module_filter_hide_empty_tabs', 0),
  50. );
  51. $form['tabs']['module_filter_dynamic_save_position'] = array(
  52. '#type' => 'checkbox',
  53. '#title' => t('Dynamically position Save button'),
  54. '#description' => t("For sites with lots of tabs, enable to help keep the 'Save configuration' button more accessible."),
  55. '#default_value' => variable_get('module_filter_dynamic_save_position', 1),
  56. );
  57. $form['tabs']['module_filter_use_url_fragment'] = array(
  58. '#type' => 'checkbox',
  59. '#title' => t('Use URL fragment'),
  60. '#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.'),
  61. '#default_value' => variable_get('module_filter_use_url_fragment', 1),
  62. );
  63. $form['tabs']['module_filter_use_switch'] = array(
  64. '#type' => 'checkbox',
  65. '#title' => t('Use switch instead of checkbox'),
  66. '#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>'),
  67. '#default_value' => variable_get('module_filter_use_switch', 1),
  68. );
  69. $form['tabs']['module_filter_track_recent_modules'] = array(
  70. '#type' => 'checkbox',
  71. '#title' => t('Track recently enabled/disabled modules'),
  72. '#description' => t('Adds a "Recent" tab that displays modules that have been enabled or disabled with the last week.'),
  73. '#default_value' => variable_get('module_filter_track_recent_modules', 1),
  74. );
  75. $form['tabs']['module_filter_remember_active_tab'] = array(
  76. '#type' => 'checkbox',
  77. '#title' => t('Remember active tab.'),
  78. '#description' => t('When enabled, the active tab will be remembered.'),
  79. '#default_value' => variable_get('module_filter_remember_active_tab', 1),
  80. );
  81. $form['tabs']['module_filter_version_column'] = array(
  82. '#type' => 'checkbox',
  83. '#title' => t('Place version in own column'),
  84. '#description' => t("Moves the version out of the description and into it's own column"),
  85. '#default_value' => variable_get('module_filter_version_column', 0),
  86. );
  87. $form['tabs']['module_filter_expanded_description'] = array(
  88. '#type' => 'checkbox',
  89. '#title' => t('Expand description by default'),
  90. '#description' => t('When enabled, the description will be expanded by default.'),
  91. '#default_value' => variable_get('module_filter_expanded_description', 0),
  92. );
  93. $form['update'] = array(
  94. '#type' => 'fieldset',
  95. '#title' => t('Update status'),
  96. '#collapsible' => TRUE,
  97. '#collapsed' => (module_exists('update')) ? FALSE : TRUE,
  98. );
  99. $form['update']['module_filter_remember_update_state'] = array(
  100. '#type' => 'checkbox',
  101. '#title' => t('Remember the last selected filter.'),
  102. '#description' => t('When enabled, the last state (All, Update available, Security update, Unknown) will be remembered.'),
  103. '#default_value' => variable_get('module_filter_remember_update_state', 0),
  104. );
  105. if (module_exists('page_actions')) {
  106. $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')));
  107. }
  108. return system_settings_form($form);
  109. }