2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 09:10:25 +08:00

(experimental) added framework for filtering all sorts of internals in discourse and consuming by plugins

This commit is contained in:
Sam 2013-10-10 18:45:40 +11:00
parent 8afff108bf
commit b0465c517e
4 changed files with 78 additions and 1 deletions

18
lib/plugin/filter.rb Normal file
View file

@ -0,0 +1,18 @@
require_dependency 'plugin/filter_manager'
# this concept is borrowed straight out of wordpress
module Plugin
class Filter
def self.manager
@manager ||= FilterManager.new
end
def self.register(name, &blk)
manager.register(name, &blk)
end
def self.apply(name, context, result)
manager.apply(name, context, result)
end
end
end