Sha256: 64be4a3877136fa00734a62109d32318a2453044b038340b4bbaf7c8d7d759c2

Contents?: true

Size: 1.15 KB

Versions: 3

Compression:

Stored size: 1.15 KB

Contents

module Refinery
  module Contacts
    class Engine < Rails::Engine
      include Refinery::Engine
      isolate_namespace Refinery::Contacts

      engine_name :refinery_contacts

      def self.register(tab)
        tab.name = tab.name = ::I18n.t(:'refinery.plugins.contacts.tab_name')
        tab.partial = "/refinery/admin/pages/tabs/contacts/contacts"
      end

      initializer "register refinerycms_contacts plugin" do
        Refinery::Plugin.register do |plugin|
          plugin.name = "contacts"
          plugin.url = proc { Refinery::Core::Engine.routes.url_helpers.contacts_admin_contacts_path }
          plugin.pathname = root
          plugin.activity = {
            :class_name => :'refinery/contacts/contact'
          }
          
        end
      end

      config.to_prepare do
        require 'refinerycms-pages'
        Refinery::Page.send :has_one_contact
      end

      config.before_initialize do
        require 'recaptcha/rails'
      end

      config.after_initialize do
        Refinery::Pages::Tab.register do |tab|
          register tab
        end
        Refinery.register_extension(Refinery::Contacts)
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
refinerycms-contacts-0.1.2 lib/refinery/contacts/engine.rb
refinerycms-contacts-0.1.1 lib/refinery/contacts/engine.rb
refinerycms-contacts-0.1.0 lib/refinery/contacts/engine.rb