module_filter.module

Tracking 6.x-1.x branch
  1. drupal
    1. 6 contributions/module_filter/module_filter.module

This is the file description for Module Filter module.

In this more verbose, multi-line description, you can specify what this file does exactly. Make sure to wrap your documentation in column 78 so that the file can be displayed nicely in default-sized consoles.

@author greenSkin

Functions & methods

NameDescription
module_filter_form_system_modules_alterImplementation of hook_form_FORM_ID_alter().
module_filter_menuImplementation of hook_menu().
module_filter_permImplementation of hook_perm().
module_filter_themeImplementation of hook_theme().

File

View source
  1. <?php
  2. /**
  3. * @file
  4. * This is the file description for Module Filter module.
  5. *
  6. * In this more verbose, multi-line description, you can specify what this
  7. * file does exactly. Make sure to wrap your documentation in column 78 so
  8. * that the file can be displayed nicely in default-sized consoles.
  9. *
  10. * @author greenSkin
  11. */
  12. /**
  13. * Implementation of hook_perm().
  14. */
  15. function module_filter_perm() {
  16. return array('administer module filter');
  17. }
  18. /**
  19. * Implementation of hook_menu().
  20. */
  21. function module_filter_menu() {
  22. $items['admin/settings/module_filter'] = array(
  23. 'title' => 'Module filter',
  24. 'description' => 'Configure settings for Module Filter.',
  25. 'access arguments' => array('administer module filter'),
  26. 'page callback' => 'drupal_get_form',
  27. 'page arguments' => array('module_filter_settings'),
  28. 'file' => 'module_filter.admin.inc'
  29. );
  30. return $items;
  31. }
  32. /**
  33. * Implementation of hook_form_FORM_ID_alter().
  34. */
  35. function module_filter_form_system_modules_alter(&$form, $form_state) {
  36. // Don't alter the form when confirming.
  37. if (isset($form['confirm'])) {
  38. return;
  39. }
  40. $form['module_filter'] = array('#tree' => TRUE);
  41. $form['module_filter']['name'] = array(
  42. '#type' => 'textfield',
  43. '#title' => t('Filter list')
  44. );
  45. $form['module_filter']['show'] = array(
  46. '#type' => 'checkboxes',
  47. '#default_value' => array('enabled', 'disabled', 'required', 'unavailable'),
  48. '#options' => array('enabled' => t('Enabled'), 'disabled' => t('Disabled'), 'required' => t('Required'), 'unavailable' => t('Unavailable')),
  49. '#prefix' => '<div id="module-filter-show-wrapper">',
  50. '#suffix' => '</div>'
  51. );
  52. $form['#theme'] = 'module_filter_system_modules';
  53. }
  54. /**
  55. * Implementation of hook_theme().
  56. */
  57. function module_filter_theme() {
  58. return array(
  59. 'module_filter_system_modules' => array(
  60. 'arguments' => array('form' => NULL),
  61. 'file' => 'module_filter.theme.inc'
  62. ),
  63. 'module_filter_system_modules_tabs' => array(
  64. 'arguments' => array('form' => NULL),
  65. 'file' => 'module_filter.theme.inc'
  66. )
  67. );
  68. }