# code: # * George Moschovitis # # (c) 2004 Navel, all rights reserved. # $Id: tabs.rb 101 2004-10-22 12:35:39Z gmosx $ module N; module UI # Render a tabs bar # # Example: # # #{N::UI.tabs(request, # ["Page1", "Page2", "Page3"] # } # def self.tabs(request, options, param) tabs = [] selected = request.get(param, 0) options.each_with_index { |opt, idx| if idx == selected tabs << %|#{opt}| else tabs << %|#{opt}| end } return %|
#{tabs.join('|')}
| end end; end # module