Class: BcmsFckeditor::FileBrowserController

Inherits:
Cms::BaseController
  • Object
show all
Defined in:
app/controllers/bcms_fckeditor/file_browser_controller.rb

Overview

FckEditor File Browser Integration

Instance Method Summary collapse

Instance Method Details

#indexObject

All requests generated by the file browser are handled by this controller action. Currently, there are 3 commands implemented:

a) Uploading a new image, which creates a new ImageBlock
b) Creating a new CMS Section
c) Displaying file browser contents


13
14
15
16
17
18
19
20
21
22
# File 'app/controllers/bcms_fckeditor/file_browser_controller.rb', line 13

def index
  @section = Cms::Section.find_by_name_path(params[:CurrentFolder])
  if request.post? && params[:NewFile]
    handle_file_browser_upload
  elsif params["Command"] == "CreateFolder"
    create_section
  else
    render_file_browser
  end
end