2024-04-02 23:05:08 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class HomepageHelper
|
2024-06-21 23:24:11 +08:00
|
|
|
def self.resolve(request = nil, current_user = nil)
|
|
|
|
return "custom" if ThemeModifierHelper.new(request: request).custom_homepage
|
2024-04-02 23:05:08 +08:00
|
|
|
|
2024-08-30 17:06:07 +08:00
|
|
|
enabled = false
|
|
|
|
enabled =
|
|
|
|
DiscoursePluginRegistry.apply_modifier(
|
|
|
|
:custom_homepage_enabled,
|
|
|
|
enabled,
|
|
|
|
request: request,
|
|
|
|
current_user: current_user,
|
|
|
|
)
|
|
|
|
return "custom" if enabled
|
|
|
|
|
2024-04-02 23:05:08 +08:00
|
|
|
current_user ? SiteSetting.homepage : SiteSetting.anonymous_homepage
|
|
|
|
end
|
|
|
|
end
|