Class: Caboose::PostPlugin

Inherits:
CaboosePlugin show all
Defined in:
app/models/caboose/post_plugin.rb

Class Method Summary collapse

Methods inherited from CaboosePlugin

page_content

Class Method Details

.admin_nav(nav, user, page) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/models/caboose/post_plugin.rb', line 3

def self.admin_nav(nav, user, page)    
  return nav if user.nil? || !user.is_allowed('pages', 'view')
  
  item = {
    'id' => 'posts', 
    'text' => 'Posts',
    'children' => []      
    #'show_children_default' => true
  }
  item['children'] << { 
    'href' => "/admin/posts",
    'text' => 'New Post',
    'modal' => true 
  }
  if (user.is_allowed('posts', 'add'))
    item['children'] << { 
      'href' => "/admin/posts/new",
      'text' => 'New Post',
      'modal' => true 
    }
  end    
  nav << item
  return nav
end