function theme_book_access_ui_grants_form in Book access 7.2
Same name and namespace in other branches
- 6.2 book_access_ui.admin.inc \theme_book_access_ui_grants_form()
Themes the permission tab added to each book.
Parameters
$variables: An associative array containing:
- form: A render element representing the form.
See also
File
- ./
book_access_ui.admin.inc, line 495 - Administration interface for the Book access module.
Code
function theme_book_access_ui_grants_form($variables) {
$form = $variables['form'];
$rows = array();
if (isset($form['#author'])) {
$rows[] = array(
drupal_render($form['author']['name']),
drupal_render($form['author']['grant_admin_access']),
drupal_render($form['author']['grant_update']),
drupal_render($form['author']['grant_delete']),
drupal_render($form['author']['grant_add_child']),
drupal_render($form['author']['grant_edit_outline']),
drupal_render($form['author']['grant_view']),
' ',
);
}
if (isset($form['#rids'])) {
foreach ($form['#rids'] as $key) {
$row = array();
$row[] = drupal_render($form['roles']['names'][$key]);
$row[] = drupal_render($form['roles']['grant_admin_access'][$key]);
$row[] = drupal_render($form['roles']['grant_update'][$key]);
$row[] = drupal_render($form['roles']['grant_delete'][$key]);
$row[] = drupal_render($form['roles']['grant_add_child'][$key]);
$row[] = drupal_render($form['roles']['grant_edit_outline'][$key]);
$row[] = drupal_render($form['roles']['grant_view'][$key]);
$row[] = ' ';
$rows[] = $row;
}
}
if (isset($form['#uids'])) {
foreach ($form['#uids'] as $key) {
$row = array();
$user = user_load($key);
$row[] = theme('username', array(
'account' => $user,
));
$row[] = drupal_render($form['users']['grant_admin_access'][$key]);
$row[] = drupal_render($form['users']['grant_update'][$key]);
$row[] = drupal_render($form['users']['grant_delete'][$key]);
$row[] = drupal_render($form['users']['grant_add_child'][$key]);
$row[] = drupal_render($form['users']['grant_edit_outline'][$key]);
$row[] = drupal_render($form['users']['grant_view'][$key]);
$row[] = l(t('delete'), 'book_access/delete/user_permission/' . $form['#bid'] . "/{$key}");
$rows[] = $row;
}
}
$rows[] = array(
drupal_render($form['user']['username']),
drupal_render($form['user']['grant_admin_access']),
drupal_render($form['user']['grant_update']),
drupal_render($form['user']['grant_delete']),
drupal_render($form['user']['grant_add_child']),
drupal_render($form['user']['grant_edit_outline']),
drupal_render($form['user']['grant_view']),
drupal_render($form['user']['add_user']),
);
$header = array(
t('Role/user'),
t('Administer access'),
t('Edit pages'),
t('Delete pages'),
t('Add child pages'),
t('Edit outline'),
t('View this book'),
t('Operations'),
);
return theme('table', array(
'header' => $header,
'rows' => $rows,
)) . drupal_render_children($form);
}