You are here

function book_access_ui_form_book_admin_settings_alter in Book access 6.2

Same name and namespace in other branches
  1. 7.2 book_access_ui.module \book_access_ui_form_book_admin_settings_alter()

Implements hook_form_FORM_ID_alter() for book_admin_settings().

See also

theme_book_access_ui_settings()

File

./book_access_ui.module, line 14
User interface for the Book access module.

Code

function book_access_ui_form_book_admin_settings_alter(&$form, &$form_state) {
  $options = array(
    'grant_admin_access' => '',
    'grant_update' => '',
    'grant_delete' => '',
    'grant_add_child' => '',
    'grant_edit_outline' => '',
    'grant_view' => '',
  );
  $vars = new BookAccessVars();
  $form['book_access_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Book access settings'),
    '#collapsible' => TRUE,
    '#theme' => 'book_access_ui_settings',
  );
  $form['book_access_settings']['#options'] = array(
    'grant_view' => t('View book'),
    'grant_update' => t('Edit pages'),
    'grant_delete' => t('Delete pages'),
    'grant_admin_access' => t('Administer access'),
    'grant_add_child' => t('Add child pages'),
    'grant_edit_outline' => t('Edit book outlines'),
  );
  $form['book_access_settings']['info'] = array(
    '#value' => '<em>' . t('These are the default values for authors, roles, and users access. Third-party modules can alter these values on a per book basis.') . '</em>',
  );
  $form['book_access_settings']['grants']['book_access_default_authors_access'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Default authors access'),
    '#default_value' => $vars['book_access_default_authors_access'],
    '#options' => $options,
  );
  $form['book_access_settings']['grants']['book_access_default_roles_access'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Default roles access'),
    '#default_value' => $vars['book_access_default_roles_access'],
    '#options' => $options,
  );
  $form['book_access_settings']['grants']['book_access_default_users_access'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Default users access'),
    '#default_value' => $vars['book_access_default_users_access'],
    '#options' => $options,
  );
  $form['buttons']['#weight'] = 100;
}