You are here

function role_watchdog_admin_settings in Role Watchdog 5

Same name and namespace in other branches
  1. 6.2 role_watchdog.admin.inc \role_watchdog_admin_settings()
  2. 6 role_watchdog.admin.inc \role_watchdog_admin_settings()
  3. 7.2 role_watchdog.admin.inc \role_watchdog_admin_settings()
  4. 7 role_watchdog.admin.inc \role_watchdog_admin_settings()

Menu callback

Return value

array of form content.

1 string reference to 'role_watchdog_admin_settings'
role_watchdog_menu in ./role_watchdog.module
Implementation of hook_menu().

File

./role_watchdog.module, line 50
Logs changes to user roles.

Code

function role_watchdog_admin_settings() {
  $role_names = array();
  $sql = "SELECT * FROM {role} r WHERE r.rid > 2 ORDER BY name";
  $results = db_query($sql);
  while ($result = db_fetch_object($results)) {
    $role_names[$result->rid] = $result->name;
  }
  $form['role_watchdog_monitor_roles'] = array(
    '#type' => 'select',
    '#title' => t('Monitor for change'),
    '#options' => $role_names,
    '#default_value' => variable_get('role_watchdog_monitor_roles', NULL),
    '#description' => t('Select roles to monitor for change.'),
    '#multiple' => TRUE,
  );
  $form['role_watchdog_notify_roles'] = array(
    '#type' => 'select',
    '#title' => t('Notify on change'),
    '#options' => array(
      SUPERUSER_RID => 'Superuser (uid 1)',
    ) + $role_names,
    '#default_value' => variable_get('role_watchdog_notify_roles', NULL),
    '#description' => t('Select roles to notify on change.'),
    '#multiple' => TRUE,
  );
  return system_settings_form($form);
}