- Patch #276860 by pwolanin: removed dead code from book module. Does not affect the book module tests.
parent
7b66734d4e
commit
31fbddc458
|
@ -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']);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue