Class: ODDB::View::Navigation

Inherits:
HtmlGrid::Composite show all
Includes:
ExternalLinks
Defined in:
src/view/navigation.rb

Direct Known Subclasses

LanguageChooser, LanguageChooserShort, ZoneNavigation

Constant Summary

COMPONENTS =
{}
LEGACY_INTERFACE =
false
NavigationLink
'subheading'
:navigation
SYMBOL_MAP =
{
  :navigation_divider =>  HtmlGrid::Text,
}

Instance Method Summary (collapse)

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(links = @lookandfeel.send(self::class::NAV_METHOD))



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

def build_navigation(links = @lookandfeel.send(self::class::NAV_METHOD))
  links.each_with_index { |state, idx| 
    pos = [idx*2,0]
    if(state.is_a?(String))
      state = state.intern
    end
    #css_map.store(pos, self::class::NAV_LINK_CSS)
    component_css_map.store(pos, self::class::NAV_LINK_CSS)
    evt = if(state.is_a?(Symbol))
      unless(self.respond_to?(state))
        symbol_map.store(state, self::class::NAV_LINK_CLASS)
      end
      state
    else
      evt = state.direct_event
      symbol_map.store(evt, self::class::NAV_LINK_CLASS)
      evt
    end
    components.store(pos, evt)
    components.store([idx*2-1,0], 'navigation_divider') if idx > 0
  }
end

- (Object) home(model)



48
49
50
51
52
# File 'src/view/navigation.rb', line 48

def home(model)
  link = self.class::NAV_LINK_CLASS.new(:home_drugs, model, @session, self)
  link.value = @lookandfeel.lookup(:home)
  link
end

- (Object) init



22
23
24
25
# File 'src/view/navigation.rb', line 22

def init
  build_navigation()
  super
end