theme_book_admin_table

5 book.module theme_book_admin_table($form)
6 book.admin.inc theme_book_admin_table($form)
7 book.admin.inc theme_book_admin_table($variables)
8 book.admin.inc theme_book_admin_table($variables)

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);
}
Login or register to post comments