MDL-40344 navigation: expandable branch id is now properly unique

This commit is contained in:
Sam Hemelryk 2013-06-27 10:05:35 +12:00
parent f0d37f4ac5
commit 09da042b36

View File

@ -589,7 +589,7 @@ class navigation_node implements renderable {
public function find_expandable(array &$expandable) {
foreach ($this->children as &$child) {
if ($child->display && $child->has_children() && $child->children->count() == 0) {
$child->id = 'expandable_branch_'.(count($expandable)+1);
$child->id = 'expandable_branch_'.$child->type.'_'.clean_param($child->key, PARAM_ALPHANUMEXT);
$this->add_class('canexpand');
$expandable[] = array('id' => $child->id, 'key' => $child->key, 'type' => $child->type);
}