--- ./ezpublish_legacy/design/admin/templates/content/browse_mode_list-backup.tpl 2014-07-25 16:03:33.452280948 +0200 +++ ./ezpublish_legacy/design/admin/templates/content/browse_mode_list.tpl 2014-07-29 09:12:51.160157080 +0200 @@ -1,3 +1,7 @@ +{if and( eq( $browse.action_name, 'SwapNode' ), is_set( $browse.persistent_data.ContentNodeID ) )} + {def $swap_node = fetch( 'content', 'node', hash( 'node_id', $browse.persistent_data.ContentNodeID ) )} +{/if} +
@@ -57,8 +61,18 @@ {/if} {else} + {* + Do not allow node selection if + - Action is move, copy or add node, and item is not a container + - Action is swap node, and node to swap has children and item is not a container, and vice versa + *} {if and( or( eq( $browse.action_name, 'MoveNode' ), eq( $browse.action_name, 'CopyNode' ), eq( $browse.action_name, 'AddNodeAssignment' ) ), $Nodes.item.object.content_class.is_container|not )} + {elseif and( eq( $browse.action_name, 'SwapNode' ), + eq( get_class( $swap_node ), 'ezcontentobjecttreenode' ), + or( and( $swap_node.children_count|gt(0), $Nodes.item.object.content_class.is_container|not ), + and( $swap_node.is_container|not, $Nodes.item.children_count|gt(0) ) ) )} + {else} {/if} |
---|