class Panel::WebResource::Widget::WebLinksController < OrbitWidgetController

  def initialize
    super
    @app_title = 'web_resource'
  end
  
  # GET /web_links
  # GET /web_links.xml
  
  def index
	
	# deadline
  
    # @web_link = WebLink.where( :is_hidden => false ).desc(:is_top, :name).first

    @web_links = WebLink.widget_datas.page(params[:page]).per(5)
	
	# get_categorys
  	
  	module_app = ModuleApp.first(:conditions => {:key => 'web_resource'})
  	@tags = Tag.all(:conditions => {:module_app_id => module_app.id})
	
  end

  def reload_web_links
    @web_links = WebLink.widget_datas.page(params[:page]).per(5)
  end
  
  
  protected
  
  def get_categorys
    @web_link_categorys = WebLinkCategory.excludes('disabled' => true)
  end
  
  def get_tags
  	module_app = ModuleApp.first(:conditions => {:key => 'web_resource'})
  	@tags = Tag.all(:conditions => {:module_app_id => module_app.id})
  end
  
end
