class Panel::Archive::BackEnd::ArchiveFileCategorysController < OrbitBackendController
  
  def index
    @archive_file_categorys = ArchiveFileCategory.all
    @archive_file_category = ArchiveFileCategory.new(:display => 'List')
	
	@url = panel_archive_back_end_archive_file_categorys_path
	
    respond_to do |format|
      format.html # index.html.erb
      format.js
    end
  end

  # GET /archive_files/1
  # GET /archive_files/1.xml
  def show
    @archive_file_category = ArchiveFileCategory.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.js
    end
  end

  # GET /archive_files/new
  # GET /archive_files/new.xml
  def new
    @archive_file_category = ArchiveFileCategory.new(:display => 'List')

    respond_to do |format|
      format.html # new.html.erb
      format.js
    end
  end
  
  # GET /archive_files/1/edit
  def edit
    @archive_file_category = ArchiveFileCategory.find(params[:id])
	
	@url = panel_archive_back_end_archive_file_category_path(@archive_file_category)

    respond_to do |format|
      format.html
      format.js
    end
  end

  # POST /archive_files
  # POST /archive_files.xml
  def create
    @archive_file_category = ArchiveFileCategory.new(params[:archive_file_category])

    respond_to do |format|
      if @archive_file_category.save
        format.html { redirect_to(panel_archive_back_end_archive_file_categorys_url, :notice => t('archive_file_category.create_archive_file_category_success')) }
        format.js
      else
        format.html { render :action => "new" }
        format.js { render action: "new" }
      end
    end
  end

  # PUT /archive_files/1
  # PUT /archive_files/1.xml
  def update
    @archive_file_category = ArchiveFileCategory.find(params[:id])
	
	@url = panel_archive_back_end_archive_file_category_path(@archive_file_category)

    respond_to do |format|
      if @archive_file_category.update_attributes(params[:archive_file_category])
        format.html { redirect_to(panel_archive_back_end_archive_file_categorys_url, :notice => t('archive_file_category.update_archive_file_category_success')) }
        # format.xml  { head :ok }
        format.js
      else
        format.html { render :action => "edit" }
        format.js { render :action => "edit" }
      end
    end
  end

  # DELETE /archive_files/1
  # DELETE /archive_files/1.xml
  def destroy
    @archive_file_category = ArchiveFileCategory.find(params[:id])
    @archive_file_category.destroy

    respond_to do |format|
      format.html { redirect_to(panel_archive_back_end_archive_file_categorys_url) }
      # format.xml  { head :ok }
      format.js
    end
  end
end
