function ctools_book_node_ctools_access_summary

Provide a summary description based upon the checked node_languages.

1 string reference to 'ctools_book_node_ctools_access_summary'
book.inc in plugins/access/book.inc
Plugin to provide access control based on whether a node belongs to a book.

File

plugins/access/book.inc, line 76

Code

function ctools_book_node_ctools_access_summary($conf, $context) {
    if ($conf['book']['any']) {
        return t('@identifier belongs to a book', array(
            '@identifier' => $context->identifier,
        ));
    }
    $books = array();
    foreach ($conf['book'] as $bid => $value) {
        if ($value) {
            $node = node_load($bid);
            $books[] = $node->title;
        }
    }
    if (count($books) == 1) {
        return t('@identifier belongs to the book "@book"', array(
            '@book' => $books[0],
            '@identifier' => $context->identifier,
        ));
    }
    return t('@identifier belongs in multiple books', array(
        '@identifier' => $context->identifier,
    ));
}