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