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

merge-requests/26/head
Dries Buytaert 2008-07-01 20:59:38 +00:00
parent 7b66734d4e
commit 31fbddc458
1 changed files with 0 additions and 23 deletions

View File

@ -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']);
}