Sync with Instiki Trunk

Sync with Revision 519 of Instiki trunk (2007/5/7).
This commit is contained in:
Jacques Distler 2007-05-11 11:47:38 -05:00
parent b0e063451f
commit 3b6cd309ff
21 changed files with 173 additions and 158 deletions

View file

@ -10,10 +10,10 @@ class FileController < ApplicationController
before_filter :check_allow_uploads
def file
@file_name = @params['id']
if @params['file']
@file_name = params['id']
if params['file']
# form supplied
new_file = @web.wiki_files.create(@params['file'])
new_file = @web.wiki_files.create(params['file'])
if new_file.valid?
flash[:info] = "File '#{@file_name}' successfully uploaded"
return_to_last_remembered
@ -39,10 +39,10 @@ class FileController < ApplicationController
end
def import
if @params['file']
if params['file']
@problems = []
import_file_name = "#{@web.address}-import-#{Time.now.strftime('%Y-%m-%d-%H-%M-%S')}.zip"
import_from_archive(@params['file'].path)
import_from_archive(params['file'].path)
if @problems.empty?
flash[:info] = 'Import successfully finished'
else
@ -58,7 +58,7 @@ class FileController < ApplicationController
protected
def check_allow_uploads
render(:status => 404, :text => "Web #{@params['web'].inspect} not found") and return false unless @web
render(:status => 404, :text => "Web #{params['web'].inspect} not found") and return false unless @web
if @web.allow_uploads?
return true
else