diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2008-06-10 15:20:57 -0700 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2008-07-23 21:03:10 -0700 |
commit | 8995245a0c3862b5ed5ce84ea62827a070b77acf (patch) | |
tree | feb437373a7ed514aa1becb775dabf6886d85c31 | |
parent | 04434cd6efa5665a983a2b8acde20b898fcf28c0 (diff) | |
download | redmine-8995245a0c3862b5ed5ce84ea62827a070b77acf.tar.gz redmine-8995245a0c3862b5ed5ce84ea62827a070b77acf.zip |
Added Base class for Plugin Hooks. #1296
-rw-r--r-- | lib/redmine/plugin.rb | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/lib/redmine/plugin.rb b/lib/redmine/plugin.rb index 2366c49ff..72317765b 100644 --- a/lib/redmine/plugin.rb +++ b/lib/redmine/plugin.rb @@ -174,9 +174,33 @@ module Redmine #:nodoc: end end - # Default class for Hooks to subclass + # Base class for Redmin Plugin hooks. class Base - + + # Class level access to Rails' helper methods. + def self.help + Helper.instance + end + + # Includes several Helper methods to be used in the class + class Helper # :nodoc: + include Singleton + include ERB::Util + include ActionView::Helpers::TagHelper + include ActionView::Helpers::FormHelper + include ActionView::Helpers::FormTagHelper + include ActionView::Helpers::FormOptionsHelper + include ActionView::Helpers::JavaScriptHelper + include ActionView::Helpers::PrototypeHelper + include ActionView::Helpers::UrlHelper + + include ActionController::UrlWriter + + def protect_against_forgery? # :nodoc: + false + end + + end end end end |