You are here

function tac_fields_build_row in Taxonomy Access Control 6

Assembles an admin form row with the appropriate radio buttons.

Parameters

$grants: Default grants to set, if any.

Return value

Form array for the row.

1 call to tac_fields_build_row()
tac_fields_admin_form in tac_fields/tac_fields.admin.inc
Main administration form, with grid of permissions per term.

File

tac_fields/tac_fields.admin.inc, line 409
Administrative interface for TAC Fields.

Code

function tac_fields_build_row($grants = NULL) {
  $form['#title'] = '';
  $form['#tree'] = TRUE;
  foreach (array(
    'view',
    'update',
  ) as $grant) {
    $form[$grant] = array(
      '#type' => 'radios',
      '#options' => array(
        '1' => '',
        '0' => '',
        '2' => '',
      ),
      //1: Allow, 0: Ignore, 2: Deny
      '#default_value' => is_string($grants['grant_' . $grant]) ? $grants['grant_' . $grant] : '0',
      '#required' => TRUE,
    );
  }
  return $form;
}