Expose an API for plugins to be hidden on the admin plugin page.
This commit is contained in:
parent
086cb0f849
commit
c6f45fcfdb
|
@ -1,7 +1,7 @@
|
||||||
class Admin::PluginsController < Admin::AdminController
|
class Admin::PluginsController < Admin::AdminController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
render_serialized(Discourse.plugins, AdminPluginSerializer, root: 'plugins')
|
render_serialized(Discourse.display_plugins, AdminPluginSerializer, root: 'plugins')
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -164,6 +164,14 @@ module Discourse
|
||||||
@plugins ||= []
|
@plugins ||= []
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.hidden_plugins
|
||||||
|
@hidden_plugins ||= []
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.display_plugins
|
||||||
|
self.plugins - self.hidden_plugins
|
||||||
|
end
|
||||||
|
|
||||||
def self.plugin_themes
|
def self.plugin_themes
|
||||||
@plugin_themes ||= plugins.map(&:themes).flatten
|
@plugin_themes ||= plugins.map(&:themes).flatten
|
||||||
end
|
end
|
||||||
|
|
|
@ -493,6 +493,10 @@ JS
|
||||||
PluginGem.load(path, name, version, opts)
|
PluginGem.load(path, name, version, opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def hide_plugin
|
||||||
|
Discourse.hidden_plugins << self
|
||||||
|
end
|
||||||
|
|
||||||
def enabled_site_setting_filter(filter = nil)
|
def enabled_site_setting_filter(filter = nil)
|
||||||
if filter
|
if filter
|
||||||
@enabled_setting_filter = filter
|
@enabled_setting_filter = filter
|
||||||
|
|
Loading…
Reference in New Issue