diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/redmine.rb | 11 | ||||
-rw-r--r-- | lib/redmine/search.rb | 17 |
2 files changed, 28 insertions, 0 deletions
diff --git a/lib/redmine.rb b/lib/redmine.rb index d9a1f4063..09ee2f5c9 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -1,6 +1,7 @@ require 'redmine/access_control' require 'redmine/menu_manager' require 'redmine/activity' +require 'redmine/search' require 'redmine/mime_type' require 'redmine/core_ext' require 'redmine/themes' @@ -178,6 +179,16 @@ Redmine::Activity.map do |activity| activity.register :time_entries, :default => false end +Redmine::Search.map do |search| + search.register :issues + search.register :news + search.register :documents + search.register :changesets + search.register :wiki_pages + search.register :messages + search.register :projects +end + Redmine::WikiFormatting.map do |format| format.register :textile, Redmine::WikiFormatting::Textile::Formatter, Redmine::WikiFormatting::Textile::Helper end 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) |