diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-10-09 01:00:08 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-10-09 01:00:08 +0000 |
commit | c05f2181dc8556cb6700e8c6bb6e6ded43273192 (patch) | |
tree | 5446facb7f5f18dfaac48aade56c0d86f1477fff /modules/book | |
parent | 48dd14a898420ae98984c951f59e8d299080bee8 (diff) | |
download | brdo-c05f2181dc8556cb6700e8c6bb6e6ded43273192.tar.gz brdo-c05f2181dc8556cb6700e8c6bb6e6ded43273192.tar.bz2 |
- Patch #572618 by effulgentsia, pwolanin, sun: all theme functions should take a single argument. Code clean-up and performance improvement. Woot.
Diffstat (limited to 'modules/book')
-rw-r--r-- | modules/book/book.admin.inc | 10 | ||||
-rw-r--r-- | modules/book/book.module | 10 | ||||
-rw-r--r-- | modules/book/book.pages.inc | 4 |
3 files changed, 14 insertions, 10 deletions
diff --git a/modules/book/book.admin.inc b/modules/book/book.admin.inc index d1745473a..b6a7e9b5d 100644 --- a/modules/book/book.admin.inc +++ b/modules/book/book.admin.inc @@ -24,7 +24,7 @@ function book_admin_overview() { $rows[] = array(array('data' => t('No books available.'), 'colspan' => 2)); } - return theme('table', $headers, $rows); + return theme('table', array('header' => $headers, 'rows' => $rows)); } /** @@ -221,7 +221,9 @@ function _book_admin_table_tree($tree, &$form) { * @ingroup themeable * @see book_admin_table() */ -function theme_book_admin_table($form) { +function theme_book_admin_table($variables) { + $form = $variables['form']; + drupal_add_tabledrag('book-outline', 'match', 'parent', 'book-plid', 'book-plid', 'book-mlid', TRUE, MENU_MAX_DEPTH - 2); drupal_add_tabledrag('book-outline', 'order', 'sibling', 'book-weight'); @@ -240,7 +242,7 @@ function theme_book_admin_table($form) { $form[$key]['weight']['#attributes']['class'] = array('book-weight'); $data = array( - theme('indentation', $form[$key]['depth']['#value'] - 2) . drupal_render($form[$key]['title']), + theme('indentation', array('size' => $form[$key]['depth']['#value'] - 2)) . drupal_render($form[$key]['title']), drupal_render($form[$key]['weight']), drupal_render($form[$key]['plid']) . drupal_render($form[$key]['mlid']), l(t('view'), $href), @@ -255,6 +257,6 @@ function theme_book_admin_table($form) { $rows[] = $row; } - return theme('table', $header, $rows, array('id' => 'book-outline')); + return theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'book-outline'))); } diff --git a/modules/book/book.module b/modules/book/book.module index eed90fbaa..3adb48741 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -264,7 +264,7 @@ function book_block_view($delta = '') { $tree = menu_tree_all_data($node->book['menu_name'], $node->book); // There should only be one element at the top level. $data = array_shift($tree); - $block['subject'] = theme('book_title_link', $data['link']); + $block['subject'] = theme('book_title_link', array('link' => $data['link'])); $block['content'] = ($data['below']) ? menu_tree_output($data['below']) : ''; } } @@ -305,7 +305,9 @@ function book_block_save($delta = '', $edit = array()) { * * @ingroup themeable */ -function theme_book_title_link($link) { +function theme_book_title_link($variables) { + $link = $variables['link']; + $link['options']['attributes']['class'] = array('book-title'); return l($link['title'], $link['href'], $link['options']); @@ -737,7 +739,7 @@ function book_node_view($node, $build_mode) { if ($build_mode == 'full') { if (!empty($node->book['bid']) && empty($node->in_preview)) { $node->content['book_navigation'] = array( - '#markup' => theme('book_navigation', $node->book), + '#markup' => theme('book_navigation', array('book_link' => $node->book)), '#weight' => 100, ); } @@ -1087,7 +1089,7 @@ function book_node_export($node, $children = '') { node_build_content($node, 'print'); $node->rendered = drupal_render($node->content); - return theme('book_node_export_html', $node, $children); + return theme('book_node_export_html', array('node' => $node, 'children' => $children)); } /** diff --git a/modules/book/book.pages.inc b/modules/book/book.pages.inc index 5909c5b58..206f61b79 100644 --- a/modules/book/book.pages.inc +++ b/modules/book/book.pages.inc @@ -15,7 +15,7 @@ function book_render() { $book_list[] = l($book['title'], $book['href'], $book['options']); } - return theme('item_list', $book_list); + return theme('item_list', array('items' => $book_list)); } /** @@ -79,7 +79,7 @@ function book_export_html($nid) { $contents = book_export_traverse($tree, 'book_node_export'); } - return theme('book_export_html', $node->title, $contents, $node->book['depth']); + return theme('book_export_html', array('title' => $node->title, 'contents' => $contents, 'depth' => $node->book['depth'])); } else { drupal_access_denied(); |