<%# # @file # this code generates the list of icons in the filter box in the upper right menu area #%> <% @mappers = [] @synapses = [] @metacodes = [] @metacodelist = '' @mapperlist = '' @synapselist = '' # There are essentially three functions happening here one to fill data to #@mappers with all people who have mapped on the selected map, which #actually gets checked twice once for topics or within @metacodes and once #for synapses on the map. @synapses get filled with all synapses on the map #and metacodes is filled with all the metacodes that are being used on the map. if @map @alltopics.each_with_index do |topic, index| if @metacodes.index(topic.metacode) == nil @metacodes.push(topic.metacode) end end @allsynapses.each_with_index do |synapse, index| if @synapses.index{|s| s.desc == synapse.desc} == nil @synapses.push(synapse) end end @allmappings.each_with_index do |mapping, index| if @mappers.index(mapping.user) == nil @mappers.push(mapping.user) end end elsif @topic @alltopics.each_with_index do |topic, index| if @metacodes.index(topic.metacode) == nil @metacodes.push(topic.metacode) end if @mappers.index(topic.user) == nil @mappers.push(topic.user) end end @allsynapses.each_with_index do |synapse, index| if @synapses.index{|s| s.desc == synapse.desc} == nil @synapses.push(synapse) end if @mappers.index(synapse.user) == nil @mappers.push(synapse.user) end end end if @map || @topic @metacodes.sort! {|x,y| n1 = x.name || "" n2 = y.name || "" n1 <=> n2 } @synapses.sort! {|x,y| d1 = x.desc || "" d2 = y.desc || "" d1 <=> d2 } @mappers.sort! {|x,y| n1 = x.name || "" n2 = y.name || "" n1 <=> n2 } @metacodes.each_with_index do |metacode, index| @metacodelist += '
  • ' @metacodelist += '' + metacode.name + '' @metacodelist += '

    ' + metacode.name.downcase + '

  • ' end @synapses.each_with_index do |synapse, index| d = synapse.desc || "" @synapselist += '
  • ' @synapselist += 'synapse icon

    ' + d @synapselist += '

  • ' end @mappers.each_with_index do |mapper, index| @mapperlist += '
  • ' @mapperlist += '' + mapper.name + '' @mapperlist += '

    ' + mapper.name + '

  • ' end end %>

    FILTER BY

    <%= @map ? "MAPPERS" : @topic ? "CREATORS" : "" %>

    NONE ALL

    METACODES

    NONE ALL

    SYNAPSES

    NONE ALL