You are here

function entity_translation_translation_exists_ctools_access_summary in Entity Translation 7

Provide a summary description based upon the checked node_languages.

1 string reference to 'entity_translation_translation_exists_ctools_access_summary'
translation_exists.inc in plugins/access/translation_exists.inc
Plugin to provide access control on entities based on translations.

File

plugins/access/translation_exists.inc, line 120
Plugin to provide access control on entities based on translations.

Code

function entity_translation_translation_exists_ctools_access_summary($conf, $context) {
  $languages = array(
    ENTITY_TRANSLATION_LANGUAGE_CURRENT => t('Current site content language'),
    ENTITY_TRANSLATION_LANGUAGE_DEFAULT => t('Default site language'),
    LANGUAGE_NONE => t('Language neutral'),
  );
  $languages = array_merge($languages, locale_language_list());
  if (!isset($conf['language'])) {
    $conf['language'] = array();
  }
  $names = array();
  foreach (array_filter($conf['language']) as $language) {
    $names[] = $languages[$language];
  }
  if (empty($names)) {
    return t('@identifier is in any language', array(
      '@identifier' => $context->identifier,
    ));
  }
  return format_plural(count($names), '@languages translation exists for @identifier', '@languages translations exists for identifier', array(
    '@languages' => implode(', ', $names),
    '@identifier' => $context->identifier,
  ));
}