You are here

function _privatemsg_qota_role_override_form in Privatemsg 6.2

Provides a generic rules form to override the default values.

Parameters

string $name Unique name for the value:

array $default defaut form configuration:

Return value

array Form fieldset

1 call to _privatemsg_qota_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_qota_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;
}