links/lib/links/engine.rb

51 lines
2.2 KiB
Ruby

module WebResource
class Engine < ::Rails::Engine
initializer "web_resource" do
OrbitApp.registration "WebResource", :type => "ModuleApp" do
module_label "link"
base_url File.expand_path File.dirname(__FILE__)
taggable "WebLink"
widget_methods ["widget"]
categorizable
authorizable
frontend_enabled
side_bar do
head_label_i18n 'web_resource',:icon_class=>"icons-link"
available_for [:admin,:manager,:sub_manager]
active_for_controllers ({:private=>['web_resource']})
head_link_path "admin_web_resources_path"
context_link 'list_',
:link_path=>"admin_web_resources_path" ,
:priority=>1,
:active_for_action=>{'admin/web_resources'=>'index'},
:available_for => [:all]
context_link 'new_',
:link_path=>"new_admin_web_resource_path" ,
:priority=>2,
:active_for_action=>{'admin/web_resources'=>'new'},
:available_for => [:sub_manager]
context_link 'categories',
:link_path=>"admin_module_app_categories_path" ,
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'web_resource').id}",
:priority=>3,
:active_for_action=>{'admin/web_resources.'=>'categories'},
:active_for_category => 'WebResource',
:available_for => [:manager]
context_link 'tags',
:link_path=>"admin_module_app_tags_path" ,
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'web_resource').id}",
:priority=>4,
:active_for_action=>{'admin/web_resources'=>'tags'},
:active_for_tag => 'WebResource',
:available_for => [:manager]
end
end
end
end
end