Skip to content
Snippets Groups Projects
Commit 31fbddc4 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #276860 by pwolanin: removed dead code from book module. Does not...

- Patch #276860 by pwolanin: removed dead code from book module. Does not affect the book module tests.
parent 7b66734d
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -229,26 +229,3 @@ function theme_book_admin_table($form) {
return theme('table', $header, $rows, array('id' => 'book-outline'));
}
/**
* Recursive helper to sort each layer of a book tree by weight.
*/
function _book_admin_sort_tree(&$tree) {
uasort($tree, '_book_admin_compare');
foreach ($tree as $key => $subtree) {
if (!empty($tree[$key]['below'])) {
_book_admin_sort_tree($tree[$key]['below']);
}
}
}
/**
* Used by uasort() in _book_admin_sort_tree() to compare items in a book tree.
*/
function _book_admin_compare($a, $b) {
$weight = $a['link']['weight'] - $b['link']['weight'];
if ($weight) {
return $weight;
}
return strncmp($a['link']['title'], $b['link']['title']);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment