You are here

function bueditor_admin_form in BUEditor 6

Same name and namespace in other branches
  1. 6.2 admin/bueditor.admin.inc \bueditor_admin_form()
  2. 7 admin/bueditor.admin.inc \bueditor_admin_form()

Admin form.

1 string reference to 'bueditor_admin_form'
bueditor_admin in ./bueditor.admin.inc
Admin main page.

File

./bueditor.admin.inc, line 23

Code

function bueditor_admin_form($form_state) {
  $form['roles'] = array(
    '#tree' => TRUE,
  );
  $roles = bueditor_sorted_roles();
  $form['#weighted'] = count($roles) > 3;

  //user#1
  if ($GLOBALS['user']->uid == 1) {
    $u1 = array(
      'name' => t('user #1'),
      'weight' => t('n/a'),
      'editor' => variable_get('bueditor_user1', 1),
      'alt' => variable_get('bueditor_user1_alt', 0),
    );
    $form['roles']['u1'] = bueditor_role_form($u1, $form['#weighted'], 1);
  }

  //other roles
  foreach ($roles as $rid => $role) {
    $core = $rid == DRUPAL_ANONYMOUS_RID || $rid == DRUPAL_AUTHENTICATED_RID;
    $form['roles'][$rid] = bueditor_role_form($role, $form['#weighted'], $core);
  }
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save configuration'),
  );
  $form['#submit'][] = 'bueditor_admin_submit';
  $form['#theme'] = 'bueditor_admin';
  return $form;
}