function _book_helper_admin_table in Book helper 7
Same name and namespace in other branches
- 6 book_helper.admin.inc \_book_helper_admin_table()
Build the table portion of the form for the book administration page.
See also
1 call to _book_helper_admin_table()
- book_helper_admin_edit in ./
book_helper.admin.inc - Build the form to administrate the hierarchy of a single book.
File
- ./
book_helper.admin.inc, line 244 - Administration page for the 'Book helper' module.
Code
function _book_helper_admin_table($node, &$form) {
$form['table'] = array(
'#theme' => 'book_helper_admin_table',
'#tree' => TRUE,
);
$tree = book_menu_subtree_data($node->book);
// Do not include the book item itself.
$tree = array_shift($tree);
if ($tree['below']) {
$hash = drupal_hash_base64(serialize($tree['below']));
// Store the hash value as a hidden form element so that we can detect
// if another user changed the book hierarchy.
$form['tree_hash'] = array(
'#type' => 'hidden',
'#default_value' => $hash,
);
$form['tree_current_hash'] = array(
'#type' => 'value',
'#value' => $hash,
);
_book_helper_admin_table_tree($tree['below'], $form['table'], $node->book['bid']);
}
else {
// Track if book is empty.
$form['table']['#empty'] = TRUE;
}
}