<#if parentId?has_content>
<ul>
    <@_categoryList advanced=true parentId=parentId pageSize=500>
        <#list page.list as a>
            <@t.merge 'categoryIds' a.id!/>
        </#list>
        <@_sysDeptCategory deptId=admin.deptId!'' categoryIds=t.categoryIds!><#assign deptCategoryMap=map!/></@_sysDeptCategory>
        <#list page.list as a>
            <#if (deptCategoryMap[a.id?string])?has_content&&deptCategoryMap[a.id?string]>
                <li <#if a.childIds?has_content>_src="cmsContent/moveParameters.html?parentId=${a.id}"</#if>>
                    <a href="javascript:;" class="exclude-translate" onclick="$('input[name=categoryId]',$.pdialog.getCurrent()).val('${a.id}');$('form',$.pdialog.getCurrent()).submit();" target="ajax">${a.name!}</a>
                </li>
            </#if>
        <#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 'content.please_select'/>');
    $.pdialog.closeCurrent();
}
</script>
<form action="cmsContent/move?callbackType=closeCurrent" method="post" autocomplete="off" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone);">
    <input type="hidden" name="categoryId" value=""/>
    <input type="hidden" name="_csrf" value="<@_csrfToken admin=true/>"/>
    <div class="idsToMove"></div>
    <div class="pageFormContent" layoutH>
        <ul class="tree treeFolder expand">
            <li>
                <a href="javascript:;" onclick="return false;"><@t.page 'category.select'/></a>
                <ul>
                <@_categoryList advanced=true pageSize=500>
                    <#list page.list as a>
                        <@t.merge 'categoryIds' a.id!/>
                    </#list>
                    <@_sysDeptCategory deptId=admin.deptId!'' categoryIds=t.categoryIds!><#assign deptCategoryMap=map!/></@_sysDeptCategory>
                    <#list page.list as a>
                        <#if (deptCategoryMap[a.id?string])?has_content&&deptCategoryMap[a.id?string]>
                            <li<#if a.childIds?has_content> _src="cmsContent/moveParameters.html?parentId=${a.id}"</#if>>
                                <a href="javascript:;" class="exclude-translate" onclick="$('input[name=categoryId]',$.pdialog.getCurrent()).val('${a.id}');$('form',$.pdialog.getCurrent()).submit();" target="ajax">${a.name!}</a>
                            </li>
                        </#if>
                    <#else>
                        <li><a><@t.page 'empty_directory'/></a></li>
                    </#list>
                </@_categoryList>
                </ul>
            </li>
        </ul>
    </div>
    <div class="formBar">
        <ul>
            <li><button type="button" class="button close"><@t.page 'button.close'/></button></li>
        </ul>
    </div>
</form>
</#if>