<#if parentId?has_content>
<ul>
    <@cms.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()).trigger('submit');">${a.name!}</a>
            </li>
        </#list>
    </@cms.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="<@tools.csrfToken admin=true/>"/>
        <div class="idsToMove"></div>
    </form>
    <ul class="tree treeFolder">
        <li>
            <a href="javascript:;"><@t.page 'category.parent.select'/></a>
            <ul>
                <li><a href="javascript:;" onclick="$('form',$.pdialog.getCurrent()).trigger('submit');"><@t.page 'empty_directory'/></a></li>
        <@cms.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()).trigger('submit');">${a.name!}</a>
                </li>
            </#list>
        </@cms.categoryList>
            </ul>
        </li>
    </ul>
</div>
<div class="formBar">
    <ul>
        <li><button type="button" class="button close"><@t.page 'button.close'/></button></li>
    </ul>
</div>
</#if>