Advertisement
Guest User

Untitled

a guest
Mar 29th, 2013
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. {assign var="show_child" value="false"}
  2.  
  3. {if !isset($currentCategoryId)}
  4. <li {if isset($last) && $last == 'true'}class="last"{/if}>
  5. <a href="{$node.link}" title="{$node.desc|escape:html:'UTF-8'}">{$node.name|escape:html:'UTF-8'}</a>
  6. </li>
  7. {/if}
  8.  
  9. {if isset($currentCategoryId) && ($node.id == $currentCategoryId)}
  10. {assign var="show_child" value="true"}
  11. {/if}
  12.  
  13. {if $node.children|@count > 0}
  14. {foreach from=$node.children item=child name=categoryTreeBranch}
  15. {if isset($currentCategoryId) && ($child.id == $currentCategoryId)}
  16. {assign var="show_child" value="true"}
  17. {/if}
  18. {/foreach}
  19. {/if}
  20.  
  21. {if $show_child == 'true'}
  22. {if $node.children|@count > 0}
  23. {foreach from=$node.children item=child name=categoryTreeBranch}
  24. {if isset($smarty.foreach.categoryTreeBranch) && $smarty.foreach.categoryTreeBranch.last}
  25. {include file="$branche_tpl_path" node=$child show='true' last='true'}
  26. {else}
  27. {include file="$branche_tpl_path" node=$child show='true' last='false'}
  28. {/if}
  29. {/foreach}
  30. {if $child.children|@count > 0}
  31. {foreach from=$child.children item=child2 name=categoryTreeBranch2}
  32. {if isset($currentCategoryId) && ($child2.id == $currentCategoryId)}
  33. {assign var="show_child" value="true"}
  34. {/if}
  35. {/foreach}
  36. {/if}
  37. {/if}
  38. {/if}
  39.  
  40.  
  41. {if isset($show)}
  42. <li {if isset($last) && $last == 'true'}class="last"{/if}>
  43. <a href="{$node.link}" {if isset($currentCategoryId) && ($node.id == $currentCategoryId)}class="selected"{/if} title="{$node.desc|escape:html:'UTF-8'}">{$node.name|escape:html:'UTF-8'}</a>
  44. {if $node.children|@count > 0}
  45. <ul>
  46. {foreach from=$node.children item=child name=categoryTreeBranch}
  47. {if isset($smarty.foreach.categoryTreeBranch) && $smarty.foreach.categoryTreeBranch.last}
  48. {include file="$branche_tpl_path" node=$child show='true' last='true'}
  49. {else}
  50. {include file="$branche_tpl_path" node=$child show='true' last='false'}
  51. {/if}
  52. {/foreach}
  53. </ul>
  54. {/if}
  55. </li>
  56. {/if}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement