{** * Sitemap, creates tree of CMS objects, content template * Date: 30.06.08 * * @package saurus4 * * @param show comma separated list of class names to exclusively show in the tree, defaults to "section" * @param parent ID of an object from where to start the site tree, defaults to level 1 sections * * @author Saurus * *}

{sysword word="sitemap" type="saurus4"}

{if $smarty.request.parent} {init_objects name="roots" parent=$smarty.request.parent|@intval classes=$smarty.request.show|default:"section"} {else} {init_objects name="roots" parent_system_alias="home" classes=$smarty.request.show|default:"section"} {/if} {assign var="tree" value=$roots|@array_reverse} {foreach from=$tree item="tree_item"} {$tree_levels|@array_push:0} {/foreach} {assign var="loop_control" value=true} {if sizeof($tree)} {strip} {* start the list *} {/section} {/if} {* close the node print out if there is no children for this node *} {if !sizeof($children)} {/if} {* put the children into the tree for travelling + their level *} {foreach from=$children item="child"} {$tree|@array_push:$child} {$tree_levels|@array_push:$node_level+1} {/foreach} {* close the while loop if there is no more nodes to travel *} {if sizeof($tree) == 0} {assign var="loop_control" value=false} {/if} {/while} {* close the list *} {/strip} {/if}{* sizeof($tree) *}