Class: Radiant::AdminUI

Inherits:
Object
  • Object
show all
Includes:
Simpleton
Defined in:
lib/radiant/admin_ui.rb

Defined Under Namespace

Classes: DuplicateTabNameError, NavSubItem, NavTab, RegionPartials, RegionSet

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Simpleton

included

Constructor Details

#initializeAdminUI

Returns a new instance of AdminUI.



131
132
133
134
# File 'lib/radiant/admin_ui.rb', line 131

def initialize
  @nav = NavTab.new("Tab Container")
  load_default_regions
end

Instance Attribute Details

Returns the value of attribute nav.



111
112
113
# File 'lib/radiant/admin_ui.rb', line 111

def nav
  @nav
end

Instance Method Details

#load_default_navObject



136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/radiant/admin_ui.rb', line 136

def load_default_nav
  content = nav_tab("Content")
  content << nav_item("Pages", "/admin/pages")
  nav << content

  design = nav_tab("Design")
  design << nav_item("Layouts", "/admin/layouts")
  design << nav_item("Snippets", "/admin/snippets")
  nav << design

  settings = nav_tab("Settings")
  settings << nav_item("Personal", "/admin/preferences")
  settings << nav_item("Users", "/admin/users")
  settings << nav_item("Extensions", "/admin/extensions")
  nav << settings
end

#load_default_regionsObject



153
154
155
156
157
158
159
# File 'lib/radiant/admin_ui.rb', line 153

def load_default_regions
  @page = load_default_page_regions
  @snippet = load_default_snippet_regions
  @layout = load_default_layout_regions
  @user = load_default_user_regions
  @extension = load_default_extension_regions
end


117
118
119
# File 'lib/radiant/admin_ui.rb', line 117

def nav_item(*args)
  NavSubItem.new(*args)
end


113
114
115
# File 'lib/radiant/admin_ui.rb', line 113

def nav_tab(*args)
  NavTab.new(*args)
end

#tabsObject



121
122
123
# File 'lib/radiant/admin_ui.rb', line 121

def tabs
  nav['Content']
end