You are here

function access_scheme_taxonomy_term_settings in Access Control Kit 7

Settings callback for the taxonomy term scheme type.

See also

access_access_scheme_info()

2 string references to 'access_scheme_taxonomy_term_settings'
access_access_scheme_info in ./access.access.inc
Implements hook_access_scheme_info().
hook_access_scheme_info in ./access.api.php
Defines access scheme types.

File

callbacks/access.taxonomy.inc, line 28
Callback functions for the taxonomy access scheme type.

Code

function access_scheme_taxonomy_term_settings($scheme, $has_data) {
  $options = array();
  foreach (taxonomy_get_vocabularies() as $vocabulary) {
    $options[$vocabulary->machine_name] = $vocabulary->name;
  }
  $form['vocabulary'] = array(
    '#type' => 'select',
    '#title' => t('Vocabulary'),
    '#description' => t('The terms in this vocabulary will become the access realms for the scheme.'),
    '#default_value' => isset($scheme->settings['vocabulary']) ? $scheme->settings['vocabulary'] : NULL,
    '#options' => $options,
    '#required' => TRUE,
    '#disabled' => $has_data,
  );
  return $form;
}