app/presenters/tree_builder_pxe_customization_templates.rb
# Get root nodes count/array for explorer tree
Get root nodes count/array for explorer tree
Get root nodes count / array for explorer tree
def x_get_tree_roots(count_only, _options)
    items = PxeImageType.all
    if count_only
      items.length + 1
    else
      objects = []
      objects.push(:id    => "xx-system",
                   :text  => _("Examples (read only)"),
                   :image => "folder",
                   :tip   => _("Examples (read only)"))
      PxeImageType.all.sort.each do |item, _idx|
        objects.push(:id => "xx-#{to_cid(item.id)}", :text => item.name, :image => "folder", :tip => item.name)
      end
      objects
    end
  end
def x_get_tree_roots ( count_only , _options ) items = PxeImageType . all if count_only items . length + 1 else objects = [ ] objects . push ( :id => "xx-system" , :text => _ ( "Examples (read only)" ) , :image => "folder" , :tip => _ ( "Examples (read only)" ) ) PxeImageType . all . sort . each do | item , _idx | objects . push ( :id => "xx-#{to_cid(item.id)}" , :text => item . name , :image => "folder" , :tip => item . name ) end objects end end
Get root nodes count/array for explorer tree
Get root nodes count / array for explorer tree
# add +1 for customization spec folder thats used to show system templates
count_only
<not_specific>
_options
<not_specific>