_book_admin_table

Versions
4.7 – 5
_book_admin_table($nodes = array())
6 – 7
_book_admin_table($node, &$form)

Build the table portion of the form for the book administration page.

See also

book_admin_edit()

▾ 1 function calls _book_admin_table()

book_admin_edit in modules/book/book.admin.inc
Build the form to administrate the hierarchy of a single book.

Code

modules/book/book.admin.inc, line 142

<?php
function _book_admin_table($node, &$form) {
  $form['table'] = array(
    '#theme' => 'book_admin_table',
    '#tree' => TRUE,
  );

  $tree = book_menu_subtree_data($node->book);
  $tree = array_shift($tree); // Do not include the book item itself.
  if ($tree['below']) {
    $hash = sha1(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_admin_table_tree($tree['below'], $form['table']);
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.