Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- OLD:
- if (($node->name() == 'li') && ($id = $node->attributes('id'))) {
- if ($node->attributes('class')) {
- $node->addAttribute('class', $node->attributes('class').' item'.$id);
- } else {
- $node->addAttribute('class', 'item'.$id);
- }
- }
- NEW:
- if (($node->name() == 'li') && ($id = $node->attributes('id'))) {
- $class_name = '';
- if ($newItem = $menu->getItem($id)) {
- $tmp = clone($newItem);
- $class_name = $tmp->class_name;
- }
- if ($node->attributes('class')) {
- $node->addAttribute('class', $node->attributes('class').' item'.$id . ' ' . $class_name);
- } else {
- $node->addAttribute('class', 'item'.$id . ' ' . $class_name);
- }
- }
Add Comment
Please, Sign In to add comment