<#-- -- Build the js script -- extendTitle : Title -- hasBoxTools : Has tools -- manageByResource : Default false --> <#macro extendBox cols=12 extendTitle='' hasBoxTools=false manageByResource=false extendBoxTools='' skipHead=true > <@row> <@columns> <@box color='primary'> <@boxHeader title=extendTitle boxTools=hasBoxTools skipHeader=skipHead > <#if extendBoxTools !='' && !manageByResource> ${extendBoxTools!} <#elseif hasBoxTools> <@tform type='inline' action='jsp/admin/plugins/extend/ManageResourceExtendersByResource.jsp'> <@input type='hidden' name='manageByResource' value='${manageByResource?c}' /> <@btnGroup> <#list resourceExtenderActions?reverse as resourceExtenderAction> <#if resourceExtenderAction.buttonTemplate?has_content> <#include resourceExtenderAction.buttonTemplate /> <@boxBody> <#nested> <#-- -- Build the js script --> <#macro extendScript> <#-- -- Build the attribute for sorting table -- @param filter the filter -- @return the attributes used in the URL --> <#function buildSortSearchAttribute filter> <#assign sortSearchAttribute = "" /> <#if filter??> <#if filter.filterExtenderType?? && filter.filterExtenderType != ""> <#assign sortSearchAttribute = sortSearchAttribute + "&filterExtenderType=" + filter.filterExtenderType /> <#if filter.filterIdExtendableResource?? && filter.filterIdExtendableResource != ""> <#assign sortSearchAttribute = sortSearchAttribute + "&filterIdExtendableResource=" + filter.filterIdExtendableResource /> <#if filter.filterExtendableResourceType?? && filter.filterExtendableResourceType != ""> <#assign sortSearchAttribute = sortSearchAttribute + "&filterExtendableResourceType=" + filter.filterExtendableResourceType /> <#return sortSearchAttribute /> <#-- -- Check if the given extender type has a config or not -- @param listExtender the list of extenders -- @param extenderType the extender type -- @return true if it has a config, false otherwise --> <#function isExtenderConfigRequired listExtenders extenderType> <#if listExtenders?? && listExtenders?has_content> <#list listExtenders as extender> <#if extender.key = extenderType> <#return extender.configRequired /> <#return false /> <#-- -- Check if the given extender type has a history or not -- @param listExtender the list of extenders -- @param extenderType the extender type -- @return true if it has a history, false otherwise --> <#function isExtenderHistoryEnable listExtenders extenderType> <#if listExtenders?? && listExtenders?has_content> <#list listExtenders as extender> <#if extender.key = extenderType> <#return extender.historyEnable /> <#return false /> <#function isExtenderStateEnable listExtenders extenderType> <#if listExtenders?? && listExtenders?has_content> <#list listExtenders as extender> <#if extender.key = extenderType> <#return extender.stateEnable /> <#return false /> <#-- -- Check if the user has the permission to see the button -- @param idExtender the id extender -- @param permission the permission key -- @param mapActionsPermissions the map of permission -- @return true if he has the permission, false otherwise --> <#function isAuthorized idExtender permission mapActionPermissions> <#if mapActionPermissions?? && mapActionPermissions?has_content> <#if mapActionPermissions["" + idExtender]??> <#return mapActionPermissions["" + idExtender][permission] /> <#return false />