summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2013-06-14 22:59:22 (GMT)
committerAlex Pott2013-06-14 22:59:22 (GMT)
commitfa6444e06794bea6b2a20dd0d4e241912fac21d8 (patch)
tree375cc360fa4b9494780132415c4749da2c8bcf3d
parentf6f0478873d72965ab4e398e605caa9b1f2a0325 (diff)
Issue #2008974 by K15.Multik, drupee: Replace theme() with drupal_render() in book module.
-rw-r--r--core/modules/book/book.admin.inc7
-rw-r--r--core/modules/book/book.module7
-rw-r--r--core/modules/book/book.pages.inc3
-rw-r--r--core/modules/book/lib/Drupal/book/Controller/BookController.php8
-rw-r--r--core/modules/book/lib/Drupal/book/Plugin/Block/BookNavigationBlock.php3
5 files changed, 16 insertions, 12 deletions
diff --git a/core/modules/book/book.admin.inc b/core/modules/book/book.admin.inc
index 8f30ada..63118ab 100644
--- a/core/modules/book/book.admin.inc
+++ b/core/modules/book/book.admin.inc
@@ -219,8 +219,9 @@ function theme_book_admin_table($variables) {
$form[$key]['mlid']['#attributes']['class'] = array('book-mlid');
$form[$key]['weight']['#attributes']['class'] = array('book-weight');
+ $indentation = array('#theme' => 'indentation', '#size' => $form[$key]['depth']['#value'] - 2);
$data = array(
- theme('indentation', array('size' => $form[$key]['depth']['#value'] - 2)) . drupal_render($form[$key]['title']),
+ drupal_render($indentation) . drupal_render($form[$key]['title']),
drupal_render($form[$key]['weight']),
drupal_render($form[$key]['plid']) . drupal_render($form[$key]['mlid']),
);
@@ -254,6 +255,6 @@ function theme_book_admin_table($variables) {
$row['class'][] = 'draggable';
$rows[] = $row;
}
-
- return theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'book-outline'), 'empty' => t('No book content available.')));
+ $table = array('#theme' => 'table', '#header' => $header, '#rows' => $rows, '#attributes' => array('id' => 'book-outline'), '#empty' => t('No book content available.'));
+ return drupal_render($table);
}
diff --git a/core/modules/book/book.module b/core/modules/book/book.module
index fd02382..1fe04c8 100644
--- a/core/modules/book/book.module
+++ b/core/modules/book/book.module
@@ -773,8 +773,9 @@ function book_node_load($nodes, $types) {
function book_node_view(EntityInterface $node, EntityDisplay $display, $view_mode) {
if ($view_mode == 'full') {
if (!empty($node->book['bid']) && empty($node->in_preview)) {
+ $book_navigation = array( '#theme' => 'book_navigation', '#book_link' => $node->book);
$node->content['book_navigation'] = array(
- '#markup' => theme('book_navigation', array('book_link' => $node->book)),
+ '#markup' => drupal_render($book_navigation),
'#weight' => 100,
'#attached' => array(
'css' => array(
@@ -1189,8 +1190,8 @@ function book_node_export(EntityInterface $node, $children = '') {
unset($build['#theme']);
// @todo Rendering should happen in the template using render().
$node->rendered = drupal_render($build);
-
- return theme('book_node_export_html', array('node' => $node, 'children' => $children));
+ $book_node_export_html = array('#theme' => 'book_node_export_html', '#node' => $node, '#children' => $children );
+ return drupal_render($book_node_export_html);
}
/**
diff --git a/core/modules/book/book.pages.inc b/core/modules/book/book.pages.inc
index 67c4c99..bc5ec53 100644
--- a/core/modules/book/book.pages.inc
+++ b/core/modules/book/book.pages.inc
@@ -72,7 +72,8 @@ function book_export_html(EntityInterface $node) {
if (isset($node->book)) {
$tree = book_menu_subtree_data($node->book);
$contents = book_export_traverse($tree, 'book_node_export');
- return theme('book_export_html', array('title' => $node->label(), 'contents' => $contents, 'depth' => $node->book['depth']));
+ $book_exported_html = array('#theme' => 'book_export_html', '#title' => $node->label(), '#contents' => $contents, '#depth' => $node->book['depth']);
+ return drupal_render($book_exported_html);
}
else {
throw new NotFoundHttpException();
diff --git a/core/modules/book/lib/Drupal/book/Controller/BookController.php b/core/modules/book/lib/Drupal/book/Controller/BookController.php
index 4b192b4..7b10eaf 100644
--- a/core/modules/book/lib/Drupal/book/Controller/BookController.php
+++ b/core/modules/book/lib/Drupal/book/Controller/BookController.php
@@ -67,8 +67,8 @@ class BookController implements ControllerInterface {
);
$rows[] = $row;
}
-
- return theme('table', array('header' => $headers, 'rows' => $rows, 'empty' => t('No books available.')));
+ $table = array('#theme' => 'table', '#header' => $headers, '#rows' => $rows, '#empty' => t('No books available.'));
+ return drupal_render($table);
}
/**
@@ -82,8 +82,8 @@ class BookController implements ControllerInterface {
foreach ($this->bookManager->getAllBooks() as $book) {
$book_list[] = l($book['title'], $book['href'], $book['options']);
}
-
- return theme('item_list', array('items' => $book_list));
+ $item_list = array('#theme' => 'item_list' , '#items' => $book_list);
+ return drupal_render($item_list);
}
}
diff --git a/core/modules/book/lib/Drupal/book/Plugin/Block/BookNavigationBlock.php b/core/modules/book/lib/Drupal/book/Plugin/Block/BookNavigationBlock.php
index fd48f7d..8cacc04 100644
--- a/core/modules/book/lib/Drupal/book/Plugin/Block/BookNavigationBlock.php
+++ b/core/modules/book/lib/Drupal/book/Plugin/Block/BookNavigationBlock.php
@@ -107,8 +107,9 @@ class BookNavigationBlock extends BlockBase {
$data = array_shift($tree);
$below = menu_tree_output($data['below']);
if (!empty($below)) {
+ $book_title_link = array('#theme' => 'book_title_link', '#link' => $data['link']);
return array(
- '#title' => theme('book_title_link', array('link' => $data['link'])),
+ '#title' => drupal_render($book_title_link),
$below,
);
}