mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 08:49:06 +08:00
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
|
||||
|
||||
def index
|
||||
render_serialized(Discourse.plugins, AdminPluginSerializer, root: 'plugins')
|
||||
render_serialized(Discourse.display_plugins, AdminPluginSerializer, root: 'plugins')
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -164,6 +164,14 @@ module Discourse
|
|||
@plugins ||= []
|
||||
end
|
||||
|
||||
def self.hidden_plugins
|
||||
@hidden_plugins ||= []
|
||||
end
|
||||
|
||||
def self.display_plugins
|
||||
self.plugins - self.hidden_plugins
|
||||
end
|
||||
|
||||
def self.plugin_themes
|
||||
@plugin_themes ||= plugins.map(&:themes).flatten
|
||||
end
|
||||
|
|
|
@ -493,6 +493,10 @@ JS
|
|||
PluginGem.load(path, name, version, opts)
|
||||
end
|
||||
|
||||
def hide_plugin
|
||||
Discourse.hidden_plugins << self
|
||||
end
|
||||
|
||||
def enabled_site_setting_filter(filter = nil)
|
||||
if filter
|
||||
@enabled_setting_filter = filter
|
||||
|
|
Loading…
Reference in New Issue
Block a user