You are here

function theme_forum_access_table in Forum Access 7

1 theme call to theme_forum_access_table()
_forum_access_forum_grants_form in ./forum_access.admin.inc

File

./forum_access.admin.inc, line 515
forum_access.admin.inc

Code

function theme_forum_access_table($variables) {
  $tr = 't';
  $form = $variables['form'];
  foreach (element_children($form['rows']) as $key) {
    $row = array();
    $row[] = array(
      'data' => drupal_render($form['rows'][$key]),
      'class' => array(
        'grant',
      ),
    );
    foreach (element_children($form['checkboxes']) as $cid) {
      $row[] = array(
        'data' => drupal_render($form['checkboxes'][$cid][$key]),
        'class' => array(
          'checkbox',
        ),
        'title' => $form['rows'][$key]['#markup'],
      );
    }
    $rows[] = $row;
  }
  $header[] = $tr('Roles');
  foreach (element_children($form['col_ids']) as $cid) {
    $header[] = array(
      'data' => drupal_render($form['col_ids'][$cid]),
      'class' => array(
        'checkbox',
      ),
    );
  }
  $output = theme('table', array(
    'header' => $header,
    'rows' => $rows,
    'attributes' => array(
      'id' => 'grants',
    ),
  ));
  $output .= drupal_render_children($form);
  return $output;
}