1 block.overview_user.inc DashboardOverviewUserBlock::form(&$form, &$form_state)

Build the settings form for editing this block.

Overrides Block::form

File

core/modules/dashboard/includes/block.overview_user.inc, line 133
Dashboard block displaying information about user accounts, including:

Class

DashboardOverviewUserBlock
@file

Code

function form(&$form, &$form_state) {
  parent::form($form, $form_state);
  $settings = $this->settings;

  $form['user_counts'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display the <strong>total</strong> number of user accounts.'),
    '#default_value' => $settings['user_counts'],
  );
  $form['user_counts_active'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display the number of <strong>active</strong> user accounts.'),
    '#default_value' => $settings['user_counts_active'],
  );
  $form['user_counts_blocked'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display the number of <strong>blocked</strong> user accounts.'),
    '#default_value' => $settings['user_counts_blocked'],
  );

  $options = user_roles(TRUE);
  unset($options[BACKDROP_AUTHENTICATED_ROLE]);
  foreach ($options as $machine_name => $role_label) {
    $options[$machine_name] = check_plain(t($role_label));
  }

  if (!empty($options)) {
    $form['roles'] = array(
      '#type' => 'checkboxes',
      '#title' => t('List the number of accounts with the following roles'),
      '#options' => $options,
      '#default_value' => $settings['roles'],
    );
  }
}