function book_made_simple_is_reorder_access in Book made simple 7.3
Returns access rights for book.
1 call to book_made_simple_is_reorder_access()
- book_made_simple_form_alter in ./
book_made_simple.module - Implements hook_form_alter().
1 string reference to 'book_made_simple_is_reorder_access'
- book_made_simple_menu in ./
book_made_simple.module - Implementats hook_menu().
File
- ./
book_made_simple.module, line 107 - Automaticly creats a book and simple creation of child pages. Author: M. Morin
Code
function book_made_simple_is_reorder_access($node = NULL) {
if (isset($node->book) && $node->book['bid'] > 0) {
if (user_access('administer books')) {
return true;
}
if (!_book_outline_access($node) || !user_access('show book reorder tab') || !book_made_simple_creator_only_access($node)) {
return false;
}
// Cheching permissions according to rules/
$book = $node->book;
$linkVisibilty = variable_get('book_made_simple_reorder_link', "0");
$allowed = true;
if ($linkVisibilty == "0") {
$mainBook = $book;
if ($book['nid'] != $book['bid']) {
$mainBook = node_load($book['bid'])->book;
}
$allowed = count(book_toc($mainBook['bid'], 9999)) > 2;
}
return $allowed;
}
return false;
}