You are here

function theme_nodeaccess_admin_form_types in Nodeaccess 5

Same name and namespace in other branches
  1. 6.2 nodeaccess.module \theme_nodeaccess_admin_form_types()
  2. 6 nodeaccess.module \theme_nodeaccess_admin_form_types()
  3. 7 nodeaccess.admin.inc \theme_nodeaccess_admin_form_types()
1 theme call to theme_nodeaccess_admin_form_types()
nodeaccess_admin_form in ./nodeaccess.module
Menu callback. Draws the admin page.

File

./nodeaccess.module, line 232

Code

function theme_nodeaccess_admin_form_types($form) {
  $output = drupal_render($form['show']);
  $roles = element_children($form['roles']);
  $header = array(
    t('Role'),
    t('View'),
    t('Edit'),
    t('Delete'),
  );
  foreach ($roles as $role) {
    $row = array();
    $row[] = drupal_render($form['roles'][$role]['name']);
    $row[] = drupal_render($form['roles'][$role]['grant_view']);
    $row[] = drupal_render($form['roles'][$role]['grant_update']);
    $row[] = drupal_render($form['roles'][$role]['grant_delete']);
    $rows[] = $row;
  }
  $output .= theme('table', $header, $rows);
  $header = array(
    t('Author Settings'),
    t('View'),
    t('Edit'),
    t('Delete'),
  );
  $row = array();
  $row[] = t('Node author');
  $row[] = drupal_render($form['author']['grant_view']);
  $row[] = drupal_render($form['author']['grant_update']);
  $row[] = drupal_render($form['author']['grant_delete']);
  $output .= theme('table', $header, array(
    $row,
  ));
  $output .= '<small>' . t('The settings selected for the node author will define what permissions the node author has. This cannot be changed on individual node grants.') . '</small>';
  return $output;
}