Sha256: 46ae3ebc1194762c110fd3ede6225860fdf02a0f477aaa1d703b9a8c3539dd2f

Contents?: true

Size: 796 Bytes

Versions: 15

Compression:

Stored size: 796 Bytes

Contents

class Admin::TopicController < AdminController
  before_filter { licensed("forums") }

  before_filter :load_topic

  def show
  end

  def edit
  end

  def make
    v = params[:value]=='true' ? 1 : 0
    if params[:attr]=="visible"
      @topic.update_attributes(:is_visible=>v)
    end
    if params[:attr]=="open"
      @topic.update_attributes(:is_open=>v)
    end

    redirect_to "/admin/forums/topic/#{@topic.id}"
  end

  def update
    if @topic.update_attributes(params[:topic])
      redirect_to "/admin/forums/topic/#{@topic.id}"
    else
      render "edit"
    end
  end

  def destroy
    Topic.destroy(params[:id])
    flash[:notice] = "Topic Deleted"
    redirect_to "/admin/forums"
  end

  private 
  def load_topic
    @topic = Topic.find_sys_id(_sid, params[:id])
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
kit_cms-2.3.22 app/controllers/admin/topic_controller.rb
kit_cms-2.3.20 app/controllers/admin/topic_controller.rb
kit_cms-2.3.19 app/controllers/admin/topic_controller.rb
kit_cms-2.3.18 app/controllers/admin/topic_controller.rb
kit_cms-2.3.17 app/controllers/admin/topic_controller.rb
kit_cms-2.3.16 app/controllers/admin/topic_controller.rb
kit_cms-2.3.15 app/controllers/admin/topic_controller.rb
kit_cms-2.3.14 app/controllers/admin/topic_controller.rb
kit_cms-2.3.13 app/controllers/admin/topic_controller.rb
kit_cms-2.3.11 app/controllers/admin/topic_controller.rb
kit_cms-2.3.10 app/controllers/admin/topic_controller.rb
kit_cms-2.3.9 app/controllers/admin/topic_controller.rb
kit_cms-2.3.8 app/controllers/admin/topic_controller.rb
kit_cms-2.3.7 app/controllers/admin/topic_controller.rb
kit_cms-2.3.6 app/controllers/admin/topic_controller.rb