You are here

function imce_role_form in IMCE 7

Same name and namespace in other branches
  1. 6.2 inc/imce.admin.inc \imce_role_form()
  2. 6 inc/admin.inc \imce_role_form()

Role-profile form.

1 call to imce_role_form()
imce_admin_form in inc/imce.admin.inc
Admin form.

File

inc/imce.admin.inc, line 580
Serves administration pages of IMCE.

Code

function imce_role_form($role, $weight = TRUE, $core = TRUE) {
  $form['name'] = array(
    '#markup' => check_plain($role['name']),
  );
  if ($weight) {
    $form['weight'] = $core ? array(
      '#type' => 'textfield',
      '#value' => $role['weight'],
      '#attributes' => array(
        'readonly' => 'readonly',
        'style' => 'border: none; width: 2em; background-color: transparent;',
      ),
    ) : array(
      '#type' => 'weight',
      '#default_value' => $role['weight'],
    );
  }
  foreach (array_keys(file_get_stream_wrappers(STREAM_WRAPPERS_VISIBLE)) as $scheme) {
    $form[$scheme . '_pid'] = array(
      '#type' => 'select',
      '#options' => imce_profile_options(),
      '#default_value' => $role[$scheme . '_pid'],
      '#empty_value' => 0,
    );
  }
  return $form;
}