Make html_ext Available as a Helper

... and protected.
This commit is contained in:
Jacques Distler 2009-12-16 00:59:33 -06:00
parent f3b69bc57b
commit fe877a10b4
3 changed files with 19 additions and 13 deletions

View file

@ -19,13 +19,22 @@ class ApplicationController < ActionController::Base
Wiki.new
end
helper_method :xhtml_enabled?, :html_ext
protected
def xhtml_enabled?
in_a_web? and [:markdownMML, :markdownPNG, :markdown].include?(@web.markup)
end
helper_method :xhtml_enabled?
def html_ext
if xhtml_enabled? && request.env.include?('HTTP_ACCEPT') &&
Mime::Type.parse(request.env["HTTP_ACCEPT"]).include?(Mime::XHTML)
'xhtml'
else
'html'
end
end
def check_authorization
if in_a_web? and authorization_needed? and not authorized?

View file

@ -380,15 +380,6 @@ class WikiController < ApplicationController
end
end
def html_ext
if xhtml_enabled? && request.env.include?('HTTP_ACCEPT') &&
Mime::Type.parse(request.env["HTTP_ACCEPT"]).include?(Mime::XHTML)
'xhtml'
else
'html'
end
end
protected
def do_caching?