]> source.dussan.org Git - redmine.git/commitdiff
Added Base class for Plugin Hooks. #1296
authorEric Davis <edavis@littlestreamsoftware.com>
Tue, 10 Jun 2008 22:20:57 +0000 (15:20 -0700)
committerEric Davis <edavis@littlestreamsoftware.com>
Thu, 24 Jul 2008 04:03:10 +0000 (21:03 -0700)
lib/redmine/plugin.rb

index 2366c49ff3c874f0537d5a91a92229f3cc2fe0b5..72317765b3ec84f6c5286e109d4af616a6d5a688 100644 (file)
@@ -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