Method: Anoubis::Data::Set#set_current_tab

Defined in:
app/controllers/anoubis/data/set.rb

#set_current_tabObject

Gets tab for current controller and place it into self.etc.tab system variable. If params absent or incorrect then self.etc.tab is set as first value of Defaults#tabs hash.



24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'app/controllers/anoubis/data/set.rb', line 24

def set_current_tab
  if !self.etc.tab
    tabs = self.tabs
    if params.key? :tab
      if params[:tab].to_s != ''
        if tabs.key? params[:tab].to_s.to_sym
          self.etc.tab = Etc::TabItem.new(self.get_tab(params[:tab].to_s, tabs[params[:tab].to_s.to_sym]))
        end
      end
    end
    self.etc.tab = Etc::TabItem.new(self.get_tab(tabs.keys[0].to_s, tabs.values[0])) if !self.etc.tab
  end
end