module ParserCommon
def menu_level(page, current, menu, edit = false)
if current <= menu.levels
res = "
"
i = nil
i = 1 if menu.values["li_incremental_#{current}"]
if current == 1 && menu.values['home'].eql?('true')
res << menu_li(page, current, menu, i, edit)
i += 1 if i
end
page.children.each do |child|
res << menu_li(child, current, menu, i, edit)
i += 1 if i
end
res << "
"
end
end
def menu_li(page, current, menu, i, edit)
res = "
"
res << "#{page.name}"
res << menu_level(page, current + 1, menu, edit) if page.children.size > 0 && !page.is_home?
res << "