You are here

function theme_book_admin_table in Drupal 5

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

File

modules/book/book.module, line 853
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'];
    $rows[] = array(
      '<div style="padding-left: ' . 25 * $form[$key]['depth']['#value'] . 'px;">' . drupal_render($form[$key]['title']) . '</div>',
      drupal_render($form[$key]['weight']),
      l(t('view'), 'node/' . $nid),
      l(t('edit'), 'node/' . $nid . '/edit'),
      l(t('delete'), 'node/' . $nid . '/delete', NULL, 'destination=admin/content/book' . (arg(3) == 'orphan' ? '/orphan' : '') . ($pid != $nid ? '/' . $pid : '')),
    );
  }
  return theme('table', $header, $rows);
}