You are here

function ctools_term_vocabulary_ctools_access_summary in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 plugins/access/term_vocabulary.inc \ctools_term_vocabulary_ctools_access_summary()

Provide a summary description based upon the checked term_vocabularys.

1 string reference to 'ctools_term_vocabulary_ctools_access_summary'
term_vocabulary.inc in plugins/access/term_vocabulary.inc
Plugin to provide access control based upon term vocabulary

File

plugins/access/term_vocabulary.inc, line 69
Plugin to provide access control based upon term vocabulary

Code

function ctools_term_vocabulary_ctools_access_summary($conf, $context) {
  if (!isset($conf['type'])) {
    $conf['type'] = array();
  }
  $vocabularies = taxonomy_get_vocabularies();
  $names = array();
  foreach (array_filter($conf['vids']) as $vid) {
    $names[] = check_plain($vocabularies[$vid]->name);
  }
  if (empty($names)) {
    return t('@identifier is any vocabulary', array(
      '@identifier' => $context->identifier,
    ));
  }
  return format_plural(count($names), '@identifier vocabulary is "@vids"', '@identifier vocabulary is one of "@vids"', array(
    '@vids' => implode(', ', $names),
    '@identifier' => $context->identifier,
  ));
}