function ctools_node_language_ctools_access_summary

Provide a summary description based upon the checked node_languages.

1 string reference to 'ctools_node_language_ctools_access_summary'
node_language.inc in plugins/access/node_language.inc
Plugin to provide access control based upon node type.

File

plugins/access/node_language.inc, line 91

Code

function ctools_node_language_ctools_access_summary($conf, $context) {
    $languages = array(
        'current' => t('Current site language'),
        'default' => t('Default site language'),
        'no_language' => t('No language'),
    );
    $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), '@identifier language is "@languages"', '@identifier language is one of "@languages"', array(
        '@languages' => implode(', ', $names),
        '@identifier' => $context->identifier,
    ));
}