app/presenters/tree_builder.rb
# Build an explorer tree, from scratch
# Options:
# :open_nodes             # Tree node ids of currently open nodes
# :full_ids               # stack parent id on top of each node id
# :lazy                   # set if tree is lazy
Build an explorer tree, from scratch
Options:
:open_nodes             # Tree node ids of currently open nodes
:full_ids               # stack parent id on top of each node id
:lazy                   # set if tree is lazy
Build an explorer tree from scratch Options : : open_nodes # Tree node ids of currently open nodes : full_ids # stack parent id on top of each node id : lazy # set if tree is lazy
def x_build_tree(options)
    nodes = x_get_tree_objects(nil, options, false, []).map do |child|
      if child.kind_of?(Hash) && child.key?(:text) && child.key?(:key) && child.key?(:image)
        child
      else
        x_build_node_tree(child, nil, options)
      end
    end
    return nodes unless respond_to?(:root_options, true)
    [{:key => 'root', :nodes => nodes, :expand => true}]
  end
def x_build_tree ( options ) nodes = x_get_tree_objects ( nil , options , false , [ ] ) . map do | child | if child . kind_of? ( Hash ) && child . key? ( :text ) && child . key? ( :key ) && child . key? ( :image ) child else x_build_node_tree ( child , nil , options ) end end return nodes unless respond_to? ( :root_options , true ) [ { :key => 'root' , :nodes => nodes , :expand => true } ] end
Build an explorer tree, from scratch
Options:
:open_nodes             # Tree node ids of currently open nodes
:full_ids               # stack parent id on top of each node id
:lazy                   # set if tree is lazy
Build an explorer tree from scratch Options : : open_nodes # Tree node ids of currently open nodes : full_ids # stack parent id on top of each node id : lazy # set if tree is lazy
# already a node? FIXME: make a class for node
options
<not_specific>