Sha256: 7948934f3b30ec779404d0bbd95b687c6a2acc70bc1f8764fa474dfb6a17b6c3

Contents?: true

Size: 912 Bytes

Versions: 17

Compression:

Stored size: 912 Bytes

Contents

module Cms
class PortletsController < Cms::ContentBlockController
  
  protected
    def load_blocks
      @blocks = Portlet.search(params[:search]).paginate(
        :page => params[:page],
        :order => params[:order] || "name",
        :conditions => ["deleted = ?", false]
      )
    end
  
    def build_block
      if params[:type].blank?
        @block = model_class.new
      else
        @block = params[:type].classify.constantize.new(params[params[:type]])
      end
    end
    
    def update_block
      load_block
      @block.update_attributes(params[@block.class.name.underscore])
    end    
    
    def block_form
      "portlets/portlets/form"
    end
    
    def new_block_path(block)
      new_portlet_path
    end
  
    def block_path(block, action=nil)
      send("#{action ? "#{action}_" : ""}portlet_path", block)
    end

    def blocks_path
      portlets_path
    end
end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
browsercms-3.5.7 app/controllers/cms/portlets_controller.rb
browsercms-3.5.6 app/controllers/cms/portlets_controller.rb
browsercms-3.5.5 app/controllers/cms/portlets_controller.rb
browsercms-3.5.4 app/controllers/cms/portlets_controller.rb
browsercms-3.5.3 app/controllers/cms/portlets_controller.rb
browsercms-3.5.2 app/controllers/cms/portlets_controller.rb
browsercms-3.5.1 app/controllers/cms/portlets_controller.rb
browsercms-3.5.0 app/controllers/cms/portlets_controller.rb
browsercms-3.5.0.rc3 app/controllers/cms/portlets_controller.rb
browsercms-3.5.0.rc2 app/controllers/cms/portlets_controller.rb
browsercms-3.5.0.rc1 app/controllers/cms/portlets_controller.rb
browsercms-3.4.2 app/controllers/cms/portlets_controller.rb
browsercms-3.4.2.rc1 app/controllers/cms/portlets_controller.rb
browsercms-3.4.1 app/controllers/cms/portlets_controller.rb
browsercms-3.4.0 app/controllers/cms/portlets_controller.rb
browsercms-3.4.0.rc2 app/controllers/cms/portlets_controller.rb
browsercms-3.4.0.rc1 app/controllers/cms/portlets_controller.rb