Same name and namespace in other branches
  1. 5.x modules/book/book.module \theme_book_admin_table()
  2. 6.x modules/book/book.admin.inc \theme_book_admin_table()
  3. 7.x modules/book/book.admin.inc \theme_book_admin_table()
1 theme call to theme_book_admin_table()
_book_admin_table in modules/book.module

File

modules/book.module, line 868
Allows users to collaboratively author a book.

Code

function theme_book_admin_table($form) {
  $header = array(
    t('Title'),
    t('Weight'),
    array(
      'data' => t('Operations'),
      'colspan' => '3',
    ),
  );
  $rows = array();
  foreach (element_children($form) as $key) {
    $nid = $form[$key]['nid']['#value'];
    $pid = $form[0]['nid']['#value'];
    if ($pid == $nid) {

      // Don't return to the parent book page if it is deleted.
      $pid = '';
    }
    $rows[] = array(
      '<div style="padding-left: ' . 25 * $form[$key]['depth']['#value'] . 'px;">' . form_render($form[$key]['title']) . '</div>',
      form_render($form[$key]['weight']),
      l(t('view'), 'node/' . $nid),
      l(t('edit'), 'node/' . $nid . '/edit'),
      l(t('delete'), 'node/' . $nid . '/delete', NULL, 'destination=admin/node/book/' . (arg(3) == 'orphan' ? 'orphan' : $pid)),
    );
  }
  return theme('table', $header, $rows);
}