summaryrefslogtreecommitdiffstats
path: root/lib/redmine/search.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2010-02-17 20:05:51 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2010-02-17 20:05:51 +0000
commitc11d30ebc9f50abf476779e046ba1792453a585d (patch)
treefd0df1a93996674bf71853e2e3f02afafa3e762b /lib/redmine/search.rb
parentb733accfe336e7870a9d420584bf1c11e5778b49 (diff)
downloadredmine-c11d30ebc9f50abf476779e046ba1792453a585d.tar.gz
redmine-c11d30ebc9f50abf476779e046ba1792453a585d.zip
Makes search providers extensible (#3936).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3444 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/search.rb')
-rw-r--r--lib/redmine/search.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/redmine/search.rb b/lib/redmine/search.rb
index ed1f629ea..153197ea1 100644
--- a/lib/redmine/search.rb
+++ b/lib/redmine/search.rb
@@ -17,6 +17,23 @@
module Redmine
module Search
+
+ mattr_accessor :available_search_types
+
+ @@available_search_types = []
+
+ class << self
+ def map(&block)
+ yield self
+ end
+
+ # Registers a search provider
+ def register(search_type, options={})
+ search_type = search_type.to_s
+ @@available_search_types << search_type unless @@available_search_types.include?(search_type)
+ end
+ end
+
module Controller
def self.included(base)
base.extend(ClassMethods)