pagecontent/lib/page_content/engine.rb

37 lines
1.3 KiB
Ruby

module PageContent
class Engine < ::Rails::Engine
initializer "page_content" do
Rails.application.config.to_prepare do
OrbitApp.registration "PageContent", :type => "ModuleApp" do
module_label "page_content.page_content"
base_url File.expand_path File.dirname(__FILE__)
frontend_enabled
authorizable
categorizable
side_bar do
head_label_i18n 'page_content.page', icon_class: "icons-newspaper"
available_for "users"
active_for_controllers (['admin/page_contents', 'admin/wiki_pages'])
head_link_path "admin_page_contents_path"
context_link 'page_content.all',
:link_path=>"admin_page_contents_path" ,
:priority=>1,
:active_for_action=>{'admin/page_contents'=>"index"},
:available_for => 'users'
context_link 'categories',
:link_path=>"admin_module_app_categories_path" ,
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'page_content').id}",
:priority=>3,
:active_for_action=>{'admin/page_contents'=>'categories'},
:active_for_category => 'PageContent',
:available_for => 'managers'
end
end
end
end
end
end