#(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank?
ifparams[:insite]
@result=find_public_attacheq
@searched_attach=paginateHelper@result,10
else
@result=find_course_attacheq,@course
@searched_attach=paginateHelper@result,10
end
rescueException=>e
#render 'stores'
redirect_tostores_url
end
end
deffind_course_attachekeywords,course
resultSet=Attachment.where("attachments.container_type = 'Course' And attachments.container_id = '#{course.id}' AND filename LIKE :like ",like:"%#{keywords}%").
resultSet=Attachment.where("attachments.container_type IS NOT NULL AND (is_public = 1 OR author_id = #{User.current.id}) AND filename LIKE :like ",like:"%#{keywords}%").
reorder("created_on DESC")
end
defindex
@ -48,7 +81,9 @@ class FilesController < ApplicationController
'size'=>"#{Attachment.table_name}.filesize",
'downloads'=>"#{Attachment.table_name}.downloads"
sort=""
@sort=""
@order=""
@is_remote=false
ifparams[:project_id]
@isproject=true
@ -113,7 +148,8 @@ class FilesController < ApplicationController