function total_control_add_user_pane_settings in Total Control Admin Dashboard 7.2
Same name and namespace in other branches
- 6.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 452 - Helper functions for total control.
Code
function total_control_add_user_pane_settings(&$form, $conf = array()) {
$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();
$roles_defaults = 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 the number of user accounts with the following roles:'),
'#options' => $roles_options,
'#default_value' => $conf['roles'] ? $conf['roles'] : $roles_defaults,
);
}
}