Class: Radiant::AdminUI

Inherits:
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.



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

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

Instance Attribute Details

Returns the value of attribute nav.



93
94
95
# File 'lib/radiant/admin_ui.rb', line 93

def nav
  @nav
end

Instance Method Details

#load_default_navObject



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/radiant/admin_ui.rb', line 118

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

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

  # media = NavTab.new(:assets, "Assets")
  # media << NavSubItem.new(:all, "All", "/admin/assets/")
  # media << NavSubItem.new(:all, "Unattached", "/admin/assets/unattached/")

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

#load_default_regionsObject



139
140
141
142
143
144
145
# File 'lib/radiant/admin_ui.rb', line 139

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


99
100
101
# File 'lib/radiant/admin_ui.rb', line 99

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


95
96
97
# File 'lib/radiant/admin_ui.rb', line 95

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

#tabsObject



103
104
105
# File 'lib/radiant/admin_ui.rb', line 103

def tabs
  nav[:content]
end