You are here

function bueditor_admin_form in BUEditor 7

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

Admin form.

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

File

admin/bueditor.admin.inc, line 50

Code

function bueditor_admin_form($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('Site maintenance account'),
      '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;
}