You are here

function context_admin_term_parent_access_restrictions in Contextual Administration 6

Inform the UI that we've eliminated a bunch of possibilities for this context.

1 string reference to 'context_admin_term_parent_access_restrictions'
term_parent.inc in plugins/access/term_parent.inc
Plugin to provide access control based upon a term's parent tid.

File

plugins/access/term_parent.inc, line 72
Plugin to provide access control based upon a term's parent tid.

Code

function context_admin_term_parent_access_restrictions($conf, &$context) {
  if (!is_array($conf['parent'])) {
    $conf['parent'] = array(
      $conf['parent'],
    );
  }
  if (isset($context->restrictions['parent'])) {
    $context->restrictions['parent'] = array_unique(array_merge($context->restrictions['parent'], array_keys(array_filter($conf['parent']))));
  }
  else {
    $context->restrictions['parent'] = array_keys(array_filter($conf['parent']));
  }
}