<#if parentId?has_content>
<ul>
    <@_categoryList advanced=true parentId=parentId pageSize=500>
        <#list page.list as a>
            <li<#if a.childIds?has_content> _src="cmsCategory/moveParameters.html?parentId=${a.id}"</#if>>
                <a href="javascript:;" class="exclude-translate" onclick="$('input[name=parentId]',$.pdialog.getCurrent()).val('${a.id}');$('form',$.pdialog.getCurrent()).submit();">${a.name!}</a>
            </li>
        <#else>
            <li><a><@t.page 'empty_directory'/></a></li>
        </#list>
    </@_categoryList>
</ul>
<#else>
<script>
$('.pageContent table tbody tr input[name=ids]',navTab.getCurrentPanel()).each(function(){
    if($(this).is(":checked")){
        $('<input type="hidden" name="ids" value="'+$(this).val()+'"/>').appendTo($('.idsToMove',$.pdialog.getCurrent()));
    }
});
if(0==$('.idsToMove input',$.pdialog.getCurrent()).length){
    alertMsg.error('<@t.page 'category.parent.please_select'/>');
    $.pdialog.closeCurrent();
}
</script>
<div class="pageFormContent" layoutH>
    <form action="cmsCategory/move?callbackType=closeCurrent&navTabId=cmsCategory/list&rel=page" method="post" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone);">
        <input type="hidden" name="parentId" value=""/>
        <input type="hidden" name="_csrf" value="<@_csrfToken admin=true/>"/>
        <div class="idsToMove"></div>
        <ul class="tree treeFolder expand">
            <li>
                <a href="javascript:;" onclick="return false;"><@t.page 'category.parent.select'/></a>
                <ul>
                    <@_categoryList advanced=true pageSize=500>
                        <#list page.list as a>
                            <li<#if a.childIds?has_content> _src="cmsCategory/moveParameters.html?parentId=${a.id}"</#if>>
                                <a href="javascript:;" class="exclude-translate" onclick="$('input[name=parentId]',$.pdialog.getCurrent()).val('${a.id}');$('form',$.pdialog.getCurrent()).submit();">${a.name!}</a>
                            </li>
                        <#else>
                            <li><a><@t.page 'empty_directory'/></a></li>
                        </#list>
                    </@_categoryList>
                </ul>
            </li>
        </ul>
    </form>
</div>
<div class="formBar">
    <ul>
        <li><button type="button" class="button close"><@t.page 'button.close'/></button></li>
    </ul>
</div>
</#if>