aboutsummaryrefslogtreecommitdiffstats
path: root/lib/refinery/banners/engine.rb
blob: 94c35acd13b0fd0fe7753a071387a82465e1df41 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
module Refinery
  module Banners
    class Engine < Rails::Engine
      include Refinery::Engine
      isolate_namespace Refinery::Banners

      engine_name :refinery_banners

      initializer "register refinerycms_banners plugin" do
        Refinery::Plugin.register do |plugin|
          plugin.name = "banners"
          plugin.url = proc { Refinery::Core::Engine.routes.url_helpers.banners_admin_banners_path }
          plugin.pathname = root
          plugin.activity = {
            :class_name => :'refinery/banners/banner',
            :title => 'name'
          }

        end
      end

      initializer "refinerycms_banners.assets.precompile" do |app|
        app.config.assets.precompile += %w(banners.js jquery.tristate.js)
      end

      config.to_prepare do
        require 'page_extensions'
        Refinery::Page.send :include, Refinery::Banners::Extensions::Page
      end

      config.after_initialize do
        Refinery.register_extension(Refinery::Banners)
      end
    end
  end
end