Permalink
Browse files

Fix fckeditor to work fully (?) under Radiant 0.8.0.

  • Loading branch information...
1 parent 764a8fd commit f12c23826cd658ee44778bed9877d4249c895b28 @djcp committed Jun 20, 2009
Showing with 10 additions and 5 deletions.
  1. +6 −1 README
  2. +3 −3 app/controllers/fckeditor_controller.rb
  3. +1 −1 fckeditor_extension.rb
View
7 README
@@ -2,7 +2,9 @@
This gives you the excellent FCKEditor (with file uploads and spell checking) in your Radiant page parts.
== Requirements
-This extension has been tested on Radiant version 0.7.1. It will not work on versions < 0.7.0 because the Radiant admin interface has changed. If you need a version of this extension that works for Radiant < 0.7.0, please see the "radiant-0.6.9" tag on github.
+This extension has been tested on Radiant version 0.8.0. It will not work on versions < 0.8.0.
+
+If you need a version of this extension that works for Radiant < 0.8.0, please see the "radiant-0.7.1" (or other) tag on github.
You need to have aspell installed for spell checking to work.
@@ -56,3 +58,6 @@ http://www.fckeditor.net/
== Contributors
* Jereme Claussen, www.jeremeclaussen.com, for debugging help.
+* http://github.com/dko for the assistance getting this to work under Radiant 0.8.0.
+
+
@@ -2,7 +2,7 @@
require 'tmpdir'
class FckeditorController < ApplicationController
- include ActionView::Helpers::SanitizeHelper
+
protect_from_forgery :except => [:command,:check_spelling,:config]
UPLOADED = "/uploads"
UPLOADED_ROOT = RAILS_ROOT + "/public" + UPLOADED
@@ -168,7 +168,7 @@ def upload
def check_spelling
require 'cgi'
@original_text = params[:textinputs] ? params[:textinputs].first : ''
- plain_text = strip_tags(CGI.unescape(@original_text))
+ plain_text = ActionController::Base.helpers.strip_tags(CGI.unescape(@original_text))
@words = FckeditorSpellCheck.check_spelling(plain_text)
render :file => "#{FckeditorExtension.root}/app/views/fckeditor/spell_check.rhtml"
end
@@ -181,7 +181,7 @@ def current_directory_path
end
def upload_directory_path
- uploaded = request.relative_url_root.to_s+"#{UPLOADED}/#{params[:Type]}"
+ uploaded = ActionController::Base.relative_url_root.to_s+"#{UPLOADED}/#{params[:Type]}"
"#{uploaded}#{params[:CurrentFolder]}"
end
View
@@ -1,5 +1,5 @@
# Uncomment this if you reference any of your controllers in activate
-require_dependency 'application'
+require_dependency 'application_controller'
class FckeditorExtension < Radiant::Extension
version "0.5"

0 comments on commit f12c238

Please sign in to comment.