-$idBase = 'kriatree_'.rand_str('1234567890', 10)
-$idBase_div = $idBase.'_div'

-if($value === NULL)
  %b=$key
  %i='NULL'
-else
  -if(is_object($value))
    $value = (array)$value
  -if(is_array($value))
    %div(class="kriatree" id="#{$idBase}")
      %b=$key
      %img(src="#{url('/images/plus.gif')}")
      =t('Click to expand/collapse')
    %div(id="#{$idBase_div}" style="display: none;")      
      -ksort($value)
      %ul(style="list-style: none;")
        -if(count($value) <= 0)
          %li
            %i='('.t('Empty').')'
        -else
          -foreach($value as $k => $v)
            %li
              -$this->renderPartial('/shared/_treeBuilder', array('key' => $k,'value' => $v))
  -else
    %b=$key
    %i="".var_export($value, true)." (".gettype($value).")"
