Sha256: 00de37548c4b2adbd2e60c1f521d2ede89a5050702e118e1e44d44daff1fdf4d

Contents?: true

Size: 918 Bytes

Versions: 8

Compression:

Stored size: 918 Bytes

Contents

class Admin::TrashController < AlchemyController
  
  filter_access_to [:index, :clear]
  
  before_filter :set_translation
  
  helper Admin::ElementsHelper
  
  def index
    @elements = Element.trashed
    @page = Page.find_by_id(params[:page_id])
    @allowed_elements = Element.all_for_page(@page)
		@draggable_trash_items = {}
		@elements.each { |e| @draggable_trash_items["element_#{e.id}"] = e.belonging_cellnames(@page) }
    render :layout => false
  rescue Exception => e
    exception_handler(e)
  end
  
  def clear
    @page = Page.find_by_id(params[:page_id])
    @elements = Element.trashed
    @elements.map(&:destroy)
    render :update do |page|
      page.call('Alchemy.growl', _("Cleared trash"))
      page << "Alchemy.refreshTrashWindow(#{@page.id})"
      page << "jQuery('#element_trash_button .icon').removeClass('full')"
    end
  rescue Exception => e
    exception_handler(e)
  end
  
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
alchemy_cms-2.0.7 app/controllers/admin/trash_controller.rb
alchemy_cms-2.0.6.1 app/controllers/admin/trash_controller.rb
alchemy_cms-2.0.5 app/controllers/admin/trash_controller.rb
alchemy_cms-2.0.4 app/controllers/admin/trash_controller.rb
alchemy_cms-2.0.3.1 app/controllers/admin/trash_controller.rb
alchemy_cms-2.0.3 app/controllers/admin/trash_controller.rb
alchemy_cms-2.0.2 app/controllers/admin/trash_controller.rb
alchemy_cms-2.0.1 app/controllers/admin/trash_controller.rb