<xf:macro name="simple_node_list"
arg-nodeIds="{{ [] }}"
arg-selected="0"
arg-pathToSelected="{{ [] }}"
arg-children="!"
arg-isActive="{{ false }}"
arg-startExpanded="">
<ol class="categoryList toggleTarget{{ $isActive ? ' is-active' : '' }}">
<xf:foreach loop="$children" key="$id" value="$child">
<xf:macro name="simple_node_list_item"
arg-node="{$child.record}"
arg-nodeIds="{$nodeIds}"
arg-children="{$child.children}"
arg-selected="{$selected}"
arg-pathToSelected="{$pathToSelected}"
arg-startExpanded="{$startExpanded}"
/>
</xf:foreach>
</ol>
</xf:macro>
<xf:macro name="simple_node_list_item"
arg-node="{$node}"
arg-nodeIds="{$nodeIds}"
arg-children="{$children}"
arg-selected="!"
arg-pathToSelected="{{ [] }}"
arg-startExpanded="">
<xf:set var="$isSelected" value="{{ $node.node_id == $selected }}" />
<xf:set var="$hasPathToSelected" value="{$pathToSelected.{$node.node_id}}" />
<xf:set var="$isActive" value="{{ $isSelected OR $startExpanded OR $hasPathToSelected AND $children is not empty }}" />
<li class="categoryList-item">
<div class="categoryList-itemRow">
<xf:if is="$children is not empty">
<a class="categoryList-toggler{{ $isActive ? ' is-active' : '' }}"
data-xf-click="toggle" data-target="< :up :next"
role="button" tabindex="0" aria-label="{{ phrase('toggle_expanded') }}"
></a>
<xf:else />
<span class="categoryList-togglerSpacer"></span>
</xf:if>
<xf:if is="$node.node_type_id == 'Category'">
<xf:macro name="node_title_category" arg-node="{$node}" arg-isSelected="{$isSelected}" />
<xf:elseif is="$node.node_type_id == 'Forum'" />
<xf:macro name="node_title_forum" arg-node="{$node}" arg-isSelected="{$isSelected}" />
<xf:elseif is="$node.node_type_id == 'LinkForum'" />
<xf:macro name="node_title_link_forum" arg-node="{$node}" arg-isSelected="{$isSelected}" />
<xf:elseif is="$node.node_type_id == 'Page'" />
<xf:macro name="node_title_page" arg-node="{$node}" arg-isSelected="{$isSelected}" />
<xf:elseif is="$node.node_type_id == 'SearchForum'" />
<xf:macro name="node_title_search_forum" arg-node="{$node}" arg-isSelected="{$isSelected}" />
</xf:if>
</div>
<xf:if is="$children is not empty">
<xf:macro name="simple_node_list"
arg-selected="{$selected}"
arg-pathToSelected="{$pathToSelected}"
arg-children="{$children}"
arg-isActive="{$isActive}"
arg-startExpanded="{$isActive}"
/>
</xf:if>
</li>
</xf:macro>
<xf:macro name="node_title_category" arg-node="!" arg-isSelected="!">
<a href="{{ link('categories', $node) }}" class="categoryList-link{{ $isSelected ? ' is-selected' : '' }}">
{$node.title}
</a>
</xf:macro>
<xf:macro name="node_title_forum" arg-node="!">
<a href="{{ link('forums', $node) }}" class="categoryList-link{{ $isSelected ? ' is-selected' : '' }}">
{$node.title}
</a>
</xf:macro>
<xf:macro name="node_title_link_forum" arg-node="!">
<a href="{{ link('link-forums', $node) }}" class="categoryList-link{{ $isSelected ? ' is-selected' : '' }}">
{$node.title}
</a>
</xf:macro>
<xf:macro name="node_title_page" arg-node="!">
<a href="{{ link('pages', $node) }}" class="categoryList-link{{ $isSelected ? ' is-selected' : '' }}">
{$node.title}
</a>
</xf:macro>
<xf:macro name="node_title_search_forum" arg-node="!">
<a href="{{ link('search-forums', $node) }}" class="categoryList-link{{ $isSelected ? ' is-selected' : '' }}">
{$node.title}
</a>
</xf:macro>