You are here

function total_control_add_user_pane_settings in Total Control Admin Dashboard 6.2

Same name and namespace in other branches
  1. 7.2 includes/total_control.inc \total_control_add_user_pane_settings()

Adds user settings to the panel pane config form.

Parameters

$form: Panel pane config form.

$conf: Panel content pane config data.

2 calls to total_control_add_user_pane_settings()
total_control_overview_content_type_edit_form in plugins/content_types/overview.inc
'Edit form' callback for the content type.
total_control_overview_user_content_type_edit_form in plugins/content_types/overview_user.inc
'Edit form' callback for the content type.

File

includes/total_control.inc, line 505
total_control.inc

Code

function total_control_add_user_pane_settings(&$form, &$form_state) {
  $conf = $form_state['conf'];
  $user_options = array(
    0 => t('no'),
    1 => t('Include the total number of user accounts, including active and blocked.'),
  );
  $form['user'] = array(
    '#type' => 'checkbox',
    '#title' => t('Include the total number of user accounts, including active and blocked.'),
    '#options' => $user_options,
    '#default_value' => $form_state['op'] == 'add' ? TRUE : $conf['user'],
  );
  $roles = user_roles(TRUE);
  $roles_options = array();
  foreach ($roles as $rid => $role) {
    if ($rid != 2) {
      $roles_options[$rid] = $role;
      $roles_defaults[] = $rid;
    }
  }
  if (!empty($roles_options)) {
    $form['roles'] = array(
      '#type' => 'checkboxes',
      '#title' => t('Include User counts in Roles'),
      '#options' => $roles_options,
      '#default_value' => $form_state['op'] == 'add' || !isset($conf['roles']) ? $roles_defaults : $conf['roles'],
    );
  }
}