function ctools_book_node_ctools_access_settings

Settings form for the 'by book_node' access plugin.

1 string reference to 'ctools_book_node_ctools_access_settings'
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 28

Code

function ctools_book_node_ctools_access_settings($form, &$form_state, $conf) {
    $options = array(
        'any' => t('In any book'),
    );
    $books = book_get_books();
    foreach ($books as $bid => $book) {
        $options[$bid] = $book['title'];
    }
    $form['settings']['book'] = array(
        '#title' => t('Book'),
        '#type' => 'checkboxes',
        '#options' => $options,
        '#description' => t('Pass only if the node belongs to one of the selected books'),
        '#default_value' => $conf['book'],
        '#required' => TRUE,
    );
    return $form;
}