Class: ODDB::View::LanguageChooser

Inherits:
Navigation show all
Defined in:
src/view/language_chooser.rb

Constant Summary

CSS_CLASS =

“center“

nil
:languages
LanguageNavigationLink
HTML_ATTRIBUTES =
{ }

Constants inherited from Navigation

COMPONENTS, LEGACY_INTERFACE, NAV_LINK_CLASS, NAV_LINK_CSS, NAV_METHOD, SYMBOL_MAP

Instance Method Summary (collapse)

Methods inherited from Navigation

#home, #init

Methods included from ExternalLinks

#contact_link, #data_declaration, #external_link, #faq_link, #generic_definition, #help_link, #legal_note, #meddrugs_update, #wiki_link

Methods inherited from HtmlGrid::Composite

event_link, #hash_insert_col, #hash_insert_row

Instance Method Details

- (Object) build_navigation



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'src/view/language_chooser.rb', line 25

def build_navigation
  offset = 0
  @lookandfeel.languages.each_with_index { |state, idx| 
    xpos = idx*2
    pos = [xpos,0]
    if(state.is_a?(String))
      state = state.intern
    end
    symbol_map.store(state, LanguageNavigationLink)
    components.store(pos, state)
    components.store([xpos-1,0], :navigation_divider) if idx > 0
    offset = idx.next * 2
  }
  if(@lookandfeel.enabled?(:currency_switcher))
    components.store([offset-1, 0], 'dash_separator')
    @lookandfeel.currencies.each_with_index { |state, idx| 
      xpos = offset + idx*2
      pos = [xpos,0]
      if(state.is_a?(String))
        state = state.intern
      end
      symbol_map.store(state, CurrencyNavigationLink)
      components.store(pos, state)
      components.store([xpos-1,0], :navigation_divider) if idx > 0
    }
  end
end