function _privatemsg_limits_role_override_form in Privatemsg 7.2
Same name and namespace in other branches
- 7 privatemsg_limits/privatemsg_limits.admin.inc \_privatemsg_limits_role_override_form()
Provides a generic rules form to override the default values.
Parameters
string $name Unique name for the value:
array $default default form configuration:
Return value
array Form fieldset
1 call to _privatemsg_limits_role_override_form()
- privatemsg_limits_admin in privatemsg_limits/
privatemsg_limits.admin.inc - Menu callback for the admin configuration.
File
- privatemsg_limits/
privatemsg_limits.admin.inc, line 125 - Admin menu callbacks for privatemsg_limits module.
Code
function _privatemsg_limits_role_override_form($name, $default) {
$form['roles'] = array(
'#type' => 'fieldset',
'#description' => t('You may override the maximum limit specified above on a per-role basis. If a user has multiple roles, then the highest maximum value shall be used. Enter "unlimited" if a role may have unlimited messages/conversations. Enter "0" if you do not want to override the maximum limit setting.'),
'#title' => t('Override maximum limit by role'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
foreach (user_roles(TRUE) as $id => $role) {
$form['roles']["privatemsg_limits_{$name}_role_{$id}"] = $default + array(
'#title' => $role,
'#default_value' => variable_get("privatemsg_limits_{$name}_role_" . $id, 0),
);
}
return $form;
}