You are here

function theme_book_access_ui_settings in Book access 7.2

Same name and namespace in other branches
  1. 6.2 book_access_ui.admin.inc \theme_book_access_ui_settings()

Themes the settings fieldset added to the book settings page.

Parameters

$variables: An associative array containing:

  • form: A render element representing the form.

See also

book_access_ui_form_book_admin_settings_alter()

1 theme call to theme_book_access_ui_settings()
book_access_ui_form_book_admin_settings_alter in ./book_access_ui.module
Implements hook_form_FORM_ID_alter() for book_admin_settings().

File

./book_access_ui.admin.inc, line 583
Administration interface for the Book access module.

Code

function theme_book_access_ui_settings($variables) {
  $form = $variables['form'];
  $header = array(
    t('Access type'),
  );
  $options = $form['#options'];
  $rows = array();
  foreach ($options as $option => $title) {
    $header[] = $title;
  }
  foreach (element_children($form['grants']) as $key) {
    $row = array();
    $row[] = $form['grants'][$key]['#title'];
    unset($form['grants'][$key]['#title']);
    foreach ($options as $option => $title) {
      $row[] = drupal_render($form['grants'][$key][$option]);
    }
    $rows[] = $row;
  }
  return drupal_render($form['info']) . theme('table', array(
    'header' => $header,
    'rows' => $rows,
  )) . drupal_render_children($form);
}