Sha256: f8cc83d5d6924fa33a09198feaaca0c5ff459f9349b27eb1d07b618504a1f399

Contents?: true

Size: 1.19 KB

Versions: 1

Compression:

Stored size: 1.19 KB

Contents

module Hancock::Catalog
  module Admin
    module CategoryImage
      def self.config(nav_label = nil, fields = {})
        if nav_label.is_a?(Hash)
          nav_label, fields = nav_label[:nav_label], nav_label
        elsif nav_label.is_a?(Array)
          nav_label, fields = nil, nav_label
        end
        nav_label ||= I18n.t('hancock.catalog')

        if Hancock::Catalog.config.gallery_support
          if Hancock::Catalog.mongoid?
            if block_given?
              Hancock::Gallery::Admin::EmbeddedImage.config(nav_label, fields) do |config|
                yield config
              end
            else
              Hancock::Gallery::Admin::EmbeddedImage.config(nav_label, fields)
            end

          else
            if block_given?
              Hancock::Gallery::Admin::Image.config(nav_label, fields) do |config|
                yield config
              end
            else
              Hancock::Gallery::Admin::Image.config(nav_label,fields)
            end
          end #if Hancock::Catalog.mongoid?
        end #if Hancock::Catalog.config.gallery_support

      end #def self.config(fields = {})

    end #module CategoryImage
  end #module Admin
end #module Hancock::Catalog

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hancock_cms_catalog-1.0.2 lib/hancock/catalog/admin/category_image.rb