org.openurp.web.action.home.submenus.ftl Maven / Gradle / Ivy
[#ftl]
[#macro i18nNameTitle(entity)][#if locale.language?index_of("en")!=-1][#if entity.engTitle!?trim==""]${entity.title!}[#else]${entity.engTitle!}[/#if][#else][#if entity.title!?trim!=""]${entity.title!}[#else]${entity.engTitle!}[/#if][/#if][/#macro]
[#assign displayed={} /]
[#macro displayMenu menu]
[#if !(displayed[menu.id?string]??)][#assign displayed=displayed+{menu.id?string:menu}/][#else][#return/][/#if]
[#if menu.entry??]
[@b.a href="${(menu.entry.name)!}" target="main"][@i18nNameTitle menu/][/@]
[#else]
[@i18nNameTitle menu/]
[#list menu.children?sort_by("code") as child]
[#if submenus?seq_contains(child)][@displayMenu child/][/#if]
[/#list]
[/#if]
[/#macro]
[#macro menuEntry module]
[#if (module.entry!"")?trim?length=0][@b.a cssClass="p_1" href="${(module.entry.name)!}" target="main"][@i18nNameTitle module/] [/@]
[#else]
[@ems.guard res=module.entry.name][@b.a cssClass="p_1" href="${(module.entry.name)!}" target="main"][@i18nNameTitle module/][/@] [/@]
[/#if]
[/#macro]
[#if submenus?size>0]
[#assign nodeIndex=nodeIndex+1]
[/#if]
[/#list]